{
  "caseId": "invalid-cycle",
  "expectedValidation": {
    "valid": false,
    "violationCodes": ["wiring_cycle"]
  },
  "topology": {
    "topologyId": "top_constraints_cycle",
    "projectId": "prj_topology_constraints",
    "environment": "dev",
    "services": {
      "boxes": [
        {
          "serviceId": "hwlab-box-simu",
          "boxId": "boxsim_alpha",
          "projectId": "prj_topology_constraints",
          "gatewaySessionId": "gws_constraints_alpha",
          "live": true,
          "resource": {
            "resourceId": "res_constraints_alpha",
            "projectId": "prj_topology_constraints",
            "gatewaySessionId": "gws_constraints_alpha",
            "boxId": "boxsim_alpha",
            "resourceType": "simulator_endpoint",
            "name": "boxsim_alpha simulator endpoint",
            "state": "available",
            "environment": "dev",
            "metadata": {
              "serviceId": "hwlab-box-simu",
              "ports": ["DO1", "DI1"],
              "propagation": "patch-panel-only"
            }
          },
          "ports": {
            "DO1": {
              "port": "DO1",
              "direction": "output",
              "value": false,
              "source": "local"
            },
            "DI1": {
              "port": "DI1",
              "direction": "input",
              "value": false,
              "source": "local"
            }
          },
          "constraints": {
            "crossDevicePropagation": "patch-panel-only",
            "localLoopbackEnabled": false
          }
        },
        {
          "serviceId": "hwlab-box-simu",
          "boxId": "boxsim_beta",
          "projectId": "prj_topology_constraints",
          "gatewaySessionId": "gws_constraints_beta",
          "live": true,
          "resource": {
            "resourceId": "res_constraints_beta",
            "projectId": "prj_topology_constraints",
            "gatewaySessionId": "gws_constraints_beta",
            "boxId": "boxsim_beta",
            "resourceType": "simulator_endpoint",
            "name": "boxsim_beta simulator endpoint",
            "state": "available",
            "environment": "dev",
            "metadata": {
              "serviceId": "hwlab-box-simu",
              "ports": ["DO1", "DI1"],
              "propagation": "patch-panel-only"
            }
          },
          "ports": {
            "DO1": {
              "port": "DO1",
              "direction": "output",
              "value": false,
              "source": "local"
            },
            "DI1": {
              "port": "DI1",
              "direction": "input",
              "value": false,
              "source": "local"
            }
          },
          "constraints": {
            "crossDevicePropagation": "patch-panel-only",
            "localLoopbackEnabled": false
          }
        }
      ],
      "gateways": [
        {
          "serviceId": "hwlab-gateway-simu",
          "gatewayId": "gwsimu_alpha",
          "projectId": "prj_topology_constraints",
          "live": true,
          "session": {
            "gatewaySessionId": "gws_constraints_alpha",
            "projectId": "prj_topology_constraints",
            "serviceId": "hwlab-gateway-simu",
            "gatewayId": "gwsimu_alpha",
            "endpoint": "http://127.0.0.1:7301",
            "status": "connected",
            "environment": "dev"
          },
          "boxes": ["res_constraints_alpha"]
        },
        {
          "serviceId": "hwlab-gateway-simu",
          "gatewayId": "gwsimu_beta",
          "projectId": "prj_topology_constraints",
          "live": true,
          "session": {
            "gatewaySessionId": "gws_constraints_beta",
            "projectId": "prj_topology_constraints",
            "serviceId": "hwlab-gateway-simu",
            "gatewayId": "gwsimu_beta",
            "endpoint": "http://127.0.0.1:7302",
            "status": "connected",
            "environment": "dev"
          },
          "boxes": ["res_constraints_beta"]
        }
      ],
      "patchPanel": {
        "patchPanelStatusId": "pps_constraints_cycle",
        "projectId": "prj_topology_constraints",
        "gatewaySessionId": "gws_constraints_alpha",
        "wiringConfigId": "wir_constraints_cycle",
        "serviceId": "hwlab-patch-panel",
        "state": "active",
        "environment": "dev",
        "activeConnections": [
          {
            "fromResourceId": "res_constraints_alpha",
            "fromPort": "DO1",
            "toResourceId": "res_constraints_beta",
            "toPort": "DI1"
          },
          {
            "fromResourceId": "res_constraints_beta",
            "fromPort": "DO1",
            "toResourceId": "res_constraints_alpha",
            "toPort": "DI1"
          }
        ],
        "observedAt": "2026-05-21T00:00:00.000Z",
        "metadata": {
          "propagation": "patch-panel-only",
          "connectionCount": 2
        }
      }
    },
    "wiringConfigs": [
      {
        "wiringConfigId": "wir_constraints_cycle",
        "projectId": "prj_topology_constraints",
        "gatewaySessionId": "gws_constraints_alpha",
        "name": "Topology constraints cycle wiring",
        "status": "active",
        "connections": [
          {
            "from": {
              "resourceId": "res_constraints_alpha",
              "port": "DO1"
            },
            "to": {
              "resourceId": "res_constraints_beta",
              "port": "DI1"
            },
            "mode": "exclusive"
          },
          {
            "from": {
              "resourceId": "res_constraints_beta",
              "port": "DO1"
            },
            "to": {
              "resourceId": "res_constraints_alpha",
              "port": "DI1"
            },
            "mode": "exclusive"
          }
        ],
        "constraints": {
          "resourceGroupId": "rg_constraints_alpha_beta",
          "propagation": "patch-panel-only",
          "localLoopbackSubstituteAllowed": false
        },
        "createdAt": "2026-05-21T00:00:00.000Z",
        "updatedAt": "2026-05-21T00:00:00.000Z"
      }
    ],
    "constraints": {
      "patchPanelIsOnlyCrossDeviceChannel": true,
      "boxSimuLocalLoopbackForCrossDeviceSync": false
    }
  }
}
