{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://theloopbreaker.com/schemas/v3-x402/contract-catalog.v1.schema.json",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "schemaVersion",
    "protocolVersion",
    "route",
    "generatedAt",
    "deploymentState",
    "addressPolicy",
    "contracts",
    "routeInventory"
  ],
  "properties": {
    "schema": {
      "const": "vaultfire.v3.contract-catalog.v1"
    },
    "schemaVersion": {
      "const": "1.0.0"
    },
    "protocolVersion": {
      "const": "3.0.0"
    },
    "route": {
      "const": "/api/v3/contracts"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "deploymentState": {
      "const": "unconfigured"
    },
    "addressPolicy": {
      "const": "null-until-independently-verified"
    },
    "contracts": {
      "type": "array",
      "minItems": 22,
      "maxItems": 22,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "module",
          "disposition",
          "deployment",
          "address",
          "sourceAvailable",
          "executableEvidenceAvailable",
          "reason"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2
          },
          "module": {
            "type": "string",
            "minLength": 1
          },
          "disposition": {
            "enum": [
              "supported",
              "deferred",
              "retired"
            ]
          },
          "deployment": {
            "enum": [
              "unconfigured",
              "not-in-pilot",
              "prohibited"
            ]
          },
          "address": {
            "type": "null"
          },
          "sourceAvailable": {
            "type": "boolean"
          },
          "executableEvidenceAvailable": {
            "const": false
          },
          "reason": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    },
    "routeInventory": {
      "type": "array",
      "minItems": 20,
      "maxItems": 20,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "method",
          "path",
          "canonicalSdkRoute",
          "disposition",
          "readOnly",
          "deploymentRequired",
          "responseSchema",
          "responseStatuses",
          "description"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9-]+$"
          },
          "method": {
            "enum": [
              "GET",
              "POST"
            ]
          },
          "path": {
            "type": "string",
            "pattern": "^/api/v3/"
          },
          "canonicalSdkRoute": {
            "type": [
              "string",
              "null"
            ]
          },
          "disposition": {
            "enum": [
              "supported",
              "degraded",
              "unavailable",
              "retired"
            ]
          },
          "readOnly": {
            "const": true
          },
          "deploymentRequired": {
            "type": "boolean"
          },
          "responseSchema": {
            "type": "string",
            "pattern": "^https://theloopbreaker.com/schemas/v3-x402/"
          },
          "responseStatuses": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "enum": [
                200,
                400,
                404,
                503
              ]
            }
          },
          "description": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    }
  }
}
