{
  "openapi": "3.1.0",
  "info": {
    "title": "HAIP — Human-Agent Interaction Protocol",
    "version": "2.0.0-draft.3",
    "description": "Draft portable review contract and execution extension. No HAIP 1 compatibility. Implementation ledger lists incomplete release gates.",
    "license": { "name": "MIT", "identifier": "MIT" }
  },
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "paths": {
    "/.well-known/haip": {
      "get": {
        "operationId": "get___well_known_haip",
        "summary": "Supported immutable revisions and profiles",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/Discovery" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        }
      }
    },
    "/.well-known/haip-trust": {
      "get": {
        "operationId": "get___well_known_haip_trust",
        "summary": "Discovery only; never trust included keys automatically",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/TrustManifest" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        }
      }
    },
    "/v2/bundles": {
      "post": {
        "operationId": "post__v2_bundles",
        "summary": "Register a publisher-owned immutable app",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": { "type": "string", "minLength": 1, "maxLength": 160 }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/ReviewBundle" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": { "schema": { "$ref": "#/components/schemas/BundleRegistration" } }
          }
        }
      }
    },
    "/v2/requests": {
      "post": {
        "operationId": "post__v2_requests",
        "summary": "Create one immutable review request",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": { "type": "string", "minLength": 1, "maxLength": 160 }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/RequestStatus" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": { "schema": { "$ref": "#/components/schemas/RequestInput" } }
          }
        }
      },
      "get": {
        "operationId": "get__v2_requests",
        "summary": "List owned or assigned route requests",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          {
            "in": "query",
            "name": "offset",
            "schema": { "type": "integer", "minimum": 0, "maximum": 100000 }
          },
          {
            "in": "query",
            "name": "state",
            "schema": {
              "type": "string",
              "enum": ["", "pending", "confirmed", "cancelled", "expired", "superseded"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/RequestList" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        }
      }
    },
    "/v2/requests/{id}": {
      "get": {
        "operationId": "get__v2_requests__id_",
        "summary": "Authoritative state; links are not credentials",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/RequestStatus" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        }
      }
    },
    "/v2/requests/{id}/material": {
      "get": {
        "operationId": "get__v2_requests__id__material",
        "summary": "Retained payload, schema and canonical review document",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/Material" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        }
      }
    },
    "/v2/requests/{id}/app": {
      "get": {
        "operationId": "get__v2_requests__id__app",
        "summary": "Stored View bundle with its verified Agent UI envelope and snapshots; authenticated human only",
        "security": [{ "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/StoredApp" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        }
      }
    },
    "/v2/requests/{id}/assignment": {
      "post": {
        "operationId": "post__v2_requests__id__assignment",
        "summary": "Renew reviewer assignment without authority",
        "security": [{ "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": { "type": "string", "minLength": 1, "maxLength": 160 }
          },
          {
            "in": "header",
            "name": "X-CSRF-Token",
            "required": true,
            "schema": { "type": "string" }
          },
          {
            "in": "header",
            "name": "Origin",
            "required": true,
            "schema": { "type": "string", "format": "uri" }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/Assignment" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": { "schema": { "$ref": "#/components/schemas/EmptyInput" } }
          }
        }
      }
    },
    "/v2/requests/{id}/candidates": {
      "post": {
        "operationId": "post__v2_requests__id__candidates",
        "summary": "Freeze a schema-validated response",
        "security": [{ "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": { "type": "string", "minLength": 1, "maxLength": 160 }
          },
          {
            "in": "header",
            "name": "X-CSRF-Token",
            "required": true,
            "schema": { "type": "string" }
          },
          {
            "in": "header",
            "name": "Origin",
            "required": true,
            "schema": { "type": "string", "format": "uri" }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/DecisionCandidate" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": { "schema": { "$ref": "#/components/schemas/DecisionProposal" } }
          }
        }
      }
    },
    "/v2/requests/{id}/confirm": {
      "post": {
        "operationId": "post__v2_requests__id__confirm",
        "summary": "Confirm the exact frozen candidate as an authenticated human",
        "security": [{ "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": { "type": "string", "minLength": 1, "maxLength": 160 }
          },
          {
            "in": "header",
            "name": "X-CSRF-Token",
            "required": true,
            "schema": { "type": "string" }
          },
          {
            "in": "header",
            "name": "Origin",
            "required": true,
            "schema": { "type": "string", "format": "uri" }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/SignedRecord" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": { "schema": { "$ref": "#/components/schemas/Confirmation" } }
          }
        }
      }
    },
    "/v2/requests/{id}/cancel": {
      "post": {
        "operationId": "post__v2_requests__id__cancel",
        "summary": "Cancel unused authority without retracting issued permits",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": { "type": "string", "minLength": 1, "maxLength": 160 }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/RequestStatus" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": { "schema": { "$ref": "#/components/schemas/EmptyInput" } }
          }
        }
      }
    },
    "/v2/requests/{id}/revoke": {
      "post": {
        "operationId": "post__v2_requests__id__revoke",
        "summary": "Revoke unused authority",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": { "type": "string", "minLength": 1, "maxLength": 160 }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/RequestStatus" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": { "schema": { "$ref": "#/components/schemas/EmptyInput" } }
          }
        }
      }
    },
    "/v2/requests/{id}/remind": {
      "post": {
        "operationId": "post__v2_requests__id__remind",
        "summary": "Queue a reminder at most once per day; supersession preserves the limit",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": { "type": "string", "minLength": 1, "maxLength": 160 }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/ReminderResult" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": { "schema": { "$ref": "#/components/schemas/EmptyInput" } }
          }
        }
      }
    },
    "/v2/requests/{id}/discard": {
      "post": {
        "operationId": "post__v2_requests__id__discard",
        "summary": "Delete private material early and block new admission",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": { "type": "string", "minLength": 1, "maxLength": 160 }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/RequestStatus" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": { "schema": { "$ref": "#/components/schemas/EmptyInput" } }
          }
        }
      }
    },
    "/v2/requests/{id}/supersede": {
      "post": {
        "operationId": "post__v2_requests__id__supersede",
        "summary": "Atomically replace unconsumed work",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": { "type": "string", "minLength": 1, "maxLength": 160 }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/RequestStatus" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": { "schema": { "$ref": "#/components/schemas/RequestInput" } }
          }
        }
      }
    },
    "/v2/requests/{id}/claims": {
      "post": {
        "operationId": "post__v2_requests__id__claims",
        "summary": "Consume an exclusive execution occurrence",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": { "type": "string", "minLength": 1, "maxLength": 160 }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/SignedRecord" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": { "schema": { "$ref": "#/components/schemas/ClaimInput" } }
          }
        }
      }
    },
    "/v2/requests/{id}/admission": {
      "post": {
        "operationId": "post__v2_requests__id__admission",
        "summary": "Issue fresh bounded admission; nonces cannot be replayed",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/SignedRecord" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": { "schema": { "$ref": "#/components/schemas/AdmissionInput" } }
          }
        }
      }
    },
    "/v2/requests/{id}/outcomes": {
      "post": {
        "operationId": "post__v2_requests__id__outcomes",
        "summary": "Record completion, partial effects or uncertainty",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": { "type": "string", "minLength": 1, "maxLength": 160 }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/SignedRecord" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": { "schema": { "$ref": "#/components/schemas/ExecutionOutcome" } }
          }
        }
      }
    },
    "/v2/requests/{id}/reconcile": {
      "post": {
        "operationId": "post__v2_requests__id__reconcile",
        "summary": "Operator reconciliation with reasons and evidence",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": { "type": "string", "minLength": 1, "maxLength": 160 }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/SignedRecord" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": { "schema": { "$ref": "#/components/schemas/ExecutionOutcome" } }
          }
        }
      }
    },
    "/v2/requests/{id}/export": {
      "get": {
        "operationId": "get__v2_requests__id__export",
        "summary": "Export original signed records and retained material",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/AuditExport" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        }
      }
    },
    "/v2/events": {
      "get": {
        "operationId": "get__v2_events",
        "summary": "Poll producer-owned signed status events",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          {
            "in": "query",
            "name": "after",
            "schema": { "type": "integer", "minimum": 0, "maximum": 99999999 }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/EventPage" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        }
      }
    },
    "/v2/hitl/{id}": {
      "get": {
        "operationId": "get__v2_hitl__id_",
        "summary": "HITL v0.8 browser review handoff; pending uses HTTP 202",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/HitlStatus" } }
            }
          },
          "202": { "description": "Human review pending" },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        }
      }
    },
    "/v2/hitl/{id}/poll": {
      "get": {
        "operationId": "get__v2_hitl__id__poll",
        "summary": "HITL v0.8 authenticated polling",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/HitlPoll" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        }
      }
    },
    "/v2/admin/principals/{id}": {
      "put": {
        "operationId": "put__v2_admin_principals__id_",
        "summary": "Operator directory, producer, publisher and credential configuration",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/PrincipalResult" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": { "schema": { "$ref": "#/components/schemas/PrincipalInput" } }
          }
        }
      }
    },
    "/v2/admin/routes/{id}": {
      "put": {
        "operationId": "put__v2_admin_routes__id_",
        "summary": "Operator-controlled route configuration and targeted invalidation",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/RouteResult" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": { "schema": { "$ref": "#/components/schemas/RouteInput" } }
          }
        }
      }
    },
    "/v2/admin/ledger": {
      "get": {
        "operationId": "get__v2_admin_ledger",
        "summary": "Operator-only paginated complete audit chain",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [
          {
            "in": "query",
            "name": "after",
            "schema": { "type": "integer", "minimum": 0, "maximum": 99999999 }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/LedgerPage" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        }
      }
    },
    "/v2/admin/metrics": {
      "get": {
        "operationId": "get__v2_admin_metrics",
        "summary": "Tenant-scoped operational metrics and incidents",
        "security": [{ "producerBearer": [] }, { "humanSession": [] }],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/MetricsSnapshot" } }
            }
          },
          "400": { "description": "Invalid or ambiguous input" },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operation not permitted" },
          "404": { "description": "Resource not found or inaccessible" },
          "409": { "description": "State, ownership or idempotency conflict" },
          "410": { "description": "Private material deleted" },
          "413": { "description": "Uncompressed size limit" },
          "422": { "description": "Unsupported purpose/profile/renderer" },
          "429": { "description": "Captured quota exceeded" },
          "503": { "description": "Required authority, storage or identity unavailable" }
        }
      }
    },
    "/v2/admin/metrics.prom": {
      "get": {
        "operationId": "get_v2_admin_metrics_prom",
        "summary": "Operator-scoped Prometheus metrics",
        "security": [{ "producerBearer": [] }],
        "responses": {
          "200": {
            "description": "Metrics",
            "content": { "text/plain": { "schema": { "type": "string" } } }
          },
          "401": { "description": "Authentication required" },
          "403": { "description": "Operator required" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Profiles": {
        "type": "object",
        "additionalProperties": { "type": "string", "minLength": 1, "maxLength": 100 },
        "maxProperties": 10
      },
      "Metadata": { "type": "object", "additionalProperties": true },
      "AgentUiCompatibility": {
        "type": "object",
        "additionalProperties": true,
        "properties": { "agent_ui": { "const": "2", "type": "string" } },
        "required": ["agent_ui"]
      },
      "AgentUiOrigin": {
        "description": "Canonical lowercase HTTP or HTTPS origin using localhost, an IPv4 address or a DNS name. Default and invalid ports are forbidden.",
        "oneOf": [
          {
            "type": "string",
            "pattern": "^http://(?:localhost|(?:(?:0|[1-9][0-9]?|1[0-9]{2}|2[0-4][0-9]|25[0-5]))(?:\\.(?:(?:0|[1-9][0-9]?|1[0-9]{2}|2[0-4][0-9]|25[0-5]))){3}|(?=[a-z0-9.-]*[a-z])(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)(?:\\.(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?))*)(?::(?!80$)(?:[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$"
          },
          {
            "type": "string",
            "pattern": "^https://(?:localhost|(?:(?:0|[1-9][0-9]?|1[0-9]{2}|2[0-4][0-9]|25[0-5]))(?:\\.(?:(?:0|[1-9][0-9]?|1[0-9]{2}|2[0-4][0-9]|25[0-5]))){3}|(?=[a-z0-9.-]*[a-z])(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)(?:\\.(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?))*)(?::(?!443$)(?:[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$"
          }
        ]
      },
      "Limits": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "bundle_bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
          "payload_bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
          "response_bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
          "inline_result_bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
          "retained_bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
          "review_seconds": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
          "grant_seconds": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
          "execution_seconds": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
          "reconciliation_seconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "audit_seconds": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }
        },
        "required": [
          "bundle_bytes",
          "payload_bytes",
          "response_bytes",
          "inline_result_bytes",
          "retained_bytes",
          "review_seconds",
          "grant_seconds",
          "execution_seconds",
          "reconciliation_seconds",
          "audit_seconds"
        ]
      },
      "ExecutionBinding": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "action_occurrence_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "proposal_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "proposal_format": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "context_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "context_format": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "policy": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "source": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[a-zA-Z0-9_.:@/-]+$"
              },
              "revision": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[a-zA-Z0-9_.:@/-]+$"
              },
              "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
            },
            "required": ["source", "revision", "digest"]
          },
          "mode": { "type": "string", "enum": ["live_window", "durable", "fixed_mock"] },
          "valid_until": { "type": "string", "format": "date-time" },
          "execution_seconds": { "type": "integer", "minimum": 1, "maximum": 3600 },
          "provenance": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "profile": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[a-zA-Z0-9_.:@/-]+$"
              },
              "version": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[a-zA-Z0-9_.:@/-]+$"
              },
              "references": { "$ref": "#/components/schemas/Metadata" }
            },
            "required": ["profile", "version", "references"]
          },
          "recovery_of": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          }
        },
        "required": [
          "action_occurrence_id",
          "proposal_digest",
          "proposal_format",
          "context_digest",
          "context_format",
          "policy",
          "mode",
          "valid_until",
          "execution_seconds",
          "provenance"
        ]
      },
      "ReviewBinding": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "artefact_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "representation": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "digest_rules": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "payload_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "response_schema_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "document_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "bundle": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[a-zA-Z0-9_.:@/-]+$"
              },
              "publisher": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[a-zA-Z0-9_.:@/-]+$"
              },
              "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
              "compatibility": { "$ref": "#/components/schemas/AgentUiCompatibility" },
              "created_at": {
                "type": "string",
                "format": "date-time",
                "description": "Immutable registration time captured when the request binds the bundle.",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:[0-5]\\d\\.\\d{3}Z$"
              }
            },
            "required": ["id", "publisher", "digest", "compatibility", "created_at"]
          }
        },
        "required": [
          "artefact_digest",
          "representation",
          "digest_rules",
          "payload_digest",
          "response_schema_digest",
          "document_digest"
        ]
      },
      "ReviewBundle": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "tenant": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "publisher": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "compatibility": { "$ref": "#/components/schemas/AgentUiCompatibility" },
          "author": { "type": "string", "minLength": 1, "maxLength": 1000 },
          "licence": { "type": "string", "minLength": 1, "maxLength": 160 },
          "created_at": { "type": "string", "format": "date-time" }
        },
        "required": [
          "id",
          "tenant",
          "publisher",
          "digest",
          "compatibility",
          "author",
          "licence",
          "created_at"
        ]
      },
      "BundleRegistration": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "html": { "type": "string", "minLength": 1 },
          "compatibility": { "$ref": "#/components/schemas/AgentUiCompatibility" },
          "author": { "type": "string", "minLength": 1, "maxLength": 1000 },
          "licence": { "type": "string", "minLength": 1, "maxLength": 160 }
        },
        "required": ["html", "compatibility", "author", "licence"]
      },
      "RequestInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "protocol_revision": { "const": "2.0.0-draft.3", "type": "string" },
          "purpose": { "type": "string", "enum": ["review", "authorise_execution"] },
          "profiles": { "$ref": "#/components/schemas/Profiles" },
          "route": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "summary": { "type": "string", "minLength": 1, "maxLength": 300 },
          "artefact": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
              "representation": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[a-zA-Z0-9_.:@/-]+$"
              },
              "digest_rules": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[a-zA-Z0-9_.:@/-]+$"
              }
            },
            "required": ["digest", "representation", "digest_rules"]
          },
          "payload": {},
          "response_schema": { "type": "object" },
          "review_document": { "type": "string", "maxLength": 10485760 },
          "bundle_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "execution": { "$ref": "#/components/schemas/ExecutionBinding" },
          "review_seconds": { "type": "integer", "minimum": 1, "maximum": 86400 },
          "metadata": { "$ref": "#/components/schemas/Metadata" }
        },
        "required": [
          "protocol_revision",
          "purpose",
          "profiles",
          "route",
          "summary",
          "artefact",
          "payload",
          "response_schema",
          "review_document"
        ],
        "dependentSchemas": {
          "bundle_id": {
            "type": "object",
            "properties": {
              "profiles": {
                "type": "object",
                "properties": { "haip.agent-ui": { "const": "2" } },
                "required": ["haip.agent-ui"]
              }
            }
          }
        },
        "if": {
          "properties": { "purpose": { "const": "authorise_execution" } },
          "required": ["purpose"]
        },
        "then": {
          "properties": {
            "execution": { "$ref": "#/components/schemas/ExecutionBinding" },
            "profiles": {
              "type": "object",
              "properties": { "haip.execution": { "const": "1-draft.1" } },
              "required": ["haip.execution"]
            }
          },
          "required": ["execution", "profiles"]
        },
        "else": { "properties": { "execution": false } }
      },
      "DecisionRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "protocol_revision": { "const": "2.0.0-draft.3", "type": "string" },
          "purpose": { "type": "string", "enum": ["review", "authorise_execution"] },
          "profiles": { "$ref": "#/components/schemas/Profiles" },
          "tenant": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "producer": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "requester": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "subject": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[a-zA-Z0-9_.:@/-]+$"
              },
              "source": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[a-zA-Z0-9_.:@/-]+$"
              }
            },
            "required": ["subject", "source"]
          },
          "route": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "authorisation_revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "summary": { "type": "string" },
          "review": { "$ref": "#/components/schemas/ReviewBinding" },
          "execution": { "$ref": "#/components/schemas/ExecutionBinding" },
          "limits": { "$ref": "#/components/schemas/Limits" },
          "accepted_at": { "type": "string", "format": "date-time" },
          "review_deadline": { "type": "string", "format": "date-time" },
          "private_delete_at": { "type": "string", "format": "date-time" },
          "audit_delete_at": { "type": "string", "format": "date-time" },
          "metadata": { "$ref": "#/components/schemas/Metadata" },
          "supersedes": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "authority_namespace": {
            "type": "string",
            "format": "uuid",
            "description": "Immutable service execution namespace. Retired namespaces cannot admit execution."
          }
        },
        "required": [
          "id",
          "protocol_revision",
          "purpose",
          "profiles",
          "tenant",
          "producer",
          "requester",
          "route",
          "authorisation_revision",
          "summary",
          "review",
          "limits",
          "accepted_at",
          "review_deadline",
          "private_delete_at",
          "audit_delete_at",
          "metadata"
        ],
        "if": {
          "properties": { "purpose": { "const": "authorise_execution" } },
          "required": ["purpose"]
        },
        "then": {
          "properties": {
            "execution": { "$ref": "#/components/schemas/ExecutionBinding" },
            "profiles": {
              "type": "object",
              "properties": { "haip.execution": { "const": "1-draft.1" } },
              "required": ["haip.execution"]
            }
          },
          "required": ["execution", "profiles"],
          "if": {
            "properties": {
              "review": { "type": "object", "properties": { "bundle": {} }, "required": ["bundle"] }
            }
          },
          "then": {
            "properties": {
              "profiles": {
                "type": "object",
                "properties": { "haip.agent-ui": { "const": "2" } },
                "required": ["haip.agent-ui"]
              }
            }
          }
        },
        "else": {
          "properties": { "execution": false },
          "if": {
            "properties": {
              "review": { "type": "object", "properties": { "bundle": {} }, "required": ["bundle"] }
            }
          },
          "then": {
            "properties": {
              "profiles": {
                "type": "object",
                "properties": { "haip.agent-ui": { "const": "2" } },
                "required": ["haip.agent-ui"]
              }
            }
          }
        }
      },
      "DecisionProposal": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "response": {},
          "decision": {
            "type": "string",
            "enum": ["answer", "approve", "reject", "authorise", "refuse"]
          }
        },
        "required": ["response", "decision"]
      },
      "DecisionCandidate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "request_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "reviewer": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "revision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
          "response": {},
          "response_canonical": { "type": "string" },
          "response_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "decision": {
            "type": "string",
            "enum": ["answer", "approve", "reject", "authorise", "refuse"]
          },
          "created_at": { "type": "string", "format": "date-time" }
        },
        "required": [
          "id",
          "request_id",
          "request_digest",
          "reviewer",
          "revision",
          "response",
          "response_canonical",
          "response_digest",
          "decision",
          "created_at"
        ]
      },
      "DecisionReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "purpose": { "type": "string", "enum": ["review", "authorise_execution"] },
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "request_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "candidate_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "candidate_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "reviewer": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "requester": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "response_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "decision": {
            "type": "string",
            "enum": ["answer", "approve", "reject", "authorise", "refuse"]
          },
          "confirmed_at": { "type": "string", "format": "date-time" },
          "grant_deadline": { "type": "string", "format": "date-time" }
        },
        "required": [
          "purpose",
          "request_id",
          "request_digest",
          "candidate_id",
          "candidate_digest",
          "reviewer",
          "requester",
          "response_digest",
          "decision",
          "confirmed_at"
        ],
        "if": {
          "properties": { "purpose": { "const": "authorise_execution" } },
          "required": ["purpose"]
        },
        "then": {
          "properties": {
            "decision": { "enum": ["authorise", "refuse"] },
            "grant_deadline": { "type": "string", "format": "date-time" }
          },
          "required": ["grant_deadline"]
        },
        "else": {
          "properties": {
            "decision": { "enum": ["answer", "approve", "reject"] },
            "grant_deadline": false
          }
        }
      },
      "ReviewClaim": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "reviewer": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "expires_at": { "type": "string", "format": "date-time" }
        },
        "required": ["id", "request_id", "reviewer", "expires_at"]
      },
      "ExecutionClaim": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "request_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "receipt_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "execution_identity": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "action_occurrence_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "execution_binding_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "claimed_at": { "type": "string", "format": "date-time" },
          "dispatch_before": { "type": "string", "format": "date-time" },
          "execution_seconds": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }
        },
        "required": [
          "id",
          "request_id",
          "request_digest",
          "receipt_digest",
          "execution_identity",
          "action_occurrence_id",
          "execution_binding_digest",
          "claimed_at",
          "dispatch_before",
          "execution_seconds"
        ]
      },
      "ClaimInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "execution_identity": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "execution_binding_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
        },
        "required": ["execution_identity", "execution_binding_digest"]
      },
      "AdmissionStatus": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "claim_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "claim_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "execution_identity": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "execution_binding_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "checked_at": { "type": "string", "format": "date-time" },
          "dispatch_before": { "type": "string", "format": "date-time" },
          "execution_seconds": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
          "nonce": { "type": "string", "minLength": 16, "maxLength": 160 },
          "anchor": { "$ref": "#/components/schemas/Metadata" }
        },
        "required": [
          "claim_id",
          "claim_digest",
          "request_id",
          "execution_identity",
          "execution_binding_digest",
          "checked_at",
          "dispatch_before",
          "execution_seconds",
          "nonce",
          "anchor"
        ]
      },
      "ExecutionOutcome": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "execution_identity": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "status": {
            "type": "string",
            "enum": [
              "completed",
              "failed",
              "failed_partial",
              "uncertain",
              "cancelled_before_dispatch",
              "abandoned"
            ]
          },
          "details": { "$ref": "#/components/schemas/Metadata" }
        },
        "required": ["execution_identity", "status", "details"]
      },
      "RequestChangedEvent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "event_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "type": { "const": "haip.request.changed", "type": "string" },
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "revision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "state": { "$ref": "#/components/schemas/Metadata" },
          "deadline": { "type": "string", "format": "date-time" },
          "status_ref": { "type": "string" }
        },
        "required": [
          "event_id",
          "type",
          "request_id",
          "revision",
          "reason",
          "state",
          "deadline",
          "status_ref"
        ]
      },
      "RequestStatus": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "request": { "$ref": "#/components/schemas/DecisionRequest" },
          "request_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "decision_state": {
            "type": "string",
            "enum": ["pending", "confirmed", "cancelled", "superseded", "expired"]
          },
          "audit_state": {
            "type": "string",
            "enum": ["unanchored", "pending", "anchored", "conflict"]
          },
          "grant_state": {
            "type": "string",
            "enum": [
              "not_applicable",
              "none",
              "pending_anchor",
              "available",
              "expired",
              "revoked",
              "consumed"
            ]
          },
          "execution_state": {
            "type": "string",
            "enum": [
              "not_applicable",
              "unclaimed",
              "claimed",
              "admitted",
              "completed",
              "failed",
              "failed_partial",
              "uncertain",
              "cancelled_before_dispatch",
              "abandoned"
            ]
          },
          "revision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
          "receipt": {
            "anyOf": [{ "$ref": "#/components/schemas/SignedRecord" }, { "type": "null" }]
          },
          "claim": {
            "anyOf": [{ "$ref": "#/components/schemas/SignedRecord" }, { "type": "null" }]
          },
          "outcome": {
            "anyOf": [{ "$ref": "#/components/schemas/SignedRecord" }, { "type": "null" }]
          },
          "anchor": {
            "anyOf": [{ "$ref": "#/components/schemas/AnchorProof" }, { "type": "null" }]
          },
          "delivery": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/DeliveryStatus" }
          },
          "review_link": { "type": "string" },
          "polling_link": { "type": "string" }
        },
        "required": [
          "request",
          "request_digest",
          "decision_state",
          "audit_state",
          "grant_state",
          "execution_state",
          "revision",
          "receipt",
          "claim",
          "outcome",
          "anchor",
          "delivery",
          "review_link",
          "polling_link"
        ]
      },
      "TrustManifest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "issuer": { "type": "string" },
          "protocol_revision": { "type": "string", "const": "2.0.0-draft.3" },
          "keys": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "key_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 160,
                  "pattern": "^[a-zA-Z0-9_.:@/-]+$"
                },
                "algorithm": { "const": "Ed25519", "type": "string" },
                "public_key": { "type": "string", "maxLength": 4096 },
                "not_before": { "type": "string", "format": "date-time" },
                "not_after": { "type": "string", "format": "date-time" },
                "revoked_at": { "type": "string", "format": "date-time" }
              },
              "required": ["key_id", "algorithm", "public_key", "not_before", "not_after"]
            },
            "minItems": 1,
            "maxItems": 128
          }
        },
        "required": ["issuer", "protocol_revision", "keys"]
      },
      "SignedRecord": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "protected": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "type": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[a-zA-Z0-9_.:@/-]+$"
              },
              "protocol_revision": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[a-zA-Z0-9_.:@/-]+$"
              },
              "purpose": { "type": "string", "enum": ["review", "authorise_execution", "service"] },
              "profiles": { "$ref": "#/components/schemas/Profiles" },
              "issuer": { "type": "string" },
              "audience": { "type": "string" },
              "tenant": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[a-zA-Z0-9_.:@/-]+$"
              },
              "key_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[a-zA-Z0-9_.:@/-]+$"
              },
              "issued_at": { "type": "string", "format": "date-time" }
            },
            "required": [
              "type",
              "protocol_revision",
              "purpose",
              "profiles",
              "issuer",
              "audience",
              "tenant",
              "key_id",
              "issued_at"
            ]
          },
          "payload": {},
          "signature": { "type": "string" }
        },
        "required": ["protected", "payload", "signature"]
      },
      "AuditExport": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "request": { "$ref": "#/components/schemas/DecisionRequest" },
          "request_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
          "records": { "type": "array", "items": { "$ref": "#/components/schemas/SignedRecord" } },
          "audit": { "type": "array", "items": {} },
          "anchor": {},
          "material": {},
          "verification": { "type": "string" }
        },
        "required": [
          "request",
          "request_digest",
          "records",
          "audit",
          "anchor",
          "material",
          "verification"
        ]
      },
      "ReviewRoute": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "revision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
          "separation_of_duties": { "type": "boolean" },
          "reviewers": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 160,
              "pattern": "^[a-zA-Z0-9_.:@/-]+$"
            }
          },
          "limits": { "$ref": "#/components/schemas/Limits" },
          "required_profiles": { "$ref": "#/components/schemas/Profiles" }
        },
        "required": [
          "id",
          "revision",
          "separation_of_duties",
          "reviewers",
          "limits",
          "required_profiles"
        ]
      },
      "EmptyInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {},
        "required": []
      },
      "Confirmation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "candidate_id": { "type": "string", "format": "uuid" },
          "candidate_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
        },
        "required": ["candidate_id", "candidate_digest"]
      },
      "AdmissionInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "claim_id": { "type": "string", "format": "uuid" },
          "nonce": { "type": "string", "pattern": "^[A-Za-z0-9_-]{16,160}$" },
          "execution_identity": { "type": "string", "minLength": 1, "maxLength": 160 }
        },
        "required": ["claim_id", "nonce", "execution_identity"]
      },
      "Discovery": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": { "type": "string" },
          "revisions": { "type": "array", "items": { "type": "string" } },
          "profiles": { "$ref": "#/components/schemas/Profiles" },
          "renderer": {
            "type": "object",
            "additionalProperties": false,
            "properties": { "agent_ui": { "type": "string" } },
            "required": ["agent_ui"]
          },
          "mode": { "enum": ["development", "production"] },
          "release_ready": { "type": "boolean" },
          "execution_admission": { "type": "string" },
          "notifications": { "enum": ["smtp", "polling-only"] }
        },
        "required": [
          "name",
          "revisions",
          "profiles",
          "renderer",
          "mode",
          "release_ready",
          "execution_admission",
          "notifications"
        ]
      },
      "Assignment": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": { "type": "string", "format": "uuid" },
          "reviewer": { "type": "string", "minLength": 1, "maxLength": 160 },
          "expires_at": { "type": "string", "format": "date-time" }
        },
        "required": ["id", "reviewer", "expires_at"]
      },
      "RequestList": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": { "type": "string", "format": "uuid" },
                "summary": { "type": "string" },
                "deadline": { "type": "string", "format": "date-time" },
                "decision": {
                  "type": "string",
                  "enum": ["pending", "confirmed", "cancelled", "superseded", "expired"]
                },
                "audit": {
                  "type": "string",
                  "enum": ["unanchored", "pending", "anchored", "conflict"]
                },
                "grant": {
                  "type": "string",
                  "enum": [
                    "not_applicable",
                    "none",
                    "pending_anchor",
                    "available",
                    "expired",
                    "revoked",
                    "consumed"
                  ]
                },
                "execution": {
                  "type": "string",
                  "enum": [
                    "not_applicable",
                    "unclaimed",
                    "claimed",
                    "admitted",
                    "completed",
                    "failed",
                    "failed_partial",
                    "uncertain",
                    "cancelled_before_dispatch",
                    "abandoned"
                  ]
                },
                "assignment": {
                  "anyOf": [{ "$ref": "#/components/schemas/Assignment" }, { "type": "null" }]
                }
              },
              "required": [
                "id",
                "summary",
                "deadline",
                "decision",
                "audit",
                "grant",
                "execution",
                "assignment"
              ]
            },
            "maxItems": 50
          },
          "next_offset": {
            "anyOf": [{ "type": "integer", "minimum": 0, "maximum": 100000 }, { "type": "null" }],
            "description": "Next page offset, or null when no further page is available within the offset limit."
          }
        },
        "required": ["items", "next_offset"],
        "description": "A page of visible request summaries, without an exact total count."
      },
      "Material": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "request": { "$ref": "#/components/schemas/DecisionRequest" },
          "request_digest": { "type": "string" },
          "payload": {},
          "response_schema": {},
          "review_document": { "type": "string" },
          "candidate": {
            "anyOf": [{ "$ref": "#/components/schemas/DecisionCandidate" }, { "type": "null" }]
          }
        },
        "required": [
          "request",
          "request_digest",
          "payload",
          "response_schema",
          "review_document",
          "candidate"
        ]
      },
      "StoredApp": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "profile": { "const": "org.haiprotocol.agent-ui/2" },
          "protocol_revision": { "const": "2.0.0-draft.3" },
          "request": { "$ref": "#/components/schemas/AgentUiRequestIdentity" },
          "bundle": { "$ref": "#/components/schemas/AgentUiBundleIdentity" },
          "source": { "$ref": "#/components/schemas/AgentUiSource" },
          "snapshots": { "$ref": "#/components/schemas/AgentUiSnapshotDigests" },
          "binding_digest": {
            "type": "string",
            "pattern": "^sha256:[0-9a-f]{64}$",
            "description": "SHA-256 over the RFC 8785 canonical identity fields. The authenticated host and its server-side verification establish trust in this transient presentation commitment."
          },
          "html": { "type": "string" },
          "origin": { "$ref": "#/components/schemas/AgentUiOrigin" },
          "scope": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
          "input": { "$ref": "#/components/schemas/AgentUiInput" },
          "result": { "$ref": "#/components/schemas/AgentUiResult" }
        },
        "required": [
          "profile",
          "protocol_revision",
          "request",
          "bundle",
          "source",
          "snapshots",
          "binding_digest",
          "html",
          "origin",
          "scope",
          "input",
          "result"
        ]
      },
      "ReminderResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "request_id": { "type": "string", "format": "uuid" },
          "notification": { "enum": ["queued", "polling-only"] }
        },
        "required": ["request_id", "notification"]
      },
      "EventPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": { "type": "array", "items": { "$ref": "#/components/schemas/SignedRecord" } },
          "next": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }
        },
        "required": ["items", "next"]
      },
      "DeliveryStatus": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": { "type": "string", "format": "uuid" },
          "kind": { "enum": ["smtp", "webhook", "checkpoint"] },
          "state": { "enum": ["pending", "accepted", "failed", "expired"] },
          "attempts": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
          "error": { "anyOf": [{ "type": "string" }, { "type": "null" }] }
        },
        "required": ["id", "kind", "state", "attempts", "error"]
      },
      "AnchorAcceptance": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "backend": { "type": "string" },
          "key": { "type": "string" },
          "version_id": { "type": "string" },
          "digest": { "type": "string" },
          "retained_until": { "type": "string", "format": "date-time" }
        },
        "required": ["backend", "key", "version_id", "digest", "retained_until"]
      },
      "AnchorProof": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "checkpoint": { "$ref": "#/components/schemas/SignedRecord" },
          "acceptance": { "$ref": "#/components/schemas/AnchorAcceptance" },
          "proof": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "sequence": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
                "previous_head": { "type": "string" },
                "record_digest": { "type": "string" },
                "head": { "type": "string" }
              },
              "required": ["sequence", "previous_head", "record_digest", "head"]
            }
          }
        },
        "required": ["checkpoint", "acceptance", "proof"]
      },
      "WebhookDelivery": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "delivery_id": { "type": "string", "format": "uuid" },
          "event_id": { "type": "string", "format": "uuid" },
          "timestamp": { "type": "string", "format": "date-time" },
          "event": { "$ref": "#/components/schemas/SignedRecord" }
        },
        "required": ["delivery_id", "event_id", "timestamp", "event"]
      },
      "PrincipalInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": { "type": "string", "minLength": 1, "maxLength": 160 },
          "kind": { "enum": ["producer", "publisher", "human"] },
          "token": { "type": "string", "pattern": "^[A-Za-z0-9_-]{32,200}$" },
          "config": {
            "type": "object",
            "properties": {
              "enabled": { "type": "boolean" },
              "identity_certain": { "type": "boolean" },
              "publisher": { "type": "string", "minLength": 1, "maxLength": 160 },
              "routes": {
                "type": "array",
                "items": { "type": "string", "minLength": 1, "maxLength": 160 }
              },
              "owner": { "type": "string", "minLength": 1, "maxLength": 160 },
              "oidc_issuer": { "type": "string" },
              "oidc_subject": { "type": "string" },
              "email": { "type": "string" },
              "email_verified": { "type": "boolean" },
              "webhook": { "type": "string" }
            },
            "required": ["enabled"],
            "additionalProperties": true
          }
        },
        "required": ["id", "kind", "config"]
      },
      "PrincipalResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": { "type": "string", "minLength": 1, "maxLength": 160 },
          "kind": { "enum": ["producer", "publisher", "human"] }
        },
        "required": ["id", "kind"]
      },
      "RouteInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "reviewers": {
            "type": "array",
            "items": { "type": "string", "minLength": 1, "maxLength": 160 }
          },
          "separation_of_duties": { "type": "boolean" },
          "limits": { "$ref": "#/components/schemas/Limits" },
          "required_profiles": { "$ref": "#/components/schemas/Profiles" },
          "allowed_producers": {
            "type": "array",
            "items": { "type": "string", "minLength": 1, "maxLength": 160 }
          },
          "modes": {
            "type": "array",
            "items": { "type": "string", "minLength": 1, "maxLength": 160 }
          }
        },
        "required": [
          "reviewers",
          "separation_of_duties",
          "limits",
          "required_profiles",
          "allowed_producers",
          "modes"
        ]
      },
      "RouteResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": { "type": "string", "minLength": 1, "maxLength": 160 },
          "revision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
          "config": { "$ref": "#/components/schemas/RouteInput" }
        },
        "required": ["id", "revision", "config"]
      },
      "LedgerEntry": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "tenant": { "type": "string", "minLength": 1, "maxLength": 160 },
          "sequence": { "type": "string", "pattern": "^[0-9]+$" },
          "request_id": { "anyOf": [{ "type": "string", "format": "uuid" }, { "type": "null" }] },
          "previous_head": { "type": "string" },
          "head": { "type": "string" },
          "record_digest": { "type": "string" },
          "record": { "anyOf": [{ "type": "string" }, { "type": "null" }] },
          "created_at": { "type": "string", "format": "date-time" }
        },
        "required": [
          "tenant",
          "sequence",
          "request_id",
          "previous_head",
          "head",
          "record_digest",
          "record",
          "created_at"
        ]
      },
      "LedgerPage": { "type": "array", "items": { "$ref": "#/components/schemas/LedgerEntry" } },
      "HitlPoll": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "case_id": { "type": "string", "format": "uuid" },
              "status": { "enum": ["pending", "cancelled", "expired"] },
              "created_at": { "type": "string", "format": "date-time" },
              "expires_at": { "type": "string", "format": "date-time" }
            },
            "required": ["case_id", "status", "created_at", "expires_at"]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "case_id": { "type": "string", "format": "uuid" },
              "status": { "const": "completed" },
              "completed_at": { "type": "string", "format": "date-time" },
              "result": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "action": { "type": "string" },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "response": {},
                      "haip_receipt": { "$ref": "#/components/schemas/SignedRecord" },
                      "audit_state": { "type": "string" },
                      "material_available": { "type": "boolean" }
                    },
                    "required": ["response", "haip_receipt", "audit_state", "material_available"]
                  }
                },
                "required": ["action", "data"]
              }
            },
            "required": ["case_id", "status", "completed_at", "result"]
          }
        ]
      },
      "HitlStatus": {
        "oneOf": [
          { "$ref": "#/components/schemas/HitlPoll" },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": { "const": "human_input_required" },
              "hitl": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "spec_version": { "const": "0.8" },
                  "case_id": { "type": "string", "format": "uuid" },
                  "review_url": { "type": "string" },
                  "poll_url": { "type": "string" },
                  "type": { "const": "input" },
                  "prompt": { "type": "string" },
                  "timeout": { "type": "string" },
                  "default_action": { "const": "cancel" },
                  "created_at": { "type": "string", "format": "date-time" },
                  "expires_at": { "type": "string", "format": "date-time" }
                },
                "required": [
                  "spec_version",
                  "case_id",
                  "review_url",
                  "poll_url",
                  "type",
                  "prompt",
                  "timeout",
                  "default_action",
                  "created_at",
                  "expires_at"
                ]
              }
            },
            "required": ["status", "hitl"]
          }
        ]
      },
      "MetricsSnapshot": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "admission_fenced": { "type": "boolean" },
          "requests": { "type": "object", "additionalProperties": { "type": "number" } },
          "enabled_reviewers": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
          "pending_per_reviewer": { "anyOf": [{ "type": "number" }, { "type": "null" }] },
          "delivery": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "kind": { "type": "string" },
                "state": { "type": "string" },
                "count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
                "oldest_seconds": { "type": "number" }
              },
              "required": ["kind", "state", "count", "oldest_seconds"]
            }
          },
          "incidents": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": { "type": "string" },
                "code": { "type": "string" },
                "created_at": { "type": "string", "format": "date-time" }
              },
              "required": ["id", "code", "created_at"]
            }
          },
          "operations": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "name": { "type": "string" },
                "succeeded_at": {
                  "anyOf": [{ "type": "string", "format": "date-time" }, { "type": "null" }]
                },
                "failed_at": {
                  "anyOf": [{ "type": "string", "format": "date-time" }, { "type": "null" }]
                }
              },
              "required": ["name", "succeeded_at", "failed_at"]
            }
          },
          "http_since_process_start": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "total": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
              "failures": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
              "conflicts": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }
            },
            "required": ["total", "failures", "conflicts"]
          },
          "policy_and_executor_evidence": { "type": "string" }
        },
        "required": [
          "admission_fenced",
          "requests",
          "enabled_reviewers",
          "pending_per_reviewer",
          "delivery",
          "incidents",
          "operations",
          "http_since_process_start",
          "policy_and_executor_evidence"
        ]
      },
      "AgentUiRequestIdentity": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
          "purpose": { "enum": ["review", "authorise_execution"] },
          "authorisation_revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "supersedes": {
            "oneOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[a-zA-Z0-9_.:@/-]+$"
              },
              { "type": "null" }
            ]
          }
        },
        "required": ["id", "digest", "purpose", "authorisation_revision", "supersedes"]
      },
      "AgentUiBundleIdentity": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "publisher": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Immutable registration time captured in the accepted request binding.",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:[0-5]\\d\\.\\d{3}Z$"
          }
        },
        "required": ["id", "publisher", "digest", "created_at"]
      },
      "AgentUiSource": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "tenant": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$"
          },
          "producer": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "pattern": "^[a-zA-Z0-9_.:@/-]+$",
            "description": "Authenticated machine principal acting as the producer and agent system."
          },
          "requester": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "subject": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[a-zA-Z0-9_.:@/-]+$"
              },
              "source": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "pattern": "^[a-zA-Z0-9_.:@/-]+$"
              }
            },
            "required": ["subject", "source"],
            "description": "Operator-resolved human owner on whose behalf the producer submitted the request."
          },
          "origin": { "$ref": "#/components/schemas/AgentUiOrigin" }
        },
        "required": ["tenant", "producer", "requester", "origin"]
      },
      "AgentUiSnapshotDigests": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "input_digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
          "result_digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
        },
        "required": ["input_digest", "result_digest"]
      },
      "AgentUiEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "profile": { "const": "org.haiprotocol.agent-ui/2" },
          "protocol_revision": { "const": "2.0.0-draft.3" },
          "request": { "$ref": "#/components/schemas/AgentUiRequestIdentity" },
          "bundle": { "$ref": "#/components/schemas/AgentUiBundleIdentity" },
          "source": { "$ref": "#/components/schemas/AgentUiSource" },
          "snapshots": { "$ref": "#/components/schemas/AgentUiSnapshotDigests" },
          "binding_digest": {
            "type": "string",
            "pattern": "^sha256:[0-9a-f]{64}$",
            "description": "SHA-256 over the RFC 8785 canonical identity fields. The authenticated host and its server-side verification establish trust in this transient presentation commitment."
          }
        },
        "required": [
          "profile",
          "protocol_revision",
          "request",
          "bundle",
          "source",
          "snapshots",
          "binding_digest"
        ]
      },
      "AgentUiInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "purpose": { "enum": ["review", "authorise_execution"] }
        },
        "required": ["request_id", "purpose"]
      },
      "AgentUiResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "content": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": { "type": { "const": "text" }, "text": { "type": "string" } },
              "required": ["type", "text"]
            }
          },
          "structuredContent": {
            "type": "object",
            "additionalProperties": false,
            "properties": { "payload": {} },
            "required": ["payload"]
          }
        },
        "required": ["content", "structuredContent"]
      },
      "AgentUiInitializeParams": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "protocolVersion": { "const": "org.haiprotocol.agent-ui/2" },
          "capabilities": {
            "type": "object",
            "additionalProperties": false,
            "properties": { "localProposal": { "const": true } },
            "required": ["localProposal"]
          },
          "viewInfo": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": { "type": "string", "minLength": 1, "maxLength": 120 },
              "version": { "type": "string", "minLength": 1, "maxLength": 40 }
            },
            "required": ["name", "version"]
          }
        },
        "required": ["protocolVersion", "capabilities"]
      },
      "AgentUiInitializeResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "protocolVersion": { "const": "org.haiprotocol.agent-ui/2" },
          "capabilities": {
            "type": "object",
            "additionalProperties": false,
            "properties": { "localProposal": { "const": true } },
            "required": ["localProposal"]
          },
          "hostInfo": {
            "type": "object",
            "additionalProperties": false,
            "properties": { "name": { "type": "string" }, "version": { "type": "string" } },
            "required": ["name", "version"]
          },
          "envelope": { "$ref": "#/components/schemas/AgentUiEnvelope" },
          "limits": { "$ref": "#/components/schemas/AgentUiLimits" },
          "lifecycle": { "$ref": "#/components/schemas/AgentUiLifecycle" }
        },
        "required": [
          "protocolVersion",
          "capabilities",
          "hostInfo",
          "envelope",
          "limits",
          "lifecycle"
        ]
      },
      "AgentUiTeardownResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": { "closed": { "const": true } },
        "required": ["closed"]
      },
      "AgentUiViewFailedParams": {
        "type": "object",
        "additionalProperties": false,
        "properties": { "reason": { "type": "string", "maxLength": 160 } },
        "required": ["reason"]
      },
      "AgentUiErrorCode": { "enum": [-32600, -32601, -32602, -32000] },
      "AgentUiId": {
        "oneOf": [
          { "type": "string", "minLength": 1, "maxLength": 200 },
          { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }
        ]
      },
      "AgentUiInitializedParams": { "type": "object", "additionalProperties": false },
      "AgentUiTeardownParams": { "type": "object", "additionalProperties": false },
      "AgentUiProxyReadyParams": { "type": "object", "additionalProperties": false },
      "AgentUiResourceReadyParams": {
        "type": "object",
        "additionalProperties": false,
        "properties": { "html": { "type": "string" }, "sandbox": { "const": "allow-scripts" } },
        "required": ["html", "sandbox"]
      },
      "AgentUiInitializeRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "jsonrpc": { "const": "2.0" },
          "id": { "$ref": "#/components/schemas/AgentUiId" },
          "method": { "const": "haip/ui.initialize" },
          "params": { "$ref": "#/components/schemas/AgentUiInitializeParams" }
        },
        "required": ["jsonrpc", "id", "method", "params"]
      },
      "AgentUiProposeRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "jsonrpc": { "const": "2.0" },
          "id": { "$ref": "#/components/schemas/AgentUiId" },
          "method": { "const": "haip/ui.propose" },
          "params": { "$ref": "#/components/schemas/AgentUiProposeParams" }
        },
        "required": ["jsonrpc", "id", "method", "params"]
      },
      "AgentUiTeardownRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "jsonrpc": { "const": "2.0" },
          "id": { "$ref": "#/components/schemas/AgentUiId" },
          "method": { "const": "haip/ui.teardown" },
          "params": { "$ref": "#/components/schemas/AgentUiTeardownParams" }
        },
        "required": ["jsonrpc", "id", "method", "params"]
      },
      "AgentUiInitializedNotification": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "jsonrpc": { "const": "2.0" },
          "method": { "const": "haip/ui.initialized" },
          "params": { "$ref": "#/components/schemas/AgentUiInitializedParams" }
        },
        "required": ["jsonrpc", "method", "params"]
      },
      "AgentUiInputNotification": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "jsonrpc": { "const": "2.0" },
          "method": { "const": "haip/ui.input" },
          "params": { "$ref": "#/components/schemas/AgentUiInput" }
        },
        "required": ["jsonrpc", "method", "params"]
      },
      "AgentUiResultNotification": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "jsonrpc": { "const": "2.0" },
          "method": { "const": "haip/ui.result" },
          "params": { "$ref": "#/components/schemas/AgentUiResult" }
        },
        "required": ["jsonrpc", "method", "params"]
      },
      "AgentUiProxyReadyNotification": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "jsonrpc": { "const": "2.0" },
          "method": { "const": "haip/ui.proxyReady" },
          "params": { "$ref": "#/components/schemas/AgentUiProxyReadyParams" }
        },
        "required": ["jsonrpc", "method", "params"]
      },
      "AgentUiResourceReadyNotification": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "jsonrpc": { "const": "2.0" },
          "method": { "const": "haip/ui.resourceReady" },
          "params": { "$ref": "#/components/schemas/AgentUiResourceReadyParams" }
        },
        "required": ["jsonrpc", "method", "params"]
      },
      "AgentUiViewFailedNotification": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "jsonrpc": { "const": "2.0" },
          "method": { "const": "haip/ui.viewFailed" },
          "params": { "$ref": "#/components/schemas/AgentUiViewFailedParams" }
        },
        "required": ["jsonrpc", "method", "params"]
      },
      "AgentUiInitializeSuccess": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "jsonrpc": { "const": "2.0" },
          "id": { "$ref": "#/components/schemas/AgentUiId" },
          "result": { "$ref": "#/components/schemas/AgentUiInitializeResult" }
        },
        "required": ["jsonrpc", "id", "result"]
      },
      "AgentUiProposeSuccess": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "jsonrpc": { "const": "2.0" },
          "id": { "$ref": "#/components/schemas/AgentUiId" },
          "result": { "$ref": "#/components/schemas/AgentUiProposeResult" }
        },
        "required": ["jsonrpc", "id", "result"]
      },
      "AgentUiTeardownSuccess": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "jsonrpc": { "const": "2.0" },
          "id": { "$ref": "#/components/schemas/AgentUiId" },
          "result": { "$ref": "#/components/schemas/AgentUiTeardownResult" }
        },
        "required": ["jsonrpc", "id", "result"]
      },
      "AgentUiRequest": {
        "oneOf": [
          { "$ref": "#/components/schemas/AgentUiInitializeRequest" },
          { "$ref": "#/components/schemas/AgentUiProposeRequest" },
          { "$ref": "#/components/schemas/AgentUiTeardownRequest" }
        ]
      },
      "AgentUiNotification": {
        "oneOf": [
          { "$ref": "#/components/schemas/AgentUiInitializedNotification" },
          { "$ref": "#/components/schemas/AgentUiInputNotification" },
          { "$ref": "#/components/schemas/AgentUiResultNotification" }
        ]
      },
      "AgentUiSuccess": {
        "oneOf": [
          { "$ref": "#/components/schemas/AgentUiInitializeSuccess" },
          { "$ref": "#/components/schemas/AgentUiProposeSuccess" },
          { "$ref": "#/components/schemas/AgentUiTeardownSuccess" }
        ]
      },
      "AgentUiError": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "jsonrpc": { "const": "2.0" },
          "id": { "$ref": "#/components/schemas/AgentUiId" },
          "error": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "code": { "$ref": "#/components/schemas/AgentUiErrorCode" },
              "message": { "type": "string", "maxLength": 400 }
            },
            "required": ["code", "message"]
          }
        },
        "required": ["jsonrpc", "id", "error"]
      },
      "AgentUiViewToHostMessage": {
        "oneOf": [
          { "$ref": "#/components/schemas/AgentUiInitializeRequest" },
          { "$ref": "#/components/schemas/AgentUiInitializedNotification" },
          { "$ref": "#/components/schemas/AgentUiProposeRequest" },
          { "$ref": "#/components/schemas/AgentUiTeardownSuccess" },
          { "$ref": "#/components/schemas/AgentUiError" }
        ],
        "description": "Closed public View-to-Host message union. Error responses in this direction correlate only to Host teardown requests."
      },
      "AgentUiHostToViewMessage": {
        "oneOf": [
          { "$ref": "#/components/schemas/AgentUiInitializeSuccess" },
          { "$ref": "#/components/schemas/AgentUiInputNotification" },
          { "$ref": "#/components/schemas/AgentUiResultNotification" },
          { "$ref": "#/components/schemas/AgentUiProposeSuccess" },
          { "$ref": "#/components/schemas/AgentUiTeardownRequest" },
          { "$ref": "#/components/schemas/AgentUiError" }
        ],
        "description": "Closed public Host-to-View message union. Error responses in this direction correlate only to View initialize or propose requests."
      },
      "AgentUiProxyToHostNotification": {
        "oneOf": [
          { "$ref": "#/components/schemas/AgentUiProxyReadyNotification" },
          { "$ref": "#/components/schemas/AgentUiViewFailedNotification" }
        ],
        "description": "Private outer-Proxy-to-Host lifecycle notifications. These messages never cross the public View boundary."
      },
      "AgentUiHostToProxyNotification": {
        "$ref": "#/components/schemas/AgentUiResourceReadyNotification",
        "description": "Private Host-to-outer-Proxy resource notification. This message never crosses the public View boundary."
      },
      "AgentUiPrivateProxyNotification": {
        "oneOf": [
          { "$ref": "#/components/schemas/AgentUiProxyToHostNotification" },
          { "$ref": "#/components/schemas/AgentUiHostToProxyNotification" }
        ]
      },
      "AgentUiMessage": {
        "anyOf": [
          { "$ref": "#/components/schemas/AgentUiViewToHostMessage" },
          { "$ref": "#/components/schemas/AgentUiHostToViewMessage" }
        ],
        "description": "Closed public Agent UI version 2 message union. Directional validators enforce the fixed initialize, initialized, input, result, optional proposals and terminal teardown lifecycle. Private Proxy notifications are excluded."
      },
      "AgentUiProposeParams": { "$ref": "#/components/schemas/DecisionProposal" },
      "AgentUiProposeResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "candidate_id": { "type": "string" },
          "status": { "const": "awaiting_human_confirmation" }
        },
        "required": ["candidate_id", "status"]
      },
      "AgentUiLimits": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "view_message_bytes": { "type": "integer", "const": 1048576 },
          "host_message_bytes": { "type": "integer", "const": 6291456 },
          "tracked_view_request_ids": { "type": "integer", "const": 512 },
          "proposals_per_view": { "type": "integer", "const": 32 },
          "initialise_timeout_ms": { "type": "integer", "const": 5000 },
          "teardown_grace_ms": { "type": "integer", "const": 250 },
          "json_depth": { "type": "integer", "const": 64 },
          "request_id_codepoints": { "type": "integer", "const": 200 },
          "error_message_codepoints": { "type": "integer", "const": 400 },
          "view_name_codepoints": { "type": "integer", "const": 120 },
          "view_version_codepoints": { "type": "integer", "const": 40 },
          "failure_reason_codepoints": { "type": "integer", "const": 160 }
        },
        "required": [
          "view_message_bytes",
          "host_message_bytes",
          "tracked_view_request_ids",
          "proposals_per_view",
          "initialise_timeout_ms",
          "teardown_grace_ms",
          "json_depth",
          "request_id_codepoints",
          "error_message_codepoints",
          "view_name_codepoints",
          "view_version_codepoints",
          "failure_reason_codepoints"
        ],
        "description": "Fixed Agent UI version 2 transport, lifecycle and text budgets. Message byte limits apply to UTF-8 encoded JSON, and json_depth counts the root as depth zero."
      },
      "AgentUiLifecycle": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "initialise": { "const": "haip/ui.initialize -> haip/ui.initialized" },
          "snapshots": { "const": "haip/ui.input -> haip/ui.result" },
          "proposal_after": { "const": "haip/ui.result" },
          "teardown": { "const": "terminal" }
        },
        "required": ["initialise", "snapshots", "proposal_after", "teardown"],
        "description": "Fixed Agent UI version 2 lifecycle. Messages outside this order are invalid for the active View instance."
      }
    },
    "securitySchemes": {
      "producerBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Separately provisioned machine credential; no human confirmation authority"
      },
      "humanSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-haip",
        "description": "OIDC server-side session; mutations also require CSRF and exact Origin"
      }
    }
  }
}
