{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:orbiplex:schema:orbiplex-acceptance-topology:v1",
  "title": "Orbiplex Acceptance Topology v1",
  "description": "Reusable infrastructure-only mapping from stable acceptance slots to SSH-controllable physical hosts.",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "topology/ref", "topology/revision", "nodes"],
  "properties": {
    "schema": { "const": "orbiplex-acceptance-topology.v1" },
    "topology/ref": { "type": "string", "pattern": "^acceptance-topology:[A-Za-z0-9._:-]+$", "maxLength": 256 },
    "topology/revision": { "type": "integer", "minimum": 1 },
    "topology/host-posture": { "enum": ["distinct-physical-hosts", "shared-physical-hosts"] },
    "nodes": {
      "type": "object",
      "minProperties": 2,
      "maxProperties": 32,
      "propertyNames": { "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$" },
      "additionalProperties": { "$ref": "#/$defs/node" }
    }
  },
  "$defs": {
    "host": { "type": "string", "pattern": "^[A-Za-z0-9](?:[A-Za-z0-9.-]{0,251}[A-Za-z0-9])?$", "maxLength": 253 },
    "token": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$", "maxLength": 64 },
    "node": {
      "type": "object",
      "additionalProperties": false,
      "required": ["host/name", "platform/ref", "ssh"],
      "properties": {
        "host/name": { "$ref": "#/$defs/host" },
        "platform/ref": { "$ref": "#/$defs/token" },
        "product/bind-address": { "type": "string", "format": "ipv4" },
        "ssh": {
          "type": "object",
          "additionalProperties": false,
          "required": ["host", "port", "user"],
          "properties": {
            "host": { "$ref": "#/$defs/host" },
            "port": { "type": "integer", "minimum": 1, "maximum": 65535 },
            "user": { "$ref": "#/$defs/token" }
          }
        }
      }
    }
  }
}
