{
  "openapi": "3.1.0",
  "info": {
    "title": "Verahelm API",
    "version": "1.4.0",
    "description": "Bounded preliminary automated analysis for United States business and professional users. Structured non-confidential inputs only; no saved payloads or outputs; not an audit, certification, professional advice, compliance approval, or production authorization. Every API response carries the headers X-Request-ID and Cache-Control: no-store, max-age=0 (see components.headers).",
    "contact": {
      "name": "Verahelm API support",
      "email": "support@verahelm.com",
      "url": "https://status.verahelm.com/"
    },
    "license": {
      "name": "Proprietary — governed by Verahelm API Terms",
      "url": "https://www.verahelm.com/api-terms"
    }
  },
  "servers": [
    {
      "url": "https://api.verahelm.com"
    }
  ],
  "security": [
    {
      "bearerKey": []
    }
  ],
  "paths": {
    "/v1/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Read aggregate readiness",
        "security": [],
        "responses": {
          "200": {
            "description": "Ready",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControl"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          },
          "503": {
            "description": "Configuration or dependency not ready",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControl"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          }
        }
      }
    },
    "/start-scope": {
      "get": {
        "operationId": "startManualScope",
        "summary": "Continue a public run reference into the authenticated manual-escalation flow",
        "security": [],
        "parameters": [
          {
            "name": "run",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/RunReference"
            }
          }
        ],
        "responses": {
          "303": {
            "description": "Redirect to access.verahelm.com; no API input is transferred",
            "headers": {
              "Location": {
                "required": true,
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControl"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/v1/analyze": {
      "post": {
        "operationId": "analyze",
        "summary": "Run one bounded operation through the unified contract",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyzeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Code-only preliminary result",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControl"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyzeResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/v1/decision-signal": {
      "post": {
        "operationId": "decisionSignal",
        "summary": "Analyze one bounded structured item",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DecisionSignalInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Code-only signal",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControl"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DecisionResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/v1/pairwise-signal": {
      "post": {
        "operationId": "pairwiseSignal",
        "summary": "Compare exactly two bounded candidates",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PairwiseInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Directional code-only signal",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControl"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PairwiseResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/v1/claim-triage": {
      "post": {
        "operationId": "claimTriage",
        "summary": "Triage one bounded claim and evidence summary",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimTriageInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Triage codes; not independent verification",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControl"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/v1/boundary-stress-signal": {
      "post": {
        "operationId": "boundaryStressSignal",
        "summary": "Apply a bounded server-controlled stability screen",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BoundaryStressInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stability codes without internal variations, scores, or thresholds",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControl"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BoundaryResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/v1/evidence-sufficiency-map": {
      "post": {
        "operationId": "evidenceSufficiencyMap",
        "summary": "Map a structured evidence inventory",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvidenceMapInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inventory map; no file inspection or independent verification",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControl"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceMapResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/v1/decision-envelope-keys/{key_id}": {
      "get": {
        "operationId": "getDecisionEnvelopeKey",
        "summary": "Get the public Ed25519 verification key",
        "security": [],
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9._-]{2,63}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public verification key",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControl"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ed25519PublicJwk"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/v1/decision-envelopes/{envelope_id}/status": {
      "get": {
        "operationId": "getDecisionEnvelopeStatus",
        "summary": "Get signed lifecycle status",
        "parameters": [
          {
            "name": "envelope_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^de_[a-f0-9]{32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Signed current lifecycle status",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControl"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DecisionStatus"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/v1/decision-envelopes/{envelope_id}/revoke": {
      "post": {
        "operationId": "revokeDecisionEnvelope",
        "summary": "Revoke an active Decision Envelope",
        "parameters": [
          {
            "name": "envelope_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^de_[a-f0-9]{32}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "maxProperties": 0
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signed revoked lifecycle status",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/CacheControl"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DecisionStatus"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "A one-time-displayed vh_live_ or vh_test_ key. Never place it in a URL, cookie, browser bundle, log, screenshot, or email."
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "description": "Unique per logical request. Identical retries within 24 hours return the same deterministic result without a second charge; changed payloads fail closed.",
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_.:-]{16,128}$"
        }
      }
    },
    "headers": {
      "XRequestId": {
        "required": true,
        "description": "Gateway-issued request identifier echoed on every API response for support correlation.",
        "schema": {
          "type": "string",
          "pattern": "^req_[A-Za-z0-9_-]{24}$"
        }
      },
      "CacheControl": {
        "required": true,
        "description": "API responses are never stored by any cache.",
        "schema": {
          "type": "string",
          "const": "no-store, max-age=0"
        }
      }
    },
    "responses": {
      "ErrorResponse": {
        "description": "Sanitized machine-readable failure",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/XRequestId"
          },
          "Cache-Control": {
            "$ref": "#/components/headers/CacheControl"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "RunReference": {
        "type": "string",
        "pattern": "^run_[A-Za-z0-9_-]{24}$"
      },
      "Context": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "purpose",
          "data_classification",
          "consequence"
        ],
        "properties": {
          "purpose": {
            "const": "internal_evaluation"
          },
          "data_classification": {
            "enum": [
              "public",
              "internal"
            ]
          },
          "consequence": {
            "const": "non_consequential"
          }
        }
      },
      "DecisionCategory": {
        "enum": [
          "model_selection",
          "workflow_change",
          "automation_candidate",
          "cost_quality_tradeoff",
          "evidence_readiness"
        ]
      },
      "MetricCode": {
        "enum": [
          "quality",
          "latency",
          "cost",
          "reliability",
          "failure_rate",
          "consistency",
          "coverage",
          "human_review_rate"
        ]
      },
      "ObservationCode": {
        "enum": [
          "baseline_available",
          "versions_pinned",
          "matched_conditions",
          "failure_cases_recorded",
          "human_boundary_defined",
          "cost_unit_defined",
          "latency_boundary_defined",
          "revisit_rule_defined"
        ]
      },
      "EvidenceCode": {
        "enum": [
          "baseline",
          "candidate",
          "workload",
          "versions",
          "acceptance_gate",
          "failure_cases",
          "cost",
          "latency",
          "human_review",
          "controls",
          "independent_check",
          "production_observation"
        ]
      },
      "DependencyCode": {
        "enum": [
          "data_version",
          "model_version",
          "provider_version",
          "runtime_environment",
          "human_process",
          "external_source"
        ]
      },
      "Description": {
        "type": "string",
        "minLength": 8,
        "maxLength": 320,
        "pattern": "^[^\\r\\n]+$"
      },
      "Metric": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "observed",
          "threshold",
          "objective"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/MetricCode"
          },
          "observed": {
            "type": "integer",
            "minimum": -1000000000,
            "maximum": 1000000000
          },
          "threshold": {
            "type": "integer",
            "minimum": -1000000000,
            "maximum": 1000000000
          },
          "objective": {
            "enum": [
              "minimize",
              "maximize"
            ]
          }
        }
      },
      "DecisionSignalInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "decision_category",
          "description",
          "metrics",
          "observations",
          "context"
        ],
        "properties": {
          "decision_category": {
            "$ref": "#/components/schemas/DecisionCategory"
          },
          "description": {
            "$ref": "#/components/schemas/Description"
          },
          "metrics": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/Metric"
            }
          },
          "observations": {
            "type": "array",
            "maxItems": 8,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/ObservationCode"
            }
          },
          "context": {
            "$ref": "#/components/schemas/Context"
          }
        }
      },
      "Condition": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "threshold",
          "objective"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/MetricCode"
          },
          "threshold": {
            "type": "integer",
            "minimum": -1000000000,
            "maximum": 1000000000
          },
          "objective": {
            "enum": [
              "minimize",
              "maximize"
            ]
          }
        }
      },
      "PairMetric": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "value"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/MetricCode"
          },
          "value": {
            "type": "integer",
            "minimum": -1000000000,
            "maximum": 1000000000
          }
        }
      },
      "Candidate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "label",
          "metrics"
        ],
        "properties": {
          "label": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
          },
          "metrics": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/PairMetric"
            }
          }
        }
      },
      "PairwiseInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "decision_category",
          "description",
          "conditions",
          "candidates",
          "observations",
          "context"
        ],
        "properties": {
          "decision_category": {
            "$ref": "#/components/schemas/DecisionCategory"
          },
          "description": {
            "$ref": "#/components/schemas/Description"
          },
          "conditions": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/Condition"
            }
          },
          "candidates": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
              "$ref": "#/components/schemas/Candidate"
            }
          },
          "observations": {
            "type": "array",
            "maxItems": 8,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/ObservationCode"
            }
          },
          "context": {
            "$ref": "#/components/schemas/Context"
          }
        },
        "description": "Server-enforced invariants: unique condition codes; exactly two distinct candidate labels; unique metric codes per candidate; the condition-code set must equal each candidate's metric-code set; one value per condition."
      },
      "ClaimEvidence": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "categories",
          "baseline_checks",
          "control_checks",
          "robustness_checks",
          "independent_checks",
          "reproductions",
          "contradictions",
          "has_production_evidence"
        ],
        "properties": {
          "categories": {
            "type": "array",
            "maxItems": 12,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/EvidenceCode"
            }
          },
          "baseline_checks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "control_checks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "robustness_checks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "independent_checks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "reproductions": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "contradictions": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "has_production_evidence": {
            "type": "boolean"
          }
        }
      },
      "ClaimTriageInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "claim_category",
          "claim",
          "evidence",
          "context"
        ],
        "properties": {
          "claim_category": {
            "enum": [
              "quality",
              "cost",
              "latency",
              "reliability",
              "capability",
              "commercial_value"
            ]
          },
          "claim": {
            "type": "string",
            "minLength": 8,
            "maxLength": 400,
            "pattern": "^[^\\r\\n]+$"
          },
          "evidence": {
            "$ref": "#/components/schemas/ClaimEvidence"
          },
          "context": {
            "$ref": "#/components/schemas/Context"
          }
        }
      },
      "BoundaryStressInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "decision_category",
          "description",
          "metrics",
          "observations",
          "sample_count",
          "context"
        ],
        "properties": {
          "decision_category": {
            "$ref": "#/components/schemas/DecisionCategory"
          },
          "description": {
            "$ref": "#/components/schemas/Description"
          },
          "metrics": {
            "type": "array",
            "minItems": 1,
            "maxItems": 5,
            "items": {
              "$ref": "#/components/schemas/Metric"
            }
          },
          "observations": {
            "type": "array",
            "maxItems": 8,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/ObservationCode"
            }
          },
          "sample_count": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5
          },
          "context": {
            "$ref": "#/components/schemas/Context"
          }
        }
      },
      "EvidenceMapInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "decision_category",
          "description",
          "available_categories",
          "missing_categories",
          "contradictory_categories",
          "dependencies",
          "context"
        ],
        "properties": {
          "decision_category": {
            "$ref": "#/components/schemas/DecisionCategory"
          },
          "description": {
            "$ref": "#/components/schemas/Description"
          },
          "available_categories": {
            "type": "array",
            "maxItems": 12,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/EvidenceCode"
            }
          },
          "missing_categories": {
            "type": "array",
            "maxItems": 12,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/EvidenceCode"
            }
          },
          "contradictory_categories": {
            "type": "array",
            "maxItems": 12,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/EvidenceCode"
            }
          },
          "dependencies": {
            "type": "array",
            "maxItems": 6,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/DependencyCode"
            }
          },
          "context": {
            "$ref": "#/components/schemas/Context"
          }
        },
        "description": "Server-enforced invariant: the available set is disjoint from both the missing and contradictory sets (overlap returns 422)."
      },
      "PipelineStageCode": {
        "enum": [
          "data_intake",
          "preparation",
          "selection",
          "inference",
          "validation",
          "human_review",
          "release"
        ]
      },
      "PipelineProblemCode": {
        "enum": [
          "quality_variance",
          "latency_over_budget",
          "cost_over_budget",
          "failure_escape",
          "version_drift",
          "evidence_gap",
          "review_bottleneck",
          "boundary_instability"
        ]
      },
      "PipelineConstraints": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "primary_objective",
          "maximum_effort",
          "latency_change",
          "cost_change",
          "human_review_required"
        ],
        "properties": {
          "primary_objective": {
            "enum": [
              "quality",
              "latency",
              "cost",
              "reliability",
              "evidence_readiness"
            ]
          },
          "maximum_effort": {
            "enum": [
              "low",
              "moderate",
              "high"
            ]
          },
          "latency_change": {
            "enum": [
              "reduce",
              "hold",
              "flexible"
            ]
          },
          "cost_change": {
            "enum": [
              "reduce",
              "hold",
              "flexible"
            ]
          },
          "human_review_required": {
            "type": "boolean"
          }
        }
      },
      "PipelineComparison": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode",
          "changed_stage_codes",
          "change_scope"
        ],
        "properties": {
          "mode": {
            "const": "baseline_new_configuration"
          },
          "changed_stage_codes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 7,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/PipelineStageCode"
            }
          },
          "change_scope": {
            "enum": [
              "parameter_only",
              "component",
              "subsystem"
            ]
          }
        }
      },
      "AccelerationFit": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode",
          "hot_path_share_band",
          "repeat_frequency_band",
          "deterministic",
          "side_effect_free",
          "reference_output_frozen",
          "representative_scale_count",
          "independent_check_available",
          "rollback_available"
        ],
        "properties": {
          "mode": {
            "const": "protected_speedup_lite"
          },
          "hot_path_share_band": {
            "enum": [
              "under_25",
              "25_50",
              "50_75",
              "over_75"
            ]
          },
          "repeat_frequency_band": {
            "enum": [
              "low",
              "moderate",
              "high"
            ]
          },
          "deterministic": {
            "type": "boolean"
          },
          "side_effect_free": {
            "type": "boolean"
          },
          "reference_output_frozen": {
            "type": "boolean"
          },
          "representative_scale_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5
          },
          "independent_check_available": {
            "type": "boolean"
          },
          "rollback_available": {
            "type": "boolean"
          }
        }
      },
      "PipelineImprovementInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "pipeline_stage_codes",
          "observed_problem_codes",
          "constraints",
          "context"
        ],
        "properties": {
          "pipeline_stage_codes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 7,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/PipelineStageCode"
            }
          },
          "observed_problem_codes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/PipelineProblemCode"
            }
          },
          "constraints": {
            "$ref": "#/components/schemas/PipelineConstraints"
          },
          "prior_result_codes": {
            "type": "array",
            "maxItems": 12,
            "uniqueItems": true,
            "items": {
              "enum": [
                "GATE_FAILURE",
                "MISSING_BASELINE",
                "MISSING_CONTROL",
                "CONTRADICTION",
                "CRITICAL_BOUNDARY",
                "LOW_SAMPLE",
                "UNPINNED_VERSION",
                "FAILURE_EVIDENCE_MISSING",
                "COST_BOUNDARY_MISSING",
                "LATENCY_BOUNDARY_MISSING",
                "HUMAN_BOUNDARY_MISSING",
                "PRELIMINARY_ONLY",
                "CONTEXT_INCOMPLETE"
              ]
            }
          },
          "comparison": {
            "$ref": "#/components/schemas/PipelineComparison"
          },
          "acceleration_fit": {
            "$ref": "#/components/schemas/AccelerationFit"
          },
          "context": {
            "$ref": "#/components/schemas/Context"
          }
        }
      },
      "MigrationScopeCode": {
        "enum": [
          "model",
          "provider",
          "runtime",
          "multi_component"
        ]
      },
      "WorkloadModeCode": {
        "enum": [
          "interactive",
          "batch",
          "agentic",
          "embedded",
          "mixed"
        ]
      },
      "MigrationMetricCheck": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "baseline",
          "candidate",
          "gate",
          "objective",
          "required"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/MetricCode"
          },
          "baseline": {
            "type": "integer",
            "minimum": -1000000000,
            "maximum": 1000000000
          },
          "candidate": {
            "type": "integer",
            "minimum": -1000000000,
            "maximum": 1000000000
          },
          "gate": {
            "type": "integer",
            "minimum": -1000000000,
            "maximum": 1000000000
          },
          "objective": {
            "enum": [
              "minimize",
              "maximize"
            ]
          },
          "required": {
            "type": "boolean"
          }
        }
      },
      "MigrationReadinessFlags": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "matched_workload",
          "versions_pinned",
          "failure_cases_tested",
          "independent_check",
          "rollback_ready",
          "shadow_observation"
        ],
        "properties": {
          "matched_workload": {
            "type": "boolean"
          },
          "versions_pinned": {
            "type": "boolean"
          },
          "failure_cases_tested": {
            "type": "boolean"
          },
          "independent_check": {
            "type": "boolean"
          },
          "rollback_ready": {
            "type": "boolean"
          },
          "shadow_observation": {
            "type": "boolean"
          }
        }
      },
      "MigrationReadinessInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "migration_scope",
          "workload_mode",
          "metric_checks",
          "readiness",
          "context"
        ],
        "properties": {
          "migration_scope": {
            "$ref": "#/components/schemas/MigrationScopeCode"
          },
          "workload_mode": {
            "$ref": "#/components/schemas/WorkloadModeCode"
          },
          "metric_checks": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "uniqueItems": true,
            "contains": {
              "type": "object",
              "properties": {
                "required": {
                  "const": true
                }
              },
              "required": [
                "required"
              ]
            },
            "items": {
              "$ref": "#/components/schemas/MigrationMetricCheck"
            }
          },
          "readiness": {
            "$ref": "#/components/schemas/MigrationReadinessFlags"
          },
          "context": {
            "$ref": "#/components/schemas/Context"
          }
        }
      },
      "McpAdmissionInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "subject",
          "evidence",
          "policy",
          "context"
        ],
        "properties": {
          "subject": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "publisher_verification",
              "release_identity",
              "deployment_profile",
              "change_state"
            ],
            "properties": {
              "publisher_verification": {
                "enum": [
                  "verified",
                  "self_asserted",
                  "unknown"
                ]
              },
              "release_identity": {
                "enum": [
                  "immutable_digest",
                  "version_only",
                  "unknown"
                ]
              },
              "deployment_profile": {
                "enum": [
                  "local",
                  "remote",
                  "hybrid"
                ]
              },
              "change_state": {
                "enum": [
                  "unchanged",
                  "changed",
                  "unknown"
                ]
              }
            }
          },
          "evidence": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "identity_supply_chain",
              "capabilities",
              "authorization",
              "data_boundary",
              "runtime_boundary",
              "operations"
            ],
            "properties": {
              "identity_supply_chain": {
                "enum": [
                  "verified",
                  "documented",
                  "missing"
                ]
              },
              "capabilities": {
                "enum": [
                  "bounded",
                  "broad",
                  "unknown"
                ]
              },
              "authorization": {
                "enum": [
                  "least_privilege",
                  "documented",
                  "broad",
                  "unknown"
                ]
              },
              "data_boundary": {
                "enum": [
                  "bounded",
                  "documented",
                  "unknown"
                ]
              },
              "runtime_boundary": {
                "enum": [
                  "bounded",
                  "documented",
                  "unknown"
                ]
              },
              "operations": {
                "enum": [
                  "documented",
                  "partial",
                  "missing"
                ]
              }
            }
          },
          "policy": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "destructive_tools",
              "remote_egress",
              "sensitive_resource_access",
              "retention",
              "version_pinned",
              "rollback_ready",
              "expiry_defined"
            ],
            "properties": {
              "destructive_tools": {
                "enum": [
                  "prohibited",
                  "human_approval",
                  "allowed",
                  "unknown"
                ]
              },
              "remote_egress": {
                "enum": [
                  "prohibited",
                  "allowlisted",
                  "declared",
                  "unknown"
                ]
              },
              "sensitive_resource_access": {
                "enum": [
                  "prohibited",
                  "bounded",
                  "unknown"
                ]
              },
              "retention": {
                "enum": [
                  "none",
                  "bounded",
                  "unknown"
                ]
              },
              "version_pinned": {
                "type": "boolean"
              },
              "rollback_ready": {
                "type": "boolean"
              },
              "expiry_defined": {
                "type": "boolean"
              }
            }
          },
          "context": {
            "$ref": "#/components/schemas/Context"
          }
        }
      },
      "AgentChangeGateInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "origin",
          "policy_source",
          "change_categories",
          "evidence",
          "reviews",
          "context"
        ],
        "properties": {
          "origin": {
            "enum": [
              "human",
              "agent",
              "mixed",
              "unknown"
            ]
          },
          "policy_source": {
            "enum": [
              "protected_base",
              "organization_service",
              "signed_policy_pack",
              "pull_request_head",
              "unknown"
            ]
          },
          "change_categories": {
            "type": "array",
            "minItems": 1,
            "maxItems": 6,
            "uniqueItems": true,
            "items": {
              "enum": [
                "application_code",
                "dependency",
                "workflow",
                "policy",
                "evidence",
                "production_configuration"
              ]
            }
          },
          "evidence": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "exact_head_tested",
              "tests_passed",
              "independent_validation",
              "platform_actor_verified",
              "disclosed_tools_verified",
              "limitations_resolved"
            ],
            "properties": {
              "exact_head_tested": {
                "type": "boolean"
              },
              "tests_passed": {
                "type": "boolean"
              },
              "independent_validation": {
                "type": "boolean"
              },
              "platform_actor_verified": {
                "type": "boolean"
              },
              "disclosed_tools_verified": {
                "type": "boolean"
              },
              "limitations_resolved": {
                "type": "boolean"
              }
            }
          },
          "reviews": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human_reviewer_count",
              "security_owner_review",
              "policy_owner_review"
            ],
            "properties": {
              "human_reviewer_count": {
                "type": "integer",
                "minimum": 0,
                "maximum": 5
              },
              "security_owner_review": {
                "type": "boolean"
              },
              "policy_owner_review": {
                "type": "boolean"
              }
            }
          },
          "context": {
            "$ref": "#/components/schemas/Context"
          }
        }
      },
      "AnalyzeRequest": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "input"
            ],
            "properties": {
              "operation": {
                "const": "decision_signal"
              },
              "input": {
                "$ref": "#/components/schemas/DecisionSignalInput"
              },
              "decision_context": {
                "$ref": "#/components/schemas/DecisionContext"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "input"
            ],
            "properties": {
              "operation": {
                "const": "pairwise_signal"
              },
              "input": {
                "$ref": "#/components/schemas/PairwiseInput"
              },
              "decision_context": {
                "$ref": "#/components/schemas/DecisionContext"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "input"
            ],
            "properties": {
              "operation": {
                "const": "claim_triage"
              },
              "input": {
                "$ref": "#/components/schemas/ClaimTriageInput"
              },
              "decision_context": {
                "$ref": "#/components/schemas/DecisionContext"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "input"
            ],
            "properties": {
              "operation": {
                "const": "boundary_stress_signal"
              },
              "input": {
                "$ref": "#/components/schemas/BoundaryStressInput"
              },
              "decision_context": {
                "$ref": "#/components/schemas/DecisionContext"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "input"
            ],
            "properties": {
              "operation": {
                "const": "evidence_sufficiency_map"
              },
              "input": {
                "$ref": "#/components/schemas/EvidenceMapInput"
              },
              "decision_context": {
                "$ref": "#/components/schemas/DecisionContext"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operation",
              "input"
            ],
            "properties": {
              "operation": {
                "const": "pipeline_improvement_map"
              },
              "input": {
                "$ref": "#/components/schemas/PipelineImprovementInput"
              },
              "decision_context": {
                "$ref": "#/components/schemas/DecisionContext"
              }
            }
          },
          {
            "type": "object",
            "description": "Available through the unified analyze endpoint and subject to the documented scope, plan, and operational controls.",
            "additionalProperties": false,
            "required": [
              "operation",
              "input"
            ],
            "properties": {
              "operation": {
                "const": "migration_readiness_map"
              },
              "input": {
                "$ref": "#/components/schemas/MigrationReadinessInput"
              },
              "decision_context": {
                "$ref": "#/components/schemas/DecisionContext"
              }
            }
          },
          {
            "type": "object",
            "description": "Available through the unified analyze endpoint and subject to the documented scope, plan, and operational controls.",
            "additionalProperties": false,
            "required": [
              "operation",
              "input"
            ],
            "properties": {
              "operation": {
                "const": "mcp_admission_map"
              },
              "input": {
                "$ref": "#/components/schemas/McpAdmissionInput"
              },
              "decision_context": {
                "$ref": "#/components/schemas/DecisionContext"
              }
            }
          },
          {
            "type": "object",
            "description": "Available through the unified analyze endpoint and subject to the documented scope, plan, and operational controls.",
            "additionalProperties": false,
            "required": [
              "operation",
              "input"
            ],
            "properties": {
              "operation": {
                "const": "agent_change_gate"
              },
              "input": {
                "$ref": "#/components/schemas/AgentChangeGateInput"
              },
              "decision_context": {
                "$ref": "#/components/schemas/DecisionContext"
              }
            }
          },
          {
            "type": "object",
            "description": "Available through the unified analyze endpoint and subject to the documented scope, plan, and operational controls.",
            "additionalProperties": false,
            "required": [
              "operation",
              "input"
            ],
            "properties": {
              "operation": {
                "const": "next_test_value_map"
              },
              "input": {
                "$ref": "#/components/schemas/NextTestValueInput"
              },
              "decision_context": {
                "$ref": "#/components/schemas/DecisionContext"
              }
            }
          },
          {
            "type": "object",
            "description": "Available through the unified analyze endpoint and subject to the documented scope, plan, and operational controls.",
            "additionalProperties": false,
            "required": [
              "operation",
              "input"
            ],
            "properties": {
              "operation": {
                "const": "autonomy_budget_gate"
              },
              "input": {
                "$ref": "#/components/schemas/AutonomyBudgetInput"
              },
              "decision_context": {
                "$ref": "#/components/schemas/DecisionContext"
              }
            }
          },
          {
            "type": "object",
            "description": "Available through the unified analyze endpoint and subject to the documented scope, plan, and operational controls.",
            "additionalProperties": false,
            "required": [
              "operation",
              "input"
            ],
            "properties": {
              "operation": {
                "const": "decision_receipt_retest_map"
              },
              "input": {
                "$ref": "#/components/schemas/DecisionReceiptRetestInput"
              },
              "decision_context": {
                "$ref": "#/components/schemas/DecisionContext"
              }
            }
          },
          {
            "type": "object",
            "description": "Available through the unified analyze endpoint and subject to the documented scope, plan, and operational controls.",
            "additionalProperties": false,
            "required": [
              "operation",
              "input"
            ],
            "properties": {
              "operation": {
                "const": "failure_coverage_map"
              },
              "input": {
                "$ref": "#/components/schemas/FailureCoverageInput"
              },
              "decision_context": {
                "$ref": "#/components/schemas/DecisionContext"
              }
            }
          }
        ],
        "discriminator": {
          "propertyName": "operation"
        }
      },
      "MaterialFlagCode": {
        "enum": [
          "GATE_FAILURE",
          "MISSING_BASELINE",
          "MISSING_CONTROL",
          "CONTRADICTION",
          "CRITICAL_BOUNDARY",
          "LOW_SAMPLE",
          "UNPINNED_VERSION",
          "FAILURE_EVIDENCE_MISSING",
          "COST_BOUNDARY_MISSING",
          "LATENCY_BOUNDARY_MISSING",
          "HUMAN_BOUNDARY_MISSING",
          "REPEATED_PROBING",
          "NO_MATERIAL_DIFFERENCE"
        ]
      },
      "BoundaryNoteCode": {
        "enum": [
          "PRELIMINARY_ONLY",
          "CALLER_SUPPLIED_EVIDENCE",
          "NO_INDEPENDENT_VERIFICATION",
          "NO_PRODUCTION_OBSERVATION",
          "NON_CONSEQUENTIAL_USE_ONLY",
          "MANUAL_SCOPE_REQUIRED",
          "SMALL_SAMPLE",
          "CONTEXT_INCOMPLETE",
          "TEST_KEY_NON_PRODUCTION"
        ]
      },
      "NextTestCode": {
        "enum": [
          "DEFINE_BASELINE",
          "PIN_VERSIONS",
          "RUN_MATCHED_CONTROL",
          "ADD_FAILURE_CASES",
          "DEFINE_COST_UNIT",
          "DEFINE_LATENCY_GATE",
          "DEFINE_HUMAN_BOUNDARY",
          "INDEPENDENT_REPRODUCTION",
          "PRODUCTION_OBSERVATION",
          "MANUAL_SCOPE_REVIEW",
          "NO_ADDITIONAL_AUTOMATED_TEST",
          "FREEZE_REFERENCE_OUTPUT",
          "RUN_THREE_SCALE_BENCHMARK",
          "ADD_INDEPENDENT_CHECK",
          "VERIFY_EXACT_PARITY",
          "VERIFY_FULL_PIPELINE_NONREGRESSION",
          "PIN_SOURCE_TARGET_VERSIONS",
          "RUN_MATCHED_WORKLOAD",
          "RUN_FAILURE_CASE_PARITY",
          "VERIFY_ROLLBACK",
          "RUN_SHADOW_EVALUATION",
          "RUN_BOUNDED_CANARY",
          "COMPLETE_MCP_EVIDENCE",
          "VERIFY_MCP_RELEASE_IDENTITY",
          "RESOLVE_PROTECTED_POLICY",
          "RUN_EXACT_HEAD_TESTS",
          "ADD_REQUIRED_REVIEW",
          "VERIFY_OFFLINE_PASSPORT",
          "EXECUTE_PRIORITY_TEST",
          "RELAX_TEST_CONSTRAINTS",
          "COMPLETE_AUTONOMY_CONTROLS",
          "RUN_BOUNDED_DRY_RUN",
          "REASSESS_DECISION_RECEIPT",
          "REFRESH_STALE_EVIDENCE",
          "EXPAND_FAILURE_COVERAGE",
          "RESOLVE_CRITICAL_FAILURES"
        ]
      },
      "ManualReasonCode": {
        "enum": [
          "LOW_CONFIDENCE",
          "CONFLICTING_SIGNALS",
          "CRITICAL_FLAG",
          "CUSTOM_GATE",
          "SENSITIVE_CONTEXT",
          "INDEPENDENT_REPRODUCTION",
          "EXTERNAL_EVIDENCE",
          "BOUNDARY_EXCEEDED",
          "CONTEXT_MISSING",
          "REPEATED_PROBING"
        ]
      },
      "MaterialFlagArray": {
        "type": "array",
        "maxItems": 16,
        "uniqueItems": true,
        "items": {
          "$ref": "#/components/schemas/MaterialFlagCode"
        }
      },
      "MandatoryBoundaryProvenanceArray": {
        "type": "array",
        "minItems": 4,
        "maxItems": 16,
        "uniqueItems": true,
        "items": {
          "$ref": "#/components/schemas/BoundaryNoteCode"
        },
        "allOf": [
          {
            "contains": {
              "const": "PRELIMINARY_ONLY"
            }
          },
          {
            "contains": {
              "const": "CALLER_SUPPLIED_EVIDENCE"
            }
          },
          {
            "contains": {
              "const": "NO_INDEPENDENT_VERIFICATION"
            }
          },
          {
            "contains": {
              "const": "NON_CONSEQUENTIAL_USE_ONLY"
            }
          }
        ],
        "description": "Top-level response provenance codes. The runtime force-injects PRELIMINARY_ONLY, CALLER_SUPPLIED_EVIDENCE, NO_INDEPENDENT_VERIFICATION, and NON_CONSEQUENTIAL_USE_ONLY into every successful response; a testing-environment response also contains TEST_KEY_NON_PRODUCTION (conditioned in ResponseCommon)."
      },
      "OperationBoundaryConditionArray": {
        "type": "array",
        "maxItems": 16,
        "uniqueItems": true,
        "items": {
          "$ref": "#/components/schemas/BoundaryNoteCode"
        },
        "description": "Operation-specific boundary conditions emitted inside a single operation result. Items are constrained to the closed BoundaryNoteCode enum; no provenance code is universally required at this level."
      },
      "NextTestArray": {
        "type": "array",
        "maxItems": 5,
        "uniqueItems": true,
        "items": {
          "$ref": "#/components/schemas/NextTestCode"
        }
      },
      "ManualReasonArray": {
        "type": "array",
        "maxItems": 10,
        "uniqueItems": true,
        "items": {
          "$ref": "#/components/schemas/ManualReasonCode"
        }
      },
      "StatusCode": {
        "enum": [
          "favorable",
          "conditional",
          "unfavorable",
          "insufficient",
          "manual_review_required"
        ]
      },
      "Confidence": {
        "enum": [
          "low",
          "moderate",
          "high"
        ]
      },
      "ManualReview": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "recommended",
          "reason_codes",
          "route",
          "scope_url"
        ],
        "properties": {
          "recommended": {
            "type": "boolean"
          },
          "reason_codes": {
            "$ref": "#/components/schemas/ManualReasonArray"
          },
          "route": {
            "enum": [
              "rapid_decision_review",
              "systems_benchmark",
              "findings_validation",
              "evaluation_harness",
              "vh_register",
              "custom_scope"
            ]
          },
          "scope_url": {
            "type": "string",
            "pattern": "^/start-scope\\?run=run_[A-Za-z0-9_-]{24}$"
          }
        }
      },
      "Usage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "evaluation_units",
          "remaining_units",
          "unit",
          "automatic_overage"
        ],
        "properties": {
          "evaluation_units": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000
          },
          "remaining_units": {
            "type": "integer",
            "minimum": 0
          },
          "unit": {
            "const": "evaluation_unit"
          },
          "automatic_overage": {
            "const": false
          }
        }
      },
      "ResponseCommon": {
        "type": "object",
        "required": [
          "api_version",
          "id",
          "status",
          "confidence_band",
          "material_flags",
          "boundary_notes",
          "next_test",
          "manual_review",
          "usage",
          "evidence_basis",
          "independent_verification",
          "production_approval",
          "consequential_use_allowed",
          "environment",
          "ruleset_version",
          "code_set_version",
          "schema_version",
          "evaluated_at",
          "request_digest",
          "result_digest",
          "measurement_context",
          "provenance"
        ],
        "properties": {
          "api_version": {
            "const": "v1"
          },
          "id": {
            "$ref": "#/components/schemas/RunReference"
          },
          "status": {
            "$ref": "#/components/schemas/StatusCode"
          },
          "confidence_band": {
            "$ref": "#/components/schemas/Confidence"
          },
          "material_flags": {
            "$ref": "#/components/schemas/MaterialFlagArray"
          },
          "boundary_notes": {
            "$ref": "#/components/schemas/MandatoryBoundaryProvenanceArray"
          },
          "next_test": {
            "$ref": "#/components/schemas/NextTestCode"
          },
          "manual_review": {
            "$ref": "#/components/schemas/ManualReview"
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          },
          "non_production": {
            "const": true
          },
          "evidence_basis": {
            "type": "string",
            "const": "caller_supplied",
            "description": "Every result is computed exclusively from caller-supplied summaries and measurements. Verahelm does not independently verify them."
          },
          "independent_verification": {
            "type": "boolean",
            "const": false,
            "description": "Always false. Verahelm performs no independent verification of caller-supplied evidence."
          },
          "production_approval": {
            "type": "boolean",
            "const": false,
            "description": "Always false. A result is never production approval, certification, or deployment authorization."
          },
          "consequential_use_allowed": {
            "type": "boolean",
            "const": false,
            "description": "Always false. Results must not be used as the sole or determinative basis for consequential decisions."
          },
          "environment": {
            "type": "string",
            "enum": [
              "testing",
              "live"
            ],
            "description": "Entitlement environment that produced the result. testing is always accompanied by non_production: true and the TEST_KEY_NON_PRODUCTION boundary code."
          },
          "ruleset_version": {
            "type": "string",
            "description": "Version of the approved evaluation ruleset that produced this result."
          },
          "code_set_version": {
            "type": "string",
            "description": "Version of the stable public code set used in this result."
          },
          "schema_version": {
            "type": "string",
            "const": "VH_PUBLIC_RESULT_V1",
            "description": "Public response envelope schema version."
          },
          "evaluated_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp at which the evaluation was finalized."
          },
          "request_digest": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "description": "Privacy-preserving HMAC digest of the canonical request input. Contains no request content."
          },
          "result_digest": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "description": "Privacy-preserving HMAC digest of the result code envelope. Contains no result content beyond public codes."
          },
          "measurement_context": {
            "$ref": "#/components/schemas/MeasurementContext"
          },
          "provenance": {
            "$ref": "#/components/schemas/Provenance"
          }
        },
        "if": {
          "properties": {
            "environment": {
              "const": "testing"
            }
          },
          "required": [
            "environment"
          ]
        },
        "then": {
          "properties": {
            "boundary_notes": {
              "contains": {
                "const": "TEST_KEY_NON_PRODUCTION"
              }
            }
          }
        }
      },
      "DecisionResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "signal_state"
        ],
        "properties": {
          "signal_state": {
            "enum": [
              "favorable",
              "conditional",
              "unfavorable",
              "insufficient"
            ]
          }
        }
      },
      "PairwiseResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "directional_result",
          "material_difference_codes",
          "failure_pattern_difference_codes",
          "unresolved_boundary_codes"
        ],
        "properties": {
          "directional_result": {
            "enum": [
              "candidate_a",
              "candidate_b",
              "no_material_difference",
              "insufficient"
            ]
          },
          "material_difference_codes": {
            "$ref": "#/components/schemas/MaterialFlagArray"
          },
          "failure_pattern_difference_codes": {
            "$ref": "#/components/schemas/MaterialFlagArray"
          },
          "unresolved_boundary_codes": {
            "$ref": "#/components/schemas/OperationBoundaryConditionArray"
          }
        }
      },
      "ClaimResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "triage_state",
          "evidence_gap_codes",
          "boundary_condition_codes",
          "recommended_next_test"
        ],
        "properties": {
          "triage_state": {
            "enum": [
              "provisionally_supported",
              "conditionally_supported",
              "insufficient_evidence",
              "internally_inconsistent",
              "requires_reproduction",
              "requires_production_evidence"
            ]
          },
          "evidence_gap_codes": {
            "$ref": "#/components/schemas/MaterialFlagArray"
          },
          "boundary_condition_codes": {
            "$ref": "#/components/schemas/OperationBoundaryConditionArray"
          },
          "recommended_next_test": {
            "$ref": "#/components/schemas/NextTestCode"
          }
        }
      },
      "BoundaryResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "stability_state",
          "sensitivity_flag_codes"
        ],
        "properties": {
          "stability_state": {
            "enum": [
              "stable",
              "sensitive",
              "unstable",
              "insufficient"
            ]
          },
          "sensitivity_flag_codes": {
            "$ref": "#/components/schemas/MaterialFlagArray"
          }
        }
      },
      "EvidenceMapResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "covered_evidence_category_codes",
          "missing_evidence_category_codes",
          "contradictory_evidence_category_codes",
          "dependency_flag_codes",
          "readiness_state",
          "recommended_manual_service"
        ],
        "properties": {
          "covered_evidence_category_codes": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/EvidenceCode"
            }
          },
          "missing_evidence_category_codes": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/EvidenceCode"
            }
          },
          "contradictory_evidence_category_codes": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/EvidenceCode"
            }
          },
          "dependency_flag_codes": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/DependencyCode"
            }
          },
          "readiness_state": {
            "enum": [
              "ready",
              "conditional",
              "not_ready",
              "insufficient"
            ]
          },
          "recommended_manual_service": {
            "enum": [
              "rapid_decision_review",
              "systems_benchmark",
              "findings_validation",
              "evaluation_harness",
              "vh_register",
              "custom_scope"
            ]
          }
        }
      },
      "Improvement": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "action_code",
          "affected_stage",
          "reason_code",
          "expected_effect_band",
          "effort_band",
          "dependency_codes",
          "validation_test_code",
          "order",
          "manual_review_trigger"
        ],
        "properties": {
          "action_code": {
            "enum": [
              "PIN_COMPONENT_VERSIONS",
              "ADD_MATCHED_BASELINE",
              "ADD_FAILURE_CASE_GATE",
              "DEFINE_LATENCY_BUDGET",
              "DEFINE_COST_UNIT",
              "ADD_HUMAN_REVIEW_GATE",
              "RUN_BOUNDARY_SCREEN",
              "ADD_INDEPENDENT_CHECK",
              "STAGE_ROLLOUT_WITH_ROLLBACK",
              "RUN_PROTECTED_ACCELERATION_TRIAL"
            ]
          },
          "affected_stage": {
            "$ref": "#/components/schemas/PipelineStageCode"
          },
          "reason_code": {
            "enum": [
              "QUALITY_VARIANCE",
              "LATENCY_OVER_BUDGET",
              "COST_OVER_BUDGET",
              "FAILURE_ESCAPE",
              "VERSION_DRIFT",
              "EVIDENCE_GAP",
              "REVIEW_BOTTLENECK",
              "BOUNDARY_INSTABILITY",
              "CHANGE_RISK",
              "ACCELERATION_FIT",
              "ACCELERATION_EVIDENCE_GAP"
            ]
          },
          "expected_effect_band": {
            "$ref": "#/components/schemas/Confidence"
          },
          "effort_band": {
            "$ref": "#/components/schemas/Confidence"
          },
          "dependency_codes": {
            "type": "array",
            "maxItems": 3,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/DependencyCode"
            }
          },
          "validation_test_code": {
            "$ref": "#/components/schemas/NextTestCode"
          },
          "order": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5
          },
          "manual_review_trigger": {
            "type": "boolean"
          }
        }
      },
      "PipelineAnalyzeResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "change_risk_codes",
          "required_release_test_codes"
        ],
        "properties": {
          "change_risk_codes": {
            "type": "array",
            "maxItems": 4,
            "uniqueItems": true,
            "items": {
              "enum": [
                "UNVALIDATED_CHANGE",
                "BROAD_CHANGE_SCOPE",
                "PRIOR_CRITICAL_SIGNAL",
                "PROTECTED_ROUTE_UNVALIDATED"
              ]
            }
          },
          "required_release_test_codes": {
            "$ref": "#/components/schemas/NextTestArray"
          }
        }
      },
      "MigrationMetricResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "metric_code",
          "gate_state",
          "baseline_comparison"
        ],
        "properties": {
          "metric_code": {
            "$ref": "#/components/schemas/MetricCode"
          },
          "gate_state": {
            "enum": [
              "pass",
              "fail"
            ]
          },
          "baseline_comparison": {
            "enum": [
              "improved",
              "unchanged",
              "regressed"
            ]
          }
        }
      },
      "MigrationReadinessResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "readiness_state",
          "metric_results",
          "evidence_gap_codes",
          "required_test_codes",
          "rollout_plan_codes",
          "rollback_required"
        ],
        "properties": {
          "readiness_state": {
            "enum": [
              "blocked",
              "evidence_gap",
              "ready_for_shadow",
              "ready_for_bounded_pilot"
            ]
          },
          "metric_results": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/MigrationMetricResult"
            }
          },
          "evidence_gap_codes": {
            "type": "array",
            "maxItems": 6,
            "uniqueItems": true,
            "items": {
              "enum": [
                "MATCHED_WORKLOAD_MISSING",
                "VERSIONS_UNPINNED",
                "FAILURE_CASES_UNTESTED",
                "INDEPENDENT_CHECK_MISSING",
                "ROLLBACK_UNVERIFIED",
                "SHADOW_OBSERVATION_MISSING"
              ]
            }
          },
          "required_test_codes": {
            "type": "array",
            "maxItems": 7,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/NextTestCode"
            }
          },
          "rollout_plan_codes": {
            "type": "array",
            "maxItems": 9,
            "uniqueItems": true,
            "items": {
              "enum": [
                "REJECT_CURRENT_CANDIDATE",
                "FREEZE_MIGRATION_BASELINE",
                "PIN_SOURCE_TARGET_VERSIONS",
                "RUN_MATCHED_WORKLOAD",
                "RUN_FAILURE_CASE_PARITY",
                "ADD_INDEPENDENT_CHECK",
                "VERIFY_ROLLBACK",
                "RUN_SHADOW_EVALUATION",
                "RUN_BOUNDED_CANARY"
              ]
            }
          },
          "rollback_required": {
            "const": true
          }
        }
      },
      "McpAdmissionResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "admission_state",
          "evidence_gap_codes",
          "restriction_codes",
          "revisit_trigger_codes",
          "passport_eligible"
        ],
        "properties": {
          "admission_state": {
            "enum": [
              "admit_observe_only",
              "admit_restricted",
              "additional_evidence_required",
              "manual_review_required",
              "do_not_admit_under_current_policy"
            ]
          },
          "evidence_gap_codes": {
            "type": "array",
            "maxItems": 12,
            "uniqueItems": true,
            "items": {
              "enum": [
                "PUBLISHER_UNVERIFIED",
                "RELEASE_IDENTITY_MISSING",
                "SUPPLY_CHAIN_EVIDENCE_MISSING",
                "CAPABILITIES_UNKNOWN",
                "AUTHORIZATION_UNKNOWN",
                "DATA_BOUNDARY_UNKNOWN",
                "RUNTIME_BOUNDARY_UNKNOWN",
                "OPERATIONS_EVIDENCE_MISSING",
                "VERSION_UNPINNED",
                "ROLLBACK_UNVERIFIED",
                "EXPIRY_UNDEFINED",
                "SUBJECT_CHANGED_REASSESSMENT_REQUIRED"
              ]
            }
          },
          "restriction_codes": {
            "type": "array",
            "maxItems": 7,
            "uniqueItems": true,
            "items": {
              "enum": [
                "OBSERVE_ONLY",
                "REQUIRE_HUMAN_APPROVAL",
                "DENY_DESTRUCTIVE_TOOLS",
                "DENY_SECRET_ACCESS",
                "ALLOWLIST_REMOTE_EGRESS",
                "DISABLE_RETENTION",
                "PIN_RELEASE"
              ]
            }
          },
          "revisit_trigger_codes": {
            "type": "array",
            "maxItems": 6,
            "uniqueItems": true,
            "items": {
              "enum": [
                "PUBLISHER_CHANGE",
                "RELEASE_CHANGE",
                "CAPABILITY_CHANGE",
                "POLICY_CHANGE",
                "EXPIRY_REACHED",
                "RUNTIME_CHANGE"
              ]
            }
          },
          "passport_eligible": {
            "type": "boolean"
          }
        }
      },
      "AgentChangeGateResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "gate_state",
          "gate_codes",
          "required_action_codes",
          "change_category_codes",
          "passport_eligible"
        ],
        "properties": {
          "gate_state": {
            "enum": [
              "observe_only",
              "additional_evidence_required",
              "human_review_required",
              "policy_violation",
              "eligible_for_trusted_signing"
            ]
          },
          "gate_codes": {
            "type": "array",
            "maxItems": 12,
            "uniqueItems": true,
            "items": {
              "enum": [
                "PROTECTED_POLICY_CONFIRMED",
                "UNTRUSTED_POLICY_SOURCE",
                "EXACT_HEAD_EVIDENCE_MISSING",
                "TEST_FAILURE",
                "INDEPENDENT_VALIDATION_MISSING",
                "AGENT_ORIGIN_UNVERIFIED",
                "TOOL_EVIDENCE_UNVERIFIED",
                "LIMITATIONS_UNRESOLVED",
                "HUMAN_REVIEW_MISSING",
                "SECURITY_REVIEW_MISSING",
                "POLICY_REVIEW_MISSING",
                "TRUSTED_SIGNING_ELIGIBLE"
              ]
            }
          },
          "required_action_codes": {
            "type": "array",
            "maxItems": 12,
            "uniqueItems": true,
            "items": {
              "enum": [
                "USE_PROTECTED_POLICY",
                "RUN_EXACT_HEAD_TESTS",
                "RESOLVE_TEST_FAILURES",
                "ADD_INDEPENDENT_VALIDATION",
                "VERIFY_AGENT_ORIGIN",
                "VERIFY_DISCLOSED_TOOLS",
                "RESOLVE_LIMITATIONS",
                "ADD_HUMAN_REVIEW",
                "ADD_SECURITY_REVIEW",
                "ADD_POLICY_REVIEW",
                "KEEP_OBSERVE_ONLY",
                "CREATE_TRUSTED_PASSPORT"
              ]
            }
          },
          "change_category_codes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 6,
            "uniqueItems": true,
            "items": {
              "enum": [
                "application_code",
                "dependency",
                "workflow",
                "policy",
                "evidence",
                "production_configuration"
              ]
            }
          },
          "passport_eligible": {
            "type": "boolean"
          }
        }
      },
      "AnalyzeResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseCommon"
          },
          {
            "type": "object",
            "required": [
              "operation",
              "result",
              "improvements"
            ],
            "properties": {
              "operation": {
                "enum": [
                  "decision_signal",
                  "pairwise_signal",
                  "claim_triage",
                  "boundary_stress_signal",
                  "evidence_sufficiency_map",
                  "pipeline_improvement_map",
                  "migration_readiness_map",
                  "mcp_admission_map",
                  "agent_change_gate",
                  "next_test_value_map",
                  "autonomy_budget_gate",
                  "decision_receipt_retest_map",
                  "failure_coverage_map"
                ]
              },
              "result": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/DecisionResult"
                  },
                  {
                    "$ref": "#/components/schemas/PairwiseResult"
                  },
                  {
                    "$ref": "#/components/schemas/ClaimResult"
                  },
                  {
                    "$ref": "#/components/schemas/BoundaryResult"
                  },
                  {
                    "$ref": "#/components/schemas/EvidenceMapResult"
                  },
                  {
                    "$ref": "#/components/schemas/PipelineAnalyzeResult"
                  },
                  {
                    "$ref": "#/components/schemas/MigrationReadinessResult"
                  },
                  {
                    "$ref": "#/components/schemas/McpAdmissionResult"
                  },
                  {
                    "$ref": "#/components/schemas/AgentChangeGateResult"
                  },
                  {
                    "$ref": "#/components/schemas/NextTestValueResult"
                  },
                  {
                    "$ref": "#/components/schemas/AutonomyBudgetResult"
                  },
                  {
                    "$ref": "#/components/schemas/DecisionReceiptRetestResult"
                  },
                  {
                    "$ref": "#/components/schemas/FailureCoverageResult"
                  }
                ]
              },
              "improvements": {
                "type": "array",
                "maxItems": 5,
                "items": {
                  "$ref": "#/components/schemas/Improvement"
                }
              },
              "decision_envelope": {
                "$ref": "#/components/schemas/DecisionEnvelope"
              }
            }
          }
        ],
        "unevaluatedProperties": false
      },
      "DecisionResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseCommon"
          },
          {
            "type": "object",
            "required": [
              "operation",
              "result"
            ],
            "properties": {
              "operation": {
                "const": "decision_signal"
              },
              "result": {
                "$ref": "#/components/schemas/DecisionResult"
              }
            }
          }
        ],
        "unevaluatedProperties": false
      },
      "PairwiseResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseCommon"
          },
          {
            "type": "object",
            "required": [
              "operation",
              "result"
            ],
            "properties": {
              "operation": {
                "const": "pairwise_signal"
              },
              "result": {
                "$ref": "#/components/schemas/PairwiseResult"
              }
            }
          }
        ],
        "unevaluatedProperties": false
      },
      "ClaimResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseCommon"
          },
          {
            "type": "object",
            "required": [
              "operation",
              "result"
            ],
            "properties": {
              "operation": {
                "const": "claim_triage"
              },
              "result": {
                "$ref": "#/components/schemas/ClaimResult"
              }
            }
          }
        ],
        "unevaluatedProperties": false
      },
      "BoundaryResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseCommon"
          },
          {
            "type": "object",
            "required": [
              "operation",
              "result"
            ],
            "properties": {
              "operation": {
                "const": "boundary_stress_signal"
              },
              "result": {
                "$ref": "#/components/schemas/BoundaryResult"
              }
            }
          }
        ],
        "unevaluatedProperties": false
      },
      "EvidenceMapResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseCommon"
          },
          {
            "type": "object",
            "required": [
              "operation",
              "result"
            ],
            "properties": {
              "operation": {
                "const": "evidence_sufficiency_map"
              },
              "result": {
                "$ref": "#/components/schemas/EvidenceMapResult"
              }
            }
          }
        ],
        "unevaluatedProperties": false
      },
      "Error": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "api_version",
          "id",
          "error"
        ],
        "properties": {
          "api_version": {
            "const": "v1"
          },
          "id": {
            "type": "string",
            "pattern": "^req_[A-Za-z0-9_-]{24}$"
          },
          "error": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "status"
            ],
            "properties": {
              "code": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{1,63}$"
              },
              "status": {
                "type": "integer",
                "enum": [
                  400,
                  401,
                  403,
                  404,
                  405,
                  409,
                  413,
                  415,
                  422,
                  429,
                  503
                ]
              }
            }
          }
        }
      },
      "Health": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "api_version",
          "id",
          "status"
        ],
        "properties": {
          "api_version": {
            "const": "v1"
          },
          "id": {
            "type": "string",
            "pattern": "^req_[A-Za-z0-9_-]{24}$"
          },
          "status": {
            "enum": [
              "operational",
              "configuration_required"
            ]
          }
        }
      },
      "TestValueCandidate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "candidate_label",
          "decision_impact",
          "uncertainty_reduction",
          "failure_detection",
          "effort",
          "time_to_result",
          "prerequisite_ready",
          "independently_checkable"
        ],
        "properties": {
          "candidate_label": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
          },
          "decision_impact": {
            "type": "string",
            "enum": [
              "low",
              "moderate",
              "high"
            ]
          },
          "uncertainty_reduction": {
            "type": "string",
            "enum": [
              "low",
              "moderate",
              "high"
            ]
          },
          "failure_detection": {
            "type": "string",
            "enum": [
              "low",
              "moderate",
              "high"
            ]
          },
          "effort": {
            "type": "string",
            "enum": [
              "low",
              "moderate",
              "high"
            ]
          },
          "time_to_result": {
            "type": "string",
            "enum": [
              "immediate",
              "short",
              "long"
            ]
          },
          "prerequisite_ready": {
            "type": "boolean"
          },
          "independently_checkable": {
            "type": "boolean"
          }
        }
      },
      "NextTestValueInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "test_candidates",
          "constraints",
          "context"
        ],
        "properties": {
          "test_candidates": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/TestValueCandidate"
            }
          },
          "constraints": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "maximum_effort",
              "maximum_time_to_result",
              "require_independent_check"
            ],
            "properties": {
              "maximum_effort": {
                "type": "string",
                "enum": [
                  "low",
                  "moderate",
                  "high"
                ]
              },
              "maximum_time_to_result": {
                "type": "string",
                "enum": [
                  "immediate",
                  "short",
                  "long"
                ]
              },
              "require_independent_check": {
                "type": "boolean"
              }
            }
          },
          "context": {
            "$ref": "#/components/schemas/Context"
          }
        }
      },
      "RankedTestCandidate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "candidate_label",
          "rank",
          "priority_band",
          "constraint_state",
          "reason_codes"
        ],
        "properties": {
          "candidate_label": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
          },
          "rank": {
            "type": "integer",
            "minimum": 1,
            "maximum": 8
          },
          "priority_band": {
            "type": "string",
            "enum": [
              "low",
              "moderate",
              "high"
            ]
          },
          "constraint_state": {
            "type": "string",
            "enum": [
              "eligible",
              "blocked"
            ]
          },
          "reason_codes": {
            "type": "array",
            "maxItems": 8,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "HIGH_DECISION_IMPACT",
                "HIGH_UNCERTAINTY_REDUCTION",
                "HIGH_FAILURE_DETECTION",
                "INDEPENDENTLY_CHECKABLE",
                "PREREQUISITE_MISSING",
                "EFFORT_CONSTRAINT_EXCEEDED",
                "TIME_CONSTRAINT_EXCEEDED",
                "INDEPENDENT_CHECK_REQUIRED"
              ]
            }
          }
        }
      },
      "NextTestValueResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "priority_state",
          "ranked_candidates",
          "recommended_candidate_label",
          "revisit_trigger_codes"
        ],
        "properties": {
          "priority_state": {
            "type": "string",
            "enum": [
              "ready",
              "conditional",
              "no_eligible_candidate"
            ]
          },
          "ranked_candidates": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/RankedTestCandidate"
            }
          },
          "recommended_candidate_label": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
          },
          "revisit_trigger_codes": {
            "type": "array",
            "maxItems": 5,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "EVIDENCE_CHANGE",
                "COST_CHANGE",
                "DEADLINE_CHANGE",
                "PREREQUISITE_CHANGE",
                "INDEPENDENT_CHECK_CHANGE"
              ]
            }
          }
        }
      },
      "AutonomyControls": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "preview_available",
          "rollback_ready",
          "independent_check",
          "rate_limited",
          "human_approval_available",
          "audit_receipt_enabled"
        ],
        "properties": {
          "preview_available": {
            "type": "boolean"
          },
          "rollback_ready": {
            "type": "boolean"
          },
          "independent_check": {
            "type": "boolean"
          },
          "rate_limited": {
            "type": "boolean"
          },
          "human_approval_available": {
            "type": "boolean"
          },
          "audit_receipt_enabled": {
            "type": "boolean"
          }
        }
      },
      "AutonomyBudgetInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "action_class",
          "blast_radius",
          "data_scope",
          "reversibility",
          "authorization",
          "controls",
          "context"
        ],
        "properties": {
          "action_class": {
            "type": "string",
            "enum": [
              "read_only",
              "reversible_write",
              "irreversible_write",
              "external_communication",
              "financial_commitment",
              "access_control_change",
              "production_change"
            ]
          },
          "blast_radius": {
            "type": "string",
            "enum": [
              "single_record",
              "bounded_batch",
              "system_wide",
              "external"
            ]
          },
          "data_scope": {
            "type": "string",
            "enum": [
              "public_metadata",
              "internal_metadata",
              "sensitive_material"
            ]
          },
          "reversibility": {
            "type": "string",
            "enum": [
              "automatic",
              "manual",
              "none"
            ]
          },
          "authorization": {
            "type": "string",
            "enum": [
              "explicit",
              "scoped",
              "implicit",
              "unknown"
            ]
          },
          "controls": {
            "$ref": "#/components/schemas/AutonomyControls"
          },
          "context": {
            "$ref": "#/components/schemas/Context"
          }
        }
      },
      "AutonomyBudgetResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "autonomy_state",
          "budget_band",
          "control_gap_codes",
          "required_action_codes",
          "revisit_trigger_codes",
          "automation_candidate"
        ],
        "properties": {
          "autonomy_state": {
            "type": "string",
            "enum": [
              "bounded_autonomy_candidate",
              "supervision_required",
              "human_approval_required",
              "do_not_automate"
            ]
          },
          "budget_band": {
            "type": "string",
            "enum": [
              "observe_only",
              "read_only",
              "single_action",
              "bounded_batch"
            ]
          },
          "control_gap_codes": {
            "type": "array",
            "maxItems": 11,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "AUTHORIZATION_UNVERIFIED",
                "PREVIEW_MISSING",
                "ROLLBACK_MISSING",
                "INDEPENDENT_CHECK_MISSING",
                "RATE_LIMIT_MISSING",
                "HUMAN_APPROVAL_UNAVAILABLE",
                "AUDIT_RECEIPT_MISSING",
                "IRREVERSIBLE_ACTION",
                "BROAD_BLAST_RADIUS",
                "SENSITIVE_SCOPE",
                "EXTERNAL_EFFECT"
              ]
            }
          },
          "required_action_codes": {
            "type": "array",
            "maxItems": 11,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "OBTAIN_EXPLICIT_AUTHORIZATION",
                "ADD_PREVIEW",
                "VERIFY_ROLLBACK",
                "ADD_INDEPENDENT_CHECK",
                "ADD_RATE_LIMIT",
                "ADD_HUMAN_APPROVAL",
                "ENABLE_AUDIT_RECEIPT",
                "REDUCE_BLAST_RADIUS",
                "REMOVE_SENSITIVE_SCOPE",
                "KEEP_OBSERVE_ONLY",
                "RUN_BOUNDED_DRY_RUN"
              ]
            }
          },
          "revisit_trigger_codes": {
            "type": "array",
            "maxItems": 5,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "ACTION_CLASS_CHANGE",
                "AUTHORIZATION_CHANGE",
                "BLAST_RADIUS_CHANGE",
                "DATA_SCOPE_CHANGE",
                "CONTROL_CHANGE"
              ]
            }
          },
          "automation_candidate": {
            "type": "boolean"
          }
        }
      },
      "ReceiptEvidenceControls": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "baseline_frozen",
          "versions_pinned",
          "acceptance_gate_current",
          "failure_cases_current",
          "independent_check_current",
          "production_observation_current",
          "rollback_ready"
        ],
        "properties": {
          "baseline_frozen": {
            "type": "boolean"
          },
          "versions_pinned": {
            "type": "boolean"
          },
          "acceptance_gate_current": {
            "type": "boolean"
          },
          "failure_cases_current": {
            "type": "boolean"
          },
          "independent_check_current": {
            "type": "boolean"
          },
          "production_observation_current": {
            "type": "boolean"
          },
          "rollback_ready": {
            "type": "boolean"
          }
        }
      },
      "ReceiptChangeCode": {
        "type": "string",
        "enum": [
          "data_version",
          "model_version",
          "provider_version",
          "runtime_environment",
          "workload",
          "acceptance_gate",
          "policy"
        ]
      },
      "DecisionReceiptRetestInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "record_state",
          "evidence_age",
          "prior_outcome",
          "change_signals",
          "evidence_controls",
          "context"
        ],
        "properties": {
          "record_state": {
            "type": "string",
            "enum": [
              "current",
              "provisional",
              "expired"
            ]
          },
          "evidence_age": {
            "type": "string",
            "enum": [
              "fresh",
              "aging",
              "stale",
              "unknown"
            ]
          },
          "prior_outcome": {
            "type": "string",
            "enum": [
              "favorable",
              "conditional",
              "unfavorable",
              "insufficient"
            ]
          },
          "change_signals": {
            "type": "array",
            "maxItems": 7,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/ReceiptChangeCode"
            }
          },
          "evidence_controls": {
            "$ref": "#/components/schemas/ReceiptEvidenceControls"
          },
          "context": {
            "$ref": "#/components/schemas/Context"
          }
        }
      },
      "DecisionReceiptRetestResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "receipt_state",
          "invalidating_change_codes",
          "evidence_gap_codes",
          "required_test_codes",
          "revisit_trigger_codes",
          "reuse_allowed"
        ],
        "properties": {
          "receipt_state": {
            "type": "string",
            "enum": [
              "valid",
              "valid_with_monitoring",
              "retest_required",
              "expired"
            ]
          },
          "invalidating_change_codes": {
            "type": "array",
            "maxItems": 7,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/ReceiptChangeCode"
            }
          },
          "evidence_gap_codes": {
            "type": "array",
            "maxItems": 8,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "BASELINE_NOT_FROZEN",
                "VERSIONS_UNPINNED",
                "ACCEPTANCE_GATE_STALE",
                "FAILURE_CASES_STALE",
                "INDEPENDENT_CHECK_STALE",
                "PRODUCTION_OBSERVATION_STALE",
                "ROLLBACK_UNVERIFIED",
                "EVIDENCE_AGE_UNKNOWN"
              ]
            }
          },
          "required_test_codes": {
            "type": "array",
            "maxItems": 8,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/NextTestCode"
            }
          },
          "revisit_trigger_codes": {
            "type": "array",
            "maxItems": 9,
            "uniqueItems": true,
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ReceiptChangeCode"
                },
                {
                  "type": "string",
                  "enum": [
                    "EVIDENCE_AGE_LIMIT_REACHED",
                    "FAILURE_PATTERN_CHANGE"
                  ]
                }
              ]
            }
          },
          "reuse_allowed": {
            "type": "boolean"
          }
        }
      },
      "FailureClassCode": {
        "type": "string",
        "enum": [
          "correctness",
          "reliability",
          "security",
          "privacy",
          "cost",
          "latency",
          "governance",
          "unknown"
        ]
      },
      "FailureClassInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "class_code",
          "known_cases",
          "tested_cases",
          "unresolved_cases",
          "severity"
        ],
        "properties": {
          "class_code": {
            "$ref": "#/components/schemas/FailureClassCode"
          },
          "known_cases": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          },
          "tested_cases": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          },
          "unresolved_cases": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "moderate",
              "high",
              "critical"
            ]
          }
        }
      },
      "FailureCoverageControls": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "baseline_frozen",
          "boundary_cases_included",
          "independent_check",
          "production_observation"
        ],
        "properties": {
          "baseline_frozen": {
            "type": "boolean"
          },
          "boundary_cases_included": {
            "type": "boolean"
          },
          "independent_check": {
            "type": "boolean"
          },
          "production_observation": {
            "type": "boolean"
          }
        }
      },
      "FailureCoverageInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "failure_classes",
          "controls",
          "context"
        ],
        "properties": {
          "failure_classes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/FailureClassInput"
            }
          },
          "controls": {
            "$ref": "#/components/schemas/FailureCoverageControls"
          },
          "context": {
            "$ref": "#/components/schemas/Context"
          }
        }
      },
      "FailureClassResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "class_code",
          "coverage_band",
          "risk_state",
          "required_action_code"
        ],
        "properties": {
          "class_code": {
            "$ref": "#/components/schemas/FailureClassCode"
          },
          "coverage_band": {
            "type": "string",
            "enum": [
              "none",
              "partial",
              "substantial",
              "complete"
            ]
          },
          "risk_state": {
            "type": "string",
            "enum": [
              "controlled",
              "monitor",
              "gap",
              "critical_gap"
            ]
          },
          "required_action_code": {
            "type": "string",
            "enum": [
              "NO_ACTION_REQUIRED",
              "RUN_FAILURE_CLASS_TESTS",
              "RESOLVE_CRITICAL_FAILURES",
              "ADD_FAILURE_CLASS_INVENTORY"
            ]
          }
        }
      },
      "FailureCoverageResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "coverage_state",
          "class_results",
          "failure_gap_codes",
          "required_test_codes",
          "revisit_trigger_codes",
          "coverage_ready"
        ],
        "properties": {
          "coverage_state": {
            "type": "string",
            "enum": [
              "ready",
              "conditional",
              "gap",
              "blocked"
            ]
          },
          "class_results": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/FailureClassResult"
            }
          },
          "failure_gap_codes": {
            "type": "array",
            "maxItems": 8,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "FAILURE_INVENTORY_EMPTY",
                "UNTESTED_FAILURE_CASES",
                "UNRESOLVED_FAILURE_CASES",
                "CRITICAL_FAILURE_UNRESOLVED",
                "BASELINE_NOT_FROZEN",
                "BOUNDARY_CASES_MISSING",
                "INDEPENDENT_CHECK_MISSING",
                "PRODUCTION_OBSERVATION_MISSING"
              ]
            }
          },
          "required_test_codes": {
            "type": "array",
            "maxItems": 8,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/NextTestCode"
            }
          },
          "revisit_trigger_codes": {
            "type": "array",
            "maxItems": 5,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "FAILURE_CLASS_CHANGE",
                "FAILURE_COUNT_CHANGE",
                "SEVERITY_CHANGE",
                "CONTROL_CHANGE",
                "PRODUCTION_SIGNAL_CHANGE"
              ]
            }
          },
          "coverage_ready": {
            "type": "boolean"
          }
        }
      },
      "DecisionSubject": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "id",
          "version"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "model",
              "agent",
              "mcp_server",
              "workflow",
              "runtime",
              "configuration"
            ]
          },
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,79}$"
          },
          "version": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          }
        }
      },
      "DecisionScope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "environment",
          "change"
        ],
        "properties": {
          "environment": {
            "type": "string",
            "enum": [
              "development",
              "staging",
              "production_observation"
            ]
          },
          "change": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,79}$"
          }
        }
      },
      "DecisionEvidenceRef": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "digest"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,79}$"
          },
          "digest": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          }
        }
      },
      "DecisionContext": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "subject",
          "scope",
          "evidence_refs",
          "conditions",
          "expires_in_seconds",
          "authority_confirmed"
        ],
        "properties": {
          "subject": {
            "$ref": "#/components/schemas/DecisionSubject"
          },
          "scope": {
            "$ref": "#/components/schemas/DecisionScope"
          },
          "evidence_refs": {
            "type": "array",
            "minItems": 1,
            "maxItems": 16,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/DecisionEvidenceRef"
            }
          },
          "conditions": {
            "type": "array",
            "maxItems": 8,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "RETEST_BEFORE_SCOPE_CHANGE",
                "HUMAN_REVIEW_REQUIRED",
                "REVOKE_ON_VERSION_CHANGE",
                "NO_CONSEQUENTIAL_USE",
                "NO_PRODUCTION_AUTHORIZATION"
              ]
            }
          },
          "expires_in_seconds": {
            "type": "integer",
            "minimum": 300,
            "maximum": 604800
          },
          "authority_confirmed": {
            "const": true
          },
          "supersedes": {
            "type": "string",
            "pattern": "^de_[a-f0-9]{32}$"
          }
        }
      },
      "MeasurementContext": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "billable_input_bytes",
          "latency_ms",
          "deterministic",
          "model_calls"
        ],
        "properties": {
          "billable_input_bytes": {
            "type": "integer",
            "minimum": 2,
            "maximum": 65536
          },
          "latency_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 300000
          },
          "deterministic": {
            "const": true
          },
          "model_calls": {
            "const": 0
          }
        }
      },
      "Provenance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "evidence_basis",
          "independently_verified",
          "tool",
          "tool_version",
          "contract_version"
        ],
        "properties": {
          "evidence_basis": {
            "const": "caller_supplied"
          },
          "independently_verified": {
            "const": false
          },
          "tool": {
            "const": "verahelm-api"
          },
          "tool_version": {
            "type": "string"
          },
          "contract_version": {
            "const": "v1"
          }
        }
      },
      "DecisionEnvelopePayload": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schema_version",
          "envelope_id",
          "subject",
          "authority",
          "scope",
          "evidence_refs",
          "decision",
          "lifecycle",
          "issuer"
        ],
        "properties": {
          "schema_version": {
            "const": "1.0.0"
          },
          "envelope_id": {
            "type": "string",
            "pattern": "^de_[a-f0-9]{32}$"
          },
          "subject": {
            "$ref": "#/components/schemas/DecisionSubject"
          },
          "authority": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "id"
            ],
            "properties": {
              "type": {
                "const": "customer"
              },
              "id": {
                "type": "string",
                "pattern": "^auth_[A-Za-z0-9_-]{43}$"
              }
            }
          },
          "scope": {
            "$ref": "#/components/schemas/DecisionScope"
          },
          "evidence_refs": {
            "type": "array",
            "minItems": 3,
            "maxItems": 18,
            "items": {
              "$ref": "#/components/schemas/DecisionEvidenceRef"
            }
          },
          "decision": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status",
              "conditions"
            ],
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "pass",
                  "blocked"
                ]
              },
              "conditions": {
                "type": "array",
                "minItems": 2,
                "maxItems": 10,
                "uniqueItems": true,
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "lifecycle": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "issued_at",
              "expires_at"
            ],
            "properties": {
              "issued_at": {
                "type": "string",
                "format": "date-time"
              },
              "expires_at": {
                "type": "string",
                "format": "date-time"
              },
              "supersedes": {
                "type": "string",
                "pattern": "^de_[a-f0-9]{32}$"
              }
            }
          },
          "issuer": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "key_id"
            ],
            "properties": {
              "id": {
                "const": "verahelm-api"
              },
              "key_id": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9._-]{2,63}$"
              }
            }
          }
        }
      },
      "Ed25519Signature": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "algorithm",
          "key_id",
          "value"
        ],
        "properties": {
          "algorithm": {
            "const": "Ed25519"
          },
          "key_id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9._-]{2,63}$"
          },
          "value": {
            "type": "string",
            "pattern": "^[A-Za-z0-9+/]{86}==$"
          }
        }
      },
      "DecisionEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "payload",
          "signature",
          "status_url"
        ],
        "properties": {
          "payload": {
            "$ref": "#/components/schemas/DecisionEnvelopePayload"
          },
          "signature": {
            "$ref": "#/components/schemas/Ed25519Signature"
          },
          "status_url": {
            "type": "string",
            "pattern": "^/v1/decision-envelopes/de_[a-f0-9]{32}/status$"
          }
        }
      },
      "DecisionStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "payload",
          "signature"
        ],
        "properties": {
          "payload": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "schema_version",
              "envelope_id",
              "state",
              "observed_at",
              "issued_at",
              "expires_at"
            ],
            "properties": {
              "schema_version": {
                "const": "1.0.0"
              },
              "envelope_id": {
                "type": "string",
                "pattern": "^de_[a-f0-9]{32}$"
              },
              "state": {
                "type": "string",
                "enum": [
                  "active",
                  "expired",
                  "revoked",
                  "superseded"
                ]
              },
              "observed_at": {
                "type": "string",
                "format": "date-time"
              },
              "issued_at": {
                "type": "string",
                "format": "date-time"
              },
              "expires_at": {
                "type": "string",
                "format": "date-time"
              },
              "revoked_at": {
                "type": "string",
                "format": "date-time"
              },
              "superseded_by": {
                "type": "string",
                "pattern": "^de_[a-f0-9]{32}$"
              }
            }
          },
          "signature": {
            "$ref": "#/components/schemas/Ed25519Signature"
          }
        }
      },
      "Ed25519PublicJwk": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kty",
          "crv",
          "x",
          "use",
          "alg",
          "kid"
        ],
        "properties": {
          "kty": {
            "const": "OKP"
          },
          "crv": {
            "const": "Ed25519"
          },
          "x": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "use": {
            "const": "sig"
          },
          "alg": {
            "const": "EdDSA"
          },
          "kid": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9._-]{2,63}$"
          }
        }
      }
    }
  }
}
