{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://weverlabs.com/schemas/rail-loop-contract.schema.json",
  "title": "Wever Labs Rail Loop Contract",
  "description": "Public contract describing the loop pattern used by a Wever Labs rail.",
  "type": "object",
  "required": [
    "schema_version",
    "rail",
    "loop_pattern",
    "operator_authority",
    "return_package"
  ],
  "properties": {
    "schema_version": {
      "const": "rail_loop_contract.v1"
    },
    "rail": {
      "type": "string"
    },
    "loop_pattern": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "operator_authority": {
      "type": "object"
    },
    "agent_roles": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "validators": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "exception_policy": {
      "type": "string"
    },
    "return_package": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "proof_surface": {
      "type": "string"
    },
    "runtime_endpoint": {
      "type": "string"
    },
    "loop_endpoint": {
      "type": "string"
    }
  },
  "additionalProperties": true
}
