{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://theloopbreaker.com/schemas/v3-x402/read-result.v1.schema.json",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "schemaVersion",
    "protocolVersion",
    "route",
    "resource",
    "disposition",
    "readiness",
    "data",
    "observedAt",
    "error",
    "evidence"
  ],
  "properties": {
    "schema": {
      "const": "vaultfire.v3.read-result.v1"
    },
    "schemaVersion": {
      "const": "1.0.0"
    },
    "protocolVersion": {
      "const": "3.0.0"
    },
    "route": {
      "type": "string",
      "pattern": "^/api/v3/"
    },
    "resource": {
      "type": "string",
      "pattern": "^/api/v3/"
    },
    "disposition": {
      "enum": [
        "supported",
        "degraded",
        "unavailable",
        "retired"
      ]
    },
    "readiness": {
      "enum": [
        "deployment-unconfigured",
        "adapter-unconfigured",
        "source-only",
        "deferred",
        "retired"
      ]
    },
    "data": {
      "type": "null"
    },
    "observedAt": {
      "type": "string",
      "format": "date-time"
    },
    "error": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "code",
        "message",
        "retryable"
      ],
      "properties": {
        "code": {
          "type": "string",
          "minLength": 1
        },
        "message": {
          "type": "string",
          "minLength": 1
        },
        "retryable": {
          "type": "boolean"
        }
      }
    },
    "evidence": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "deploymentVerified",
        "adapterConfigured",
        "rpcContacted",
        "v2FallbackUsed"
      ],
      "properties": {
        "deploymentVerified": {
          "const": false
        },
        "adapterConfigured": {
          "const": false
        },
        "rpcContacted": {
          "const": false
        },
        "v2FallbackUsed": {
          "const": false
        }
      }
    }
  }
}
