{
  "components": {
    "schemas": {
      "AcceptTermsRequest": {
        "additionalProperties": false,
        "properties": {
          "acceptedTerms": {
            "title": "Acceptedterms",
            "type": "boolean"
          },
          "document_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[0-9a-f]{64}$",
            "title": "Document Sha256",
            "type": "string"
          },
          "document_version": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Document Version",
            "type": "string"
          }
        },
        "required": [
          "acceptedTerms",
          "document_version",
          "document_sha256"
        ],
        "title": "AcceptTermsRequest",
        "type": "object"
      },
      "AcceptedQuoteHandoff": {
        "properties": {
          "accepted_by": {
            "format": "uuid",
            "title": "Accepted By",
            "type": "string"
          },
          "accepted_workers": {
            "title": "Accepted Workers",
            "type": "integer"
          },
          "as_of": {
            "format": "date",
            "title": "As Of",
            "type": "string"
          },
          "census_accepted_on": {
            "format": "date",
            "title": "Census Accepted On",
            "type": "string"
          },
          "census_accepted_version": {
            "default": 1,
            "title": "Census Accepted Version",
            "type": "integer"
          },
          "census_reference": {
            "title": "Census Reference",
            "type": "string"
          },
          "census_reviewer": {
            "format": "uuid",
            "title": "Census Reviewer",
            "type": "string"
          },
          "census_source_version": {
            "default": 1,
            "title": "Census Source Version",
            "type": "integer"
          },
          "census_valid_through": {
            "format": "date",
            "title": "Census Valid Through",
            "type": "string"
          },
          "checks": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Checks",
            "type": "object"
          },
          "last_result": {
            "default": "",
            "title": "Last Result",
            "type": "string"
          },
          "packet": {
            "$ref": "#/components/schemas/QuoteEvidencePacket"
          },
          "policy_reference": {
            "title": "Policy Reference",
            "type": "string"
          },
          "quote_revision": {
            "const": 2,
            "default": 2,
            "title": "Quote Revision",
            "type": "integer"
          },
          "report_digest": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Report Digest"
          },
          "report_reviewer": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Report Reviewer"
          },
          "requirement_version": {
            "const": "onboarding-1",
            "default": "onboarding-1",
            "title": "Requirement Version",
            "type": "string"
          },
          "scenario": {
            "enum": [
              "april",
              "july"
            ],
            "title": "Scenario",
            "type": "string"
          },
          "started": {
            "default": false,
            "title": "Started",
            "type": "boolean"
          }
        },
        "required": [
          "scenario",
          "as_of",
          "census_reference",
          "policy_reference",
          "packet",
          "accepted_workers",
          "census_accepted_on",
          "census_valid_through",
          "census_reviewer",
          "accepted_by"
        ],
        "title": "AcceptedQuoteHandoff",
        "type": "object"
      },
      "AccountAdoptionResponse": {
        "description": "Account-level adoption block (admin callers only).",
        "properties": {
          "active_packs": {
            "title": "Active Packs",
            "type": "integer"
          },
          "first_run_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Run At"
          },
          "last_run_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Run At"
          },
          "per_pack": {
            "items": {
              "$ref": "#/components/schemas/PackAdoptionRowResponse"
            },
            "title": "Per Pack",
            "type": "array"
          },
          "seats_total": {
            "title": "Seats Total",
            "type": "integer"
          },
          "total_runs_all_time": {
            "title": "Total Runs All Time",
            "type": "integer"
          }
        },
        "required": [
          "seats_total",
          "active_packs",
          "total_runs_all_time"
        ],
        "title": "AccountAdoptionResponse",
        "type": "object"
      },
      "AcquisitionRequirementRead": {
        "description": "Acquisition status recorded when the run's evidence was assembled.",
        "properties": {
          "requirement_id": {
            "maxLength": 128,
            "title": "Requirement Id",
            "type": "string"
          },
          "satisfied_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InputSourceRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "enum": [
              "pending",
              "acquiring",
              "acquired",
              "failed"
            ],
            "title": "Status",
            "type": "string"
          },
          "status_changed_at": {
            "format": "date-time",
            "title": "Status Changed At",
            "type": "string"
          }
        },
        "required": [
          "requirement_id",
          "status",
          "status_changed_at"
        ],
        "title": "AcquisitionRequirementRead",
        "type": "object"
      },
      "ActivateReplayRequest": {
        "description": "Preview what turning these proposals on would have done to recent runs.",
        "properties": {
          "candidate_ids": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 50,
            "minItems": 1,
            "title": "Candidate Ids",
            "type": "array"
          },
          "limit": {
            "default": 50,
            "description": "How many recent runs to preview against.",
            "maximum": 200.0,
            "minimum": 1.0,
            "title": "Limit",
            "type": "integer"
          },
          "pack_slug": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pack Slug"
          }
        },
        "required": [
          "candidate_ids"
        ],
        "title": "ActivateReplayRequest",
        "type": "object"
      },
      "ActivateRequest": {
        "description": "Turn approved rule proposals on for your workspace (or one pack).",
        "properties": {
          "candidate_ids": {
            "description": "The approved proposals to turn on (at least one).",
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 50,
            "minItems": 1,
            "title": "Candidate Ids",
            "type": "array"
          },
          "pack_slug": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The agent pack the rules should apply to, or null to apply them to every pack your workspace runs.",
            "title": "Pack Slug"
          }
        },
        "required": [
          "candidate_ids"
        ],
        "title": "ActivateRequest",
        "type": "object"
      },
      "ActivateResponse": {
        "description": "The result of turning approved proposals on.",
        "properties": {
          "activated_candidate_ids": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "title": "Activated Candidate Ids",
            "type": "array"
          },
          "pack_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pack Slug"
          },
          "revision_id": {
            "description": "The new policy version your workspace's rules now run under.",
            "format": "uuid",
            "title": "Revision Id",
            "type": "string"
          },
          "rule_count": {
            "description": "How many rules the scope carries under the new version.",
            "title": "Rule Count",
            "type": "integer"
          },
          "superseded_candidate_ids": {
            "description": "Previously turned-on proposals from older readings of the same documents, now marked as superseded (record-keeping only).",
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "title": "Superseded Candidate Ids",
            "type": "array"
          }
        },
        "required": [
          "revision_id",
          "pack_slug",
          "activated_candidate_ids",
          "superseded_candidate_ids",
          "rule_count"
        ],
        "title": "ActivateResponse",
        "type": "object"
      },
      "ActivationFunnelResponse": {
        "description": "Onboarding/activation-funnel response (see ``core/kpi/activation``).",
        "properties": {
          "activated": {
            "description": "Distinct tenants ACTIVATED in-window — first successful governed run (run.completed); the activation milestone.",
            "title": "Activated",
            "type": "integer"
          },
          "activation_rate_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "activated / signed_up * 100 — the headline onboarding number. null when there were no in-window signups (undefined ratio).",
            "title": "Activation Rate Pct"
          },
          "as_of": {
            "description": "UTC ISO-8601 timestamp the funnel was computed at.",
            "title": "As Of",
            "type": "string"
          },
          "first_run_started": {
            "description": "Distinct tenants that started >= 1 governed run in-window (run.started).",
            "title": "First Run Started",
            "type": "integer"
          },
          "signed_up": {
            "description": "Distinct tenants that signed up in-window (tenant.created).",
            "title": "Signed Up",
            "type": "integer"
          },
          "subscribed": {
            "description": "Distinct tenants with a recorded subscription creation in-window (billing.subscription_created).",
            "title": "Subscribed",
            "type": "integer"
          },
          "window_end": {
            "description": "Exclusive upper bound (UTC ISO-8601) on occurred_at used for the funnel.",
            "title": "Window End",
            "type": "string"
          },
          "window_start": {
            "description": "Inclusive lower bound (UTC ISO-8601) on occurred_at used for the funnel.",
            "title": "Window Start",
            "type": "string"
          }
        },
        "required": [
          "window_start",
          "window_end",
          "as_of",
          "signed_up",
          "first_run_started",
          "activated",
          "subscribed"
        ],
        "title": "ActivationFunnelResponse",
        "type": "object"
      },
      "AdmissionRefusal": {
        "description": "A request refused by a workspace capacity limit or by the request-burst limiter.\n\n``limited_by`` names the limit: ``tenant_capacity`` (no slot for new\nsynchronous work), ``tenant_queue_full`` (the workspace's waiting queue is\nfull), ``admission_burst`` / ``admission_daily`` (new work per minute / per\nUTC day), ``request_burst`` (requests per minute on this server) or\n``admission_unavailable`` (the platform could not decide; 503). Honour\n``Retry-After``; on repeated refusals back off exponentially with full\njitter, capped at 60 seconds, and resend with the same ``Idempotency-Key``.",
        "properties": {
          "error": {
            "description": "``admission_refused`` or ``admission_unavailable``.",
            "title": "Error",
            "type": "string"
          },
          "limited_by": {
            "title": "Limited By",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "retry_after_seconds": {
            "minimum": 1.0,
            "title": "Retry After Seconds",
            "type": "integer"
          }
        },
        "required": [
          "error",
          "message",
          "limited_by",
          "retry_after_seconds"
        ],
        "title": "AdmissionRefusal",
        "type": "object"
      },
      "AgentGovernanceScorecardResponse": {
        "description": "The per-agent governance scorecard — facts only, no grade.",
        "properties": {
          "agentKind": {
            "description": "'custom_abp' or 'pack'.",
            "title": "Agentkind",
            "type": "string"
          },
          "agentRef": {
            "$ref": "#/components/schemas/AgentRefRead"
          },
          "assuranceTier": {
            "$ref": "#/components/schemas/AssuranceTierRead"
          },
          "constraints": {
            "items": {
              "$ref": "#/components/schemas/ConstraintRead"
            },
            "title": "Constraints",
            "type": "array"
          },
          "evidence": {
            "$ref": "#/components/schemas/EvidenceRead"
          },
          "floor": {
            "$ref": "#/components/schemas/FloorRead"
          },
          "frameworkTemplates": {
            "items": {
              "$ref": "#/components/schemas/FrameworkTemplateRead"
            },
            "title": "Frameworktemplates",
            "type": "array"
          },
          "guardrail": {
            "$ref": "#/components/schemas/GuardrailRead"
          },
          "outcomeContract": {
            "$ref": "#/components/schemas/OutcomeContractRead"
          },
          "tenantOverlay": {
            "$ref": "#/components/schemas/TenantOverlayRead"
          }
        },
        "required": [
          "agentKind",
          "agentRef",
          "floor",
          "constraints",
          "guardrail",
          "frameworkTemplates",
          "tenantOverlay",
          "evidence",
          "outcomeContract",
          "assuranceTier"
        ],
        "title": "AgentGovernanceScorecardResponse",
        "type": "object"
      },
      "AgentGuidanceRead": {
        "description": "One agent's intake guidance — how to brief it and what to ask it.\n\nMirrors an entry of the pack's ``ui_manifest.json::agents[]``: the\nguidance strings the run surface renders beside the intake form, served\nverbatim from the pack's declaration.",
        "properties": {
          "context_hint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "What to provide this agent with — the materials, facts, and framing a complete brief carries (``contextHint``).",
            "title": "Context Hint"
          },
          "example_prompts": {
            "description": "Example asks the agent handles well (``examplePrompts``).",
            "items": {
              "type": "string"
            },
            "title": "Example Prompts",
            "type": "array"
          },
          "name": {
            "description": "Customer-facing agent name.",
            "title": "Name",
            "type": "string"
          },
          "question_hint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The kind of question this agent answers (``questionHint``).",
            "title": "Question Hint"
          },
          "seed_context": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Fill-in-the-blank context template from ``aiHelperSeed.context`` — placeholders in braces are for the operator to replace.",
            "title": "Seed Context"
          },
          "seed_question": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The paired ask from ``aiHelperSeed.question``.",
            "title": "Seed Question"
          },
          "slug": {
            "description": "Stable agent slug, unique within the pack.",
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "name"
        ],
        "title": "AgentGuidanceRead",
        "type": "object"
      },
      "AgentRefRead": {
        "description": "Which agent the card describes. Exactly one of abpId / packSlug is set.",
        "properties": {
          "abpId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The custom ABP's id; null for a pack.",
            "title": "Abpid"
          },
          "name": {
            "description": "The agent's display name.",
            "title": "Name",
            "type": "string"
          },
          "packSlug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The catalog pack's slug; null for a custom ABP.",
            "title": "Packslug"
          },
          "status": {
            "description": "Lifecycle status: the ABP status (draft|review|approved|deployed|archived) for a custom ABP, the catalog maturity tier for a pack.",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "name",
          "status"
        ],
        "title": "AgentRefRead",
        "type": "object"
      },
      "AlertIntakeBody": {
        "description": "Payload posted by the SNS subscription (or an app-error reporter).\n\n``kind`` discriminates the two supported payload shapes:\n\n- ``\"cloudwatch_alarm\"`` — ``payload`` is EITHER a full SNS envelope\n  (``{\"Type\":\"Notification\",\"Message\":\"<json>\"}``) OR the already-unwrapped\n  CloudWatch-alarm message dict. ``parse_cloudwatch_alarm`` handles both.\n- ``\"app_error\"`` — ``payload`` is a structured app-error report\n  (``error_class`` required; optional ``message`` / ``service`` /\n  ``severity`` / ``details``).\n\n``payload`` is an open dict (the upstream shapes are AWS-defined / app-defined\nand evolve independently) — the parser extracts only the fields it needs and\nrejects a structurally-invalid payload with a 422.",
        "properties": {
          "kind": {
            "enum": [
              "cloudwatch_alarm",
              "app_error"
            ],
            "title": "Kind",
            "type": "string"
          },
          "payload": {
            "additionalProperties": true,
            "title": "Payload",
            "type": "object",
            "x-max-serialized-bytes": 8192
          }
        },
        "required": [
          "kind"
        ],
        "title": "AlertIntakeBody",
        "type": "object"
      },
      "AlertIntakeResponse": {
        "description": "Result of an intake call (logged in CloudWatch; never user-facing).",
        "properties": {
          "created": {
            "title": "Created",
            "type": "boolean"
          },
          "escalated": {
            "title": "Escalated",
            "type": "boolean"
          },
          "fingerprint": {
            "title": "Fingerprint",
            "type": "string"
          },
          "incident_id": {
            "title": "Incident Id",
            "type": "string"
          },
          "occurrence_count": {
            "title": "Occurrence Count",
            "type": "integer"
          },
          "priority": {
            "title": "Priority",
            "type": "string"
          },
          "severity": {
            "title": "Severity",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "incident_id",
          "fingerprint",
          "severity",
          "priority",
          "status",
          "occurrence_count",
          "created",
          "escalated"
        ],
        "title": "AlertIntakeResponse",
        "type": "object"
      },
      "ApiClientCreateRequest": {
        "additionalProperties": false,
        "description": "Body for ``POST /api/v2/api-clients``.",
        "properties": {
          "name": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "scopes": {
            "items": {
              "maxLength": 64,
              "type": "string"
            },
            "maxItems": 8,
            "title": "Scopes",
            "type": "array"
          }
        },
        "required": [
          "name"
        ],
        "title": "ApiClientCreateRequest",
        "type": "object"
      },
      "ApiClientList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ApiClientRead"
            },
            "title": "Items",
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "title": "ApiClientList",
        "type": "object"
      },
      "ApiClientRead": {
        "description": "One client in the list response. NEVER carries secret material.",
        "properties": {
          "client_id": {
            "title": "Client Id",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "title": "Scopes",
            "type": "array"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "client_id",
          "scopes",
          "status",
          "created_at",
          "last_used_at"
        ],
        "title": "ApiClientRead",
        "type": "object"
      },
      "ApiClientRegistered": {
        "description": "Register response — the ONLY place the client_secret ever appears.",
        "properties": {
          "client_id": {
            "title": "Client Id",
            "type": "string"
          },
          "client_secret": {
            "description": "The client_secret (vacs_...). Shown exactly once — store it now; it is NOT retrievable later (only its SHA-256 hash is stored). Exchange client_id + client_secret at POST /api/v2/oauth/token for a short-lived M2M bearer token.",
            "title": "Client Secret",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "title": "Scopes",
            "type": "array"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "client_id",
          "scopes",
          "status",
          "created_at",
          "last_used_at",
          "client_secret"
        ],
        "title": "ApiClientRegistered",
        "type": "object"
      },
      "ApiClientRevoked": {
        "properties": {
          "already_revoked": {
            "default": false,
            "title": "Already Revoked",
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "revoked": {
            "title": "Revoked",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "revoked"
        ],
        "title": "ApiClientRevoked",
        "type": "object"
      },
      "ApiKeyCreateRequest": {
        "additionalProperties": false,
        "description": "Body for ``POST /api/v2/api-keys``.",
        "properties": {
          "expiresInDays": {
            "anyOf": [
              {
                "maximum": 365.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expiresindays"
          },
          "name": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "rateLimitTier": {
            "default": "standard",
            "maxLength": 64,
            "title": "Ratelimittier",
            "type": "string"
          },
          "scopes": {
            "items": {
              "maxLength": 64,
              "type": "string"
            },
            "maxItems": 8,
            "title": "Scopes",
            "type": "array"
          }
        },
        "required": [
          "name"
        ],
        "title": "ApiKeyCreateRequest",
        "type": "object"
      },
      "ApiKeyCreated": {
        "description": "Mint response — the ONLY place the full secret ever appears.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "key_prefix": {
            "title": "Key Prefix",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "rate_limit_tier": {
            "title": "Rate Limit Tier",
            "type": "string"
          },
          "revoked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "title": "Scopes",
            "type": "array"
          },
          "secret": {
            "description": "The full bearer token (vk_live_...). Shown exactly once — store it now; it is NOT retrievable later (only its SHA-256 hash is stored).",
            "title": "Secret",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "key_prefix",
          "scopes",
          "rate_limit_tier",
          "created_at",
          "last_used_at",
          "expires_at",
          "revoked_at",
          "secret"
        ],
        "title": "ApiKeyCreated",
        "type": "object"
      },
      "ApiKeyList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ApiKeyRead"
            },
            "title": "Items",
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "title": "ApiKeyList",
        "type": "object"
      },
      "ApiKeyRead": {
        "description": "One key in the list response. NEVER carries secret material.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "key_prefix": {
            "title": "Key Prefix",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "rate_limit_tier": {
            "title": "Rate Limit Tier",
            "type": "string"
          },
          "revoked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "title": "Scopes",
            "type": "array"
          }
        },
        "required": [
          "id",
          "name",
          "key_prefix",
          "scopes",
          "rate_limit_tier",
          "created_at",
          "last_used_at",
          "expires_at",
          "revoked_at"
        ],
        "title": "ApiKeyRead",
        "type": "object"
      },
      "ApiKeyRevoked": {
        "properties": {
          "already_revoked": {
            "default": false,
            "title": "Already Revoked",
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "revoked": {
            "title": "Revoked",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "revoked"
        ],
        "title": "ApiKeyRevoked",
        "type": "object"
      },
      "ApprovalCardConclusion": {
        "description": "What a journey step's review concluded: its approval card's first line.",
        "properties": {
          "in_set": {
            "description": "False when the review advises against the step: it is approved only on its own, opened, or declined, and a set approval refuses it.",
            "title": "In Set",
            "type": "boolean"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The review's reason, when it gave one.",
            "title": "Reason"
          },
          "state": {
            "description": "stated: the review's conclusion, read as this round's review recorded it. unreadable: the step's crew declares a review conclusion that could not be read; approving the step on its own goes ahead without it.",
            "enum": [
              "stated",
              "unreadable"
            ],
            "title": "State",
            "type": "string"
          },
          "statement": {
            "description": "The review's conclusion, in plain words.",
            "title": "Statement",
            "type": "string"
          }
        },
        "required": [
          "state",
          "statement",
          "in_set"
        ],
        "title": "ApprovalCardConclusion",
        "type": "object"
      },
      "ApprovalCardFact": {
        "description": "One computed fact a human step's card shows.",
        "properties": {
          "key": {
            "title": "Key",
            "type": "string"
          },
          "value": {
            "description": "The value the step's own compute step recorded.",
            "title": "Value"
          }
        },
        "required": [
          "key",
          "value"
        ],
        "title": "ApprovalCardFact",
        "type": "object"
      },
      "ApprovalCardRead": {
        "description": "What a person is shown before approving a journey's human step.",
        "properties": {
          "conclusion": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApprovalCardConclusion"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the step's review concluded, stated before the facts. Absent for a step that declares no review conclusion."
          },
          "digest": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "SHA-256 of exactly what this card shows. A set approval states it per item, and an item whose card has changed since is refused as stale. Null when the step's review conclusion could not be read: a set does not take it.",
            "title": "Digest"
          },
          "facts": {
            "description": "The step's declared computed facts, in declared order; empty when the digest is null.",
            "items": {
              "$ref": "#/components/schemas/ApprovalCardFact"
            },
            "title": "Facts",
            "type": "array"
          },
          "newer_answer_on": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The day a newer answer from the payer among those files arrived. Absent when no newer files wait, or none of them is a payer's answer.",
            "title": "Newer Answer On"
          },
          "newer_files_since": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The day newer files for this case arrived and were kept for its next round, after this round decided: what this card shows does not include them, and the case's next round reads them. Absent when none wait.",
            "title": "Newer Files Since"
          }
        },
        "required": [
          "digest",
          "facts"
        ],
        "title": "ApprovalCardRead",
        "type": "object"
      },
      "ApprovalDecideRequest": {
        "description": "Body for POST /approvals/{id}/decide. `status` must be one of the three\nterminal states; `reason` is free-form approver rationale.",
        "properties": {
          "reason": {
            "anyOf": [
              {
                "maxLength": 4000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "status": {
            "maxLength": 32,
            "pattern": "^(approved|rejected|timed_out)$",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "ApprovalDecideRequest",
        "type": "object"
      },
      "ApprovalDetail": {
        "description": "One recorded gate; pack-run links are proven by a same-tenant row, never inferred.",
        "properties": {
          "approval": {
            "$ref": "#/components/schemas/velerian__api__routers__approvals__ApprovalRead"
          },
          "case_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Id"
          },
          "observed_at": {
            "format": "date-time",
            "title": "Observed At",
            "type": "string"
          },
          "pack_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pack Slug"
          },
          "permitted_actions": {
            "items": {
              "enum": [
                "approve",
                "return",
                "withdraw"
              ],
              "type": "string"
            },
            "title": "Permitted Actions",
            "type": "array"
          },
          "run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          }
        },
        "required": [
          "observed_at",
          "approval",
          "run_id",
          "case_id",
          "pack_slug",
          "permitted_actions"
        ],
        "title": "ApprovalDetail",
        "type": "object"
      },
      "ApprovalGroup": {
        "description": "One invocation's HUMAN_APPROVAL gate-approvals + their dual-control progress.\n\n``gates`` are the approval rows for this ``invocation_id`` (each a distinct\n``constraint_ref``), pending-first then newest, exactly like the flat inbox\nitem ordering. ``requester`` is the originating user (shared across an\ninvocation's gates — the run had one requester).",
        "properties": {
          "abp_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Abp Id"
          },
          "gates": {
            "items": {
              "$ref": "#/components/schemas/velerian__api__routers__approvals__ApprovalRead"
            },
            "title": "Gates",
            "type": "array"
          },
          "invocation_id": {
            "format": "uuid",
            "title": "Invocation Id",
            "type": "string"
          },
          "progress": {
            "$ref": "#/components/schemas/DualControlProgress"
          },
          "requested_at": {
            "format": "date-time",
            "title": "Requested At",
            "type": "string"
          },
          "requester": {
            "format": "uuid",
            "title": "Requester",
            "type": "string"
          }
        },
        "required": [
          "invocation_id",
          "requester",
          "requested_at",
          "progress",
          "gates"
        ],
        "title": "ApprovalGroup",
        "type": "object"
      },
      "ApprovalGroupList": {
        "description": "Grouped approval inbox: one entry per invocation. ``total`` is the number\nof invocation GROUPS (not gate rows); ``limit`` / ``offset`` paginate over\ngroups.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ApprovalGroup"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "ApprovalGroupList",
        "type": "object"
      },
      "AssistedRoutePin": {
        "additionalProperties": false,
        "description": "Internal current tenant-data decision; public selection is never this pin.",
        "properties": {
          "context_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Context Sha256",
            "type": "string"
          },
          "payload_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Payload Sha256",
            "type": "string"
          },
          "product": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Product",
            "type": "string"
          },
          "provider_action": {
            "enum": [
              "claim_reconsideration",
              "paid_claim_correction",
              "formal_appeal",
              "coding_reconsideration",
              "contractual_dispute"
            ],
            "title": "Provider Action",
            "type": "string"
          },
          "record_id": {
            "format": "uuid",
            "title": "Record Id",
            "type": "string"
          },
          "route_id": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Route Id",
            "type": "string"
          },
          "route_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Route Sha256",
            "type": "string"
          },
          "state": {
            "pattern": "^[A-Z]{2}$",
            "title": "State",
            "type": "string"
          },
          "version_id": {
            "format": "uuid",
            "title": "Version Id",
            "type": "string"
          },
          "version_no": {
            "maximum": 2147483647.0,
            "minimum": 1.0,
            "title": "Version No",
            "type": "integer"
          }
        },
        "required": [
          "record_id",
          "version_id",
          "version_no",
          "payload_sha256",
          "route_id",
          "route_sha256",
          "context_sha256",
          "product",
          "state",
          "provider_action"
        ],
        "title": "AssistedRoutePin",
        "type": "object"
      },
      "AssuranceTierFactsRead": {
        "description": "Every input the tier derivation consumed — the tier's audit trail.",
        "properties": {
          "contractPresent": {
            "description": "Whether the effective outcome contract exists — the same presence fact the outcome-contract section reports.",
            "title": "Contractpresent",
            "type": "boolean"
          },
          "floorMet": {
            "description": "Whether the effective set covers all three baseline controls — the same deploy-gate predicate the floor section reports.",
            "title": "Floormet",
            "type": "boolean"
          },
          "missingFloorKinds": {
            "description": "Baseline floor controls NOT in the effective set (why the tier is null); empty when the floor is met.",
            "items": {
              "type": "string"
            },
            "title": "Missingfloorkinds",
            "type": "array"
          },
          "strictFloor": {
            "description": "Whether the guardrail-backed content controls (safety filter and PII redaction) are present and enforced fail-closed. An advisory floor (no guardrail provisioned) reads false.",
            "title": "Strictfloor",
            "type": "boolean"
          },
          "templateId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The resolved governance template's id; null when none resolves.",
            "title": "Templateid"
          },
          "templatePresent": {
            "description": "Whether a regulatory-framework governance template is bound AND resolves in the template registry.",
            "title": "Templatepresent",
            "type": "boolean"
          }
        },
        "required": [
          "floorMet",
          "templatePresent",
          "contractPresent",
          "strictFloor",
          "missingFloorKinds"
        ],
        "title": "AssuranceTierFactsRead",
        "type": "object"
      },
      "AssuranceTierRead": {
        "description": "The agent's assurance depth tier — a label derived from the facts on this\ncard, never a weighted or computed score.\n\n'standard' when the baseline governed floor is in place; 'regulated' when a\nregulatory-framework baseline is also bound; 'high_assurance' when a defined\noutcome contract is present and the content floor is enforced fail-closed.\nNull when the baseline floor is not yet in place (there is no tier below\n'standard').",
        "properties": {
          "facts": {
            "$ref": "#/components/schemas/AssuranceTierFactsRead",
            "description": "The complete fact set the tier was derived from."
          },
          "tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "'standard' | 'regulated' | 'high_assurance' | null (floor not in place).",
            "title": "Tier"
          }
        },
        "required": [
          "facts"
        ],
        "title": "AssuranceTierRead",
        "type": "object"
      },
      "AttachmentCreate": {
        "description": "Register-an-attachment request — the metadata known BEFORE the bytes land.",
        "properties": {
          "case_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional: the case to file this document on. A case-scoped attachment appears in the case file immediately — before any run — and is consumable by every run on that case; a run resolved to a DIFFERENT case cannot attach it (422 at invoke). An unknown or other-workspace case id is a 404. When omitted, the attachment is unscoped (the pre-existing contract: linked to cases only through the runs that consume it).",
            "title": "Case Id"
          },
          "content_type": {
            "description": "Declared MIME type. Must be one of the accepted types (PDF, DOCX, plaintext, opaque JSON, PNG/JPEG); others are rejected with 415.",
            "maxLength": 255,
            "minLength": 1,
            "title": "Content Type",
            "type": "string"
          },
          "document_kind": {
            "default": "input",
            "description": "The document's role: 'input' (default) — a source document attached as run INPUT (flows into the governed prompt); or 'tenant_policy' — a tenant policy / contract document, REFERENCED as a governance source in the evidence pack of runs it scopes to (not injected into the prompt, not interpreted by the model).",
            "maxLength": 24,
            "title": "Document Kind",
            "type": "string"
          },
          "filename": {
            "description": "Original client filename; the label shown in the run's attachment block.",
            "maxLength": 512,
            "minLength": 1,
            "title": "Filename",
            "type": "string"
          },
          "pack_slug": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional: the pack this upload targets (UI context; the run link is set at invoke).",
            "title": "Pack Slug"
          },
          "size_bytes": {
            "description": "Declared document size in bytes (<= 25 MiB).",
            "maximum": 26214400.0,
            "minimum": 1.0,
            "title": "Size Bytes",
            "type": "integer"
          }
        },
        "required": [
          "filename",
          "content_type",
          "size_bytes"
        ],
        "title": "AttachmentCreate",
        "type": "object"
      },
      "AttachmentCreated": {
        "description": "Register response — the attachment id + where its bytes will be stored.\n\nThe upload contract is now: create (this) → ``POST {id}/upload`` (multipart\nbytes) → ``POST {id}/finalize`` (extract text). The raw bytes are uploaded\nSERVER-SIDE via the ``/upload`` endpoint, NOT client-direct to\nS3 — the audit-evidence bucket's Object Lock rejects a browser presigned PUT.",
        "properties": {
          "extractable": {
            "title": "Extractable",
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "s3_key": {
            "title": "S3 Key",
            "type": "string"
          },
          "upload_content_type": {
            "title": "Upload Content Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "s3_key",
          "upload_content_type",
          "extractable"
        ],
        "title": "AttachmentCreated",
        "type": "object"
      },
      "AttachmentDownload": {
        "description": "``/download`` response — where to fetch the source document's bytes.\n\n``delivery`` says how. ``presigned``: ``download_url`` is a short-lived\npresigned GET that expires after ~15 minutes, and the client downloads\ndirect from object storage under the original filename (a pinned\nContent-Disposition). ``stream``: the document is held encrypted under the\nworkspace's own key, so ``download_url`` is this API's\n``GET /api/v2/run-attachments/{id}/content``, which needs the caller's\ncredentials and returns the bytes itself.",
        "properties": {
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "delivery": {
            "default": "presigned",
            "description": "'presigned': download_url is a short-lived direct link. 'stream': download_url is an API path that returns the bytes to an authenticated caller.",
            "enum": [
              "presigned",
              "stream"
            ],
            "title": "Delivery",
            "type": "string"
          },
          "download_url": {
            "title": "Download Url",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "filename",
          "content_type",
          "download_url",
          "expires_at"
        ],
        "title": "AttachmentDownload",
        "type": "object"
      },
      "AttachmentList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/AttachmentSummary"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "AttachmentList",
        "type": "object"
      },
      "AttachmentRef": {
        "description": "A saved reference to one attached document.\n\nA lightweight snapshot so the picker can show what was attached without\nre-reading the ``run_attachments`` rows. The ``attachment_id`` is re-linked by\nthe run form when starting the pre-filled run.",
        "properties": {
          "attachment_id": {
            "description": "The run_attachments id to re-link on the new run.",
            "format": "uuid",
            "title": "Attachment Id",
            "type": "string"
          },
          "content_type": {
            "description": "The document's MIME type.",
            "maxLength": 255,
            "title": "Content Type",
            "type": "string"
          },
          "filename": {
            "description": "The document's display name.",
            "maxLength": 255,
            "title": "Filename",
            "type": "string"
          }
        },
        "required": [
          "attachment_id",
          "filename",
          "content_type"
        ],
        "title": "AttachmentRef",
        "type": "object"
      },
      "AttachmentRequirementDeclare": {
        "description": "``PUT /{attachment_id}/requirement`` request.",
        "properties": {
          "requirement_id": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The id of one of the case's required documents (an entry of the case's data requirements that can be uploaded) that this file is. Null clears the statement, and the file is matched by its name again.",
            "title": "Requirement Id"
          }
        },
        "required": [
          "requirement_id"
        ],
        "title": "AttachmentRequirementDeclare",
        "type": "object"
      },
      "AttachmentRequirementDeclared": {
        "description": "``PUT /{attachment_id}/requirement`` response.",
        "properties": {
          "case_id": {
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "declared_requirement_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The required document this file is now stated to be, or null.",
            "title": "Declared Requirement Id"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "case_id",
          "declared_requirement_id"
        ],
        "title": "AttachmentRequirementDeclared",
        "type": "object"
      },
      "AttachmentSummary": {
        "description": "One attachment row for the list + finalize response.",
        "properties": {
          "case_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Id"
          },
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "declared_requirement_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The case's required document a person stated this file is (PUT /{attachment_id}/requirement). Null means nobody has, and the file is matched by its name.",
            "title": "Declared Requirement Id"
          },
          "document_kind": {
            "title": "Document Kind",
            "type": "string"
          },
          "extracted_chars": {
            "title": "Extracted Chars",
            "type": "integer"
          },
          "extraction_status": {
            "title": "Extraction Status",
            "type": "string"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "pack_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pack Slug"
          },
          "run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "size_bytes": {
            "title": "Size Bytes",
            "type": "integer"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "filename",
          "content_type",
          "size_bytes",
          "pack_slug",
          "run_id",
          "case_id",
          "status",
          "extraction_status",
          "extracted_chars",
          "document_kind",
          "created_at"
        ],
        "title": "AttachmentSummary",
        "type": "object"
      },
      "AttachmentTextPreview": {
        "description": "Current extracted text only; neither original layout nor a run snapshot.",
        "properties": {
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "extracted_chars": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extracted Chars"
          },
          "extraction_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extraction Status"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "preview_status": {
            "enum": [
              "available",
              "unavailable"
            ],
            "title": "Preview Status",
            "type": "string"
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text"
          },
          "truncated": {
            "title": "Truncated",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "filename",
          "content_type",
          "extraction_status",
          "extracted_chars",
          "preview_status",
          "text",
          "truncated"
        ],
        "title": "AttachmentTextPreview",
        "type": "object"
      },
      "AttachmentUploaded": {
        "description": "``/upload`` response — enough for the client to proceed to ``/finalize``.",
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "size_bytes": {
            "title": "Size Bytes",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "size_bytes"
        ],
        "title": "AttachmentUploaded",
        "type": "object"
      },
      "Attestation": {
        "additionalProperties": false,
        "properties": {
          "candidate_id": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Candidate Id",
            "type": "string"
          },
          "expected_revision": {
            "minimum": 0.0,
            "title": "Expected Revision",
            "type": "integer"
          },
          "reason": {
            "maxLength": 1000,
            "minLength": 12,
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "candidate_id",
          "expected_revision",
          "reason"
        ],
        "title": "Attestation",
        "type": "object"
      },
      "AttestationRequest": {
        "additionalProperties": false,
        "properties": {
          "basis_revision_id": {
            "format": "uuid",
            "title": "Basis Revision Id",
            "type": "string"
          },
          "candidate_revision_id": {
            "format": "uuid",
            "title": "Candidate Revision Id",
            "type": "string"
          },
          "expected_version": {
            "minimum": 1.0,
            "title": "Expected Version",
            "type": "integer"
          },
          "explicit_intent": {
            "const": true,
            "title": "Explicit Intent",
            "type": "boolean"
          },
          "field_citations": {
            "additionalProperties": true,
            "title": "Field Citations",
            "type": "object",
            "x-max-serialized-bytes": 6144
          },
          "fields": {
            "additionalProperties": true,
            "title": "Fields",
            "type": "object",
            "x-max-serialized-bytes": 6144
          },
          "policy_revision_id": {
            "format": "uuid",
            "title": "Policy Revision Id",
            "type": "string"
          },
          "reason": {
            "maxLength": 1000,
            "minLength": 12,
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "candidate_revision_id",
          "basis_revision_id",
          "policy_revision_id",
          "expected_version",
          "fields",
          "field_citations",
          "explicit_intent",
          "reason"
        ],
        "title": "AttestationRequest",
        "type": "object",
        "x-max-serialized-bytes": 6144
      },
      "AuditEntryRead": {
        "properties": {
          "action": {
            "title": "Action",
            "type": "string"
          },
          "actor_kind": {
            "title": "Actor Kind",
            "type": "string"
          },
          "actor_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor User Id"
          },
          "event_at": {
            "format": "date-time",
            "title": "Event At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "payload": {
            "additionalProperties": true,
            "title": "Payload",
            "type": "object"
          },
          "prev_hash": {
            "title": "Prev Hash",
            "type": "string"
          },
          "resource_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resource Id"
          },
          "resource_kind": {
            "title": "Resource Kind",
            "type": "string"
          },
          "row_hash": {
            "title": "Row Hash",
            "type": "string"
          }
        },
        "required": [
          "id",
          "event_at",
          "actor_user_id",
          "actor_kind",
          "action",
          "resource_kind",
          "resource_id",
          "payload",
          "prev_hash",
          "row_hash"
        ],
        "title": "AuditEntryRead",
        "type": "object"
      },
      "AuditList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/AuditEntryRead"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "limit",
          "offset"
        ],
        "title": "AuditList",
        "type": "object"
      },
      "AuditLoginResponse": {
        "description": "Result returned to the PXA bootstrap (logged in CloudWatch; never\nuser-facing). The session itself is delivered via the ``Set-Cookie`` headers\n(``velerian_id_token`` + ``velerian_access_token``) — the SAME two cookies a\nnormal interactive login sets. ``expires_in`` mirrors the token TTL so a\ncaller that reads cookies programmatically knows the session lifetime.",
        "properties": {
          "expires_in": {
            "title": "Expires In",
            "type": "integer"
          },
          "seat": {
            "title": "Seat",
            "type": "string"
          }
        },
        "required": [
          "seat",
          "expires_in"
        ],
        "title": "AuditLoginResponse",
        "type": "object"
      },
      "AuthorizeActionRequest": {
        "additionalProperties": false,
        "properties": {
          "expected_payer_id": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Expected Payer Id",
            "type": "string"
          },
          "expected_preparation_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Expected Preparation Sha256",
            "type": "string"
          },
          "ready_to_file": {
            "const": true,
            "title": "Ready To File",
            "type": "boolean"
          }
        },
        "required": [
          "expected_preparation_sha256",
          "expected_payer_id",
          "ready_to_file"
        ],
        "title": "AuthorizeActionRequest",
        "type": "object"
      },
      "BasisRevisionRead": {
        "properties": {
          "actor_user_id": {
            "format": "uuid",
            "title": "Actor User Id",
            "type": "string"
          },
          "authority": {
            "enum": [
              "source_checked",
              "human_confirmed"
            ],
            "title": "Authority",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "field_citations": {
            "additionalProperties": true,
            "title": "Field Citations",
            "type": "object"
          },
          "fields": {
            "additionalProperties": true,
            "title": "Fields",
            "type": "object"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          },
          "revision": {
            "title": "Revision",
            "type": "integer"
          },
          "source_revision_ids": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "title": "Source Revision Ids",
            "type": "array"
          }
        },
        "required": [
          "id",
          "revision",
          "fields",
          "source_revision_ids",
          "field_citations",
          "authority",
          "actor_user_id",
          "reason",
          "created_at"
        ],
        "title": "BasisRevisionRead",
        "type": "object"
      },
      "BlueprintBlockSpec": {
        "description": "Declarative UI block inside a workspace blueprint.",
        "properties": {
          "config": {
            "additionalProperties": true,
            "title": "Config",
            "type": "object",
            "x-max-serialized-bytes": 8192
          },
          "id": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Kind",
            "type": "string"
          },
          "layout": {
            "additionalProperties": true,
            "title": "Layout",
            "type": "object",
            "x-max-serialized-bytes": 8192
          },
          "title": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "title"
        ],
        "title": "BlueprintBlockSpec",
        "type": "object"
      },
      "BlueprintBrandingSpec": {
        "description": "Default co-branding configuration carried by a workspace blueprint.",
        "properties": {
          "accent_color": {
            "anyOf": [
              {
                "maxLength": 32,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accent Color"
          },
          "co_branded": {
            "default": true,
            "title": "Co Branded",
            "type": "boolean"
          },
          "custom": {
            "additionalProperties": true,
            "title": "Custom",
            "type": "object",
            "x-max-serialized-bytes": 8192
          },
          "display_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "logo_url": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Url"
          },
          "primary_color": {
            "anyOf": [
              {
                "maxLength": 32,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Color"
          }
        },
        "title": "BlueprintBrandingSpec",
        "type": "object"
      },
      "BlueprintCrewSpec": {
        "description": "Default crew activation entry inside a workspace blueprint.",
        "properties": {
          "config": {
            "additionalProperties": true,
            "title": "Config",
            "type": "object",
            "x-max-serialized-bytes": 8192
          },
          "crew_id": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Crew Id",
            "type": "string"
          },
          "enabled": {
            "default": true,
            "title": "Enabled",
            "type": "boolean"
          }
        },
        "required": [
          "crew_id"
        ],
        "title": "BlueprintCrewSpec",
        "type": "object"
      },
      "BlueprintListResponse": {
        "description": "Organization blueprint listing.",
        "properties": {
          "blueprints": {
            "items": {
              "$ref": "#/components/schemas/BlueprintSummary"
            },
            "title": "Blueprints",
            "type": "array"
          },
          "organization_id": {
            "format": "uuid",
            "title": "Organization Id",
            "type": "string"
          }
        },
        "required": [
          "organization_id"
        ],
        "title": "BlueprintListResponse",
        "type": "object"
      },
      "BlueprintSpec": {
        "description": "Validated declarative blueprint specification stored in ``workspace_blueprints.spec``.",
        "properties": {
          "blocks": {
            "items": {
              "$ref": "#/components/schemas/BlueprintBlockSpec"
            },
            "maxItems": 64,
            "title": "Blocks",
            "type": "array"
          },
          "branding": {
            "$ref": "#/components/schemas/BlueprintBrandingSpec"
          },
          "crews": {
            "items": {
              "$ref": "#/components/schemas/BlueprintCrewSpec"
            },
            "maxItems": 64,
            "title": "Crews",
            "type": "array"
          },
          "navigation": {
            "items": {
              "additionalProperties": true,
              "type": "object",
              "x-max-serialized-bytes": 8192
            },
            "maxItems": 64,
            "title": "Navigation",
            "type": "array"
          },
          "vertical_modules": {
            "items": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 64,
            "title": "Vertical Modules",
            "type": "array"
          }
        },
        "title": "BlueprintSpec",
        "type": "object"
      },
      "BlueprintSummary": {
        "description": "Versioned workspace blueprint descriptor.",
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "organization_id": {
            "format": "uuid",
            "title": "Organization Id",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "spec": {
            "$ref": "#/components/schemas/BlueprintSpec"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "organization_id",
          "slug",
          "version",
          "name",
          "spec",
          "status"
        ],
        "title": "BlueprintSummary",
        "type": "object"
      },
      "Body_issue_token_api_v2_oauth_token_post": {
        "properties": {
          "client_id": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Id"
          },
          "client_secret": {
            "anyOf": [
              {
                "maxLength": 512,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Secret"
          },
          "grant_type": {
            "default": "",
            "maxLength": 64,
            "title": "Grant Type",
            "type": "string"
          },
          "scope": {
            "anyOf": [
              {
                "maxLength": 1024,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scope"
          }
        },
        "title": "Body_issue_token_api_v2_oauth_token_post",
        "type": "object"
      },
      "Body_upload_attachment_api_v2_run_attachments__attachment_id__upload_post": {
        "properties": {
          "file": {
            "contentMediaType": "application/octet-stream",
            "title": "File",
            "type": "string"
          }
        },
        "required": [
          "file"
        ],
        "title": "Body_upload_attachment_api_v2_run_attachments__attachment_id__upload_post",
        "type": "object"
      },
      "BookingDestination": {
        "description": "Where a captured booking is delivered.\n\nBusiness-language options — the buyer picks \"where should a booking go?\"\nwithout being asked about APIs or scheduling-system vendors. ``MESSAGE_ONLY``\nis the safe default the pack already supports end-to-end (a booking becomes a\nclean message for the shop); the connected-scheduler options are recorded as\nintent and always accompanied by an open item, because the scheduling\nconnection is built with the shop during onboarding.",
        "enum": [
          "message_only",
          "connected_scheduler",
          "email"
        ],
        "title": "BookingDestination",
        "type": "string"
      },
      "BookingRules": {
        "additionalProperties": false,
        "description": "PRI area 3 — what to capture on a booking + where a booking goes.",
        "properties": {
          "capture_fields": {
            "items": {
              "maxLength": 255,
              "type": "string"
            },
            "title": "Capture Fields",
            "type": "array"
          },
          "destination": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BookingDestination"
              },
              {
                "type": "null"
              }
            ]
          },
          "destination_detail": {
            "anyOf": [
              {
                "maxLength": 1000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Destination Detail"
          }
        },
        "title": "BookingRules",
        "type": "object"
      },
      "CandidateEdit": {
        "description": "Edit a proposed rule before approving it (at least one field).",
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A revised plain-language statement of the rule.",
            "title": "Description"
          },
          "parameters": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object",
                "x-max-serialized-bytes": 8192
              },
              {
                "type": "null"
              }
            ],
            "description": "Revised structured details for the rule.",
            "title": "Parameters"
          }
        },
        "title": "CandidateEdit",
        "type": "object"
      },
      "CandidateList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CandidateRead"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "CandidateList",
        "type": "object"
      },
      "CandidateRead": {
        "description": "One proposed rule awaiting (or past) human review.",
        "properties": {
          "activated_revision_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Once the rule has been turned on: the policy version it landed in. Null while it awaits review or before it is turned on.",
            "title": "Activated Revision Id"
          },
          "attachment_id": {
            "description": "The policy document the rule was proposed from.",
            "format": "uuid",
            "title": "Attachment Id",
            "type": "string"
          },
          "confidence": {
            "description": "How confident the reading was: high, medium, or low.",
            "title": "Confidence",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "derivation_id": {
            "format": "uuid",
            "title": "Derivation Id",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Plain-language statement of the rule.",
            "title": "Description"
          },
          "enforcement": {
            "description": "'strict' blocks; 'advisory' flags.",
            "title": "Enforcement",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "description": "The rule's type.",
            "title": "Kind",
            "type": "string"
          },
          "original": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "The rule exactly as it was proposed, kept whenever the stored version was adjusted or edited.",
            "title": "Original"
          },
          "pack_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The agent pack the rule scopes to, or null for workspace-wide.",
            "title": "Pack Slug"
          },
          "parameters": {
            "additionalProperties": true,
            "description": "The rule's structured details.",
            "title": "Parameters",
            "type": "object"
          },
          "review_note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The note attached to this proposal, if any.",
            "title": "Review Note"
          },
          "reviewed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reviewed At"
          },
          "reviewed_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reviewed By User Id"
          },
          "source_filename": {
            "description": "The policy document's file name (for display).",
            "title": "Source Filename",
            "type": "string"
          },
          "source_location": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Where in the document the passage sits.",
            "title": "Source Location"
          },
          "source_snippet": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The verbatim document passage the rule was proposed from.",
            "title": "Source Snippet"
          },
          "status": {
            "description": "Review state: 'proposed' (awaiting review), 'invalid' (found but not usable as written), 'unenforceable' (real policy content the platform can't check at run time yet), 'duplicate' (your workspace already has this rule), 'approved', or 'rejected'.",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "derivation_id",
          "attachment_id",
          "source_filename",
          "kind",
          "parameters",
          "enforcement",
          "description",
          "pack_slug",
          "source_snippet",
          "source_location",
          "confidence",
          "status",
          "review_note",
          "original",
          "reviewed_by_user_id",
          "reviewed_at",
          "created_at"
        ],
        "title": "CandidateRead",
        "type": "object"
      },
      "CandidateRequest": {
        "additionalProperties": false,
        "properties": {
          "evidence_revision_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evidence Revision Id"
          },
          "expected_version": {
            "minimum": 1.0,
            "title": "Expected Version",
            "type": "integer"
          }
        },
        "required": [
          "evidence_revision_id",
          "expected_version"
        ],
        "title": "CandidateRequest",
        "type": "object",
        "x-max-serialized-bytes": 6144
      },
      "CapabilityRead": {
        "properties": {
          "allowed": {
            "title": "Allowed",
            "type": "boolean"
          },
          "reasons": {
            "items": {
              "type": "string"
            },
            "title": "Reasons",
            "type": "array"
          }
        },
        "required": [
          "allowed",
          "reasons"
        ],
        "title": "CapabilityRead",
        "type": "object"
      },
      "CaseApprovalLink": {
        "description": "One human sign-off raised by a run of this case (joined through\n``pack_runs.case_id`` — a pending one is why the case ``needs_human``).",
        "properties": {
          "decided_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Decided At"
          },
          "decided_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The account recorded on the approval decision. Null when no deciding account was recorded; the requester or a closure timestamp does not supply one.",
            "title": "Decided By User Id"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "invocation_id": {
            "format": "uuid",
            "title": "Invocation Id",
            "type": "string"
          },
          "requested_at": {
            "format": "date-time",
            "title": "Requested At",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "invocation_id",
          "requested_at"
        ],
        "title": "CaseApprovalLink",
        "type": "object"
      },
      "CaseAttachmentCutOf": {
        "description": "The stored batch file a sweep cut a case document from: its name and\nwhen it was uploaded. The batch itself is on no case.",
        "properties": {
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "uploaded_at": {
            "format": "date-time",
            "title": "Uploaded At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "filename",
          "uploaded_at"
        ],
        "title": "CaseAttachmentCutOf",
        "type": "object"
      },
      "CaseAttachmentLink": {
        "description": "One stored input document filed on this case or linked through its runs.\n\nExtraction metadata describes the document now. Storage, extraction success\nand presence in this case file do not prove that a selected run used its text.",
        "properties": {
          "case_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Id"
          },
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "cut_of": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CaseAttachmentCutOf"
              },
              {
                "type": "null"
              }
            ],
            "description": "When a sweep filed this document as a one-claim cut of a stored batch file: that file's name and upload time. Null for any other document."
          },
          "declared_requirement_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The case's required document a person stated this file is. Null means nobody has, and the file is matched by its name.",
            "title": "Declared Requirement Id"
          },
          "extracted_chars": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Current recorded extracted character count. Zero is a recorded count, including a successfully processed text-free document; null means unavailable.",
            "title": "Extracted Chars"
          },
          "extraction_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Current recorded text extraction state: pending, ok, unsupported, or failed. Null means unavailable, never inferred success from storage. This is not historical proof that a run consumed the document.",
            "title": "Extraction Status"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "superseded": {
            "default": false,
            "description": "True when a later document on this case's file superseded this one. It stays stored and filed on the case, but no step of the case reads it, it supplies no required document, and it cannot be named as one.",
            "title": "Superseded",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "filename",
          "content_type",
          "created_at"
        ],
        "title": "CaseAttachmentLink",
        "type": "object"
      },
      "CaseClockChip": {
        "description": "The soonest live deadline on a case — just enough for a countdown chip.\n\nPresent only on worklist rows of open cases that carry at least one\nrunning or on-hold clock; the full per-clock readings live at\n``GET /api/v2/clocks?case_id=…``.",
        "properties": {
          "deadline_at_basis": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Recorded deadline basis: derived, stated, or legacy null.",
            "title": "Deadline At Basis"
          },
          "definition_name": {
            "description": "The deadline policy's name.",
            "title": "Definition Name",
            "type": "string"
          },
          "effective_deadline_at": {
            "description": "The deadline shifted by accumulated on-hold time.",
            "format": "date-time",
            "title": "Effective Deadline At",
            "type": "string"
          },
          "open_clocks": {
            "description": "How many live deadlines the case carries in total (this chip shows the soonest).",
            "title": "Open Clocks",
            "type": "integer"
          },
          "paused": {
            "description": "True while the deadline is on hold because the case is waiting on the outside world.",
            "title": "Paused",
            "type": "boolean"
          },
          "remaining_seconds": {
            "description": "Whole seconds until the effective deadline, rounded down: 0 in its last second, the deadline instant included, and negative only once it has passed. Frozen while the deadline is on hold.",
            "title": "Remaining Seconds",
            "type": "integer"
          },
          "started_at_basis": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Recorded clock start basis: reported, estimated, or legacy null.",
            "title": "Started At Basis"
          },
          "zone": {
            "description": "'ok' (inside the window), 'warning' (close to due), or 'breached' (past due while the case is still open).",
            "title": "Zone",
            "type": "string"
          }
        },
        "required": [
          "definition_name",
          "zone",
          "remaining_seconds",
          "effective_deadline_at",
          "paused",
          "open_clocks"
        ],
        "title": "CaseClockChip",
        "type": "object"
      },
      "CaseClockCreate": {
        "additionalProperties": false,
        "description": "Instantiate a deadline policy on a case.",
        "properties": {
          "case_id": {
            "description": "The case the clock measures.",
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "definition_id": {
            "description": "The deadline policy to materialize.",
            "format": "uuid",
            "title": "Definition Id",
            "type": "string"
          },
          "started_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the deadline's real-world window opened. May be in the past (retroactive start); defaults to now. Never in the future. A value with no UTC offset is read as UTC.",
            "title": "Started At"
          }
        },
        "required": [
          "case_id",
          "definition_id"
        ],
        "title": "CaseClockCreate",
        "type": "object"
      },
      "CaseClockList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CaseClockRead"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "CaseClockList",
        "type": "object"
      },
      "CaseClockRead": {
        "description": "One clock instance plus its computed reading at response time.",
        "properties": {
          "calendar": {
            "title": "Calendar",
            "type": "string"
          },
          "case_id": {
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "deadline_at": {
            "format": "date-time",
            "title": "Deadline At",
            "type": "string"
          },
          "deadline_at_basis": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "'stated' — this deadline IS a date the case's own record states, read from the policy's declared deadline fields; 'derived' — it was computed from the policy's duration on its calendar. Empty for clocks started before this was recorded (all derived).",
            "title": "Deadline At Basis"
          },
          "deadline_source": {
            "title": "Deadline Source",
            "type": "string"
          },
          "definition_id": {
            "format": "uuid",
            "title": "Definition Id",
            "type": "string"
          },
          "definition_name": {
            "title": "Definition Name",
            "type": "string"
          },
          "effective_deadline_at": {
            "description": "The deadline shifted by accumulated pause time.",
            "format": "date-time",
            "title": "Effective Deadline At",
            "type": "string"
          },
          "firings": {
            "description": "The automatic actions this clock has fired, oldest first: entering the warning zone fires one governed run that attempts to clear the blocker; a breach (or a spent warning attempt) creates one work item for a teammate. At most one of each per clock.",
            "items": {
              "$ref": "#/components/schemas/ClockFiringRead"
            },
            "title": "Firings",
            "type": "array"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "normative_citation": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Normative Citation"
          },
          "pause_count": {
            "title": "Pause Count",
            "type": "integer"
          },
          "paused_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Paused At"
          },
          "paused_seconds_total": {
            "title": "Paused Seconds Total",
            "type": "integer"
          },
          "remaining_seconds": {
            "description": "Whole seconds until the effective deadline, rounded down: 0 in its last second, the deadline instant included, and negative only once it has passed. Frozen while the clock is paused; frozen at close for met/breached clocks.",
            "title": "Remaining Seconds",
            "type": "integer"
          },
          "started_at": {
            "format": "date-time",
            "title": "Started At",
            "type": "string"
          },
          "started_at_basis": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "'reported' — the start reflects when this window actually opened: a date the case's own record states, a date supplied when the clock was started, or the policy's case-open anchor when it declares no event anchor; 'estimated' — the policy anchors to a record-stated event date the record does not state, so the deadline counts from when the clock was attached and should be read as an estimate. Empty for clocks started before this was recorded.",
            "title": "Started At Basis"
          },
          "state": {
            "title": "State",
            "type": "string"
          },
          "stopped_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stopped At"
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The policy's current IANA zone; null means UTC. This is read from the editable policy, not snapshotted on the clock. Policy edits do not change this clock's materialized deadline.",
            "title": "Timezone"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "warning_threshold_pct": {
            "title": "Warning Threshold Pct",
            "type": "integer"
          },
          "zone": {
            "description": "'ok', 'warning', or 'breached' for an open clock (computed against the policy's warning threshold); 'met' or 'breached' once its case has closed.",
            "title": "Zone",
            "type": "string"
          }
        },
        "required": [
          "id",
          "case_id",
          "definition_id",
          "definition_name",
          "deadline_source",
          "normative_citation",
          "calendar",
          "warning_threshold_pct",
          "state",
          "started_at",
          "deadline_at",
          "paused_at",
          "paused_seconds_total",
          "pause_count",
          "stopped_at",
          "effective_deadline_at",
          "remaining_seconds",
          "zone",
          "created_at",
          "updated_at"
        ],
        "title": "CaseClockRead",
        "type": "object"
      },
      "CaseCreateRequest": {
        "additionalProperties": false,
        "description": "Body for ``POST /api/v2/cases``.",
        "properties": {
          "openedVia": {
            "default": "api",
            "maxLength": 32,
            "pattern": "^(intake|run|api|schedule|email|webhook|manual)$",
            "title": "Openedvia",
            "type": "string"
          },
          "practiceFixture": {
            "anyOf": [
              {
                "const": "peo_quote",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional internal-dev quote worksheets for a manual synthetic case without a crew.",
            "title": "Practicefixture"
          },
          "primaryPackSlug": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primarypackslug"
          },
          "synthetic": {
            "default": false,
            "description": "Explicit creation-time synthetic evidence mode; internal development administrators only.",
            "title": "Synthetic",
            "type": "boolean"
          },
          "title": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "title": "CaseCreateRequest",
        "type": "object"
      },
      "CaseDataAwaitingRecord": {
        "description": "A stored document that satisfies the entity, not yet recorded against it.",
        "properties": {
          "kind": {
            "description": "Which declared source kind supplied it — 'upload' today.",
            "title": "Kind",
            "type": "string"
          },
          "label": {
            "description": "Human-readable form — the attached filename. The SAME string the row's `satisfied_by.label` will carry once it is recorded.",
            "title": "Label",
            "type": "string"
          },
          "reference": {
            "description": "The stored document's attachment id.",
            "title": "Reference",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "reference",
          "label"
        ],
        "title": "CaseDataAwaitingRecord",
        "type": "object"
      },
      "CaseDataRequirementList": {
        "description": "Everything the Data panel needs, in the contract's declared order.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CaseDataRequirementStatusRead"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "CaseDataRequirementList",
        "type": "object"
      },
      "CaseDataRequirementStatusRead": {
        "description": "One contract entity, declaration JOINED with this case's acquisition truth.",
        "properties": {
          "active_source": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DataContractSourceRead"
              },
              {
                "type": "null"
              }
            ],
            "description": "The source this datum pulls from TODAY: the first declared source that can actually put the datum into this case's acquisition ledger — an upload, or a tenant-store record. A declared connector is NOT one of those yet: its `live` flag describes the connector's code, not a connection to this case, so it rides `sources` (and the configured chain) without claiming to be where the datum comes from. Null when nothing declared can move data yet."
          },
          "awaiting_record": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CaseDataAwaitingRecord"
              },
              {
                "type": "null"
              }
            ],
            "description": "Present exactly when a document already stored on this case covers the datum and the record of it has not been written yet. `status` still reads 'pending', or 'failed' when the document answers an earlier failure — it reports what has been recorded — so this field is what tells a datum that was supplied and is still being filed apart from one that was never supplied. Show it as its own calm state, over either status: the datum is here and there is nothing to upload again. Not green (nothing is recorded yet, so nothing can be shown as its source) and not red (the document that answers it has arrived)."
          },
          "cardinality": {
            "description": "per_case | per_run | tenant_standing.",
            "title": "Cardinality",
            "type": "string"
          },
          "completion_proof": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CompletionProofPolicyRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "description": "What the datum is, in the pack persona's working vocabulary.",
            "title": "Description",
            "type": "string"
          },
          "entity_kind": {
            "description": "Closed platform entity vocabulary (e.g. remittance_835).",
            "title": "Entity Kind",
            "type": "string"
          },
          "failure_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Customer-voiced statement of what went wrong — present when 'failed'.",
            "title": "Failure Reason"
          },
          "failure_remediation": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The actionable next step (e.g. \"Upload the 835 remittance to this case.\") — present when 'failed'.",
            "title": "Failure Remediation"
          },
          "fallback_source": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DataContractSourceRead"
              },
              {
                "type": "null"
              }
            ],
            "description": "The next declared source after the active one. A `manual` fallback names an intake path with no write surface today, so the ACTIVE source is the one that can turn this row green."
          },
          "fields": {
            "description": "Named data points inside the entity, required or optional.",
            "items": {
              "$ref": "#/components/schemas/DataContractFieldRead"
            },
            "title": "Fields",
            "type": "array"
          },
          "label": {
            "description": "Customer-facing name of the datum.",
            "title": "Label",
            "type": "string"
          },
          "load_bearing": {
            "description": "Whether the pack's work cannot proceed at all without this datum. False means the work proceeds with stated limitations when it is absent; true means the journey waits for it before any stage runs. Read from the pack's declaration, never from this case's row, so every open case reads the flag the pack declares today.",
            "title": "Load Bearing",
            "type": "boolean"
          },
          "proof": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProofSummaryRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "requirement_id": {
            "description": "The contract entity's permanent slug — stable across reads.",
            "title": "Requirement Id",
            "type": "string"
          },
          "satisfied_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CaseDataSatisfiedBy"
              },
              {
                "type": "null"
              }
            ],
            "description": "What satisfied the entity — present exactly when status is 'acquired'."
          },
          "sources": {
            "description": "ORDERED acquisition paths — order is the resolution preference. Connector sources carry the code-level `live` flag, which describes the connector's code, never a connection.",
            "items": {
              "$ref": "#/components/schemas/DataContractSourceRead"
            },
            "title": "Sources",
            "type": "array"
          },
          "status": {
            "description": "pending | acquiring | acquired | failed — derived from runtime signals, never set by hand. Render gray for pending AND acquiring, green for acquired, red for failed.",
            "title": "Status",
            "type": "string"
          },
          "status_changed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the current status was entered. Null before the case is first tracked.",
            "title": "Status Changed At"
          },
          "why_needed": {
            "description": "Which conclusions are limited when this datum is absent.",
            "title": "Why Needed",
            "type": "string"
          }
        },
        "required": [
          "requirement_id",
          "label",
          "description",
          "why_needed",
          "entity_kind",
          "cardinality",
          "load_bearing",
          "sources",
          "status"
        ],
        "title": "CaseDataRequirementStatusRead",
        "type": "object"
      },
      "CaseDataSatisfiedBy": {
        "description": "What satisfied an acquired entity — kind + reference, human-readable.",
        "properties": {
          "kind": {
            "description": "Which declared source kind satisfied it: connector | tenant_store | upload | manual.",
            "title": "Kind",
            "type": "string"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Human-readable form of the reference — e.g. the attached filename.",
            "title": "Label"
          },
          "reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The satisfying artifact's id — an attachment id today; a connector call id or tenant-store record id once one of those sources supplies the datum.",
            "title": "Reference"
          }
        },
        "required": [
          "kind"
        ],
        "title": "CaseDataSatisfiedBy",
        "type": "object"
      },
      "CaseDetail": {
        "description": "The case plus its rollup: every thread that hangs off it.\n\n``runs`` are the attempts made against the case, ``intake_sessions`` the\nconversations that scoped it, ``approvals`` the human sign-offs its runs\nraised, and ``attachments`` the case file — stored input documents filed\non the case or linked through its runs, across the whole revision chain.",
        "properties": {
          "approvals": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/CaseApprovalLink"
            },
            "title": "Approvals",
            "type": "array"
          },
          "attachments": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/CaseAttachmentLink"
            },
            "title": "Attachments",
            "type": "array"
          },
          "case_number": {
            "title": "Case Number",
            "type": "integer"
          },
          "case_ref": {
            "title": "Case Ref",
            "type": "string"
          },
          "clock": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CaseClockChip"
              },
              {
                "type": "null"
              }
            ]
          },
          "closed_note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Closed Note"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "evidence_mode": {
            "default": "real",
            "description": "Immutable case provenance; synthetic events are simulations.",
            "enum": [
              "real",
              "synthetic"
            ],
            "title": "Evidence Mode",
            "type": "string"
          },
          "governance": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CaseGovernanceChip"
              },
              {
                "type": "null"
              }
            ]
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "intake_sessions": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/CaseIntakeSessionLink"
            },
            "title": "Intake Sessions",
            "type": "array"
          },
          "journey_startable": {
            "default": false,
            "description": "True when this case's agent has declared steps that have not started yet — the case is waiting for someone to start the workflow (POST /cases/{case_id}/journey). DERIVED, never stored: the pack declares steps, the case is still open, and no journey row exists. False once the workflow is running, for an agent with a single step, and for a closed case.",
            "title": "Journey Startable",
            "type": "boolean"
          },
          "opened_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Opened By User Id"
          },
          "opened_via": {
            "title": "Opened Via",
            "type": "string"
          },
          "primary_pack_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Pack Slug"
          },
          "recovery": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RecoveryRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "resolution_detail": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution Detail"
          },
          "resolution_outcome": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution Outcome"
          },
          "resolved_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolved At"
          },
          "resolved_by": {
            "anyOf": [
              {
                "enum": [
                  "person",
                  "system"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who resolved the case: 'person' when a user resolved it (signed in, or by their API key), 'system' when code resolved it with no person, which resolution_detail.decided_by names (today only 'claim_register_paid': the claim register recorded the case's claim paid). Null while the case is not resolved, or when no resolver is recorded.",
            "title": "Resolved By"
          },
          "resolved_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolved By User Id"
          },
          "runs": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/CaseRunLink"
            },
            "title": "Runs",
            "type": "array"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "case_number",
          "case_ref",
          "title",
          "status",
          "opened_via",
          "opened_by_user_id",
          "primary_pack_slug",
          "resolution_outcome",
          "resolution_detail",
          "resolved_at",
          "resolved_by_user_id",
          "created_at",
          "updated_at"
        ],
        "title": "CaseDetail",
        "type": "object"
      },
      "CaseFactReferencePage": {
        "description": "Current case fact history, independent of the selected run's input use.",
        "properties": {
          "basis": {
            "const": "current_case_context",
            "default": "current_case_context",
            "title": "Basis",
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/CaseFactReferenceRead"
            },
            "title": "Items",
            "type": "array"
          },
          "next_offset": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Offset"
          },
          "status": {
            "enum": [
              "available",
              "no_case",
              "pack_scope_limited"
            ],
            "title": "Status",
            "type": "string"
          },
          "truncated": {
            "default": false,
            "title": "Truncated",
            "type": "boolean"
          }
        },
        "required": [
          "status"
        ],
        "title": "CaseFactReferencePage",
        "type": "object"
      },
      "CaseFactReferenceRead": {
        "additionalProperties": false,
        "description": "Recorded case fact identity and production lineage; the value is excluded.",
        "properties": {
          "compute_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compute Ref"
          },
          "compute_run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compute Run Id"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "fact_id": {
            "format": "uuid",
            "title": "Fact Id",
            "type": "string"
          },
          "fact_key": {
            "title": "Fact Key",
            "type": "string"
          },
          "produced_by_selected_run": {
            "default": false,
            "title": "Produced By Selected Run",
            "type": "boolean"
          },
          "schema_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schema Id"
          },
          "selected_run_use": {
            "const": "not_recorded",
            "default": "not_recorded",
            "title": "Selected Run Use",
            "type": "string"
          },
          "source_kind": {
            "enum": [
              "model_run",
              "compute",
              "unknown"
            ],
            "title": "Source Kind",
            "type": "string"
          },
          "source_run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Run Id"
          },
          "stage_key": {
            "title": "Stage Key",
            "type": "string"
          },
          "superseded_by": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Superseded By"
          }
        },
        "required": [
          "fact_id",
          "fact_key",
          "stage_key",
          "created_at",
          "source_kind"
        ],
        "title": "CaseFactReferenceRead",
        "type": "object"
      },
      "CaseGovernanceChip": {
        "description": "Whether the work on this case passed its checks — at a glance.\n\nPresent on worklist rows whose case has at least one run that reached the\nchecks; absent when nothing has been checked yet (never inferred, never\nfabricated). ``passed`` reads the most recently checked run, and\n``not_passed_runs`` stays honest about earlier attempts that did not pass,\nso a later clean run can never quietly cover one that failed.",
        "properties": {
          "awaiting_signoff": {
            "default": false,
            "description": "True while the most recently checked run is paused for a human sign-off that nobody has decided yet — not a failed check. False once the sign-off is decided; see signoff_decision.",
            "title": "Awaiting Signoff",
            "type": "boolean"
          },
          "awaiting_signoff_runs": {
            "default": 0,
            "description": "How many of this case's runs are paused waiting for a human sign-off.",
            "title": "Awaiting Signoff Runs",
            "type": "integer"
          },
          "checked_runs": {
            "description": "How many of this case's runs have been through the checks.",
            "title": "Checked Runs",
            "type": "integer"
          },
          "not_passed_runs": {
            "description": "How many of this case's runs did not pass their checks. Runs paused for a human sign-off are not counted here — they have no verdict yet.",
            "title": "Not Passed Runs",
            "type": "integer"
          },
          "outcome_verdict": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether that run delivered what it promised — 'met', 'partial' or 'incomplete' — when a result was scored.",
            "title": "Outcome Verdict"
          },
          "passed": {
            "description": "True when the most recently checked run passed every check.",
            "title": "Passed",
            "type": "boolean"
          },
          "signoff_decision": {
            "anyOf": [
              {
                "enum": [
                  "approved",
                  "rejected",
                  "timed_out",
                  "superseded"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the most recently checked run was paused for a sign-off and is no longer waiting, what the sign-off came to: approved, rejected, timed_out, or superseded (closed with its case). Null for a run never paused and while a decision is still outstanding. Such a run is neither a pass nor a failed check, whatever was decided.",
            "title": "Signoff Decision"
          }
        },
        "required": [
          "passed",
          "checked_runs",
          "not_passed_runs"
        ],
        "title": "CaseGovernanceChip",
        "type": "object"
      },
      "CaseGroup": {
        "description": "One workflow group of the worklist, with its own count and first page.",
        "properties": {
          "items": {
            "description": "The first page of the group, ordered by the requested sort.",
            "items": {
              "$ref": "#/components/schemas/CaseRead"
            },
            "title": "Items",
            "type": "array"
          },
          "key": {
            "description": "Which group this is: 'needs_you', 'ready_to_close', 'stalled', 'waiting', 'in_progress', or 'done'.",
            "title": "Key",
            "type": "string"
          },
          "limit": {
            "description": "How many rows this page holds at most.",
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "description": "Where this page starts within the group.",
            "title": "Offset",
            "type": "integer"
          },
          "statuses": {
            "description": "The lifecycle statuses this group covers. Five groups cover 'open': 'needs_you' and 'waiting' take an open case whose workflow is paused waiting for an input (by who can supply it — a person, or a connected system / a date), and 'in_progress', 'ready_to_close' and 'stalled' partition the rest by whether a run is executing right now and whether the recorded outcomes say the job got done. Status alone cannot place an open case; the server's grouping is authoritative.",
            "items": {
              "type": "string"
            },
            "title": "Statuses",
            "type": "array"
          },
          "total": {
            "description": "How many cases fall in this group under the current filters — the whole group, not just the rows returned here.",
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "key",
          "statuses",
          "total",
          "items",
          "limit",
          "offset"
        ],
        "title": "CaseGroup",
        "type": "object"
      },
      "CaseGroupedList": {
        "description": "The worklist grouped by where the work stands, needs-you first.\n\nThe groups answer the question a worklist is opened to answer: what needs\nyou, what finished and is ready to close, what stalled without ever\nstarting, what is waiting on someone else, what is actually moving, and\nwhat is finished. \"In progress\" means a run is executing right now; an\nopen case whose work has finished with nothing running is \"Ready to\nclose\" — your turn to record how it turned out — and an open case where\nnothing has run is \"Stalled\", never quietly presented as moving. Every\ngroup is always returned, including empty ones — an empty \"needs you\" is\ngood news, and hiding a group would make its work invisible. To page\ndeeper into one group, call the flat worklist scoped to it:\n``GET /api/v2/cases?group=needs_you&offset=10``.",
        "properties": {
          "groups": {
            "description": "Every group, in the order they should be read (needs-you first).",
            "items": {
              "$ref": "#/components/schemas/CaseGroup"
            },
            "title": "Groups",
            "type": "array"
          },
          "total": {
            "description": "Total cases across all groups under the current filters.",
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "groups",
          "total"
        ],
        "title": "CaseGroupedList",
        "type": "object"
      },
      "CaseIntakeSessionLink": {
        "description": "One intake conversation that scoped work inside this case.\n\nCarries the conversation's user-visible ``transcript`` (DESIGN.md §5/§6:\nthe case detail surfaces the intake transcript, so\nconversation → blueprint → runs → resolution reads as one thread).",
        "properties": {
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "state": {
            "title": "State",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "transcript": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/CaseTranscriptEntry"
            },
            "title": "Transcript",
            "type": "array"
          }
        },
        "required": [
          "id",
          "status",
          "state",
          "created_at"
        ],
        "title": "CaseIntakeSessionLink",
        "type": "object"
      },
      "CaseJournalEntryCreateRequest": {
        "additionalProperties": false,
        "description": "Body for adding one entry to a case's journal.",
        "properties": {
          "audience": {
            "description": "Who this entry is written for: 'internal' (a work note that stays inside your workspace) or 'customer_visible' (a comment written for the customer to read). Required on every entry — there is no default, because the two are not interchangeable.",
            "maxLength": 32,
            "pattern": "^(internal|customer_visible)$",
            "title": "Audience",
            "type": "string"
          },
          "body": {
            "description": "What you want recorded about the work.",
            "maxLength": 8000,
            "minLength": 1,
            "title": "Body",
            "type": "string"
          }
        },
        "required": [
          "audience",
          "body"
        ],
        "title": "CaseJournalEntryCreateRequest",
        "type": "object"
      },
      "CaseJournalEntryList": {
        "description": "A case's journal, oldest first.",
        "properties": {
          "audience_scope": {
            "description": "Which entries this response contains: 'customer_visible' (the default — only what the customer may read) or 'all'.",
            "title": "Audience Scope",
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/CaseJournalEntryRead"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "audience_scope"
        ],
        "title": "CaseJournalEntryList",
        "type": "object"
      },
      "CaseJournalEntryRead": {
        "description": "One entry on a case's journal.",
        "properties": {
          "audience": {
            "description": "'internal' — a work note that stays inside your workspace — or 'customer_visible', a comment written for the customer.",
            "title": "Audience",
            "type": "string"
          },
          "author_agent_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The agent that recorded it, when an agent did.",
            "title": "Author Agent Slug"
          },
          "author_display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who wrote it, in a form worth showing — the person's name or the agent that recorded it.",
            "title": "Author Display Name"
          },
          "author_kind": {
            "description": "'person' if someone wrote it, 'platform' if Velerian's software recorded it, 'agent' if an AI agent wrote it.",
            "title": "Author Kind",
            "type": "string"
          },
          "author_run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The run this entry came out of, when one did.",
            "title": "Author Run Id"
          },
          "author_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The person who wrote it, when a person did.",
            "title": "Author User Id"
          },
          "body": {
            "title": "Body",
            "type": "string"
          },
          "case_id": {
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "recorded_at": {
            "description": "When the entry was recorded.",
            "format": "date-time",
            "title": "Recorded At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "case_id",
          "audience",
          "body",
          "author_kind",
          "recorded_at",
          "created_at"
        ],
        "title": "CaseJournalEntryRead",
        "type": "object"
      },
      "CaseList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CaseRead"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "CaseList",
        "type": "object"
      },
      "CaseNeedsYouByPack": {
        "description": "Needs-you totals for every pack that has any, in one read.\n\nThe badge beside each of a workspace's packs. Only packs with at least one\ncase needing you are listed — an absent pack is zero. Same total, same\nfilters and same tenant scoping as the needs-you group of the grouped\nworklist, so a badge and the list it opens can never disagree.",
        "properties": {
          "totals": {
            "description": "One entry per pack that has at least one case needing you.",
            "items": {
              "$ref": "#/components/schemas/PackNeedsYouTotal"
            },
            "title": "Totals",
            "type": "array"
          }
        },
        "required": [
          "totals"
        ],
        "title": "CaseNeedsYouByPack",
        "type": "object"
      },
      "CaseRead": {
        "description": "One case in a response. ``case_ref`` (``C-000123``) is the quotable\nreference shown everywhere a case is named.",
        "properties": {
          "case_number": {
            "title": "Case Number",
            "type": "integer"
          },
          "case_ref": {
            "title": "Case Ref",
            "type": "string"
          },
          "clock": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CaseClockChip"
              },
              {
                "type": "null"
              }
            ]
          },
          "closed_note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Closed Note"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "evidence_mode": {
            "default": "real",
            "description": "Immutable case provenance; synthetic events are simulations.",
            "enum": [
              "real",
              "synthetic"
            ],
            "title": "Evidence Mode",
            "type": "string"
          },
          "governance": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CaseGovernanceChip"
              },
              {
                "type": "null"
              }
            ]
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "opened_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Opened By User Id"
          },
          "opened_via": {
            "title": "Opened Via",
            "type": "string"
          },
          "primary_pack_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Pack Slug"
          },
          "resolution_detail": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution Detail"
          },
          "resolution_outcome": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution Outcome"
          },
          "resolved_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolved At"
          },
          "resolved_by": {
            "anyOf": [
              {
                "enum": [
                  "person",
                  "system"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who resolved the case: 'person' when a user resolved it (signed in, or by their API key), 'system' when code resolved it with no person, which resolution_detail.decided_by names (today only 'claim_register_paid': the claim register recorded the case's claim paid). Null while the case is not resolved, or when no resolver is recorded.",
            "title": "Resolved By"
          },
          "resolved_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolved By User Id"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "case_number",
          "case_ref",
          "title",
          "status",
          "opened_via",
          "opened_by_user_id",
          "primary_pack_slug",
          "resolution_outcome",
          "resolution_detail",
          "resolved_at",
          "resolved_by_user_id",
          "created_at",
          "updated_at"
        ],
        "title": "CaseRead",
        "type": "object"
      },
      "CaseRecordedHistory": {
        "properties": {
          "can_export": {
            "title": "Can Export",
            "type": "boolean"
          },
          "case": {
            "$ref": "#/components/schemas/HistoryCase"
          },
          "collection_finished_at": {
            "format": "date-time",
            "title": "Collection Finished At",
            "type": "string"
          },
          "collection_started_at": {
            "format": "date-time",
            "title": "Collection Started At",
            "type": "string"
          },
          "concurrent_changes_possible": {
            "const": true,
            "default": true,
            "title": "Concurrent Changes Possible",
            "type": "boolean"
          },
          "consistency": {
            "const": "read_committed_observed_collection",
            "default": "read_committed_observed_collection",
            "title": "Consistency",
            "type": "string"
          },
          "enumeration_limitation": {
            "default": "Pages can observe different committed states and miss concurrent or backdated inserts. Exhaustion is query-local, not point-in-time completeness.",
            "title": "Enumeration Limitation",
            "type": "string"
          },
          "journey": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/HistoryJourney"
              },
              {
                "type": "null"
              }
            ]
          },
          "related_case_scope": {
            "const": "references_only",
            "default": "references_only",
            "title": "Related Case Scope",
            "type": "string"
          },
          "schema_revision": {
            "const": 1,
            "default": 1,
            "title": "Schema Revision",
            "type": "integer"
          },
          "scope": {
            "const": "requested_case",
            "default": "requested_case",
            "title": "Scope",
            "type": "string"
          },
          "sections": {
            "additionalProperties": {
              "$ref": "#/components/schemas/HistoryPage"
            },
            "propertyNames": {
              "enum": [
                "stages",
                "lifecycle",
                "runs",
                "approvals",
                "attachments",
                "evidence_revisions",
                "proof_bindings",
                "proof_context",
                "proof_attempts",
                "proof_consumptions",
                "identity_revisions",
                "policy_revisions",
                "recovery_events",
                "recovery_movements",
                "restarts"
              ]
            },
            "title": "Sections",
            "type": "object"
          }
        },
        "required": [
          "case",
          "journey",
          "collection_started_at",
          "collection_finished_at",
          "can_export",
          "sections"
        ],
        "title": "CaseRecordedHistory",
        "type": "object"
      },
      "CaseReopened": {
        "description": "The case as the reopen left it, and what a person does next.",
        "properties": {
          "case_id": {
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "case_status": {
            "description": "needs_human: the case holds an item for a person.",
            "title": "Case Status",
            "type": "string"
          },
          "next_step": {
            "description": "What a person does next, in one sentence.",
            "title": "Next Step",
            "type": "string"
          },
          "work_item_id": {
            "description": "The item the reopen raised on the case.",
            "format": "uuid",
            "title": "Work Item Id",
            "type": "string"
          }
        },
        "required": [
          "case_id",
          "case_status",
          "work_item_id",
          "next_step"
        ],
        "title": "CaseReopened",
        "type": "object"
      },
      "CaseResolutionRollupResponse": {
        "description": "Per-case resolution rollup — recorded reality vs run self-assessment.",
        "properties": {
          "abandoned_cases": {
            "description": "Cases closed as abandoned in-window. Counted separately and never folded into the outcome mix — abandonment means work stopped, not a real-world outcome.",
            "title": "Abandoned Cases",
            "type": "integer"
          },
          "achieved_after_revisions": {
            "description": "Achieved-after-N-revisions histogram (revisions asc) over achieved cases with at least one run: how many attempts reality took, per case.",
            "items": {
              "$ref": "#/components/schemas/ResolutionRevisionsCountResponse"
            },
            "title": "Achieved After Revisions",
            "type": "array"
          },
          "achieved_but_verdict_not_met": {
            "default": 0,
            "description": "Resolved cases achieved in reality whose newest run verdict was not 'met' — the platform under-claimed, or never scored the attempt.",
            "title": "Achieved But Verdict Not Met",
            "type": "integer"
          },
          "achieved_cases": {
            "default": 0,
            "description": "Resolved cases whose recorded outcome was 'achieved'.",
            "title": "Achieved Cases",
            "type": "integer"
          },
          "achieved_rate_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "achieved_cases / resolved_cases * 100 — the real-world success headline. null when no case was resolved in-window (render 'no resolutions yet', never '0%').",
            "title": "Achieved Rate Pct"
          },
          "achieved_without_runs": {
            "default": 0,
            "description": "Achieved cases with no runs attached — the outcome was achieved outside the platform. Excluded from the revisions histogram and average.",
            "title": "Achieved Without Runs",
            "type": "integer"
          },
          "avg_revisions_to_achieved": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Mean revisions across the histogram's cases (2dp). null when no achieved case had a run.",
            "title": "Avg Revisions To Achieved"
          },
          "outcomes": {
            "description": "The resolution-outcome mix over resolved cases (count desc). Open vocabulary, grouped exactly as recorded; 'achieved' is the recognized success value.",
            "items": {
              "$ref": "#/components/schemas/ResolutionOutcomeCountResponse"
            },
            "title": "Outcomes",
            "type": "array"
          },
          "resolved_cases": {
            "description": "Cases closed as resolved in-window (each records a real-world outcome). Windowed on when the case was closed, independently of the run buckets' window on run submission time.",
            "title": "Resolved Cases",
            "type": "integer"
          },
          "verdict_met_but_not_achieved": {
            "default": 0,
            "description": "Resolved cases where the newest run's verdict said 'met' but the recorded real-world outcome was not 'achieved' — the work product looked right, reality disagreed. The primary learning signal.",
            "title": "Verdict Met But Not Achieved",
            "type": "integer"
          },
          "verdict_vs_resolution": {
            "description": "Cross-tab of the newest run's own verdict against the recorded real-world outcome, over resolved cases (count desc). Off-diagonal cells show where self-assessment and reality disagree.",
            "items": {
              "$ref": "#/components/schemas/VerdictResolutionCellResponse"
            },
            "title": "Verdict Vs Resolution",
            "type": "array"
          }
        },
        "required": [
          "resolved_cases",
          "abandoned_cases"
        ],
        "title": "CaseResolutionRollupResponse",
        "type": "object"
      },
      "CaseRoundsRead": {
        "description": "Every round a case has run, earliest first.",
        "properties": {
          "case_id": {
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "next_round": {
            "$ref": "#/components/schemas/NextRoundRead"
          },
          "rounds": {
            "items": {
              "$ref": "#/components/schemas/JourneyRoundRead"
            },
            "title": "Rounds",
            "type": "array"
          }
        },
        "required": [
          "case_id",
          "rounds",
          "next_round"
        ],
        "title": "CaseRoundsRead",
        "type": "object"
      },
      "CaseRunLink": {
        "description": "One pack run attempted against this case.\n\nJust enough to render + navigate: the run's id, its status, the pack it\nran, whether it passed its checks, its outcome verdict, and when it was\nsubmitted. The full record lives at ``GET /api/v2/pack-runs/{id}``.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "governance_pass": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Governance Pass"
          },
          "human_approval_decision": {
            "anyOf": [
              {
                "enum": [
                  "approved",
                  "rejected",
                  "timed_out",
                  "superseded"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Human Approval Decision"
          },
          "human_approval_pending": {
            "default": false,
            "title": "Human Approval Pending",
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "outcome_verdict": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Outcome Verdict"
          },
          "output_origin": {
            "$ref": "#/components/schemas/RunOrigin",
            "default": "unknown"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "parent_run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Run Id"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "pack_slug",
          "created_at"
        ],
        "title": "CaseRunLink",
        "type": "object"
      },
      "CaseTranscriptEntry": {
        "description": "One user-visible turn of an intake conversation on this case.\n\nThe same rendering the intake surface itself uses (tool plumbing\nstripped, split replies coalesced), so the case detail re-tells the\nconversation exactly as the user saw it. ``masked`` / ``blocked`` are the\ngoverned-intake honesty markers: anonymized or withheld turns render\ntruthfully here too.",
        "properties": {
          "blocked": {
            "default": false,
            "title": "Blocked",
            "type": "boolean"
          },
          "masked": {
            "default": false,
            "title": "Masked",
            "type": "boolean"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "text": {
            "title": "Text",
            "type": "string"
          }
        },
        "required": [
          "role",
          "text"
        ],
        "title": "CaseTranscriptEntry",
        "type": "object"
      },
      "CaseUpdateRequest": {
        "additionalProperties": false,
        "description": "Body for ``PATCH /api/v2/cases/{case_id}`` — every field optional.\n\n``resolution_outcome`` / ``resolution_detail`` are only accepted alongside\na closing ``status`` (``resolved`` / ``abandoned``) — resolution fields ARE\nthe closure attestation, not free-floating edits.",
        "properties": {
          "primaryPackSlug": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primarypackslug"
          },
          "resolutionDetail": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object",
                "x-max-serialized-bytes": 8192
              },
              {
                "type": "null"
              }
            ],
            "description": "Free-form ground-truth detail about what happened — for example settled-at amount or denied-with-reason. The top-level key `decided_by` is reserved for the platform, which records it on a close it makes itself; a request that sets it is refused with 422.",
            "title": "Resolutiondetail"
          },
          "resolutionOutcome": {
            "anyOf": [
              {
                "maxLength": 32,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The real-world result, in your own words (up to 32 characters). The vocabulary is open — 'achieved', 'not_achieved', 'overtaken', and 'unknown' are the recommended values, and reporting groups by the exact value recorded, with 'achieved' counted as real-world success.",
            "title": "Resolutionoutcome"
          },
          "status": {
            "anyOf": [
              {
                "maxLength": 32,
                "pattern": "^(open|waiting_external|needs_human|resolved|abandoned)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "title": {
            "anyOf": [
              {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "title": "CaseUpdateRequest",
        "type": "object"
      },
      "CaseWatchRequest": {
        "additionalProperties": false,
        "description": "Body for starting a watch on a case.",
        "properties": {
          "userId": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who should watch the case. Defaults to you.",
            "title": "Userid"
          }
        },
        "title": "CaseWatchRequest",
        "type": "object"
      },
      "CaseWatcherList": {
        "description": "Everyone currently watching a case.\n\nWatching is separate from owning the work: someone on this list sees what\nhappens, and that is all it means.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CaseWatcherRead"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "viewer_is_watching": {
            "description": "Whether you are watching this case.",
            "title": "Viewer Is Watching",
            "type": "boolean"
          },
          "viewer_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your own id, so a surface can offer you the stop-watching action.",
            "title": "Viewer User Id"
          }
        },
        "required": [
          "items",
          "total",
          "viewer_is_watching"
        ],
        "title": "CaseWatcherList",
        "type": "object"
      },
      "CaseWatcherRead": {
        "description": "One person watching a case.",
        "properties": {
          "added_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who put them on the case — themselves, or a colleague.",
            "title": "Added By User Id"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The watcher's name, when we have one.",
            "title": "Display Name"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The watcher's email address.",
            "title": "Email"
          },
          "user_id": {
            "format": "uuid",
            "title": "User Id",
            "type": "string"
          },
          "watching_since": {
            "format": "date-time",
            "title": "Watching Since",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "watching_since"
        ],
        "title": "CaseWatcherRead",
        "type": "object"
      },
      "CatalogSegment": {
        "additionalProperties": false,
        "description": "The tenant's declared buyer segment (or null = no declaration).",
        "properties": {
          "segment": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "One of the pack-catalog buyer segments (see `valid_segments` on the GET response), or null to clear the declaration and restore the static catalog order.",
            "title": "Segment"
          }
        },
        "title": "CatalogSegment",
        "type": "object"
      },
      "CatalogSegmentRead": {
        "additionalProperties": false,
        "description": "GET/PUT response: the stored segment + the valid alphabet.\n\n``valid_segments`` is included so the admin UI can render the picker\nwithout hardcoding the taxonomy (source of truth:\n``velerian/products/agenticx/segments.py``).",
        "properties": {
          "segment": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "One of the pack-catalog buyer segments (see `valid_segments` on the GET response), or null to clear the declaration and restore the static catalog order.",
            "title": "Segment"
          },
          "valid_segments": {
            "description": "The accepted `segment` values, sorted.",
            "items": {
              "type": "string"
            },
            "title": "Valid Segments",
            "type": "array"
          }
        },
        "title": "CatalogSegmentRead",
        "type": "object"
      },
      "ChainBreakRead": {
        "description": "The first broken link in a tamper-detected chain.",
        "properties": {
          "actual": {
            "title": "Actual",
            "type": "string"
          },
          "entry_id": {
            "format": "uuid",
            "title": "Entry Id",
            "type": "string"
          },
          "expected": {
            "title": "Expected",
            "type": "string"
          },
          "position": {
            "title": "Position",
            "type": "integer"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "entry_id",
          "position",
          "reason",
          "expected",
          "actual"
        ],
        "title": "ChainBreakRead",
        "type": "object"
      },
      "ChannelIntakeResponse": {
        "description": "What the accepted message did.",
        "properties": {
          "caseId": {
            "format": "uuid",
            "title": "Caseid",
            "type": "string"
          },
          "caseRef": {
            "title": "Caseref",
            "type": "string"
          },
          "channel": {
            "title": "Channel",
            "type": "string"
          },
          "created": {
            "title": "Created",
            "type": "boolean"
          },
          "deduplicated": {
            "default": false,
            "title": "Deduplicated",
            "type": "boolean"
          },
          "joinedThread": {
            "default": false,
            "title": "Joinedthread",
            "type": "boolean"
          }
        },
        "required": [
          "channel",
          "caseId",
          "caseRef",
          "created"
        ],
        "title": "ChannelIntakeResponse",
        "type": "object"
      },
      "ClaimBinding": {
        "additionalProperties": false,
        "properties": {
          "baseline_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Baseline Sha256",
            "type": "string"
          },
          "claim_id": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Claim Id",
            "type": "string"
          },
          "claim_key": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Claim Key",
            "type": "string"
          },
          "payee_id": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Payee Id",
            "type": "string"
          },
          "payer_claim_control_number": {
            "anyOf": [
              {
                "maxLength": 128,
                "minLength": 1,
                "pattern": "^\\S(?:.*\\S)?$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payer Claim Control Number"
          },
          "payer_id": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Payer Id",
            "type": "string"
          }
        },
        "required": [
          "claim_key",
          "payer_id",
          "payee_id",
          "claim_id",
          "baseline_sha256"
        ],
        "title": "ClaimBinding",
        "type": "object"
      },
      "ClaimSweepRequest": {
        "additionalProperties": false,
        "description": "The batch to sweep and how.",
        "properties": {
          "as_of": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The date the batch is read as of; today when omitted.",
            "title": "As Of"
          },
          "authorization_records_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional: the hospital's authorization records, uploaded the same way.",
            "title": "Authorization Records Attachment Id"
          },
          "batch_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The batch, such as the practice's aging report, uploaded through /api/v2/run-attachments for this crew with no case. Required for a crew whose sweep reads one batch; a crew that sweeps payers' 835 files and worklists names those below instead.",
            "title": "Batch Attachment Id"
          },
          "crew_slug": {
            "description": "The claims crew to sweep for.",
            "maxLength": 64,
            "minLength": 1,
            "title": "Crew Slug",
            "type": "string"
          },
          "fee_schedule_attachment_ids": {
            "description": "Optional, for a crew that prices from a fee schedule: the one schedule, uploaded the same way. Each claim's case is given that schedule's rows for its payer. More than one is refused (more_than_one_fee_schedule): merge them into one file.",
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "title": "Fee Schedule Attachment Ids",
            "type": "array"
          },
          "remittance_835_attachment_ids": {
            "description": "Optional, for a crew that sweeps payers' 835 files: each file, uploaded the same way, in the order to read them. They are read together, and one the reader refuses refuses the whole sweep.",
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 20,
            "title": "Remittance 835 Attachment Ids",
            "type": "array"
          },
          "remittance_lines_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional: the remittance lines table, uploaded the same way.",
            "title": "Remittance Lines Attachment Id"
          },
          "submitted_claims_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional: the hospital's submitted-claims worklist, uploaded the same way.",
            "title": "Submitted Claims Attachment Id"
          },
          "synthetic": {
            "default": false,
            "description": "Open the cases as synthetic cases, for a rehearsal. Only an administrator in an internal development workspace may.",
            "title": "Synthetic",
            "type": "boolean"
          },
          "variance_worklist_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional: the hospital's variance worklist, uploaded the same way.",
            "title": "Variance Worklist Attachment Id"
          }
        },
        "required": [
          "crew_slug"
        ],
        "title": "ClaimSweepRequest",
        "type": "object"
      },
      "ClaimSweepResult": {
        "description": "The sweep's record: its status, its counts by disposition and each claim.",
        "properties": {
          "claims": {
            "items": {
              "$ref": "#/components/schemas/SweptClaimRead"
            },
            "title": "Claims",
            "type": "array"
          },
          "counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Counts",
            "type": "object"
          },
          "held_lines": {
            "default": 0,
            "description": "Remittance lines of claims the sweep held; filed on no case.",
            "title": "Held Lines",
            "type": "integer"
          },
          "items_total": {
            "title": "Items Total",
            "type": "integer"
          },
          "resumes_sweep_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resumes Sweep Id"
          },
          "review_items": {
            "description": "What the batch states that names no claim of it; the sweep is then completed_review.",
            "items": {
              "$ref": "#/components/schemas/SweepReviewRead"
            },
            "title": "Review Items",
            "type": "array"
          },
          "status": {
            "enum": [
              "completed",
              "partial",
              "completed_review"
            ],
            "title": "Status",
            "type": "string"
          },
          "sweep_id": {
            "format": "uuid",
            "title": "Sweep Id",
            "type": "string"
          },
          "unassigned_lines": {
            "description": "Remittance lines that name no claim on the batch; filed on no case.",
            "title": "Unassigned Lines",
            "type": "integer"
          }
        },
        "required": [
          "sweep_id",
          "status",
          "items_total",
          "counts",
          "unassigned_lines",
          "claims"
        ],
        "title": "ClaimSweepResult",
        "type": "object"
      },
      "ClauseSupport": {
        "description": "The regulatory obligations one governance check *supports*.\n\nMirrors the CTO-APPROVED ``docs/compliance/evidence-pack-clause-mapping.md``\ntable for this check's ``kind``: the EU AI Act / NIST AI RMF / ISO 42001\nobligations an enforced check helps a deployer evidence. The compatible\n``naic`` field is reserved and empty: no current registered control backs\nan insurer mapping. This is a **supports** mapping that equips a deployer's own\nassessment — NOT a certification or a statement of conformance. It\npresents the already-attested mapping; it asserts no new conformance claim. A\nframework with no traceable obligation for a check carries an empty list.",
        "properties": {
          "eu_ai_act": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Eu Ai Act",
            "type": "array"
          },
          "iso_42001": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Iso 42001",
            "type": "array"
          },
          "naic": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Naic",
            "type": "array"
          },
          "nist_ai_rmf": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Nist Ai Rmf",
            "type": "array"
          }
        },
        "title": "ClauseSupport",
        "type": "object"
      },
      "ClockDefinitionCreate": {
        "additionalProperties": false,
        "description": "A declarative deadline policy: where the deadline comes from, how long\nit runs, on which calendar, and where the warning zone begins.",
        "properties": {
          "active": {
            "default": true,
            "description": "Inactive policies are never instantiated (there is no delete).",
            "title": "Active",
            "type": "boolean"
          },
          "anchor_fields": {
            "anyOf": [
              {
                "items": {
                  "maxLength": 64,
                  "type": "string"
                },
                "maxItems": 8,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Record fields, in order of preference, holding the date the deadline actually runs from (e.g. remittance_date, denial_date). When the case's record states one, the clock starts there; when none is on record the clock counts from when the case opened and is shown as an estimate. A date with no time of day starts the clock at the end of that day in this policy's timezone; with no timezone set it starts at 00:00 UTC on that date. Omit to count from case open unless start_event=record requires confirmation.",
            "title": "Anchor Fields"
          },
          "applies_when": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/ClockFactCondition"
                },
                "type": "object",
                "x-max-serialized-bytes": 4096
              },
              {
                "type": "null"
              }
            ],
            "description": "Conditions on the case's own record that gate automatic instantiation, keyed by fact name (e.g. plan_type). A policy with conditions attaches only to cases whose record satisfies every one, so a deadline citing an authority never lands on a case the authority does not cover. Omit to attach to every case of the pack.",
            "title": "Applies When"
          },
          "calendar": {
            "default": "24x7",
            "description": "'24x7' counts every wall-clock second; 'business_days' counts only whole local weekdays Monday-Friday; 'business_days_sun_thu' counts only whole local weekdays Sunday-Thursday. The work-week calendars read the local day in this policy's timezone (UTC when unset).",
            "enum": [
              "24x7",
              "business_days",
              "business_days_sun_thu"
            ],
            "title": "Calendar",
            "type": "string"
          },
          "deadline_fields": {
            "anyOf": [
              {
                "items": {
                  "maxLength": 64,
                  "type": "string"
                },
                "maxItems": 8,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Record fields, in order of preference, holding the absolute date the deadline IS — a date the case record itself states (e.g. programme_arrival_deadline). When set, this policy takes its deadline from the record instead of counting the duration out on the calendar, and a case whose record states no such date gets NO clock rather than a made-up one. The duration is still used: it is the nominal window the warning threshold is a percent of. Omit for a duration-based deadline.",
            "title": "Deadline Fields"
          },
          "deadline_source": {
            "description": "'normative' (a statute or regulation — citation required), 'contractual' (a response-time commitment), or 'internal' (a self-imposed target).",
            "enum": [
              "normative",
              "contractual",
              "internal"
            ],
            "title": "Deadline Source",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "maxLength": 4000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "duration_seconds": {
            "description": "Deadline length in calendar seconds (per the calendar field).",
            "exclusiveMinimum": 0.0,
            "maximum": 316224000.0,
            "title": "Duration Seconds",
            "type": "integer"
          },
          "name": {
            "description": "Policy name, e.g. 'Payer appeal window'.",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "normative_citation": {
            "anyOf": [
              {
                "maxLength": 4000,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The law or regulation the deadline derives from. Required when deadline_source is 'normative'.",
            "title": "Normative Citation"
          },
          "pack_slug": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When set, every case opened for this pack automatically gets an instance of this policy. Omit for manual instantiation only.",
            "title": "Pack Slug"
          },
          "pauses_on_waiting_external": {
            "default": true,
            "description": "Whether instances pause while their case waits on the outside world. Set false for statutory windows that do not stop.",
            "title": "Pauses On Waiting External",
            "type": "boolean"
          },
          "start_event": {
            "anyOf": [
              {
                "enum": [
                  "case_opened",
                  "record"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Start intent: case_opened starts at case open; record requires a usable declared anchor date and remains estimated while its fields or date are missing. Omit/null preserves legacy case-open behavior without anchors; nonempty anchor_fields imply record intent. case_opened cannot have anchors.",
            "title": "Start Event"
          },
          "timezone": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "IANA time zone the work-week calendars count their local days in, e.g. 'Asia/Damascus'. Omit (or send blank) for UTC. A property of this policy — the contract or regulation it encodes — not of your workspace, so a Mon-Fri and a Sun-Thu policy in different zones coexist. The '24x7' calendar counts every second and does not use it to count, but under every calendar an anchor date with no time of day starts the clock when that day ends in this zone.",
            "title": "Timezone"
          },
          "warning_threshold_pct": {
            "default": 75,
            "description": "Percent of the duration elapsed at which the warning zone begins.",
            "maximum": 99.0,
            "minimum": 1.0,
            "title": "Warning Threshold Pct",
            "type": "integer"
          },
          "window_days_fields": {
            "anyOf": [
              {
                "items": {
                  "maxLength": 64,
                  "type": "string"
                },
                "maxItems": 8,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Record fields, in order of preference, holding the LENGTH of the window as a whole number of days on this policy's calendar (e.g. appeal_window_days, as the plan the case actually read states it). When the case's record states one, the deadline is counted over that many days instead of the duration; while the record states none the duration places the clock and it is shown as an estimate — never settled onto the policy's own number. Cannot be combined with deadline_fields. Omit to always count the duration.",
            "title": "Window Days Fields"
          }
        },
        "required": [
          "name",
          "deadline_source",
          "duration_seconds"
        ],
        "title": "ClockDefinitionCreate",
        "type": "object"
      },
      "ClockDefinitionList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ClockDefinitionRead"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "ClockDefinitionList",
        "type": "object"
      },
      "ClockDefinitionRead": {
        "description": "One deadline policy, as stored.",
        "properties": {
          "active": {
            "title": "Active",
            "type": "boolean"
          },
          "anchor_fields": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anchor Fields"
          },
          "applies_when": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Applies When"
          },
          "calendar": {
            "title": "Calendar",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By User Id"
          },
          "deadline_fields": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deadline Fields"
          },
          "deadline_source": {
            "title": "Deadline Source",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "duration_seconds": {
            "title": "Duration Seconds",
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "normative_citation": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Normative Citation"
          },
          "pack_default_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pack Default Key"
          },
          "pack_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pack Slug"
          },
          "pauses_on_waiting_external": {
            "title": "Pauses On Waiting External",
            "type": "boolean"
          },
          "start_event": {
            "anyOf": [
              {
                "enum": [
                  "case_opened",
                  "record"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Event"
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "IANA zone the work-week calendars count local days in; null means UTC.",
            "title": "Timezone"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "warning_threshold_pct": {
            "title": "Warning Threshold Pct",
            "type": "integer"
          },
          "window_days_fields": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Record fields holding the window length in days; null means the duration is the window.",
            "title": "Window Days Fields"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "pack_slug",
          "applies_when",
          "anchor_fields",
          "deadline_fields",
          "pack_default_key",
          "deadline_source",
          "normative_citation",
          "duration_seconds",
          "calendar",
          "pauses_on_waiting_external",
          "warning_threshold_pct",
          "active",
          "created_by_user_id",
          "created_at",
          "updated_at"
        ],
        "title": "ClockDefinitionRead",
        "type": "object"
      },
      "ClockDefinitionUpdate": {
        "additionalProperties": false,
        "description": "Edit a deadline policy. Every field optional; edits affect only future\ninstantiations — existing clocks keep the deadline they materialized.",
        "properties": {
          "active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Active"
          },
          "anchor_fields": {
            "anyOf": [
              {
                "items": {
                  "maxLength": 64,
                  "type": "string"
                },
                "maxItems": 8,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anchor Fields"
          },
          "applies_when": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/ClockFactCondition"
                },
                "type": "object",
                "x-max-serialized-bytes": 4096
              },
              {
                "type": "null"
              }
            ],
            "title": "Applies When"
          },
          "calendar": {
            "anyOf": [
              {
                "enum": [
                  "24x7",
                  "business_days",
                  "business_days_sun_thu"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Calendar"
          },
          "deadline_fields": {
            "anyOf": [
              {
                "items": {
                  "maxLength": 64,
                  "type": "string"
                },
                "maxItems": 8,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deadline Fields"
          },
          "deadline_source": {
            "anyOf": [
              {
                "enum": [
                  "normative",
                  "contractual",
                  "internal"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deadline Source"
          },
          "description": {
            "anyOf": [
              {
                "maxLength": 4000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "duration_seconds": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "maximum": 316224000.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Seconds"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "normative_citation": {
            "anyOf": [
              {
                "maxLength": 4000,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Normative Citation"
          },
          "pack_slug": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pack Slug"
          },
          "pauses_on_waiting_external": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pauses On Waiting External"
          },
          "start_event": {
            "anyOf": [
              {
                "enum": [
                  "case_opened",
                  "record"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Omit to leave intent unchanged; null restores legacy interpretation.",
            "title": "Start Event"
          },
          "timezone": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "IANA time zone the work-week calendars count their local days in, e.g. 'Asia/Damascus'. Omit (or send blank) for UTC. A property of this policy — the contract or regulation it encodes — not of your workspace, so a Mon-Fri and a Sun-Thu policy in different zones coexist. The '24x7' calendar counts every second and does not use it to count, but under every calendar an anchor date with no time of day starts the clock when that day ends in this zone. On an edit, omit to leave the zone alone; send null or an empty string to clear it back to UTC.",
            "title": "Timezone"
          },
          "warning_threshold_pct": {
            "anyOf": [
              {
                "maximum": 99.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Warning Threshold Pct"
          },
          "window_days_fields": {
            "anyOf": [
              {
                "items": {
                  "maxLength": 64,
                  "type": "string"
                },
                "maxItems": 8,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Window Days Fields"
          }
        },
        "title": "ClockDefinitionUpdate",
        "type": "object"
      },
      "ClockFactCondition": {
        "additionalProperties": false,
        "description": "One case-fact condition gating auto-instantiation: exactly one of\n``any_of`` (the fact must be present and match) or ``none_of`` (absent or\nnon-matching passes).",
        "properties": {
          "any_of": {
            "anyOf": [
              {
                "items": {
                  "maxLength": 128,
                  "type": "string"
                },
                "maxItems": 16,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "The case's record must state this fact, and its value must match one of these (case-insensitive). Use for policies that only apply when a fact is affirmatively on record — e.g. a regulation-backed deadline that applies only to the plan type the regulation covers.",
            "title": "Any Of"
          },
          "none_of": {
            "anyOf": [
              {
                "items": {
                  "maxLength": 128,
                  "type": "string"
                },
                "maxItems": 16,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Passes when the fact is absent or matches none of these (case-insensitive). Use for a fallback policy covering every case a scoped sibling policy does not.",
            "title": "None Of"
          }
        },
        "title": "ClockFactCondition",
        "type": "object"
      },
      "ClockFiringRead": {
        "description": "One automatic action taken when a clock entered a pre-deadline zone.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "description": "'agent_run' — a governed run automatically attempted to clear the blocker while time remained; 'escalation' — a work item was created for a teammate with what was tried and what is needed.",
            "title": "Kind",
            "type": "string"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Human-readable detail, e.g. why an automatic attempt was not possible.",
            "title": "Note"
          },
          "outcome": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How the action ended: 'succeeded' or 'failed' for a run, 'skipped_no_pack', 'skipped_no_actor', 'skipped_crew_on_hold' or 'skipped_exposure_policy' when no run was possible or allowed, 'escalated' for an escalation. Empty while a run is still executing.",
            "title": "Outcome"
          },
          "pack_run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The governed run the automatic attempt fired, when one ran.",
            "title": "Pack Run Id"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "work_item_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The work item the escalation created, when one was created.",
            "title": "Work Item Id"
          },
          "zone": {
            "description": "The zone ('warning' or 'breached') the clock was in when this fired.",
            "title": "Zone",
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "zone",
          "pack_run_id",
          "work_item_id",
          "outcome",
          "note",
          "created_at",
          "updated_at"
        ],
        "title": "ClockFiringRead",
        "type": "object"
      },
      "ClockSummaryResponse": {
        "description": "Aggregate deadline KPI response (see ``core/kpi/clock_summary``).",
        "properties": {
          "as_of": {
            "description": "UTC ISO-8601 timestamp the summary was computed at — also the instant the live-deadline zones were evaluated.",
            "title": "As Of",
            "type": "string"
          },
          "breach_rate_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "closed_breached / closed_clocks * 100 (2dp) — of the deadlines that concluded in-window, how many were missed. null when none concluded in-window.",
            "title": "Breach Rate Pct"
          },
          "closed_breached": {
            "description": "Concluded deadlines that were missed.",
            "title": "Closed Breached",
            "type": "integer"
          },
          "closed_clocks": {
            "description": "Deadlines concluded in-window — stamped met or missed when their case closed. The two buckets sum to this.",
            "title": "Closed Clocks",
            "type": "integer"
          },
          "closed_met": {
            "description": "Concluded deadlines that were met.",
            "title": "Closed Met",
            "type": "integer"
          },
          "near_breach_rate_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "(open_warning + open_breached) / open_clocks * 100 (2dp) — the live-exposure headline: the share of live deadlines needing attention now. null when there are no live deadlines (render 'no live deadlines', never '0%').",
            "title": "Near Breach Rate Pct"
          },
          "open_breached": {
            "description": "Live deadlines already past due while their case is still open.",
            "title": "Open Breached",
            "type": "integer"
          },
          "open_clocks": {
            "description": "Live deadlines (running or on hold) across all open cases right now. The three zone buckets sum to this.",
            "title": "Open Clocks",
            "type": "integer"
          },
          "open_ok": {
            "description": "Live deadlines comfortably inside their window.",
            "title": "Open Ok",
            "type": "integer"
          },
          "open_warning": {
            "description": "Live deadlines inside their warning zone — close to due.",
            "title": "Open Warning",
            "type": "integer"
          },
          "per_pack": {
            "description": "Per-pack rollup rows, worst exposure first (past-due, then warning, then volume), capped at `per_pack`.",
            "items": {
              "$ref": "#/components/schemas/PackClockRollupResponse"
            },
            "title": "Per Pack",
            "type": "array"
          },
          "unattributed_closed_clocks": {
            "default": 0,
            "description": "Concluded in-window deadlines on cases with no pack attribution.",
            "title": "Unattributed Closed Clocks",
            "type": "integer"
          },
          "unattributed_open_clocks": {
            "default": 0,
            "description": "Live deadlines on cases with no pack attribution — included in the totals above, reported here so the per-pack rows visibly don't sum to the totals when unattributed work exists.",
            "title": "Unattributed Open Clocks",
            "type": "integer"
          },
          "window_end": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Exclusive upper bound (UTC ISO-8601), or null when unbounded.",
            "title": "Window End"
          },
          "window_start": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Inclusive lower bound (UTC ISO-8601) applied to when concluded deadlines were stamped, or null when unbounded (no `since`). Live deadlines are never windowed — they are a point-in-time snapshot.",
            "title": "Window Start"
          }
        },
        "required": [
          "as_of",
          "open_clocks",
          "open_ok",
          "open_warning",
          "open_breached",
          "closed_clocks",
          "closed_met",
          "closed_breached"
        ],
        "title": "ClockSummaryResponse",
        "type": "object"
      },
      "ClockSweepResult": {
        "description": "What one pre-breach pass over your workspace's clocks did.",
        "properties": {
          "agent_runs_fired": {
            "description": "Governed runs fired to attempt clearing a warning-zone blocker.",
            "title": "Agent Runs Fired",
            "type": "integer"
          },
          "agent_runs_skipped": {
            "description": "Warning-zone attempts recorded as skipped (no pack or no eligible teammate).",
            "title": "Agent Runs Skipped",
            "type": "integer"
          },
          "escalations_created": {
            "description": "Typed work items created for clocks whose deadline needs a human.",
            "title": "Escalations Created",
            "type": "integer"
          },
          "examined": {
            "description": "Open clocks evaluated.",
            "title": "Examined",
            "type": "integer"
          },
          "in_breach": {
            "description": "Clocks currently past their effective deadline.",
            "title": "In Breach",
            "type": "integer"
          },
          "in_warning": {
            "description": "Clocks currently in their warning zone.",
            "title": "In Warning",
            "type": "integer"
          },
          "on_hold_runs_withheld": {
            "default": 0,
            "description": "Automatic attempts not started because the case's crew is on hold. Each is also counted as skipped, and its deadline is raised to a teammate.",
            "title": "On Hold Runs Withheld",
            "type": "integer"
          },
          "on_hold_watch_steps_kept_open": {
            "default": 0,
            "description": "Waiting steps of a crew on hold whose deadline has passed. The deadline is raised to a teammate; the step stays open because the crew cannot continue.",
            "title": "On Hold Watch Steps Kept Open",
            "type": "integer"
          }
        },
        "required": [
          "examined",
          "in_warning",
          "in_breach",
          "agent_runs_fired",
          "agent_runs_skipped",
          "escalations_created"
        ],
        "title": "ClockSweepResult",
        "type": "object"
      },
      "CognitoSyncStatus": {
        "description": "Best-effort outcome of the live Cognito IdP registration.\n\nSurfaced on create/update/delete responses so an admin can see whether the\nstored config was also registered on the live Cognito pool. NEVER carries\nsecret material — only a boolean attempt/ok plus a sanitized detail string.\nA failure here does NOT fail the request: the config of record is the\ndurable source of truth and a failed registration can be re-synced. ``None``\non a read (list) response — registration only happens on a write.",
        "properties": {
          "attempted": {
            "title": "Attempted",
            "type": "boolean"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "ok": {
            "title": "Ok",
            "type": "boolean"
          }
        },
        "required": [
          "attempted",
          "ok"
        ],
        "title": "CognitoSyncStatus",
        "type": "object"
      },
      "CompleteRequest": {
        "description": "Complete a pending work item. ``note`` records what the human did/decided.",
        "properties": {
          "note": {
            "anyOf": [
              {
                "maxLength": 4000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "shown_digest": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 64,
                "pattern": "^[0-9a-f]{64}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The digest of the approval card this person was shown (``card.digest`` on GET /work-items/{id}). Required to complete a step that has a card: a missing one is refused as card_not_shown, and one the card no longer matches as card_stale. Ignored for a step that has no card.",
            "title": "Shown Digest"
          }
        },
        "title": "CompleteRequest",
        "type": "object"
      },
      "CompleteSetItem": {
        "description": "One work item of a set approval, and the card digest the person was shown.",
        "properties": {
          "shown_digest": {
            "description": "The card digest shown for this item (``card.digest`` on GET /work-actions).",
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[0-9a-f]{64}$",
            "title": "Shown Digest",
            "type": "string"
          },
          "work_item_id": {
            "format": "uuid",
            "title": "Work Item Id",
            "type": "string"
          }
        },
        "required": [
          "work_item_id",
          "shown_digest"
        ],
        "title": "CompleteSetItem",
        "type": "object"
      },
      "CompleteSetRequest": {
        "description": "Approve up to 50 journey steps of one crew and step in one act.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CompleteSetItem"
            },
            "maxItems": 50,
            "minItems": 1,
            "title": "Items",
            "type": "array"
          },
          "note": {
            "anyOf": [
              {
                "maxLength": 4000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          }
        },
        "required": [
          "items"
        ],
        "title": "CompleteSetRequest",
        "type": "object"
      },
      "CompletionProofHoldRead": {
        "properties": {
          "code": {
            "maxLength": 160,
            "title": "Code",
            "type": "string"
          },
          "message": {
            "maxLength": 500,
            "title": "Message",
            "type": "string"
          },
          "requirement_id": {
            "maxLength": 160,
            "title": "Requirement Id",
            "type": "string"
          }
        },
        "required": [
          "requirement_id",
          "code",
          "message"
        ],
        "title": "CompletionProofHoldRead",
        "type": "object"
      },
      "CompletionProofPolicyRead": {
        "description": "Published proof qualifier; acquisition remains a separate state.",
        "properties": {
          "allowed_completion_methods": {
            "items": {
              "enum": [
                "human_attested",
                "connector_verified"
              ],
              "type": "string"
            },
            "title": "Allowed Completion Methods",
            "type": "array"
          },
          "contract": {
            "maxLength": 160,
            "minLength": 1,
            "title": "Contract",
            "type": "string"
          },
          "event_type": {
            "maxLength": 160,
            "minLength": 1,
            "title": "Event Type",
            "type": "string"
          },
          "revision": {
            "maxLength": 160,
            "minLength": 1,
            "title": "Revision",
            "type": "string"
          },
          "validator_version": {
            "maxLength": 160,
            "minLength": 1,
            "title": "Validator Version",
            "type": "string"
          }
        },
        "required": [
          "contract",
          "revision",
          "validator_version",
          "event_type",
          "allowed_completion_methods"
        ],
        "title": "CompletionProofPolicyRead",
        "type": "object"
      },
      "ComplianceReport": {
        "description": "One report row in the admin /reports response.\n\n``s3_key_json`` / ``s3_key_pdf`` are the keys (not URIs) so the\nfrontend can call the presigned-URL endpoint with the same shape\nlater. ``sign_off_state`` reflects whether the (tenant, kind, date)\ntriple has an entry in ``audit_signoffs`` — ``\"pending\"`` when not,\n``\"signed\"`` when yes. ``signed_by`` + ``signed_at`` populate only\nin the signed case.",
        "properties": {
          "as_of": {
            "description": "Report date (parsed from the S3 key).",
            "format": "date",
            "title": "As Of",
            "type": "string"
          },
          "generated_at": {
            "description": "S3 LastModified timestamp on the JSON object, in ISO-8601 UTC. This is when the writer Lambda finished, not the auditor-facing as_of (which is captured in `as_of`).",
            "title": "Generated At",
            "type": "string"
          },
          "kind": {
            "enum": [
              "access-review",
              "provisioning-audit"
            ],
            "title": "Kind",
            "type": "string"
          },
          "s3_key_json": {
            "title": "S3 Key Json",
            "type": "string"
          },
          "s3_key_pdf": {
            "title": "S3 Key Pdf",
            "type": "string"
          },
          "sign_off_state": {
            "default": "pending",
            "enum": [
              "pending",
              "signed"
            ],
            "title": "Sign Off State",
            "type": "string"
          },
          "signed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO-8601 timestamp of the signoff, or null when pending.",
            "title": "Signed At"
          },
          "signed_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Display name (or email fallback) of the user who signed off. Null when `sign_off_state == 'pending'`.",
            "title": "Signed By"
          }
        },
        "required": [
          "kind",
          "as_of",
          "s3_key_json",
          "s3_key_pdf",
          "generated_at"
        ],
        "title": "ComplianceReport",
        "type": "object"
      },
      "ComplianceReportList": {
        "properties": {
          "bucket": {
            "description": "The S3 bucket the artifacts were enumerated from.",
            "title": "Bucket",
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ComplianceReport"
            },
            "title": "Items",
            "type": "array"
          }
        },
        "required": [
          "items",
          "bucket"
        ],
        "title": "ComplianceReportList",
        "type": "object"
      },
      "ComputeExportDownload": {
        "properties": {
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "delivery": {
            "default": "presigned",
            "description": "'presigned': download_url is a short-lived direct link. 'stream': download_url is an API path that returns the file to an authenticated caller until expires_at.",
            "enum": [
              "presigned",
              "stream"
            ],
            "title": "Delivery",
            "type": "string"
          },
          "download_url": {
            "title": "Download Url",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          },
          "export_id": {
            "format": "uuid",
            "title": "Export Id",
            "type": "string"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "format": {
            "title": "Format",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "s3_key": {
            "title": "S3 Key",
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/ComputeExportIdentity"
          },
          "warnings": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/StructuredExportWarning"
            },
            "title": "Warnings",
            "type": "array"
          }
        },
        "required": [
          "source",
          "kind",
          "export_id",
          "format",
          "content_type",
          "filename",
          "s3_key",
          "download_url",
          "expires_at"
        ],
        "title": "ComputeExportDownload",
        "type": "object"
      },
      "ComputeExportIdentity": {
        "properties": {
          "case_id": {
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "completed_at": {
            "format": "date-time",
            "title": "Completed At",
            "type": "string"
          },
          "compute_run_id": {
            "format": "uuid",
            "title": "Compute Run Id",
            "type": "string"
          },
          "evidence_mode": {
            "default": "real",
            "description": "The case's evidence enrollment. 'synthetic': the computation ran on a synthetic case, which may hold simulated connector data; the saved file's name starts with SYNTHETIC-.",
            "enum": [
              "real",
              "synthetic"
            ],
            "title": "Evidence Mode",
            "type": "string"
          },
          "fact_id": {
            "format": "uuid",
            "title": "Fact Id",
            "type": "string"
          },
          "function_name": {
            "title": "Function Name",
            "type": "string"
          },
          "journey_id": {
            "format": "uuid",
            "title": "Journey Id",
            "type": "string"
          },
          "model_invocations": {
            "const": 0,
            "default": 0,
            "title": "Model Invocations",
            "type": "integer"
          },
          "output_sha256": {
            "title": "Output Sha256",
            "type": "string"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "predicate_fact_id": {
            "format": "uuid",
            "title": "Predicate Fact Id",
            "type": "string"
          },
          "schema_id": {
            "title": "Schema Id",
            "type": "string"
          },
          "source_type": {
            "const": "compute",
            "default": "compute",
            "title": "Source Type",
            "type": "string"
          },
          "stage_id": {
            "format": "uuid",
            "title": "Stage Id",
            "type": "string"
          },
          "stage_key": {
            "title": "Stage Key",
            "type": "string"
          },
          "stages_revision": {
            "title": "Stages Revision",
            "type": "string"
          }
        },
        "required": [
          "case_id",
          "journey_id",
          "stage_id",
          "compute_run_id",
          "fact_id",
          "predicate_fact_id",
          "pack_slug",
          "stages_revision",
          "stage_key",
          "function_name",
          "schema_id",
          "output_sha256",
          "completed_at"
        ],
        "title": "ComputeExportIdentity",
        "type": "object"
      },
      "ComputeExportList": {
        "properties": {
          "case_id": {
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "kinds": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/StructuredExportDescriptor"
            },
            "title": "Kinds",
            "type": "array"
          },
          "not_offered": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/StructuredExportNotOffered"
            },
            "title": "Not Offered",
            "type": "array"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "source": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ComputeExportIdentity"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "case_id"
        ],
        "title": "ComputeExportList",
        "type": "object"
      },
      "ComputedResultList": {
        "properties": {
          "basis": {
            "const": "current_recorded_computation",
            "default": "current_recorded_computation",
            "title": "Basis",
            "type": "string"
          },
          "case_id": {
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ComputedResultRead"
            },
            "title": "Items",
            "type": "array"
          },
          "next_offset": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Offset"
          },
          "supplied": {
            "description": "Facts a model step's platform reading recorded in code on entry to that step (for example each claim line's route, the rule that decided it and the codes it read). Listed on the first page only.",
            "items": {
              "$ref": "#/components/schemas/ComputedResultRead"
            },
            "title": "Supplied",
            "type": "array"
          },
          "truncated": {
            "default": false,
            "title": "Truncated",
            "type": "boolean"
          }
        },
        "required": [
          "case_id",
          "items"
        ],
        "title": "ComputedResultList",
        "type": "object"
      },
      "ComputedResultRead": {
        "properties": {
          "compute_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compute Ref"
          },
          "compute_run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compute Run Id"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "fact_id": {
            "format": "uuid",
            "title": "Fact Id",
            "type": "string"
          },
          "fact_key": {
            "title": "Fact Key",
            "type": "string"
          },
          "schema_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schema Id"
          },
          "stage_key": {
            "title": "Stage Key",
            "type": "string"
          },
          "status": {
            "enum": [
              "available",
              "unavailable",
              "too_large"
            ],
            "title": "Status",
            "type": "string"
          },
          "value": {
            "title": "Value"
          }
        },
        "required": [
          "fact_id",
          "fact_key",
          "stage_key",
          "created_at",
          "status"
        ],
        "title": "ComputedResultRead",
        "type": "object"
      },
      "ConfidenceFinding": {
        "description": "One per-finding confidence entry on a governed run.\n\nMirrors :class:`velerian.core.governance.output_confidence.ConfidenceFinding`:\nthe model's own assertion (``claim``), the confidence ``level`` it stated for\nit (``High`` | ``Medium`` | ``Low`` — ``Moderate`` is normalised to\n``Medium``), and an optional one-line ``rationale`` (the honest basis /\nuncertainty note). Honest by construction: only a level the model\nexplicitly asserted is ever present — nothing is inferred.",
        "properties": {
          "claim": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Claim"
          },
          "level": {
            "title": "Level",
            "type": "string"
          },
          "rationale": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rationale"
          }
        },
        "required": [
          "level"
        ],
        "title": "ConfidenceFinding",
        "type": "object"
      },
      "ConnectorCatalog": {
        "description": "Full catalog response: categories in a fixed display order + a total.",
        "properties": {
          "categories": {
            "description": "Connector categories in display order.",
            "items": {
              "$ref": "#/components/schemas/ConnectorCategory"
            },
            "title": "Categories",
            "type": "array"
          },
          "total": {
            "description": "Total number of connectors in the catalog. Each is built and switched on with the customer during onboarding.",
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "categories",
          "total"
        ],
        "title": "ConnectorCatalog",
        "type": "object"
      },
      "ConnectorCategory": {
        "description": "A named group of connectors.",
        "properties": {
          "category": {
            "description": "Category label.",
            "title": "Category",
            "type": "string"
          },
          "connectors": {
            "description": "Connectors in this category, sorted by display name.",
            "items": {
              "$ref": "#/components/schemas/ConnectorWire"
            },
            "title": "Connectors",
            "type": "array"
          }
        },
        "required": [
          "category",
          "connectors"
        ],
        "title": "ConnectorCategory",
        "type": "object"
      },
      "ConnectorWire": {
        "description": "One connector in the catalog response.",
        "properties": {
          "category": {
            "description": "Customer-facing category the connector belongs to.",
            "title": "Category",
            "type": "string"
          },
          "display_name": {
            "description": "Vendor brand name shown to the customer.",
            "title": "Display Name",
            "type": "string"
          },
          "slug": {
            "description": "Stable connector identifier (kebab-case).",
            "title": "Slug",
            "type": "string"
          },
          "status": {
            "description": "live: the connector has been proven against the vendor's sandbox or production system. planned: not yet proven. Either way, each connector is built and switched on with the customer during onboarding.",
            "enum": [
              "live",
              "planned"
            ],
            "title": "Status",
            "type": "string"
          },
          "supports_pull": {
            "description": "Technical inbound-support metadata. Customer scope and setup are agreed during onboarding.",
            "title": "Supports Pull",
            "type": "boolean"
          },
          "supports_push": {
            "description": "Technical outbound-support metadata. Customer scope and setup are agreed during onboarding.",
            "title": "Supports Push",
            "type": "boolean"
          }
        },
        "required": [
          "slug",
          "display_name",
          "category",
          "supports_push",
          "supports_pull",
          "status"
        ],
        "title": "ConnectorWire",
        "type": "object"
      },
      "ConstraintRead": {
        "description": "One governance constraint in the agent's effective set — facts only.",
        "properties": {
          "enforcement": {
            "description": "'strict' (fail-closed) or 'advisory'.",
            "title": "Enforcement",
            "type": "string"
          },
          "floorInjected": {
            "description": "True when the baseline governance floor injected this constraint.",
            "title": "Floorinjected",
            "type": "boolean"
          },
          "guardrailBacked": {
            "description": "True when a real Bedrock Guardrail backs this constraint (the raw guardrail id is never surfaced).",
            "title": "Guardrailbacked",
            "type": "boolean"
          },
          "kind": {
            "description": "The governance-constraint kind.",
            "title": "Kind",
            "type": "string"
          },
          "phase": {
            "description": "Runtime evaluation phase: 'pre_llm' or 'post_llm'.",
            "title": "Phase",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "enforcement",
          "phase",
          "floorInjected",
          "guardrailBacked"
        ],
        "title": "ConstraintRead",
        "type": "object"
      },
      "ConsumerRead": {
        "additionalProperties": false,
        "properties": {
          "accepted_run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accepted Run Id"
          },
          "binding": {
            "default": "unavailable",
            "enum": [
              "same_source",
              "different_source",
              "unavailable"
            ],
            "title": "Binding",
            "type": "string"
          },
          "carriage": {
            "default": "unknown",
            "enum": [
              "whole",
              "compact",
              "dropped",
              "unknown"
            ],
            "title": "Carriage",
            "type": "string"
          },
          "consumed_fact_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Consumed Fact Id"
          },
          "fact_key": {
            "title": "Fact Key",
            "type": "string"
          },
          "reason": {
            "anyOf": [
              {
                "enum": [
                  "not_accepted",
                  "carriage_not_whole",
                  "source_unverified"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "reference_fact_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference Fact Id"
          },
          "source_value_sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Value Sha256"
          },
          "stage_id": {
            "format": "uuid",
            "title": "Stage Id",
            "type": "string"
          },
          "stage_key": {
            "title": "Stage Key",
            "type": "string"
          }
        },
        "required": [
          "stage_id",
          "stage_key",
          "fact_key"
        ],
        "title": "ConsumerRead",
        "type": "object"
      },
      "ConsumptionRead": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "evidence_mode": {
            "enum": [
              "real",
              "synthetic"
            ],
            "title": "Evidence Mode",
            "type": "string"
          },
          "exception": {
            "title": "Exception",
            "type": "boolean"
          },
          "journey_id": {
            "format": "uuid",
            "title": "Journey Id",
            "type": "string"
          },
          "stage_id": {
            "format": "uuid",
            "title": "Stage Id",
            "type": "string"
          },
          "validation_id": {
            "format": "uuid",
            "title": "Validation Id",
            "type": "string"
          }
        },
        "required": [
          "journey_id",
          "stage_id",
          "validation_id",
          "evidence_mode",
          "created_at",
          "exception"
        ],
        "title": "ConsumptionRead",
        "type": "object"
      },
      "ContinuationRead": {
        "properties": {
          "attempts": {
            "title": "Attempts",
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "last_error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error Code"
          },
          "status": {
            "enum": [
              "pending",
              "delivered",
              "obsolete",
              "blocked"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "attempts"
        ],
        "title": "ContinuationRead",
        "type": "object"
      },
      "ContractConfirm": {
        "additionalProperties": false,
        "properties": {
          "expected_mapping_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[0-9a-f]{64}$",
            "title": "Expected Mapping Sha256",
            "type": "string"
          },
          "expected_payload_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[0-9a-f]{64}$",
            "title": "Expected Payload Sha256",
            "type": "string"
          },
          "expected_source_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[0-9a-f]{64}$",
            "title": "Expected Source Sha256",
            "type": "string"
          },
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "target_record_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Record Id"
          }
        },
        "required": [
          "expected_source_sha256",
          "expected_mapping_sha256",
          "expected_payload_sha256",
          "name"
        ],
        "title": "ContractConfirm",
        "type": "object"
      },
      "CorrectedField": {
        "additionalProperties": false,
        "properties": {
          "corrected": {
            "maxLength": 512,
            "minLength": 1,
            "title": "Corrected",
            "type": "string"
          },
          "field": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Field",
            "type": "string"
          },
          "original": {
            "anyOf": [
              {
                "maxLength": 512,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Original"
          }
        },
        "required": [
          "field",
          "original",
          "corrected"
        ],
        "title": "CorrectedField",
        "type": "object"
      },
      "CreateBlueprintRequest": {
        "description": "Request body for ``POST /api/v2/organizations/{org_id}/blueprints``.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 4000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Slug",
            "type": "string"
          },
          "spec": {
            "$ref": "#/components/schemas/BlueprintSpec"
          },
          "status": {
            "default": "active",
            "enum": [
              "draft",
              "active",
              "archived"
            ],
            "title": "Status",
            "type": "string"
          },
          "version": {
            "anyOf": [
              {
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          }
        },
        "required": [
          "slug",
          "name",
          "spec"
        ],
        "title": "CreateBlueprintRequest",
        "type": "object"
      },
      "CrewGrant": {
        "description": "One crew's grant to a workspace.",
        "properties": {
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "tier": {
            "title": "Tier",
            "type": "string"
          },
          "valid_from": {
            "format": "date-time",
            "title": "Valid From",
            "type": "string"
          },
          "valid_until": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When access ends; null while it is open.",
            "title": "Valid Until"
          }
        },
        "required": [
          "tenant_id",
          "pack_slug",
          "tier",
          "valid_from",
          "valid_until"
        ],
        "title": "CrewGrant",
        "type": "object"
      },
      "CrewLimitRead": {
        "description": "One limit this workspace may set for the crew.",
        "properties": {
          "default": {
            "description": "The crew's own number, used when this workspace sets none.",
            "title": "Default",
            "type": "integer"
          },
          "effective": {
            "description": "The number the crew uses now.",
            "title": "Effective",
            "type": "integer"
          },
          "max": {
            "description": "The largest number this workspace may set.",
            "title": "Max",
            "type": "integer"
          },
          "min": {
            "description": "The smallest number this workspace may set.",
            "title": "Min",
            "type": "integer"
          },
          "value": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "This workspace's own number, or null for the crew's default.",
            "title": "Value"
          }
        },
        "required": [
          "default",
          "min",
          "max",
          "effective"
        ],
        "title": "CrewLimitRead",
        "type": "object"
      },
      "CrewRecoveryCensus": {
        "description": "One crew's unfinished journeys in the census.",
        "properties": {
          "active_examined": {
            "default": 0,
            "title": "Active Examined",
            "type": "integer"
          },
          "halted_examined": {
            "default": 0,
            "title": "Halted Examined",
            "type": "integer"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "paused_examined": {
            "default": 0,
            "title": "Paused Examined",
            "type": "integer"
          },
          "stranded_active": {
            "default": 0,
            "title": "Stranded Active",
            "type": "integer"
          },
          "stranded_halted": {
            "default": 0,
            "title": "Stranded Halted",
            "type": "integer"
          },
          "stranded_paused": {
            "default": 0,
            "title": "Stranded Paused",
            "type": "integer"
          }
        },
        "required": [
          "pack_slug"
        ],
        "title": "CrewRecoveryCensus",
        "type": "object"
      },
      "CrewRevocation": {
        "additionalProperties": false,
        "description": "Why a crew's grant ends. Sent in the body, so it stays out of access logs.",
        "properties": {
          "reason": {
            "description": "Why access ends, for example that the client's agreement ended.",
            "maxLength": 500,
            "minLength": 1,
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "reason"
        ],
        "title": "CrewRevocation",
        "type": "object"
      },
      "DataContractFieldRead": {
        "description": "One named data point inside a contract entry.",
        "properties": {
          "name": {
            "description": "Customer-facing name of the data point.",
            "title": "Name",
            "type": "string"
          },
          "required": {
            "description": "Whether the pack needs this data point to complete its work (false = the work proceeds with stated limitations).",
            "title": "Required",
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "required"
        ],
        "title": "DataContractFieldRead",
        "type": "object"
      },
      "DataContractSourceRead": {
        "description": "One way a declared datum can arrive.",
        "properties": {
          "connector_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Vendor slug for connector sources; null for other kinds.",
            "title": "Connector Id"
          },
          "content_type_hints": {
            "description": "MIME types this datum is expected to arrive as. Advisory only — a content type never recognizes a datum on its own. Upload sources only.",
            "items": {
              "type": "string"
            },
            "title": "Content Type Hints",
            "type": "array"
          },
          "filename_hints": {
            "description": "Case-insensitive words that recognize this datum among attached filenames, matched on word boundaries. Upload sources only, and the only signal that recognizes a datum.",
            "items": {
              "type": "string"
            },
            "title": "Filename Hints",
            "type": "array"
          },
          "kind": {
            "description": "Source type: connector | tenant_store | upload | manual.",
            "title": "Kind",
            "type": "string"
          },
          "live": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "For connector sources: true when the platform's connector for this vendor has been proven against the vendor's sandbox or production system; false while it is planned. It does not mean the connector is connected or running for any workspace: every connector is built and switched on with the customer during onboarding. Derived from the connector catalog, never declared per pack. Null for non-connector kinds.",
            "title": "Live"
          }
        },
        "required": [
          "kind"
        ],
        "title": "DataContractSourceRead",
        "type": "object"
      },
      "DataRequirementRead": {
        "description": "One named datum the pack needs to run end-to-end.\n\nMirrors a pack manifest's ``data_requirements`` entry; each connector\nsource carries the code-level ``live`` flag, derived from the connector\nregistry at read time.",
        "properties": {
          "cardinality": {
            "description": "per_case | per_run | tenant_standing.",
            "title": "Cardinality",
            "type": "string"
          },
          "completion_proof": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CompletionProofPolicyRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "description": "What the datum is, in the pack persona's working vocabulary.",
            "title": "Description",
            "type": "string"
          },
          "entity_kind": {
            "description": "Closed platform entity vocabulary (e.g. remittance_835).",
            "title": "Entity Kind",
            "type": "string"
          },
          "fields": {
            "description": "Named data points inside the entity, required or optional.",
            "items": {
              "$ref": "#/components/schemas/DataContractFieldRead"
            },
            "title": "Fields",
            "type": "array"
          },
          "id": {
            "description": "Stable kebab-case id, unique within the pack.",
            "title": "Id",
            "type": "string"
          },
          "label": {
            "description": "Customer-facing name of the datum.",
            "title": "Label",
            "type": "string"
          },
          "load_bearing": {
            "description": "Whether the pack's work cannot proceed at all without this datum. False means the work proceeds with stated limitations when it is absent; true means a journey waits for it before any stage runs. Independent of cardinality, which says how often the datum recurs, not how much rides on it.",
            "title": "Load Bearing",
            "type": "boolean"
          },
          "sources": {
            "description": "ORDERED acquisition paths — order is the resolution preference.",
            "items": {
              "$ref": "#/components/schemas/DataContractSourceRead"
            },
            "title": "Sources",
            "type": "array"
          },
          "why_needed": {
            "description": "Which conclusions are limited when this datum is absent.",
            "title": "Why Needed",
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "description",
          "why_needed",
          "entity_kind",
          "cardinality",
          "load_bearing",
          "sources"
        ],
        "title": "DataRequirementRead",
        "type": "object"
      },
      "DecideResponse": {
        "description": "Decision result + (on approve) the resumed-invocation outcome.",
        "properties": {
          "approval": {
            "$ref": "#/components/schemas/velerian__api__routers__approvals__ApprovalRead"
          },
          "resume": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ResumeResult"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "approval"
        ],
        "title": "DecideResponse",
        "type": "object"
      },
      "DecisionChoices": {
        "description": "The choices open today on an item closed by a decision.",
        "properties": {
          "can_file": {
            "description": "Whether the claim can be filed now.",
            "title": "Can File",
            "type": "boolean"
          },
          "close_reasons": {
            "description": "The close reasons that apply today.",
            "items": {
              "type": "string"
            },
            "title": "Close Reasons",
            "type": "array"
          },
          "look_again": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LookAgainRange"
              },
              {
                "type": "null"
              }
            ],
            "description": "The days a person may look again on; null when no day is left."
          },
          "newer_answer_on": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The day a later sweep brought the claim a newer payer's answer, after this item was raised; null when none did. Filing now, or looking again on a later day, starts a round that reads it.",
            "title": "Newer Answer On"
          },
          "newer_files_since": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The day newer files for this claim arrived that no round has read; null when none wait. While a day is left to look again, closing waits for a round to read them.",
            "title": "Newer Files Since"
          },
          "unavailable": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DecisionUnavailable"
              },
              {
                "type": "null"
              }
            ],
            "description": "When a choice is not open: why, as the refusal a decision would get. Today only send_outcome_required, while a submission's outcome is not recorded: looking again and filing wait for it, and closing stays open."
          }
        },
        "required": [
          "look_again",
          "close_reasons",
          "can_file"
        ],
        "title": "DecisionChoices",
        "type": "object"
      },
      "DecisionUnavailable": {
        "description": "Why no choice is open on the item.",
        "properties": {
          "error": {
            "description": "The refusal's stable code.",
            "title": "Error",
            "type": "string"
          },
          "message": {
            "description": "One plain sentence saying why.",
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "error",
          "message"
        ],
        "title": "DecisionUnavailable",
        "type": "object"
      },
      "DeclaredHumanGateRead": {
        "description": "One declared human handoff in a workflow step.\n\nA workflow fact the pack's author states because enforcement cannot\nsee it — where the work waits on an outside party, a missing input,\na named human function, or a person moving data by hand.",
        "properties": {
          "kind": {
            "description": "Gate type: external_response (waits on an outside party's answer), missing_input (a named input gap only a person can resolve), route_to_specialist (a decision routed to a named human function), or data_movement (a person carries data in or out by hand until the connection to that system is set up at onboarding).",
            "title": "Kind",
            "type": "string"
          },
          "label": {
            "description": "Short name of the handoff.",
            "title": "Label",
            "type": "string"
          },
          "what_the_human_does": {
            "description": "What the person actually does at this handoff.",
            "title": "What The Human Does",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "label",
          "what_the_human_does"
        ],
        "title": "DeclaredHumanGateRead",
        "type": "object"
      },
      "DeclineRequest": {
        "description": "Decline a pending work item. The reason is MANDATORY — a decline\nwithout a reason teaches the worklist nothing.",
        "properties": {
          "reason": {
            "maxLength": 4000,
            "minLength": 1,
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "reason"
        ],
        "title": "DeclineRequest",
        "type": "object"
      },
      "DeliveryCreate": {
        "additionalProperties": false,
        "properties": {
          "mapping": {
            "additionalProperties": true,
            "title": "Mapping",
            "type": "object",
            "x-max-serialized-bytes": 4096
          },
          "placement_attachment_id": {
            "format": "uuid",
            "title": "Placement Attachment Id",
            "type": "string"
          },
          "placement_configuration": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PlacementConfiguration"
              },
              {
                "type": "null"
              }
            ]
          },
          "remittance_attachment_ids": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 20,
            "title": "Remittance Attachment Ids",
            "type": "array"
          },
          "source": {
            "$ref": "#/components/schemas/DeliverySource"
          }
        },
        "required": [
          "source",
          "mapping",
          "placement_attachment_id"
        ],
        "title": "DeliveryCreate",
        "type": "object"
      },
      "DeliverySource": {
        "additionalProperties": false,
        "properties": {
          "delivery_id": {
            "maxLength": 256,
            "minLength": 1,
            "title": "Delivery Id",
            "type": "string"
          },
          "placement_id": {
            "maxLength": 256,
            "minLength": 1,
            "title": "Placement Id",
            "type": "string"
          },
          "provider_org_id": {
            "maxLength": 256,
            "minLength": 1,
            "title": "Provider Org Id",
            "type": "string"
          },
          "source_revision": {
            "maxLength": 256,
            "minLength": 1,
            "title": "Source Revision",
            "type": "string"
          },
          "source_system": {
            "maxLength": 256,
            "minLength": 1,
            "title": "Source System",
            "type": "string"
          }
        },
        "required": [
          "source_system",
          "provider_org_id",
          "placement_id",
          "delivery_id",
          "source_revision"
        ],
        "title": "DeliverySource",
        "type": "object"
      },
      "DemoRequestCreate": {
        "description": "A public contact / demo-request submission body.\n\nBusiness-contact fields only — never credentials or payment. ``work_email``\nis validated as an email address; the free-text fields are trimmed +\nlength-capped server-side.",
        "properties": {
          "company": {
            "description": "The prospect's company / organization. Required, non-empty (trimmed).",
            "maxLength": 160,
            "minLength": 1,
            "title": "Company",
            "type": "string"
          },
          "context": {
            "anyOf": [
              {
                "maxLength": 512,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional page/route the request was submitted from (the current pathname), auto-captured by the client to help triage.",
            "title": "Context"
          },
          "name": {
            "description": "The prospect's name. Required, non-empty (trimmed).",
            "maxLength": 120,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "use_case": {
            "description": "What the prospect is trying to get done — the use case they want to put live. Required, non-empty (trimmed).",
            "maxLength": 4000,
            "minLength": 1,
            "title": "Use Case",
            "type": "string"
          },
          "work_email": {
            "description": "The prospect's work email address (validated).",
            "format": "email",
            "title": "Work Email",
            "type": "string"
          }
        },
        "required": [
          "name",
          "company",
          "work_email",
          "use_case"
        ],
        "title": "DemoRequestCreate",
        "type": "object"
      },
      "DemoRequestResult": {
        "description": "The outcome of a contact / demo-request submission.\n\nDiscriminated by ``channel``:\n\n- ``ticket`` — the request was recorded for the team; ``reference``\n  carries its human-facing key and ``support_email`` is omitted.\n- ``email`` — the request could not be filed here; ``support_email`` carries\n  the address to reach a human directly and ``reference`` is omitted.\n\n``ack_sent`` reports whether the auto-acknowledgement email was delivered\n(``false`` while SES sending is dark, or when it could not be sent) — the\non-page confirmation is the immediate acknowledgement either way.",
        "properties": {
          "ack_sent": {
            "default": false,
            "description": "True iff the auto-acknowledgement email was delivered to the prospect.",
            "title": "Ack Sent",
            "type": "boolean"
          },
          "channel": {
            "description": "The channel used: 'ticket' | 'email'.",
            "title": "Channel",
            "type": "string"
          },
          "ok": {
            "description": "True iff the request was filed to the funnel.",
            "title": "Ok",
            "type": "boolean"
          },
          "reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The filed ticket's human-facing reference (ticket channel only).",
            "title": "Reference"
          },
          "support_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The address to email a human directly (email-fallback channel only).",
            "title": "Support Email"
          }
        },
        "required": [
          "ok",
          "channel"
        ],
        "title": "DemoRequestResult",
        "type": "object"
      },
      "DerivationRead": {
        "description": "One rule-proposal run over one policy document.",
        "properties": {
          "attachment_id": {
            "format": "uuid",
            "title": "Attachment Id",
            "type": "string"
          },
          "candidate_count": {
            "description": "How many rule proposals were stored for review.",
            "title": "Candidate Count",
            "type": "integer"
          },
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "error_detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the run failed, when it did; null otherwise.",
            "title": "Error Detail"
          },
          "evidence_record_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The id of the reading's sealed record, for GET /api/v2/evidence-records/{id}. Read it from this run's status record once the reading is complete; null when the reading has no sealed record.",
            "title": "Evidence Record Id"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The model that read the document.",
            "title": "Model Id"
          },
          "prompt_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The reading-instructions version used.",
            "title": "Prompt Version"
          },
          "status": {
            "description": "How the run went: 'running' (in progress), 'succeeded' (proposals ready for review), 'no_rules_found' (the document was read but contained no operating rules), or 'failed'.",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "attachment_id",
          "status",
          "candidate_count",
          "model_id",
          "prompt_version",
          "error_detail",
          "created_at",
          "completed_at"
        ],
        "title": "DerivationRead",
        "type": "object"
      },
      "DerivationSummary": {
        "description": "The latest rule-proposal attempt for one policy document.\n\n``null`` on a document no derivation has ever read.",
        "properties": {
          "candidate_count": {
            "description": "How many rules the attempt proposed for review.",
            "title": "Candidate Count",
            "type": "integer"
          },
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "status": {
            "description": "How the latest rule-proposal attempt went: pending, running, succeeded, failed, or no_rules_found.",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "candidate_count",
          "created_at",
          "completed_at"
        ],
        "title": "DerivationSummary",
        "type": "object"
      },
      "DerivedFromRead": {
        "description": "A policy document one of this scope's rules was derived from.",
        "properties": {
          "attachment_id": {
            "description": "The policy-library document id.",
            "title": "Attachment Id",
            "type": "string"
          },
          "filename": {
            "description": "The document's file name (for display).",
            "title": "Filename",
            "type": "string"
          }
        },
        "required": [
          "attachment_id",
          "filename"
        ],
        "title": "DerivedFromRead",
        "type": "object"
      },
      "DerivedGateRead": {
        "description": "One enforcement-backed gate in a workflow step.\n\nDerived from the pack's declared governance — the same checks a real\nrun evaluates — never hand-written: approval (a reviewer signs off\nbefore the work proceeds), withhold (non-conforming output is held\nbefore it reaches you), or flag_review (findings are flagged for a\nperson to review afterwards).",
        "properties": {
          "detail": {
            "description": "What the underlying safeguard actually enforces.",
            "title": "Detail",
            "type": "string"
          },
          "kind": {
            "description": "Gate type: approval, withhold, or flag_review.",
            "title": "Kind",
            "type": "string"
          },
          "label": {
            "description": "Short name of the gate class.",
            "title": "Label",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "label",
          "detail"
        ],
        "title": "DerivedGateRead",
        "type": "object"
      },
      "DualControlProgress": {
        "description": "Dual-control progress for one invocation's HUMAN_APPROVAL gates.\n\n``gates_total`` is the number of gate rows the run enqueued (a withhold\nenqueues one row per declared gate, atomically). ``fully_approved`` is True iff EVERY gate is approved — i.e.\n``gates_approved == gates_total`` and ``gates_total > 0`` — the signal that\ndual control is satisfied and the invocation can proceed.",
        "properties": {
          "fully_approved": {
            "title": "Fully Approved",
            "type": "boolean"
          },
          "gates_approved": {
            "title": "Gates Approved",
            "type": "integer"
          },
          "gates_pending": {
            "title": "Gates Pending",
            "type": "integer"
          },
          "gates_rejected": {
            "title": "Gates Rejected",
            "type": "integer"
          },
          "gates_total": {
            "title": "Gates Total",
            "type": "integer"
          }
        },
        "required": [
          "gates_total",
          "gates_approved",
          "gates_pending",
          "gates_rejected",
          "fully_approved"
        ],
        "title": "DualControlProgress",
        "type": "object"
      },
      "EmailChangeConfirm": {
        "description": "Prove the new address with the code sent to it.",
        "properties": {
          "change_id": {
            "description": "The change's id.",
            "format": "uuid",
            "title": "Change Id",
            "type": "string"
          },
          "code": {
            "description": "The code sent to it.",
            "maxLength": 16,
            "minLength": 1,
            "title": "Code",
            "type": "string"
          },
          "new_email": {
            "description": "The address the change names.",
            "format": "email",
            "title": "New Email",
            "type": "string"
          }
        },
        "required": [
          "change_id",
          "new_email",
          "code"
        ],
        "title": "EmailChangeConfirm",
        "type": "object"
      },
      "EmailChangeConfirmed": {
        "description": "The account's sign-in and recovery address is now the new one.",
        "properties": {
          "email": {
            "title": "Email",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "title": "EmailChangeConfirmed",
        "type": "object"
      },
      "EmailChangeStart": {
        "description": "The address to change to.",
        "properties": {
          "new_email": {
            "description": "The new sign-in and recovery address.",
            "format": "email",
            "title": "New Email",
            "type": "string"
          }
        },
        "required": [
          "new_email"
        ],
        "title": "EmailChangeStart",
        "type": "object"
      },
      "EmailChangeStarted": {
        "description": "The open change; the code went to the new address.",
        "properties": {
          "change_id": {
            "description": "The change's id, sent back with the code.",
            "format": "uuid",
            "title": "Change Id",
            "type": "string"
          },
          "expires_at": {
            "description": "When the code stops working.",
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          }
        },
        "required": [
          "change_id",
          "expires_at"
        ],
        "title": "EmailChangeStarted",
        "type": "object"
      },
      "EraseRequest": {
        "description": "Admin erasure request body.",
        "properties": {
          "reason": {
            "anyOf": [
              {
                "enum": [
                  "subject_request",
                  "consent_withdrawn",
                  "account_closed",
                  "unlawful_processing",
                  "legal_obligation",
                  "admin_cleanup"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional structured erasure reason code recorded in the audit payload.",
            "title": "Reason"
          },
          "subject_user_id": {
            "description": "The data subject to erase.",
            "format": "uuid",
            "title": "Subject User Id",
            "type": "string"
          }
        },
        "required": [
          "subject_user_id"
        ],
        "title": "EraseRequest",
        "type": "object"
      },
      "EraseResponse": {
        "description": "Admin erasure result envelope (counts/booleans — no PII).",
        "properties": {
          "already_erased": {
            "title": "Already Erased",
            "type": "boolean"
          },
          "invitations_erased": {
            "default": 0,
            "title": "Invitations Erased",
            "type": "integer"
          },
          "notifications_anonymized": {
            "title": "Notifications Anonymized",
            "type": "integer"
          },
          "preferences_reset": {
            "title": "Preferences Reset",
            "type": "integer"
          },
          "request_id": {
            "format": "uuid",
            "title": "Request Id",
            "type": "string"
          },
          "scim_users_erased": {
            "default": 0,
            "title": "Scim Users Erased",
            "type": "integer"
          },
          "subject_user_id": {
            "format": "uuid",
            "title": "Subject User Id",
            "type": "string"
          },
          "user_tombstoned": {
            "title": "User Tombstoned",
            "type": "boolean"
          }
        },
        "required": [
          "request_id",
          "subject_user_id",
          "already_erased",
          "user_tombstoned",
          "preferences_reset",
          "notifications_anonymized"
        ],
        "title": "EraseResponse",
        "type": "object"
      },
      "EscalationCreate": {
        "description": "The typed escalation contract — every field is load-bearing.\n\n``case_id`` + at least one run ref (``pack_run_id`` / ``invocation_id``)\nanchor the escalation to the work it interrupts; the mandatory trio makes a\n\"naked escalation\" (an agent shrugging) unrepresentable.",
        "properties": {
          "case_id": {
            "description": "The case this escalation interrupts.",
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "context": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object",
                "x-max-serialized-bytes": 8192
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional typed context beyond the contract trio (payload excerpts, links). Never a substitute for the mandatory fields.",
            "title": "Context"
          },
          "invocation_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Run-lineage key for ABP invocations. At least one of pack_run_id / invocation_id is required.",
            "title": "Invocation Id"
          },
          "pack_run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The governed run that escalated (pack_runs.id). At least one of pack_run_id / invocation_id is required.",
            "title": "Pack Run Id"
          },
          "what_is_needed": {
            "description": "The specific human input needed to unblock. Mandatory, non-empty.",
            "maxLength": 4000,
            "minLength": 1,
            "title": "What Is Needed",
            "type": "string"
          },
          "what_was_tried": {
            "description": "What the agent attempted before escalating. Mandatory, non-empty.",
            "maxLength": 4000,
            "minLength": 1,
            "title": "What Was Tried",
            "type": "string"
          },
          "why_escalated": {
            "description": "Why a human is needed: 'capability' (the agent cannot do it), 'policy' (a rule forbids it), or 'uncertainty' (not confident enough to proceed). Closed set.",
            "enum": [
              "capability",
              "policy",
              "uncertainty"
            ],
            "title": "Why Escalated",
            "type": "string"
          }
        },
        "required": [
          "case_id",
          "what_was_tried",
          "why_escalated",
          "what_is_needed"
        ],
        "title": "EscalationCreate",
        "type": "object"
      },
      "EstateConductFilters": {
        "description": "The filters actually applied to a rollup read.\n\nEchoed back so the UI can render the active filter state (and confirm the\nserver interpreted the request as expected). ``None`` / empty means the axis\nwas not constrained. Dates are ISO date strings (``YYYY-MM-DD``); when a\ndate window is given it bounds the WHOLE rollup (totals + by-pack + flagged +\ntrend) and ``trend_window_days`` is null because the window — not the\ntrailing-day count — defines the trend span.",
        "properties": {
          "end_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Date"
          },
          "outcomes": {
            "items": {
              "type": "string"
            },
            "title": "Outcomes",
            "type": "array"
          },
          "pack_slugs": {
            "items": {
              "type": "string"
            },
            "title": "Pack Slugs",
            "type": "array"
          },
          "start_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Date"
          }
        },
        "title": "EstateConductFilters",
        "type": "object"
      },
      "EstateConductSummary": {
        "description": "The tenant's estate-level conduct-risk rollup.\n\nThe aggregate over the tenant's whole run history (RLS-scoped): outcome\ntotals, a per-pack breakdown, the most recent flagged runs, and a daily\noutcome trend over a trailing window. Operational and factual; it carries no\nregulatory-conformance claim.",
        "properties": {
          "by_pack": {
            "items": {
              "$ref": "#/components/schemas/EstatePackBreakdown"
            },
            "title": "By Pack",
            "type": "array"
          },
          "filters": {
            "$ref": "#/components/schemas/EstateConductFilters"
          },
          "recent_flagged": {
            "items": {
              "$ref": "#/components/schemas/EstateFlaggedRun"
            },
            "title": "Recent Flagged",
            "type": "array"
          },
          "totals": {
            "$ref": "#/components/schemas/EstateOutcomeTotals"
          },
          "trend": {
            "items": {
              "$ref": "#/components/schemas/EstateTrendBucket"
            },
            "title": "Trend",
            "type": "array"
          },
          "trend_window_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trend Window Days"
          }
        },
        "required": [
          "totals",
          "by_pack",
          "recent_flagged",
          "trend",
          "trend_window_days",
          "filters"
        ],
        "title": "EstateConductSummary",
        "type": "object"
      },
      "EstateFlaggedRun": {
        "description": "One recent flagged run (failed or escalated), newest first.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "outcome": {
            "title": "Outcome",
            "type": "string"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          }
        },
        "required": [
          "id",
          "pack_slug",
          "outcome",
          "created_at"
        ],
        "title": "EstateFlaggedRun",
        "type": "object"
      },
      "EstateOutcomeTotals": {
        "description": "Run counts by estate conduct outcome across the whole history.",
        "properties": {
          "conditional": {
            "title": "Conditional",
            "type": "integer"
          },
          "escalated": {
            "title": "Escalated",
            "type": "integer"
          },
          "failed": {
            "title": "Failed",
            "type": "integer"
          },
          "passed": {
            "title": "Passed",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "unevaluated": {
            "title": "Unevaluated",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "passed",
          "failed",
          "conditional",
          "escalated",
          "unevaluated"
        ],
        "title": "EstateOutcomeTotals",
        "type": "object"
      },
      "EstatePackBreakdown": {
        "description": "Per-pack rollup: how many runs and how many passed, for one pack.",
        "properties": {
          "conditional": {
            "title": "Conditional",
            "type": "integer"
          },
          "escalated": {
            "title": "Escalated",
            "type": "integer"
          },
          "failed": {
            "title": "Failed",
            "type": "integer"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "pass_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pass Rate"
          },
          "passed": {
            "title": "Passed",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "unevaluated": {
            "title": "Unevaluated",
            "type": "integer"
          }
        },
        "required": [
          "pack_slug",
          "total",
          "passed",
          "failed",
          "conditional",
          "escalated",
          "unevaluated",
          "pass_rate"
        ],
        "title": "EstatePackBreakdown",
        "type": "object"
      },
      "EstateTrendBucket": {
        "description": "One day's outcome counts for the trend (UTC calendar day).",
        "properties": {
          "conditional": {
            "title": "Conditional",
            "type": "integer"
          },
          "day": {
            "title": "Day",
            "type": "string"
          },
          "escalated": {
            "title": "Escalated",
            "type": "integer"
          },
          "failed": {
            "title": "Failed",
            "type": "integer"
          },
          "passed": {
            "title": "Passed",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "unevaluated": {
            "title": "Unevaluated",
            "type": "integer"
          }
        },
        "required": [
          "day",
          "total",
          "passed",
          "failed",
          "conditional",
          "escalated",
          "unevaluated"
        ],
        "title": "EstateTrendBucket",
        "type": "object"
      },
      "EvidencePackHistoryResponse": {
        "description": "Paginated evidence-pack history.",
        "properties": {
          "has_more": {
            "title": "Has More",
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/EvidencePackResponse"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "limit",
          "offset",
          "has_more"
        ],
        "title": "EvidencePackHistoryResponse",
        "type": "object"
      },
      "EvidencePackResponse": {
        "description": "One evidence-pack history entry, with a link to its export endpoint.",
        "properties": {
          "abp_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The custom agent the pack belongs to. null for a governed pack run — packs are not agent blueprints.",
            "title": "Abp Id"
          },
          "agent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The agent's name, or the pack's display name for a pack run.",
            "title": "Agent Name"
          },
          "chain_hash": {
            "title": "Chain Hash",
            "type": "string"
          },
          "created_at": {
            "description": "UTC ISO-8601 timestamp the pack was recorded.",
            "title": "Created At",
            "type": "string"
          },
          "download_path": {
            "description": "Relative path to the record that serves this pack: the per-decision evidence export endpoint for a custom-agent evaluation (mints a signed download URL), or the governed run's own record for a pack run.",
            "title": "Download Path",
            "type": "string"
          },
          "has_bundle": {
            "description": "True only when the pack's file is confirmed stored (storage_status is stored). A sealed pack whose file is not stored yet, or whose storage is not known, reads false.",
            "title": "Has Bundle",
            "type": "boolean"
          },
          "id": {
            "description": "The artefact's id — the pointer row's id for a custom-agent evaluation; the run id for a governed pack run, whose pack is sealed on the run record itself.",
            "title": "Id",
            "type": "string"
          },
          "invocation_id": {
            "title": "Invocation Id",
            "type": "string"
          },
          "storage_status": {
            "default": "unknown",
            "description": "Whether the pack's file is stored. stored: it is. pending: the pack is sealed and its file has not been stored yet; it is retried every five minutes. conflict: the pack is sealed, but a different file already holds its place, so it was not stored; it is not retried and Velerian is alerted. missing: the file was not written and will not be retried. unknown: the pack was sealed before storage outcomes were recorded; open its run to check the file.",
            "enum": [
              "stored",
              "pending",
              "conflict",
              "missing",
              "unknown"
            ],
            "title": "Storage Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "invocation_id",
          "chain_hash",
          "has_bundle",
          "created_at",
          "download_path"
        ],
        "title": "EvidencePackResponse",
        "type": "object"
      },
      "EvidenceRead": {
        "description": "The declared evidence-capture requirement + the recorded-pack count.",
        "properties": {
          "captureInputs": {
            "title": "Captureinputs",
            "type": "boolean"
          },
          "captureIntermediateReasoning": {
            "title": "Captureintermediatereasoning",
            "type": "boolean"
          },
          "captureOutputs": {
            "title": "Captureoutputs",
            "type": "boolean"
          },
          "captureSourcesUsed": {
            "title": "Capturesourcesused",
            "type": "boolean"
          },
          "evidencePacksRecorded": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Chain-hashed evidence-pack pointer rows recorded for this agent (custom ABPs). Null for packs — pack runs record evidence in S3 + the audit log without a per-run countable column, and this card never fabricates a number.",
            "title": "Evidencepacksrecorded"
          },
          "format": {
            "description": "Declared evidence-pack render format.",
            "title": "Format",
            "type": "string"
          },
          "retentionDays": {
            "description": "Declared evidence retention window in days.",
            "title": "Retentiondays",
            "type": "integer"
          }
        },
        "required": [
          "captureInputs",
          "captureOutputs",
          "captureIntermediateReasoning",
          "captureSourcesUsed",
          "retentionDays",
          "format"
        ],
        "title": "EvidenceRead",
        "type": "object"
      },
      "EvidenceRecordLink": {
        "description": "Where to download one sealed record, or why it cannot be downloaded yet.",
        "properties": {
          "content_path": {
            "description": "This API's path that returns the record to a workspace owner or administrator, with its signature attached once it is signed.",
            "title": "Content Path",
            "type": "string"
          },
          "content_sha256": {
            "description": "SHA-256 of the record's exact bytes, taken when it was sealed.",
            "title": "Content Sha256",
            "type": "string"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why there is no link, when there is none.",
            "title": "Detail"
          },
          "download_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A link to exactly this record's stored file, valid until expires_at; null unless storage_status is 'stored'. The stored file carries no signature: content_path serves the signed record.",
            "title": "Download Url"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "record_id": {
            "format": "uuid",
            "title": "Record Id",
            "type": "string"
          },
          "sealed_at": {
            "format": "date-time",
            "title": "Sealed At",
            "type": "string"
          },
          "signature_status": {
            "default": "unsigned",
            "description": "'signed': content_path serves the record with Velerian's signature, which the offline verifier checks with --signature. 'pending': signing is under way. 'unsigned': the record was sealed with signing off. 'failed': signing failed and is retried.",
            "title": "Signature Status",
            "type": "string"
          },
          "storage_status": {
            "description": "'stored': the file is stored and download_url fetches it. 'pending': sealed, not stored yet; retried every five minutes. 'conflict': a different file holds its place and is never served as this record. 'missing': sealed, and storage has no file for it. 'unknown': storage could not be read just now.",
            "enum": [
              "stored",
              "pending",
              "conflict",
              "missing",
              "unknown"
            ],
            "title": "Storage Status",
            "type": "string"
          }
        },
        "required": [
          "record_id",
          "storage_status",
          "content_sha256",
          "sealed_at",
          "download_url",
          "expires_at",
          "content_path"
        ],
        "title": "EvidenceRecordLink",
        "type": "object"
      },
      "EvidenceRevisionRead": {
        "properties": {
          "attachment_id": {
            "format": "uuid",
            "title": "Attachment Id",
            "type": "string"
          },
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "current": {
            "default": false,
            "title": "Current",
            "type": "boolean"
          },
          "extracted_text_sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extracted Text Sha256"
          },
          "extractor_version": {
            "title": "Extractor Version",
            "type": "string"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "revision": {
            "title": "Revision",
            "type": "integer"
          },
          "sha256": {
            "title": "Sha256",
            "type": "string"
          },
          "status": {
            "default": "available",
            "enum": [
              "available",
              "retired",
              "unavailable"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "attachment_id",
          "revision",
          "filename",
          "content_type",
          "sha256",
          "extracted_text_sha256",
          "extractor_version",
          "created_at"
        ],
        "title": "EvidenceRevisionRead",
        "type": "object"
      },
      "EvidenceShareLinkCreated": {
        "description": "Mint response — the ONLY place the full evidence-share token ever appears.",
        "properties": {
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "members_only": {
            "default": false,
            "title": "Members Only",
            "type": "boolean"
          },
          "token": {
            "title": "Token",
            "type": "string"
          },
          "token_prefix": {
            "title": "Token Prefix",
            "type": "string"
          }
        },
        "required": [
          "token",
          "token_prefix",
          "expires_at"
        ],
        "title": "EvidenceShareLinkCreated",
        "type": "object"
      },
      "EvidenceShareLinkMetadata": {
        "description": "The active evidence-share link's metadata (NEVER the full token).",
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "exists": {
            "title": "Exists",
            "type": "boolean"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "members_only": {
            "default": false,
            "title": "Members Only",
            "type": "boolean"
          },
          "token_prefix": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token Prefix"
          }
        },
        "required": [
          "exists"
        ],
        "title": "EvidenceShareLinkMetadata",
        "type": "object"
      },
      "ExportPreflight": {
        "additionalProperties": false,
        "properties": {
          "pack_slug": {
            "const": "underpayments",
            "title": "Pack Slug",
            "type": "string"
          },
          "schema_version": {
            "const": "underpayments.export-preflight.v1",
            "title": "Schema Version",
            "type": "string"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "schema_version",
          "tenant_id",
          "pack_slug"
        ],
        "title": "ExportPreflight",
        "type": "object"
      },
      "ExposeRequest": {
        "additionalProperties": false,
        "description": "Body for ``POST /api/v2/networks/{slug}/expose``.",
        "properties": {
          "acknowledge": {
            "default": false,
            "description": "Informed-consent acknowledgment (REQUIRED true): you understand that outside systems will be able to trigger this agent with the issued key, that every call is a governed run that counts toward your workspace's monthly run limit, and that the key carries your workspace's entitlements for this agent. Omitting or sending false returns 400 — exposure is an explicit, consented act.",
            "title": "Acknowledge",
            "type": "boolean"
          }
        },
        "title": "ExposeRequest",
        "type": "object"
      },
      "ExposeResponse": {
        "description": "Mint response — the ONLY place the exposure key's secret ever appears.",
        "properties": {
          "confirmed_ack_at": {
            "format": "date-time",
            "title": "Confirmed Ack At",
            "type": "string"
          },
          "endpoint": {
            "description": "Path of the external invoke endpoint for this agent (prepend your environment's origin). Supports sync (200) and ?async=true (202 + poll URL) calls.",
            "title": "Endpoint",
            "type": "string"
          },
          "exposed": {
            "title": "Exposed",
            "type": "boolean"
          },
          "key_prefix": {
            "title": "Key Prefix",
            "type": "string"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "title": "Scopes",
            "type": "array"
          },
          "secret": {
            "description": "The full bearer token (vk_live_...), restricted to this agent. Shown exactly once — store it now; only its SHA-256 hash is kept.",
            "title": "Secret",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "exposed",
          "endpoint",
          "key_prefix",
          "secret",
          "scopes",
          "confirmed_ack_at"
        ],
        "title": "ExposeResponse",
        "type": "object"
      },
      "ExposureKeyMeta": {
        "description": "One minted key under an exposure — metadata ONLY, never secrets.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "key_prefix": {
            "title": "Key Prefix",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "revoked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "title": "Scopes",
            "type": "array"
          }
        },
        "required": [
          "id",
          "name",
          "key_prefix",
          "scopes",
          "created_at",
          "last_used_at",
          "expires_at",
          "revoked_at"
        ],
        "title": "ExposureKeyMeta",
        "type": "object"
      },
      "ExposurePolicyVerdict": {
        "description": "Your workspace policy's verdict on exposing this agent.\n\nThe SAME stable shape the deny payload carries, so the dashboard can\ndisable the toggle (and say why) BEFORE an expose attempt is made.",
        "properties": {
          "allowed": {
            "description": "Whether your workspace's policy permits exposing this agent to outside systems. False disables the exposure toggle.",
            "title": "Allowed",
            "type": "boolean"
          },
          "policy_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Reference to the workspace policy rule that decided (scope + saved version), or null when no rule matched.",
            "title": "Policy Ref"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why, in your workspace's own words — present when a policy rule matched (blocking or advisory), null otherwise.",
            "title": "Reason"
          }
        },
        "required": [
          "allowed"
        ],
        "title": "ExposurePolicyVerdict",
        "type": "object"
      },
      "ExposureStatus": {
        "description": "Wire shape for ``GET /api/v2/networks/{slug}/exposure``.",
        "properties": {
          "confirmed_ack_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confirmed Ack At"
          },
          "disabled_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disabled At"
          },
          "endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Endpoint"
          },
          "exposed": {
            "title": "Exposed",
            "type": "boolean"
          },
          "keys": {
            "items": {
              "$ref": "#/components/schemas/ExposureKeyMeta"
            },
            "title": "Keys",
            "type": "array"
          },
          "policy": {
            "$ref": "#/components/schemas/ExposurePolicyVerdict"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "exposed",
          "endpoint",
          "confirmed_ack_at",
          "disabled_at",
          "keys",
          "policy"
        ],
        "title": "ExposureStatus",
        "type": "object"
      },
      "FairnessReportCardRead": {
        "description": "Wire shape for ``GET /{slug}/report-card`` — a pack's governance &\nfairness report card.\n\nAn outward-facing trust artifact that externalizes the platform's\ninward-facing fairness gate (EEOC 4/5ths / AIR >= 0.80) per pack. Mirrors\n:class:`velerian.core.governance.fairness.report_card.FairnessReportCard`\none-for-one.\n\n**Honesty.** ``provenance`` is deliberately ``methodology_validated``\n(never \"audited\") for the packs with a wired CI gate, and ``not_evaluated``\nfor every other pack — there is no numeric AIR field because the specific\nvalue from a real-model run is uncommitted (the committed baselines are stub\ndry-runs). ``provenance_statement`` is the load-bearing honest line the UI\nrenders verbatim.",
        "properties": {
          "air_threshold": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Enforced adverse-impact-ratio floor (0.80); null when not evaluated.",
            "title": "Air Threshold"
          },
          "as_of": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Point-in-time anchor (the methodology's ratification date).",
            "title": "As Of"
          },
          "corpus_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The synthetic, no-PII corpus the gate runs over.",
            "title": "Corpus Label"
          },
          "display_name": {
            "description": "Public pack name shown in the UI.",
            "title": "Display Name",
            "type": "string"
          },
          "evidence_integrity": {
            "description": "Platform-true governance-integrity signals (never a fabricated number).",
            "items": {
              "type": "string"
            },
            "title": "Evidence Integrity",
            "type": "array"
          },
          "framework_anchors": {
            "description": "Regulatory frameworks the floor maps to (EEOC / EU AI Act / NAIC).",
            "items": {
              "type": "string"
            },
            "title": "Framework Anchors",
            "type": "array"
          },
          "method_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "One-line description of how the evaluation is run.",
            "title": "Method Label"
          },
          "metric_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The fairness metric the gate enforces; null when not evaluated.",
            "title": "Metric Label"
          },
          "provenance": {
            "description": "`methodology_validated` | `not_evaluated` — the honesty label.",
            "title": "Provenance",
            "type": "string"
          },
          "provenance_statement": {
            "default": "",
            "description": "Honest provenance sentence rendered verbatim — audited vs validated.",
            "title": "Provenance Statement",
            "type": "string"
          },
          "slug": {
            "description": "Kebab-case pack slug.",
            "title": "Slug",
            "type": "string"
          },
          "status": {
            "description": "`gate_enforced` (a wired AIR >= 0.80 CI gate) | `not_evaluated`.",
            "title": "Status",
            "type": "string"
          },
          "threshold_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Human threshold label, e.g. 'AIR ≥ 0.80'.",
            "title": "Threshold Label"
          }
        },
        "required": [
          "slug",
          "display_name",
          "status",
          "provenance"
        ],
        "title": "FairnessReportCardRead",
        "type": "object"
      },
      "FeedbackCreate": {
        "description": "A feedback submission body.",
        "properties": {
          "context": {
            "anyOf": [
              {
                "maxLength": 512,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional page/route the feedback was submitted from (e.g. the current pathname), auto-captured by the client for triage.",
            "title": "Context"
          },
          "kind": {
            "description": "The kind of feedback: 'bug' | 'feature_request' | 'general'.",
            "enum": [
              "bug",
              "feature_request",
              "general"
            ],
            "title": "Kind",
            "type": "string"
          },
          "message": {
            "description": "The free-text feedback body. Required, non-empty (whitespace trimmed).",
            "maxLength": 4000,
            "minLength": 1,
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "message"
        ],
        "title": "FeedbackCreate",
        "type": "object"
      },
      "FeedbackCreated": {
        "description": "The created feedback row's identifier.",
        "properties": {
          "id": {
            "description": "The created feedback row's UUID.",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "title": "FeedbackCreated",
        "type": "object"
      },
      "FeedbackItemResponse": {
        "description": "One recent feedback submission (see ``core/kpi/feedback.FeedbackItem``).",
        "properties": {
          "context": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Page/route the feedback was submitted from, if captured.",
            "title": "Context"
          },
          "created_at": {
            "description": "UTC ISO-8601 submission timestamp.",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "description": "The feedback row's UUID.",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "description": "Feedback kind: 'bug' | 'feature_request' | 'general'.",
            "title": "Kind",
            "type": "string"
          },
          "message": {
            "description": "The free-text feedback body.",
            "title": "Message",
            "type": "string"
          },
          "tenant_id": {
            "description": "Submitting tenant's UUID (operator attribution).",
            "title": "Tenant Id",
            "type": "string"
          },
          "user_id": {
            "description": "Submitting user's UUID.",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "user_id",
          "kind",
          "message",
          "created_at"
        ],
        "title": "FeedbackItemResponse",
        "type": "object"
      },
      "FeedbackListResponse": {
        "description": "A page of feedback submissions, most recent first.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/FeedbackRow"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "description": "The page size that was applied.",
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "description": "The page offset that was applied.",
            "title": "Offset",
            "type": "integer"
          }
        },
        "required": [
          "limit",
          "offset"
        ],
        "title": "FeedbackListResponse",
        "type": "object"
      },
      "FeedbackRow": {
        "description": "One feedback submission in the admin triage list.",
        "properties": {
          "context": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The page/route the feedback was submitted from, if captured.",
            "title": "Context"
          },
          "created_at": {
            "description": "UTC ISO-8601 timestamp the feedback was submitted.",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "description": "The feedback row's UUID.",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "description": "bug | feature_request | general.",
            "title": "Kind",
            "type": "string"
          },
          "message": {
            "description": "The free-text feedback body.",
            "title": "Message",
            "type": "string"
          },
          "tenant_id": {
            "description": "The submitting tenant's UUID (for attribution).",
            "title": "Tenant Id",
            "type": "string"
          },
          "user_id": {
            "description": "The submitting user's UUID.",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "user_id",
          "kind",
          "message",
          "created_at"
        ],
        "title": "FeedbackRow",
        "type": "object"
      },
      "FeedbackSummaryResponse": {
        "description": "In-product feedback-volume rollup (see ``core/kpi/feedback``).",
        "properties": {
          "as_of": {
            "description": "UTC ISO-8601 timestamp the summary was computed at.",
            "title": "As Of",
            "type": "string"
          },
          "counts_by_kind": {
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Per-kind submission counts — a DENSE map: every known kind ('bug'/'feature_request'/'general') is present, zero-filled.",
            "title": "Counts By Kind",
            "type": "object"
          },
          "recent": {
            "description": "The most-recent submissions (newest first), capped at `recent_limit`.",
            "items": {
              "$ref": "#/components/schemas/FeedbackItemResponse"
            },
            "title": "Recent",
            "type": "array"
          },
          "total": {
            "description": "Total feedback submissions in-window (across all kinds).",
            "title": "Total",
            "type": "integer"
          },
          "window_end": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Exclusive upper bound (UTC ISO-8601) on created_at used, or null when unbounded.",
            "title": "Window End"
          },
          "window_start": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Inclusive lower bound (UTC ISO-8601) on created_at used, or null when unbounded (no `since` and no derived window).",
            "title": "Window Start"
          }
        },
        "required": [
          "as_of",
          "total",
          "counts_by_kind"
        ],
        "title": "FeedbackSummaryResponse",
        "type": "object"
      },
      "FeedbackWidgetConfigRead": {
        "description": "The design-partner feedback-widget window.\n\n``enabled`` is the effective master switch after folding in expiry (False\nwhen the remote flag is off OR the configured end instant has passed);\n``expires_at`` is the raw configured end (ISO-8601) or null for an open-ended\nwindow. Both come from env so the window is flippable WITHOUT a redeploy.",
        "properties": {
          "enabled": {
            "description": "Effective master switch (flag on AND not past expiry).",
            "title": "Enabled",
            "type": "boolean"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO-8601 instant the widget stops showing, or null (open-ended).",
            "title": "Expires At"
          }
        },
        "required": [
          "enabled"
        ],
        "title": "FeedbackWidgetConfigRead",
        "type": "object"
      },
      "FieldChecksRead": {
        "properties": {
          "reason_codes": {
            "items": {
              "type": "string"
            },
            "title": "Reason Codes",
            "type": "array"
          },
          "state": {
            "default": "not_evaluated",
            "title": "State",
            "type": "string"
          }
        },
        "title": "FieldChecksRead",
        "type": "object"
      },
      "FilingNotRecorded": {
        "description": "Why an arrival was saved with no filing: the claim's own state.",
        "properties": {
          "error": {
            "description": "The reason's stable code.",
            "title": "Error",
            "type": "string"
          },
          "message": {
            "description": "One plain sentence saying why.",
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "error",
          "message"
        ],
        "title": "FilingNotRecorded",
        "type": "object"
      },
      "FloorKindRead": {
        "description": "Coverage of one minimum-viable-floor control kind.",
        "properties": {
          "enforcement": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "'strict' (fail-closed) or 'advisory'; null when absent.",
            "title": "Enforcement"
          },
          "kind": {
            "description": "The governance-constraint kind.",
            "title": "Kind",
            "type": "string"
          },
          "present": {
            "description": "Whether any constraint of this kind is in force.",
            "title": "Present",
            "type": "boolean"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "'floor' when the injected baseline floor covers the kind, 'custom' when an authored constraint of the kind does; null when absent.",
            "title": "Source"
          }
        },
        "required": [
          "kind",
          "present"
        ],
        "title": "FloorKindRead",
        "type": "object"
      },
      "FloorRead": {
        "description": "Minimum-viable-floor coverage over the effective constraint set.",
        "properties": {
          "kinds": {
            "description": "Per-kind coverage of the three baseline floor controls.",
            "items": {
              "$ref": "#/components/schemas/FloorKindRead"
            },
            "title": "Kinds",
            "type": "array"
          },
          "minimumViableFloorMet": {
            "description": "Whether the effective set covers all three baseline controls (a content safety filter, PII handling, evidence capture) — the same predicate the ABP deploy gate enforces.",
            "title": "Minimumviablefloormet",
            "type": "boolean"
          }
        },
        "required": [
          "minimumViableFloorMet",
          "kinds"
        ],
        "title": "FloorRead",
        "type": "object"
      },
      "FollowUpSettingWrite": {
        "additionalProperties": false,
        "description": "Change one or more of this workspace's settings for a crew.\n\nA setting left out is unchanged; null returns it to the crew's default.",
        "properties": {
          "every_days": {
            "anyOf": [
              {
                "maximum": 90.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whole calendar days between follow-ups, 1 to 90, or null for the crew's default.",
            "title": "Every Days"
          },
          "max_follow_ups": {
            "anyOf": [
              {
                "maximum": 10.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Follow-ups before the claim goes to a person, 1 to 10, or null for the crew's default.",
            "title": "Max Follow Ups"
          },
          "max_rechecks": {
            "anyOf": [
              {
                "maximum": 20.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Rechecks of a pended claim before it goes to a person, 1 to 20, or null for the crew's default.",
            "title": "Max Rechecks"
          }
        },
        "title": "FollowUpSettingWrite",
        "type": "object"
      },
      "FollowUpSettingsRead": {
        "description": "This workspace's follow-up settings for a crew.\n\n``follows_up`` says whether the crew follows up unanswered claims at an\ninterval; the interval's fields are null when it does not. ``every_days`` is\nthis workspace's own interval, or null for the crew's default, and\n``effective_every_days`` is the interval the crew's next follow-up uses.\n``max_follow_ups`` and ``max_rechecks`` are null for a crew that does not\noffer them.",
        "properties": {
          "default_every_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The crew's own interval in calendar days, used when this workspace sets none.",
            "title": "Default Every Days"
          },
          "effective_every_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The interval the crew's next follow-up uses, in calendar days.",
            "title": "Effective Every Days"
          },
          "every_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "This workspace's own interval in calendar days, or null for the crew's default.",
            "title": "Every Days"
          },
          "follows_up": {
            "description": "Whether this crew follows up unanswered claims.",
            "title": "Follows Up",
            "type": "boolean"
          },
          "max_every_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The longest interval this workspace may set, in days.",
            "title": "Max Every Days"
          },
          "max_follow_ups": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CrewLimitRead"
              },
              {
                "type": "null"
              }
            ],
            "description": "How many follow-ups an unanswered claim gets before it goes to a person, or null for a crew that does not offer this."
          },
          "max_rechecks": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CrewLimitRead"
              },
              {
                "type": "null"
              }
            ],
            "description": "How many times a claim the payer has pended is read again before it goes to a person, or null for a crew that does not offer this."
          },
          "min_every_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The shortest interval this workspace may set, in days.",
            "title": "Min Every Days"
          },
          "slug": {
            "description": "The crew these settings describe.",
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "follows_up"
        ],
        "title": "FollowUpSettingsRead",
        "type": "object"
      },
      "ForkPointRead": {
        "description": "Rows that link the same predecessor (a fork in the chain).",
        "properties": {
          "entry_ids": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "title": "Entry Ids",
            "type": "array"
          },
          "parent_hash": {
            "title": "Parent Hash",
            "type": "string"
          },
          "position": {
            "title": "Position",
            "type": "integer"
          }
        },
        "required": [
          "parent_hash",
          "entry_ids",
          "position"
        ],
        "title": "ForkPointRead",
        "type": "object"
      },
      "FrameworkTemplateRead": {
        "description": "One regulatory-framework policy template the agent references.",
        "properties": {
          "framework": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The regulatory framework the template aligns to (e.g. 'SR 26-2'); null for a directly-referenced tenant policy, which carries no framework attribution.",
            "title": "Framework"
          },
          "id": {
            "description": "The template pack id (packs) or policy id (custom ABPs).",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "The template's display name.",
            "title": "Name",
            "type": "string"
          },
          "policyCount": {
            "description": "How many policies the reference contributes.",
            "title": "Policycount",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "name",
          "policyCount"
        ],
        "title": "FrameworkTemplateRead",
        "type": "object"
      },
      "FreezeRequest": {
        "additionalProperties": false,
        "properties": {
          "basis_id": {
            "format": "uuid",
            "title": "Basis Id",
            "type": "string"
          },
          "exhibit_ids": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 32,
            "title": "Exhibit Ids",
            "type": "array"
          },
          "included_line_ids": {
            "items": {
              "maxLength": 256,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 1000,
            "minItems": 1,
            "title": "Included Line Ids",
            "type": "array"
          },
          "run_id": {
            "format": "uuid",
            "title": "Run Id",
            "type": "string"
          }
        },
        "required": [
          "run_id",
          "basis_id",
          "included_line_ids"
        ],
        "title": "FreezeRequest",
        "type": "object"
      },
      "GapLabelCountResponse": {
        "description": "One recurring gap label + occurrence count (see ``core/kpi/outcome_summary``).",
        "properties": {
          "count": {
            "description": "Number of gap occurrences carrying this label across the window's runs.",
            "title": "Count",
            "type": "integer"
          },
          "label": {
            "description": "Customer-facing name of the recurring missing section/criterion.",
            "title": "Label",
            "type": "string"
          }
        },
        "required": [
          "label",
          "count"
        ],
        "title": "GapLabelCountResponse",
        "type": "object"
      },
      "GovernanceCheck": {
        "description": "One governance check the evaluator ran on this run.\n\nThe capture+expose half of \"show the checks behind a PASS badge\": the\nevaluator already produces a per-constraint result for every constraint it\nevaluates; the invoke route persists them to ``pack_runs.governance_checks``.\n``kind`` is the constraint taxonomy value (``source_required``,\n``data_residency``, ...); ``outcome`` is the per-constraint decision\n(``allow`` | ``allow_with_conditions`` | ``deny`` | ``escalate``), or, for a\ncheck that verified nothing, ``not_applicable`` (nothing to check on this\nresult), ``not_configured`` (what it needs is not set up, e.g. a PII or\nsafety check on a crew with no guardrail) or ``error`` (the attempt failed,\ne.g. the guardrail call errored) — such a check never reads ``allow``;\n``reason`` is the evaluator's human-readable note. The frontend maps\nkind+outcome to customer-facing labels — these are the raw wire values.\nHonest by construction: exactly the checks the evaluator recorded,\nincluding any that could not run. Runs recorded before a marker existed\nkeep the ``allow`` they were recorded with.",
        "properties": {
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "outcome": {
            "title": "Outcome",
            "type": "string"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "outcome",
          "reason"
        ],
        "title": "GovernanceCheck",
        "type": "object"
      },
      "GovernanceScorecard": {
        "description": "The full per-rule examiner scorecard for a run.\n\nMirrors the evidence bundle's ``governance_scorecard`` shape verbatim\n(``summary`` header + per-rule ``rules``). Surfaced on the run-detail API so\nan examiner (and the run page) sees EVERY check, its status, and the policy it\ntraces to — not just the kind/outcome/reason carried by ``governance_checks``.\n\nWhen any rule carries an attested ``supports`` mapping,\n``supports_disclaimer`` carries the one posture line the dossier shows under\nit — a plain-language reminder that the mapping equips a deployer's own\nassessment and is NOT a certification (Velerian holds none). Null when no rule\ncarries a supports mapping.",
        "properties": {
          "rules": {
            "items": {
              "$ref": "#/components/schemas/GovernanceScorecardRule"
            },
            "title": "Rules",
            "type": "array"
          },
          "summary": {
            "$ref": "#/components/schemas/GovernanceScorecardSummary"
          },
          "supports_disclaimer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Disclaimer"
          }
        },
        "required": [
          "summary",
          "rules"
        ],
        "title": "GovernanceScorecard",
        "type": "object"
      },
      "GovernanceScorecardResponse": {
        "description": "The tenant-level governance scorecard for the current month.",
        "properties": {
          "evidencePacksGenerated": {
            "description": "Chain-hashed evidence packs written this month.",
            "title": "Evidencepacksgenerated",
            "type": "integer"
          },
          "governanceChecksPerformed": {
            "description": "Total individual policy checks run across the month's governed runs.",
            "title": "Governancechecksperformed",
            "type": "integer"
          },
          "governedRuns": {
            "description": "Runs that received a governance verdict this month.",
            "title": "Governedruns",
            "type": "integer"
          },
          "humanCounterSignatures": {
            "description": "Governed decisions a human approver counter-signed this month.",
            "title": "Humancountersignatures",
            "type": "integer"
          },
          "outcomeMix": {
            "$ref": "#/components/schemas/OutcomeMixResponse"
          },
          "passRate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "runsPassed / (governedRuns - runsAwaitingSignoff) * 100 (2dp). null when no governed run has reached a verdict yet.",
            "title": "Passrate"
          },
          "period": {
            "description": "Calendar month the counts cover (YYYY-MM).",
            "title": "Period",
            "type": "string"
          },
          "resetDate": {
            "description": "UTC ISO-8601 instant the monthly window rolls over.",
            "title": "Resetdate",
            "type": "string"
          },
          "runsAwaitingSignoff": {
            "default": 0,
            "description": "Governed runs this month that a sign-off gate held before the work, whether or not the sign-off has since been decided. A held run is neither a pass nor a failure, so it is excluded from the pass rate entirely. For the runs still waiting for a person, read runsSignoffPending.",
            "title": "Runsawaitingsignoff",
            "type": "integer"
          },
          "runsPassed": {
            "description": "Governed runs whose governance verdict was PASS.",
            "title": "Runspassed",
            "type": "integer"
          },
          "runsSignoffPending": {
            "default": 0,
            "description": "Of runsAwaitingSignoff, the runs still waiting for a person: a sign-off is pending or no decision has been recorded. Approved, rejected, timed-out and superseded sign-offs are not counted.",
            "title": "Runssignoffpending",
            "type": "integer"
          },
          "runsWithheld": {
            "description": "Governed runs whose output policy withheld because the checks did not pass. Excludes runs held for a human sign-off, which are counted separately.",
            "title": "Runswithheld",
            "type": "integer"
          },
          "windowStart": {
            "description": "UTC ISO-8601 first instant of the window (inclusive).",
            "title": "Windowstart",
            "type": "string"
          }
        },
        "required": [
          "period",
          "windowStart",
          "resetDate",
          "governedRuns",
          "runsPassed",
          "runsWithheld",
          "evidencePacksGenerated",
          "governanceChecksPerformed",
          "humanCounterSignatures",
          "outcomeMix"
        ],
        "title": "GovernanceScorecardResponse",
        "type": "object"
      },
      "GovernanceScorecardRule": {
        "description": "One rule in the full examiner scorecard.\n\nThe status+basis enrichment over ``GovernanceCheck``: each evaluated\ngovernance rule with its ``status`` (``pass`` | ``fail`` | ``conditional`` |\n``escalate`` | ``not_applicable`` | ``not_configured`` | ``error`` — the\nexaminer verdict, mapped from the per-constraint outcome), the policy ``anchor``\n(the governing constraint's\nhuman-readable description, or the ``kind`` value when no description\nresolves), the constraint ``kind``, and the evaluator's ``reason``. Built by\nthe same canonical ``velerian.core.evidence.build_governance_scorecard`` the\nevidence pack uses, so the API view and the pack view are identical per rule.\nHonest by construction: exactly the rules that genuinely ran.\n\n``not_applicable`` is a check that had nothing to verify on this result\n(e.g. a recomputation check over a free-text output that stated no\nmachine-verifiable figure). It is its own state — neither a green \"verified\npass\" nor a failure — so an examiner is not misled into thinking a value was\nchecked when it was not.\n\n``not_configured`` is a check that could not be evaluated at all because a\nparameter it requires is absent — a guardrail-backed safety or PII\nconstraint in an environment with no Bedrock Guardrail provisioned. No\ncontent was examined. It is deliberately NOT ``not_applicable``: that state\nsays \"nothing to check here\", this one says \"this control is not wired\", so\nan unconfigured control is never mistaken for one that ran and was clean.\n\n``error`` is a check that is set up but could not reach a verdict — its\nguardrail call failed, or the content reached it in a form it does not\nread. No content was examined, and it is never a pass.\n\n``supports`` carries the attested regulatory obligations this check's\n``kind`` supports (from ``evidence-pack-clause-mapping.md``), attached at\nread time keyed by ``kind``. Null when this kind has no attested row\n(nothing is fabricated). It is a supports mapping, not a conformance claim.",
        "properties": {
          "anchor": {
            "title": "Anchor",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "supports": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ClauseSupport"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "anchor",
          "kind",
          "status",
          "reason"
        ],
        "title": "GovernanceScorecardRule",
        "type": "object"
      },
      "GovernanceScorecardSummary": {
        "description": "At-a-glance status counts for the scorecard.",
        "properties": {
          "conditional": {
            "title": "Conditional",
            "type": "integer"
          },
          "errored": {
            "default": 0,
            "title": "Errored",
            "type": "integer"
          },
          "escalated": {
            "title": "Escalated",
            "type": "integer"
          },
          "failed": {
            "title": "Failed",
            "type": "integer"
          },
          "not_applicable": {
            "default": 0,
            "title": "Not Applicable",
            "type": "integer"
          },
          "not_configured": {
            "default": 0,
            "title": "Not Configured",
            "type": "integer"
          },
          "passed": {
            "title": "Passed",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "passed",
          "failed",
          "conditional",
          "escalated"
        ],
        "title": "GovernanceScorecardSummary",
        "type": "object"
      },
      "GovernedRunUsageResponse": {
        "description": "Governed-run count against the workspace's monthly run limit.",
        "properties": {
          "limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Monthly governed-run limit. null when unlimited or not yet derived.",
            "title": "Limit"
          },
          "overage": {
            "description": "Runs beyond the limit (0 when unlimited / under cap).",
            "title": "Overage",
            "type": "integer"
          },
          "percent_used": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "used / limit * 100. null when unlimited or limit unknown.",
            "title": "Percent Used"
          },
          "period": {
            "description": "Calendar month the count covers (YYYY-MM).",
            "title": "Period",
            "type": "string"
          },
          "reset_at": {
            "description": "UTC ISO-8601 instant the monthly counter resets.",
            "title": "Reset At",
            "type": "string"
          },
          "unlimited": {
            "description": "True when the workspace has no monthly run limit.",
            "title": "Unlimited",
            "type": "boolean"
          },
          "used": {
            "description": "Governed runs (metered invocations) this period.",
            "title": "Used",
            "type": "integer"
          }
        },
        "required": [
          "period",
          "used",
          "unlimited",
          "overage",
          "reset_at"
        ],
        "title": "GovernedRunUsageResponse",
        "type": "object"
      },
      "GreetingAndEscalation": {
        "additionalProperties": false,
        "description": "PRI area 4 — the greeting / persona + the transfer-to-human path.",
        "properties": {
          "escalation_number": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Escalation Number"
          },
          "greeting": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Greeting"
          },
          "persona": {
            "anyOf": [
              {
                "maxLength": 1000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Persona"
          }
        },
        "title": "GreetingAndEscalation",
        "type": "object"
      },
      "GrowthMetricsResponse": {
        "description": "Business-growth metrics (see ``core/kpi/summary.GrowthMetrics``).",
        "properties": {
          "active_subscriptions": {
            "description": "Active/trialing subscription rows.",
            "title": "Active Subscriptions",
            "type": "integer"
          },
          "arr_usd": {
            "description": "Annual Recurring Revenue = mrr_usd * 12.",
            "title": "Arr Usd",
            "type": "integer"
          },
          "churned_subscriptions": {
            "description": "Subscriptions that entered canceled/unpaid within the window.",
            "title": "Churned Subscriptions",
            "type": "integer"
          },
          "mrr_usd": {
            "description": "Monthly Recurring Revenue (USD): sum of per-tier list price over active/trialing subscriptions, quantity-weighted.",
            "title": "Mrr Usd",
            "type": "integer"
          },
          "net_new_subscriptions": {
            "description": "new - churned over the window.",
            "title": "Net New Subscriptions",
            "type": "integer"
          },
          "new_subscriptions": {
            "description": "Subscriptions created within the window.",
            "title": "New Subscriptions",
            "type": "integer"
          },
          "nrr_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Net Revenue Retention % over the window (retained MRR / start-of-window MRR). null when no pre-window subscriptions (undefined).",
            "title": "Nrr Pct"
          },
          "unpriced_tiers": {
            "description": "Active tiers with no price in the KPI pricing map (contributed $0 to MRR). Empty in the healthy case.",
            "items": {
              "type": "string"
            },
            "title": "Unpriced Tiers",
            "type": "array"
          }
        },
        "required": [
          "mrr_usd",
          "arr_usd",
          "active_subscriptions",
          "new_subscriptions",
          "churned_subscriptions",
          "net_new_subscriptions"
        ],
        "title": "GrowthMetricsResponse",
        "type": "object"
      },
      "GuardrailRead": {
        "description": "Guardrail provisioning + the effective set's enforcement mix.",
        "properties": {
          "advisoryConstraintCount": {
            "description": "Constraints in the effective set enforced advisory.",
            "title": "Advisoryconstraintcount",
            "type": "integer"
          },
          "provisioned": {
            "description": "Whether a Bedrock Guardrail is provisioned for this agent.",
            "title": "Provisioned",
            "type": "boolean"
          },
          "scope": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "'platform_default' (VELERIAN_DEFAULT_GUARDRAIL_ID backs the floor) or 'pack' (the pack declares its own guardrail); null when none is provisioned.",
            "title": "Scope"
          },
          "strictConstraintCount": {
            "description": "Constraints in the effective set enforced strict / fail-closed.",
            "title": "Strictconstraintcount",
            "type": "integer"
          }
        },
        "required": [
          "provisioned",
          "strictConstraintCount",
          "advisoryConstraintCount"
        ],
        "title": "GuardrailRead",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "HeldItemRead": {
        "description": "The held item after this request.",
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          },
          "ending": {
            "title": "Ending",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "ending",
          "code"
        ],
        "title": "HeldItemRead",
        "type": "object"
      },
      "HistoryApproval": {
        "properties": {
          "decided_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Decided At"
          },
          "decided_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Decided By User Id"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "const": "approval",
            "default": "approval",
            "title": "Kind",
            "type": "string"
          },
          "recorded_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recorded At"
          },
          "refs": {
            "items": {
              "$ref": "#/components/schemas/HistoryReference"
            },
            "title": "Refs",
            "type": "array"
          },
          "state": {
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "id",
          "recorded_at",
          "state"
        ],
        "title": "HistoryApproval",
        "type": "object"
      },
      "HistoryCase": {
        "properties": {
          "case_ref": {
            "title": "Case Ref",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "evidence_mode": {
            "enum": [
              "real",
              "synthetic"
            ],
            "title": "Evidence Mode",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "opened_via": {
            "title": "Opened Via",
            "type": "string"
          },
          "resolution_outcome": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution Outcome"
          },
          "resolved_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolved At"
          },
          "resolved_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolved By User Id"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "case_ref",
          "status",
          "opened_via",
          "evidence_mode",
          "created_at",
          "resolved_at",
          "resolved_by_user_id",
          "resolution_outcome"
        ],
        "title": "HistoryCase",
        "type": "object"
      },
      "HistoryJourney": {
        "properties": {
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "stage_count": {
            "title": "Stage Count",
            "type": "integer"
          },
          "stages_revision": {
            "title": "Stages Revision",
            "type": "string"
          },
          "started_at": {
            "format": "date-time",
            "title": "Started At",
            "type": "string"
          },
          "started_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started By User Id"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "pack_slug",
          "stages_revision",
          "status",
          "stage_count",
          "started_at",
          "completed_at",
          "started_by_user_id"
        ],
        "title": "HistoryJourney",
        "type": "object"
      },
      "HistoryLifecycle": {
        "properties": {
          "action": {
            "title": "Action",
            "type": "string"
          },
          "actor_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor User Id"
          },
          "approval_basis": {
            "anyOf": [
              {
                "enum": [
                  "single",
                  "set"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approval Basis"
          },
          "approval_set_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approval Set Id"
          },
          "halt_cause": {
            "anyOf": [
              {
                "enum": [
                  "capability",
                  "policy",
                  "outcome_reached"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Halt Cause"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "const": "lifecycle",
            "default": "lifecycle",
            "title": "Kind",
            "type": "string"
          },
          "prior_halt_cause": {
            "anyOf": [
              {
                "enum": [
                  "capability",
                  "policy",
                  "outcome_reached"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prior Halt Cause"
          },
          "prior_halted_reason_sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prior Halted Reason Sha256"
          },
          "prior_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prior Status"
          },
          "reason_kind": {
            "anyOf": [
              {
                "const": "output_truncated",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason Kind"
          },
          "reason_sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason Sha256"
          },
          "recorded_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recorded At"
          },
          "refs": {
            "items": {
              "$ref": "#/components/schemas/HistoryReference"
            },
            "title": "Refs",
            "type": "array"
          },
          "resource_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resource Id"
          },
          "resource_kind": {
            "anyOf": [
              {
                "enum": [
                  "case",
                  "case_journey",
                  "pack_run",
                  "run"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resource Kind"
          },
          "set_size": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Size"
          },
          "shown_digest": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shown Digest"
          },
          "stage_index": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stage Index"
          }
        },
        "required": [
          "id",
          "recorded_at",
          "action"
        ],
        "title": "HistoryLifecycle",
        "type": "object"
      },
      "HistoryPage": {
        "properties": {
          "availability": {
            "enum": [
              "available",
              "not_recorded",
              "unavailable"
            ],
            "title": "Availability",
            "type": "string"
          },
          "enumeration_complete": {
            "description": "This observed query is exhausted; not point-in-time case completeness.",
            "title": "Enumeration Complete",
            "type": "boolean"
          },
          "has_more": {
            "title": "Has More",
            "type": "boolean"
          },
          "items": {
            "items": {
              "discriminator": {
                "mapping": {
                  "approval": "#/components/schemas/HistoryApproval",
                  "attachment": "#/components/schemas/HistorySource",
                  "evidence_revision": "#/components/schemas/HistorySource",
                  "identity_revision": "#/components/schemas/HistoryProof",
                  "lifecycle": "#/components/schemas/HistoryLifecycle",
                  "policy_revision": "#/components/schemas/HistoryProof",
                  "proof_attempt": "#/components/schemas/HistoryProof",
                  "proof_binding": "#/components/schemas/HistoryProof",
                  "proof_consumption": "#/components/schemas/HistoryProof",
                  "proof_context": "#/components/schemas/HistoryProof",
                  "recovery_event": "#/components/schemas/HistoryRecovery",
                  "recovery_movement": "#/components/schemas/HistoryRecovery",
                  "restart": "#/components/schemas/HistoryRestart",
                  "run": "#/components/schemas/HistoryRun",
                  "stage": "#/components/schemas/HistoryStage"
                },
                "propertyName": "kind"
              },
              "oneOf": [
                {
                  "$ref": "#/components/schemas/HistoryStage"
                },
                {
                  "$ref": "#/components/schemas/HistoryLifecycle"
                },
                {
                  "$ref": "#/components/schemas/HistoryRun"
                },
                {
                  "$ref": "#/components/schemas/HistoryApproval"
                },
                {
                  "$ref": "#/components/schemas/HistorySource"
                },
                {
                  "$ref": "#/components/schemas/HistoryProof"
                },
                {
                  "$ref": "#/components/schemas/HistoryRecovery"
                },
                {
                  "$ref": "#/components/schemas/HistoryRestart"
                }
              ]
            },
            "title": "Items",
            "type": "array"
          },
          "ledger_cutoff": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ledger Cutoff"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "reading_revision": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reading Revision"
          },
          "returned_count": {
            "title": "Returned Count",
            "type": "integer"
          },
          "section": {
            "enum": [
              "stages",
              "lifecycle",
              "runs",
              "approvals",
              "attachments",
              "evidence_revisions",
              "proof_bindings",
              "proof_context",
              "proof_attempts",
              "proof_consumptions",
              "identity_revisions",
              "policy_revisions",
              "recovery_events",
              "recovery_movements",
              "restarts"
            ],
            "title": "Section",
            "type": "string"
          }
        },
        "required": [
          "section",
          "items",
          "availability",
          "returned_count",
          "limit",
          "has_more",
          "next_cursor",
          "enumeration_complete"
        ],
        "title": "HistoryPage",
        "type": "object"
      },
      "HistoryProof": {
        "properties": {
          "actor_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor User Id"
          },
          "authority": {
            "anyOf": [
              {
                "enum": [
                  "source_checked",
                  "human_confirmed"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authority"
          },
          "contract_revision": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contract Revision"
          },
          "evidence_mode": {
            "anyOf": [
              {
                "enum": [
                  "real",
                  "synthetic"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evidence Mode"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "enum": [
              "proof_binding",
              "proof_context",
              "proof_attempt",
              "proof_consumption",
              "identity_revision",
              "policy_revision"
            ],
            "title": "Kind",
            "type": "string"
          },
          "method": {
            "anyOf": [
              {
                "enum": [
                  "human_attested",
                  "connector_verified"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          },
          "recorded_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recorded At"
          },
          "refs": {
            "items": {
              "$ref": "#/components/schemas/HistoryReference"
            },
            "title": "Refs",
            "type": "array"
          },
          "requirement_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requirement Id"
          },
          "revision": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revision"
          },
          "state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "State"
          },
          "validator_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Validator Version"
          },
          "version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          }
        },
        "required": [
          "id",
          "recorded_at",
          "kind"
        ],
        "title": "HistoryProof",
        "type": "object"
      },
      "HistoryRecovery": {
        "properties": {
          "amount_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Cents"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "effective_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective At"
          },
          "event_kind": {
            "anyOf": [
              {
                "enum": [
                  "remittance",
                  "posting",
                  "reversal",
                  "interest",
                  "adjustment"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Kind"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "interest_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Interest Cents"
          },
          "kind": {
            "enum": [
              "recovery_event",
              "recovery_movement"
            ],
            "title": "Kind",
            "type": "string"
          },
          "movement_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Movement Kind"
          },
          "principal_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Principal Cents"
          },
          "recorded_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recorded At"
          },
          "refs": {
            "items": {
              "$ref": "#/components/schemas/HistoryReference"
            },
            "title": "Refs",
            "type": "array"
          },
          "revision": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revision"
          },
          "state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "State"
          },
          "synthetic": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Synthetic"
          }
        },
        "required": [
          "id",
          "recorded_at",
          "kind"
        ],
        "title": "HistoryRecovery",
        "type": "object"
      },
      "HistoryReference": {
        "properties": {
          "availability": {
            "enum": [
              "recorded",
              "unavailable"
            ],
            "title": "Availability",
            "type": "string"
          },
          "availability_basis": {
            "const": "persisted_record",
            "default": "persisted_record",
            "title": "Availability Basis",
            "type": "string"
          },
          "case_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Ref"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "output_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Hash"
          },
          "validator_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Validator Version"
          }
        },
        "required": [
          "kind",
          "id",
          "availability"
        ],
        "title": "HistoryReference",
        "type": "object"
      },
      "HistoryRestart": {
        "properties": {
          "actor_user_id": {
            "format": "uuid",
            "title": "Actor User Id",
            "type": "string"
          },
          "available_revision": {
            "title": "Available Revision",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "const": "restart",
            "default": "restart",
            "title": "Kind",
            "type": "string"
          },
          "recorded_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recorded At"
          },
          "refs": {
            "items": {
              "$ref": "#/components/schemas/HistoryReference"
            },
            "title": "Refs",
            "type": "array"
          },
          "source_revision": {
            "title": "Source Revision",
            "type": "string"
          }
        },
        "required": [
          "id",
          "recorded_at",
          "source_revision",
          "available_revision",
          "actor_user_id"
        ],
        "title": "HistoryRestart",
        "type": "object"
      },
      "HistoryRun": {
        "properties": {
          "governance_pass": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Governance Pass"
          },
          "human_approval_decision": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Human Approval Decision"
          },
          "human_approval_pending": {
            "default": false,
            "title": "Human Approval Pending",
            "type": "boolean"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "const": "run",
            "default": "run",
            "title": "Kind",
            "type": "string"
          },
          "outcome_verdict": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Outcome Verdict"
          },
          "output_origin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Origin"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "record": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/HistoryRunRecord"
              },
              {
                "type": "null"
              }
            ]
          },
          "recorded_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recorded At"
          },
          "refs": {
            "items": {
              "$ref": "#/components/schemas/HistoryReference"
            },
            "title": "Refs",
            "type": "array"
          },
          "state": {
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "id",
          "recorded_at",
          "pack_slug",
          "state"
        ],
        "title": "HistoryRun",
        "type": "object"
      },
      "HistoryRunRecord": {
        "properties": {
          "bundle_sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bundle Sha256"
          },
          "chain_sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chain Sha256"
          },
          "record_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Record Path"
          },
          "signature_status": {
            "anyOf": [
              {
                "enum": [
                  "unsigned",
                  "pending",
                  "signed",
                  "failed"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signature Status"
          }
        },
        "title": "HistoryRunRecord",
        "type": "object"
      },
      "HistorySource": {
        "properties": {
          "content_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content Type"
          },
          "extracted_text_sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extracted Text Sha256"
          },
          "extractor_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extractor Version"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "enum": [
              "attachment",
              "evidence_revision"
            ],
            "title": "Kind",
            "type": "string"
          },
          "recorded_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recorded At"
          },
          "refs": {
            "items": {
              "$ref": "#/components/schemas/HistoryReference"
            },
            "title": "Refs",
            "type": "array"
          },
          "revision": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revision"
          },
          "sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sha256"
          },
          "state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "State"
          }
        },
        "required": [
          "id",
          "recorded_at",
          "kind",
          "filename"
        ],
        "title": "HistorySource",
        "type": "object"
      },
      "HistoryStage": {
        "properties": {
          "acting_agent_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Acting Agent Slug"
          },
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "entered_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entered At"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "const": "stage",
            "default": "stage",
            "title": "Kind",
            "type": "string"
          },
          "outcome": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Outcome"
          },
          "recorded_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recorded At"
          },
          "refs": {
            "items": {
              "$ref": "#/components/schemas/HistoryReference"
            },
            "title": "Refs",
            "type": "array"
          },
          "stage_index": {
            "title": "Stage Index",
            "type": "integer"
          },
          "stage_key": {
            "title": "Stage Key",
            "type": "string"
          },
          "stage_kind": {
            "title": "Stage Kind",
            "type": "string"
          },
          "state": {
            "title": "State",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "id",
          "recorded_at",
          "stage_index",
          "stage_key",
          "stage_kind",
          "title",
          "state"
        ],
        "title": "HistoryStage",
        "type": "object"
      },
      "HoursAndServices": {
        "additionalProperties": false,
        "description": "PRI area 2 — when the line is answered and what the shop does.",
        "properties": {
          "after_hours": {
            "anyOf": [
              {
                "maxLength": 1000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "After Hours"
          },
          "hours": {
            "anyOf": [
              {
                "maxLength": 1000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hours"
          },
          "services": {
            "items": {
              "maxLength": 255,
              "type": "string"
            },
            "title": "Services",
            "type": "array"
          },
          "timezone": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timezone"
          }
        },
        "title": "HoursAndServices",
        "type": "object"
      },
      "IdempotencyInUse": {
        "description": "The first request that used this ``Idempotency-Key`` is still running.",
        "properties": {
          "error": {
            "default": "idempotency_key_in_use",
            "title": "Error",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "poll_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Poll Url"
          },
          "retry_after_seconds": {
            "minimum": 1.0,
            "title": "Retry After Seconds",
            "type": "integer"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          }
        },
        "required": [
          "message",
          "retry_after_seconds"
        ],
        "title": "IdempotencyInUse",
        "type": "object"
      },
      "IdentityBasesRead": {
        "properties": {
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BasisRevisionRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "history": {
            "items": {
              "$ref": "#/components/schemas/BasisRevisionRead"
            },
            "title": "History",
            "type": "array"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "current",
          "history",
          "version"
        ],
        "title": "IdentityBasesRead",
        "type": "object"
      },
      "InputSourceRead": {
        "description": "Recorded source identity. A missing version means no version was pinned.",
        "properties": {
          "kind": {
            "maxLength": 64,
            "title": "Kind",
            "type": "string"
          },
          "label": {
            "anyOf": [
              {
                "maxLength": 512,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "reference": {
            "anyOf": [
              {
                "maxLength": 512,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference"
          },
          "version": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SourceVersionRead"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "kind"
        ],
        "title": "InputSourceRead",
        "type": "object"
      },
      "InstantiateWorkspaceRequest": {
        "description": "Request body for ``POST /api/v2/organizations/{org_id}/workspaces/instantiate``.",
        "properties": {
          "blueprint_id": {
            "format": "uuid",
            "title": "Blueprint Id",
            "type": "string"
          },
          "blueprint_version": {
            "anyOf": [
              {
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Blueprint Version"
          },
          "branding_overrides": {
            "additionalProperties": true,
            "title": "Branding Overrides",
            "type": "object",
            "x-max-serialized-bytes": 8192
          },
          "config_overrides": {
            "additionalProperties": true,
            "title": "Config Overrides",
            "type": "object",
            "x-max-serialized-bytes": 8192
          },
          "instance_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Name"
          },
          "membership_role": {
            "default": "owner",
            "enum": [
              "owner",
              "admin",
              "member",
              "viewer"
            ],
            "title": "Membership Role",
            "type": "string"
          },
          "workspace_name": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Workspace Name",
            "type": "string"
          },
          "workspace_slug": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Workspace Slug",
            "type": "string"
          }
        },
        "required": [
          "blueprint_id",
          "workspace_name",
          "workspace_slug"
        ],
        "title": "InstantiateWorkspaceRequest",
        "type": "object"
      },
      "InstantiateWorkspaceResponse": {
        "description": "Atomic 1-click instantiation receipt.",
        "properties": {
          "blueprint_id": {
            "format": "uuid",
            "title": "Blueprint Id",
            "type": "string"
          },
          "blueprint_slug": {
            "title": "Blueprint Slug",
            "type": "string"
          },
          "blueprint_version": {
            "title": "Blueprint Version",
            "type": "integer"
          },
          "branding_config": {
            "additionalProperties": true,
            "title": "Branding Config",
            "type": "object"
          },
          "instance_id": {
            "format": "uuid",
            "title": "Instance Id",
            "type": "string"
          },
          "instance_name": {
            "title": "Instance Name",
            "type": "string"
          },
          "instance_status": {
            "title": "Instance Status",
            "type": "string"
          },
          "membership_id": {
            "format": "uuid",
            "title": "Membership Id",
            "type": "string"
          },
          "membership_role": {
            "title": "Membership Role",
            "type": "string"
          },
          "organization_id": {
            "format": "uuid",
            "title": "Organization Id",
            "type": "string"
          },
          "workspace_id": {
            "format": "uuid",
            "title": "Workspace Id",
            "type": "string"
          },
          "workspace_kind": {
            "title": "Workspace Kind",
            "type": "string"
          },
          "workspace_name": {
            "title": "Workspace Name",
            "type": "string"
          },
          "workspace_slug": {
            "title": "Workspace Slug",
            "type": "string"
          }
        },
        "required": [
          "workspace_id",
          "workspace_name",
          "workspace_slug",
          "workspace_kind",
          "organization_id",
          "membership_id",
          "membership_role",
          "instance_id",
          "instance_name",
          "instance_status",
          "blueprint_id",
          "blueprint_slug",
          "blueprint_version"
        ],
        "title": "InstantiateWorkspaceResponse",
        "type": "object"
      },
      "IntakeAddress": {
        "additionalProperties": false,
        "description": "One of the workspace's inbound case-mail addresses.",
        "properties": {
          "address": {
            "description": "The workspace's email address for opening cases, allocated by the platform from your workspace name. Reserved for your workspace now; it starts receiving email when inbound mail goes live for the platform.",
            "title": "Address",
            "type": "string"
          },
          "created_at": {
            "description": "When this address was reserved.",
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "enabled": {
            "description": "Whether this address is active. A retired address stops routing but keeps its history, and its name is never given to another workspace.",
            "title": "Enabled",
            "type": "boolean"
          },
          "id": {
            "description": "Identity of this address row.",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "address",
          "enabled",
          "created_at"
        ],
        "title": "IntakeAddress",
        "type": "object"
      },
      "IntakeAddressList": {
        "additionalProperties": false,
        "description": "The workspace's inbound case-mail addresses.",
        "properties": {
          "addresses": {
            "description": "Every address reserved for this workspace, oldest first.",
            "items": {
              "$ref": "#/components/schemas/IntakeAddress"
            },
            "title": "Addresses",
            "type": "array"
          },
          "receiving_live": {
            "description": "Whether the platform's inbound mail path is live. While false, addresses are reserved and unique to your workspace but do not receive email yet.",
            "title": "Receiving Live",
            "type": "boolean"
          }
        },
        "required": [
          "addresses",
          "receiving_live"
        ],
        "title": "IntakeAddressList",
        "type": "object"
      },
      "IntakeConfirmVoiceLineRequest": {
        "properties": {
          "acknowledged_cost": {
            "maxLength": 500,
            "minLength": 1,
            "title": "Acknowledged Cost",
            "type": "string"
          }
        },
        "required": [
          "acknowledged_cost"
        ],
        "title": "IntakeConfirmVoiceLineRequest",
        "type": "object"
      },
      "IntakeGovernanceStatus": {
        "additionalProperties": false,
        "description": "Read shape: the toggle plus the platform guardrail's provisioning state.",
        "properties": {
          "enabled": {
            "description": "Whether this organisation's intake-authoring turns run through the platform's governance checks. Off by default.",
            "title": "Enabled",
            "type": "boolean"
          },
          "guardrail_configured": {
            "description": "Whether the platform has a default content guardrail provisioned. When false, content checks are advisory until a guardrail is provisioned — enabling the toggle still records the decision and applies the non-content checks.",
            "title": "Guardrail Configured",
            "type": "boolean"
          }
        },
        "required": [
          "enabled",
          "guardrail_configured"
        ],
        "title": "IntakeGovernanceStatus",
        "type": "object"
      },
      "IntakeGovernanceTelemetryResponse": {
        "description": "Governed-intake toggle evidence rollup (see ``core/kpi/intake_governance_telemetry``).",
        "properties": {
          "as_of": {
            "description": "UTC ISO-8601 timestamp the rollup was computed at.",
            "title": "As Of",
            "type": "string"
          },
          "disables_in_window": {
            "description": "In-window flips TO disabled.",
            "title": "Disables In Window",
            "type": "integer"
          },
          "enables_in_window": {
            "description": "In-window flips TO enabled.",
            "title": "Enables In Window",
            "type": "integer"
          },
          "governed": {
            "$ref": "#/components/schemas/IntakeModeFunnelResponse",
            "description": "The governed-arm session funnel."
          },
          "interventions": {
            "$ref": "#/components/schemas/IntakeInterventionsResponse"
          },
          "tenants_on": {
            "description": "Tenants with the governed-intake toggle ON right now (stored literal true — matching the read helper's coercion).",
            "title": "Tenants On",
            "type": "integer"
          },
          "tenants_on_share_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "tenants_on / tenants_total * 100 (2dp). null when there are no tenants.",
            "title": "Tenants On Share Pct"
          },
          "tenants_total": {
            "description": "All tenants (adoption denominator; point-in-time).",
            "title": "Tenants Total",
            "type": "integer"
          },
          "toggle_changes": {
            "description": "In-window toggle flips, oldest first (audit-sourced; capped at 500).",
            "items": {
              "$ref": "#/components/schemas/ToggleChangeResponse"
            },
            "title": "Toggle Changes",
            "type": "array"
          },
          "unattributed_sessions": {
            "description": "In-window sessions with no mode attribution (no session_id-carrying turn event — sessions predating turn-event instrumentation, or zero-turn sessions). Never folded into either arm.",
            "title": "Unattributed Sessions",
            "type": "integer"
          },
          "ungoverned": {
            "$ref": "#/components/schemas/IntakeModeFunnelResponse",
            "description": "The ungoverned-arm session funnel."
          },
          "window_end": {
            "description": "Exclusive upper bound (UTC ISO-8601) used.",
            "title": "Window End",
            "type": "string"
          },
          "window_start": {
            "description": "Inclusive lower bound (UTC ISO-8601) on session created_at / event occurred_at / audit event_at used for the window-bounded parts.",
            "title": "Window Start",
            "type": "string"
          }
        },
        "required": [
          "window_start",
          "window_end",
          "as_of",
          "tenants_total",
          "tenants_on",
          "enables_in_window",
          "disables_in_window",
          "governed",
          "ungoverned",
          "unattributed_sessions",
          "interventions"
        ],
        "title": "IntakeGovernanceTelemetryResponse",
        "type": "object"
      },
      "IntakeGovernanceUpdate": {
        "additionalProperties": false,
        "description": "Write shape for the governed-intake toggle.",
        "properties": {
          "enabled": {
            "description": "Whether this organisation's intake-authoring turns run through the platform's governance checks. Off by default.",
            "title": "Enabled",
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "title": "IntakeGovernanceUpdate",
        "type": "object"
      },
      "IntakeInterventionsResponse": {
        "description": "Turn volumes + what the governance layer actually did.",
        "properties": {
          "blocked_inputs": {
            "description": "DERIVED upper bound on input-blocked governed turns (started-governed minus completed-governed: a blocked input emits the started event only; a mid-turn crash also lands here).",
            "title": "Blocked Inputs",
            "type": "integer"
          },
          "blocked_outputs": {
            "description": "Governed turns whose output was withheld outright.",
            "title": "Blocked Outputs",
            "type": "integer"
          },
          "masked_inputs": {
            "description": "Governed turns whose input was masked before the model saw it.",
            "title": "Masked Inputs",
            "type": "integer"
          },
          "masked_outputs": {
            "description": "Governed turns whose output was masked before display.",
            "title": "Masked Outputs",
            "type": "integer"
          },
          "turns_completed_governed": {
            "description": "Governed turns saved (model ran, session state saved).",
            "title": "Turns Completed Governed",
            "type": "integer"
          },
          "turns_completed_ungoverned": {
            "description": "Ungoverned turns saved.",
            "title": "Turns Completed Ungoverned",
            "type": "integer"
          },
          "turns_started_governed": {
            "description": "Governed intake turns that began (input gate ran).",
            "title": "Turns Started Governed",
            "type": "integer"
          },
          "turns_started_ungoverned": {
            "description": "Ungoverned intake turns that began.",
            "title": "Turns Started Ungoverned",
            "type": "integer"
          }
        },
        "required": [
          "turns_started_governed",
          "turns_started_ungoverned",
          "turns_completed_governed",
          "turns_completed_ungoverned",
          "masked_inputs",
          "masked_outputs",
          "blocked_outputs",
          "blocked_inputs"
        ],
        "title": "IntakeInterventionsResponse",
        "type": "object"
      },
      "IntakeLatestActiveSession": {
        "description": "Response for the latest-in-progress lookup.\n\n``session`` is the caller's most recent in-progress session snapshot, or\nnull when there is nothing to resume — a wrapper (not a 404) so \"nothing in\nprogress\" is a normal answer, not an error.",
        "properties": {
          "session": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/IntakeSessionSnapshot"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "title": "IntakeLatestActiveSession",
        "type": "object"
      },
      "IntakeModeFunnelResponse": {
        "description": "Build-completion funnel for one intake mode (governed or ungoverned).",
        "properties": {
          "abandoned": {
            "description": "Sessions marked 'abandoned'.",
            "title": "Abandoned",
            "type": "integer"
          },
          "abandonment_rate_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "abandoned / sessions * 100 (2dp). null when the mode has no sessions.",
            "title": "Abandonment Rate Pct"
          },
          "active": {
            "description": "Sessions still in progress (undecided — dilutes both rates; reported so the undecided share is visible).",
            "title": "Active",
            "type": "integer"
          },
          "completed": {
            "description": "Sessions that reached status 'completed' (blueprint built / voice line provisioned).",
            "title": "Completed",
            "type": "integer"
          },
          "completion_rate_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "completed / sessions * 100 (2dp). null when the mode has no sessions (render 'no sessions', never '0%').",
            "title": "Completion Rate Pct"
          },
          "sessions": {
            "description": "In-window intake sessions attributed to this mode via their turn events' governed dimension.",
            "title": "Sessions",
            "type": "integer"
          }
        },
        "required": [
          "sessions",
          "completed",
          "abandoned",
          "active"
        ],
        "title": "IntakeModeFunnelResponse",
        "type": "object"
      },
      "IntakeSessionAbandoned": {
        "description": "Response for the explicit \"Start over\" discard.",
        "properties": {
          "session_id": {
            "format": "uuid",
            "title": "Session Id",
            "type": "string"
          },
          "status": {
            "default": "abandoned",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "session_id"
        ],
        "title": "IntakeSessionAbandoned",
        "type": "object"
      },
      "IntakeSessionCreateRequest": {
        "additionalProperties": false,
        "description": "Optional body for ``POST /sessions``.\n\nOmit the body (or send neither field) to open a fresh case for the\nconversation. Supply ``case_id`` OR ``case_ref`` (never both) to continue\nscoping inside an existing case.",
        "properties": {
          "case_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Id"
          },
          "case_ref": {
            "anyOf": [
              {
                "maxLength": 32,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Ref"
          }
        },
        "title": "IntakeSessionCreateRequest",
        "type": "object"
      },
      "IntakeSessionCreated": {
        "properties": {
          "case_id": {
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "case_ref": {
            "title": "Case Ref",
            "type": "string"
          },
          "session_id": {
            "format": "uuid",
            "title": "Session Id",
            "type": "string"
          }
        },
        "required": [
          "session_id",
          "case_id",
          "case_ref"
        ],
        "title": "IntakeSessionCreated",
        "type": "object"
      },
      "IntakeSessionList": {
        "description": "Response for the open-sessions list.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/IntakeSessionListItem"
            },
            "title": "Items",
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "title": "IntakeSessionList",
        "type": "object"
      },
      "IntakeSessionListItem": {
        "description": "One row of the open-sessions list.\n\nA lightweight summary — no payload/context/transcript. Enough for the\nonboarding drafts picker (state + last-active time) and the voice-lines\n\"Pending confirmation\" section (parked status + shop name) to render a\nrow and deep-link into the full session.",
        "properties": {
          "agent_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Type"
          },
          "messages_count": {
            "title": "Messages Count",
            "type": "integer"
          },
          "provision_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provision Status"
          },
          "session_id": {
            "format": "uuid",
            "title": "Session Id",
            "type": "string"
          },
          "shop_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shop Name"
          },
          "solution_intent": {
            "title": "Solution Intent",
            "type": "string"
          },
          "state": {
            "title": "State",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "session_id",
          "state",
          "status",
          "solution_intent",
          "agent_type",
          "provision_status",
          "shop_name",
          "messages_count",
          "updated_at"
        ],
        "title": "IntakeSessionListItem",
        "type": "object"
      },
      "IntakeSessionSnapshot": {
        "additionalProperties": true,
        "description": "Response shape for read + step endpoints.",
        "properties": {
          "agent_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Type"
          },
          "case_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Id"
          },
          "case_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Ref"
          },
          "context": {
            "additionalProperties": true,
            "title": "Context",
            "type": "object"
          },
          "governed": {
            "default": false,
            "title": "Governed",
            "type": "boolean"
          },
          "messages_count": {
            "title": "Messages Count",
            "type": "integer"
          },
          "payload": {
            "additionalProperties": true,
            "title": "Payload",
            "type": "object"
          },
          "provision_cost_note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provision Cost Note"
          },
          "provision_detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provision Detail"
          },
          "provision_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provision Status"
          },
          "provisioned_did": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provisioned Did"
          },
          "risk_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Risk Tier"
          },
          "session_id": {
            "format": "uuid",
            "title": "Session Id",
            "type": "string"
          },
          "solution_intent": {
            "default": "generic",
            "title": "Solution Intent",
            "type": "string"
          },
          "state": {
            "title": "State",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "transcript": {
            "items": {
              "$ref": "#/components/schemas/IntakeTranscriptEntry"
            },
            "title": "Transcript",
            "type": "array"
          },
          "transitions_count": {
            "title": "Transitions Count",
            "type": "integer"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          },
          "voicedesk_config": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voicedesk Config"
          }
        },
        "required": [
          "session_id",
          "state",
          "status",
          "agent_type",
          "risk_tier",
          "transitions_count",
          "messages_count",
          "updated_at",
          "payload",
          "context"
        ],
        "title": "IntakeSessionSnapshot",
        "type": "object"
      },
      "IntakeTranscriptEntry": {
        "description": "One user-visible turn of the intake conversation.\n\nDerived from the raw message log with tool plumbing stripped — exactly what\nthe user saw, so a resumed session re-renders the prior conversation.",
        "properties": {
          "blocked": {
            "default": false,
            "title": "Blocked",
            "type": "boolean"
          },
          "masked": {
            "default": false,
            "title": "Masked",
            "type": "boolean"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "text": {
            "title": "Text",
            "type": "string"
          }
        },
        "required": [
          "role",
          "text"
        ],
        "title": "IntakeTranscriptEntry",
        "type": "object"
      },
      "IntakeTurnRequest": {
        "properties": {
          "message": {
            "maxLength": 20000,
            "minLength": 1,
            "title": "Message",
            "type": "string"
          },
          "user_marked_done": {
            "default": false,
            "title": "User Marked Done",
            "type": "boolean"
          }
        },
        "required": [
          "message"
        ],
        "title": "IntakeTurnRequest",
        "type": "object"
      },
      "IntakeTurnResponse": {
        "properties": {
          "assistant_text": {
            "title": "Assistant Text",
            "type": "string"
          },
          "session": {
            "$ref": "#/components/schemas/IntakeSessionSnapshot"
          }
        },
        "required": [
          "assistant_text",
          "session"
        ],
        "title": "IntakeTurnResponse",
        "type": "object"
      },
      "IntakeValidationIssue": {
        "description": "One thing wrong with the submitted file.\n\n``row`` is the 1-based DATA row (the header row is not row 1) or null for\nan issue about the file as a whole; ``column`` names the column, or null.\n``detail`` says what is wrong in the pack's own vocabulary and never quotes\nthe cell's contents — an intake file is usually the customer's own record,\nand a validation message that echoed a value would carry it onto this\nresponse and into logs.",
        "properties": {
          "column": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Column name, or null if file-level.",
            "title": "Column"
          },
          "detail": {
            "description": "What is wrong, in customer-facing language.",
            "title": "Detail",
            "type": "string"
          },
          "row": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "1-based data row, or null if file-level.",
            "title": "Row"
          }
        },
        "required": [
          "detail"
        ],
        "title": "IntakeValidationIssue",
        "type": "object"
      },
      "IntakeValidationRead": {
        "description": "``/intake-validation`` response — whether this file is one the pack can use.\n\n``accepted`` is the verdict: true only when nothing was found. Nothing\nabout it blocks a run — an unaccepted file can still be run, and the\nreport exists so the desk knows what the result will be missing.",
        "properties": {
          "accepted": {
            "description": "True only when no issue was found.",
            "title": "Accepted",
            "type": "boolean"
          },
          "attachment_id": {
            "format": "uuid",
            "title": "Attachment Id",
            "type": "string"
          },
          "issues": {
            "items": {
              "$ref": "#/components/schemas/IntakeValidationIssue"
            },
            "title": "Issues",
            "type": "array"
          },
          "kind": {
            "description": "The intake contract the file was checked against.",
            "title": "Kind",
            "type": "string"
          },
          "label": {
            "description": "Customer-facing name of that contract.",
            "title": "Label",
            "type": "string"
          },
          "missing_required_columns": {
            "description": "Required columns absent from the header — these explain most other issues.",
            "items": {
              "type": "string"
            },
            "title": "Missing Required Columns",
            "type": "array"
          },
          "notes": {
            "description": "What was deliberately NOT checked, so an accepted file is not over-read.",
            "items": {
              "type": "string"
            },
            "title": "Notes",
            "type": "array"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "row_count": {
            "description": "Data rows read from the file.",
            "title": "Row Count",
            "type": "integer"
          },
          "unit_count": {
            "description": "Units of work found (see unit_label).",
            "title": "Unit Count",
            "type": "integer"
          },
          "unit_label": {
            "description": "What a unit is for this pack, e.g. an encounter.",
            "title": "Unit Label",
            "type": "string"
          },
          "unrecognised_columns": {
            "description": "Columns the contract does not know. NOT an error: a real extract usually needs a column mapping, so these are reported, not failed.",
            "items": {
              "type": "string"
            },
            "title": "Unrecognised Columns",
            "type": "array"
          }
        },
        "required": [
          "attachment_id",
          "pack_slug",
          "kind",
          "label",
          "accepted",
          "row_count",
          "unit_count",
          "unit_label"
        ],
        "title": "IntakeValidationRead",
        "type": "object"
      },
      "IntegrityChainBreak": {
        "description": "The first broken link found while re-verifying this run's audit chain.\n\nMirrors :class:`velerian.core.audit.integrity.ChainBreak` (the same shape the\nadmin ``/api/v2/audit-log/verify`` proof carries). Present only on the rare\n``valid=false`` path; ``null`` on every intact chain.",
        "properties": {
          "actual": {
            "title": "Actual",
            "type": "string"
          },
          "entry_id": {
            "format": "uuid",
            "title": "Entry Id",
            "type": "string"
          },
          "expected": {
            "title": "Expected",
            "type": "string"
          },
          "position": {
            "title": "Position",
            "type": "integer"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "entry_id",
          "position",
          "reason",
          "expected",
          "actual"
        ],
        "title": "IntegrityChainBreak",
        "type": "object"
      },
      "IntegrityProof": {
        "description": "Re-verified tamper-evidence proof for this run's audit chain.\n\nComputed on READ by re-walking the tenant's audit hash-chain up to and\nincluding this run's audit rows (re-computing each ``row_hash`` + checking\n``prev_hash`` linkage via\n:func:`velerian.core.audit.integrity.verify_audit_chain`). Re-verifying at\nread time is the point: it proves the chain that this run's evidence rests on\nis STILL intact NOW, not just at the moment the evidence pack was assembled.\n\n``valid`` is a FACT computed from the chain — never hardcoded. ``row_count``\nis how many audit rows were verified (genesis → this run). ``first_break`` is\n``null`` on an intact chain, else the first broken link.",
        "properties": {
          "first_break": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/IntegrityChainBreak"
              },
              {
                "type": "null"
              }
            ]
          },
          "first_event_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Event At"
          },
          "last_event_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Event At"
          },
          "row_count": {
            "title": "Row Count",
            "type": "integer"
          },
          "valid": {
            "title": "Valid",
            "type": "boolean"
          }
        },
        "required": [
          "valid",
          "row_count",
          "first_event_at",
          "last_event_at",
          "first_break"
        ],
        "title": "IntegrityProof",
        "type": "object"
      },
      "IntegrityProofRead": {
        "description": "Examiner-facing hash-chain integrity proof.\n\n``valid`` is the verdict. It is false when a record was changed or a\nrecord that a later one commits to was removed, and — when the scan\nreaches the newest rows (no ``until``) — also when a record exists whose\ndeletion this verification could not detect, because no later row links\nor covers it and the chain head does not name it (``first_break.reason``\nis ``uncovered_row``). The remaining fields say how far the proof\nreaches: ``fork_count`` rows-sharing-a-predecessor points, and, for those\nscans, ``uncovered_count``, the number of such records.\n``coverage_complete`` is true when that count is zero.",
        "properties": {
          "anchored_count": {
            "default": 0,
            "title": "Anchored Count",
            "type": "integer"
          },
          "coverage_complete": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Coverage Complete"
          },
          "first_break": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ChainBreakRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "first_event_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Event At"
          },
          "first_fork": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ForkPointRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "first_uncovered_entry_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Uncovered Entry Id"
          },
          "fork_count": {
            "default": 0,
            "title": "Fork Count",
            "type": "integer"
          },
          "last_event_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Event At"
          },
          "row_count": {
            "title": "Row Count",
            "type": "integer"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "tip_witnessed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tip Witnessed"
          },
          "uncovered_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Uncovered Count"
          },
          "valid": {
            "title": "Valid",
            "type": "boolean"
          }
        },
        "required": [
          "tenant_id",
          "valid",
          "row_count",
          "first_event_at",
          "last_event_at",
          "first_break"
        ],
        "title": "IntegrityProofRead",
        "type": "object"
      },
      "InviteLinkView": {
        "description": "What an invite link resolves to — the redacted, read-only public view.\n\nDeliberately omits tenant / user / invitation ids and the token itself.\n``state`` is the only thing the sign-up surface branches on: ``pending``\nmeans the link can be signed up against; anything else is a plain-language\ndead end (expired, withdrawn, already used).",
        "properties": {
          "email": {
            "description": "The address the invite was sent to (sign up with this one).",
            "title": "Email",
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When a pending link lapses (UTC ISO-8601).",
            "title": "Expires At"
          },
          "role": {
            "description": "The role the invitee lands with.",
            "title": "Role",
            "type": "string"
          },
          "state": {
            "description": "pending = usable; expired / revoked / accepted = no longer usable.",
            "enum": [
              "pending",
              "expired",
              "revoked",
              "accepted"
            ],
            "title": "State",
            "type": "string"
          },
          "tenant_name": {
            "description": "Display name of the workspace the invite joins.",
            "title": "Tenant Name",
            "type": "string"
          }
        },
        "required": [
          "email",
          "role",
          "tenant_name",
          "state"
        ],
        "title": "InviteLinkView",
        "type": "object"
      },
      "InviteRequest": {
        "properties": {
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "role": {
            "default": "member",
            "description": "Role the invitee lands with.",
            "enum": [
              "owner",
              "admin",
              "supervisor",
              "member",
              "practitioner",
              "viewer",
              "auditor"
            ],
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "title": "InviteRequest",
        "type": "object"
      },
      "InviteResponse": {
        "properties": {
          "email": {
            "title": "Email",
            "type": "string"
          },
          "email_delivered": {
            "description": "True iff the invite email was accepted for delivery. False when it was not sent (mail is not live for this deployment, or the provider refused the address) — the inviter should share ``invite_url`` directly.",
            "title": "Email Delivered",
            "type": "boolean"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "invite_url": {
            "description": "The same link the invite email carries. Always returned so the inviter can copy and share it when the email did not go out. It is a handle, not a credential: the invitee must sign up with the invited address.",
            "title": "Invite Url",
            "type": "string"
          },
          "role": {
            "enum": [
              "owner",
              "admin",
              "supervisor",
              "member",
              "practitioner",
              "viewer",
              "auditor"
            ],
            "title": "Role",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "role",
          "status",
          "email_delivered",
          "invite_url"
        ],
        "title": "InviteResponse",
        "type": "object"
      },
      "InviteUserRequest": {
        "description": "Request body for `POST /users/invite`.\n\nThe admin picks the destination tenant explicitly (rather than\ninferring from the caller's own tenant) because they're operating\nacross the directory. Role is constrained to the same set as\n``/api/v2/users`` POST.",
        "properties": {
          "display_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "role": {
            "default": "member",
            "maxLength": 32,
            "pattern": "^(admin|member|viewer)$",
            "title": "Role",
            "type": "string"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "tenant_id",
          "email"
        ],
        "title": "InviteUserRequest",
        "type": "object"
      },
      "InvitedUser": {
        "description": "Response for `POST /users/invite`.\n\nThe render preview lets the operator see exactly what the email\nbody would contain — useful while the SES transport is still\nsandbox-gated.",
        "properties": {
          "cognito_sub": {
            "title": "Cognito Sub",
            "type": "string"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "invite_email_delivered": {
            "default": false,
            "title": "Invite Email Delivered",
            "type": "boolean"
          },
          "invite_email_rendered": {
            "title": "Invite Email Rendered",
            "type": "boolean"
          },
          "invite_email_subject": {
            "title": "Invite Email Subject",
            "type": "string"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "email",
          "role",
          "display_name",
          "cognito_sub",
          "invite_email_subject",
          "invite_email_rendered"
        ],
        "title": "InvitedUser",
        "type": "object"
      },
      "InvokeAccepted": {
        "description": "202 wire shape for an accepted-but-not-finished invoke.\n\nThe run executes out-of-band; the caller polls ``poll_url`` (the\nrun-history detail endpoint) until ``status`` is terminal\n(``succeeded``/``failed``). ``run_id`` doubles as the invocation id —\nthe same join key audit/metering/evidence carry, and the same id the\nsynchronous 200 response returns under that name.\n\n``run_url`` is the browser-openable permalink to the run detail page —\n``poll_url`` is for the machine, ``run_url`` for the human.\n\n``journey_id`` / ``journey_url`` are set when the submit started the\ncase's stage-by-stage workflow instead of a single governed pass (a pack\nthat declares stages, submitted without naming a case). ``run_id`` is then\nthe workflow's FIRST stage run — the same poll contract — and the workflow\nitself is read at ``journey_url``. Both are ``None`` on a single pass.",
        "properties": {
          "admission": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Admission"
          },
          "case_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Id"
          },
          "case_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Ref"
          },
          "journey_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Journey Id"
          },
          "journey_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Journey Url"
          },
          "poll_url": {
            "title": "Poll Url",
            "type": "string"
          },
          "run_id": {
            "title": "Run Id",
            "type": "string"
          },
          "run_url": {
            "title": "Run Url",
            "type": "string"
          },
          "status": {
            "default": "queued",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "run_id",
          "poll_url",
          "run_url"
        ],
        "title": "InvokeAccepted",
        "type": "object"
      },
      "InvokeRequest": {
        "description": "Wire shape for ``POST /{slug}/invoke``.\n\nThe intake-style prompt the operator wants the pack to act on. Free-\ntext by design — each pack's orchestrator decides how to route the\nrequest to its agents. ``metadata`` is an opaque envelope the\nfrontend may use to thread context (loan-application id, prospect\npersona, etc.) without baking the keys into the platform schema.",
        "properties": {
          "attachment_ids": {
            "description": "Optional: ids of previously-uploaded run attachments (see POST /api/v2/run-attachments) whose extracted text is prepended, clearly labeled, to the prompt as run INPUT. The attachment text flows through the SAME governed pipeline as the prompt — the governance evaluator and the model both see it. Only the calling tenant's own stored attachments are loaded (RLS); unknown/foreign ids are silently skipped. An attachment uploaded to a CASE (registered with a case_id) is consumable by every run on that case — first run, later runs, revisions — but a run resolved to a DIFFERENT case refuses it with a 422 naming the mismatched documents. How many documents one run may carry is set by the pack: most accept 10, and packs whose unit of work is a multi-document case file (an audit-defense bundle, say) accept more. The bound in this schema is the platform ceiling — supplying more than the pack's own limit is a 422 naming that limit.",
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 25,
            "title": "Attachment Ids",
            "type": "array"
          },
          "case_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional: the id of the case this run works. Supply case_id OR case_ref, not both. When neither is supplied (and the run is not a revision), a case is opened automatically and its identity is returned in the response. An unknown or other-workspace case id is a 404 — never a silent new case.",
            "title": "Case Id"
          },
          "case_ref": {
            "anyOf": [
              {
                "maxLength": 32,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional: the quotable case reference this run works (C-000123 / C-123 / 123). Supply case_ref OR case_id, not both. A string that is not a case reference is a 422; a well-formed reference with no matching case is a 404 — never a silent new case.",
            "title": "Case Ref"
          },
          "metadata": {
            "additionalProperties": true,
            "description": "Free-form per-invocation metadata. Pack-specific keys (loan_id, prospect_persona, etc.); not validated here.",
            "title": "Metadata",
            "type": "object",
            "x-max-serialized-bytes": 131072
          },
          "model_id": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional: the Claude tier to run this pack on. One of the selectable model ids (see GET /api/agenticx/networks/{slug}/models). When omitted, the pack's recommended model is used. Must be a Velerian-enabled Claude tier — BYO/arbitrary models are not accepted here.",
            "title": "Model Id"
          },
          "oversight": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RunOversightSelection"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional: the run's oversight plan. Names the workflow phase this run belongs to and any phases whose oversight the operator TIGHTENED above the pack's baseline (for example promoting a phase to human-in-the-loop, which pauses a run in that phase for a reviewer's approval). Tighten-only: a mode below the pack's baseline for a phase is rejected (422). On a revision run (parent_run_id set) the parent run's recorded plan is inherited server-side, so a resume can never drop a requested approval checkpoint."
          },
          "parent_run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional: the id of the run this run REVISES. When set, this invoke is a REVISION RUN — an ordinary single-pass governed run that additionally records its lineage (the run it descends from). It gets its OWN governance + outcome verdict + audit + evidence like any run; the parent link is the only extra fact. NULL on an origin (non-revision) run. Prefer the /api/v2/pack-runs/{id}/revise convenience endpoint, which validates the parent under RLS.",
            "title": "Parent Run Id"
          },
          "prompt_text": {
            "description": "The user's intake question or scenario to run the pack on.",
            "maxLength": 20000,
            "minLength": 1,
            "title": "Prompt Text",
            "type": "string"
          },
          "revision_gaps": {
            "anyOf": [
              {
                "items": {
                  "maxLength": 500,
                  "type": "string"
                },
                "maxItems": 50,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional: the named gaps — labels from the parent run's outcome verdict — this revision SET OUT to close. A snapshot of intent recorded on the run; pass-through for now (stored, not auto-composed into the prompt). Ignored unless parent_run_id is also set.",
            "title": "Revision Gaps"
          }
        },
        "required": [
          "prompt_text"
        ],
        "title": "InvokeRequest",
        "type": "object"
      },
      "InvokeResponse": {
        "description": "Wire shape returned by ``POST /{slug}/invoke``.\n\nMirrors the per-prompt record from ``scripts/evals/run_pack_corpus.py``\nso the eval harness + the demo invocation surface speak the same\nvocabulary. ``governance_pass`` is the governance verdict on the\ninvocation's output: an evaluation via :class:`GovernanceEvaluator`\nagainst the pack's declared governance template. ``governance_reasons`` (additive,\noptional) carries the human-readable reasons a verdict failed — empty\n/ ``None`` on a clean pass. ``evidence_download_url`` is the\nbrowser-fetchable presigned link to the per-invocation evidence pack\nrendered + uploaded on every invocation (criterion 3); ``None`` only\nwhen the best-effort upload (or presign) failed. Automated consumers\nthat need the evidence pack's canonical storage reference receive it\nin the ``evidence.ready`` webhook payload.\n\n``run_id`` + ``run_url`` make the response actionable on its own: the\ncaller can export, revise or share the run it just created without\nlisting runs and guessing which one is theirs, and can open the run in\na browser. ``prompt_id`` carries the same value and is kept for\ncompatibility.",
        "properties": {
          "case_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The id of the case this run belongs to — the one supplied on the request, the parent run's case for a revision, or the case opened automatically for this run. Every run works a case; the identity is returned so the caller can address the same case on later submits (``GET /api/v2/cases/{case_id}``).",
            "title": "Case Id"
          },
          "case_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The quotable reference of the run's case (``C-000123``) — the identifier people quote to each other, accepted anywhere a case is addressed (``case_ref`` on submit, ``GET /api/v2/cases/by-ref/{case_ref}``, worklist search).",
            "title": "Case Ref"
          },
          "evidence_download_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Browser-fetchable presigned ``https://`` URL for the per-invocation evidence pack (criterion 3) — what the run UI's 'Open evidence pack' link should use. Every invocation — alpha or production-ready — renders a compact, examiner-readable pack (model id, prompt hash, governance verdict + reasons, token usage, audit-chain pointer, timestamp) and uploads it to ``velerian-audit-evidence-{env}``. Minted at invoke time with a 1-hour TTL (long enough to click from the result panel; short enough that a leaked URL is not a lifetime disclosure — the posture matches the ABP invocation-evidence export route). ``None`` when the best-effort upload or presign failed (the invocation still succeeded + was audited + metered; the audit log remains the system of record). Automated consumers get the evidence pack's canonical storage reference via the ``evidence.ready`` webhook instead.",
            "title": "Evidence Download Url"
          },
          "evidence_stored": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether the run's evidence pack was stored before this response was sent. ``true``: it is stored. If ``evidence_download_url`` is ``null`` as well, only the download link could not be issued; reading the run (``GET /api/v2/pack-runs/{run_id}``) issues a fresh link. ``false``: storing it was not confirmed before the response was sent; the pack is kept and storing it is retried automatically. ``null`` when a replayed request finds no stored outcome for the run (additive — clients that ignore it are unaffected).",
            "title": "Evidence Stored"
          },
          "governance_pass": {
            "description": "Governance verdict on the output. ``True`` means the output passed policy evaluation against the pack's declared governance template. A ``False`` value is a normal outcome (the invocation is still recorded + metered) — not an error.",
            "title": "Governance Pass",
            "type": "boolean"
          },
          "governance_reasons": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional human-readable reasons a governance verdict failed (additive — clients that only read ``governance_pass`` are unaffected). ``None`` / empty on a clean pass.",
            "title": "Governance Reasons"
          },
          "model_id_used": {
            "description": "The Bedrock inference-profile id the response came back from (matches the pack's primary or fallback profile).",
            "title": "Model Id Used",
            "type": "string"
          },
          "output_origin": {
            "$ref": "#/components/schemas/RunOrigin",
            "default": "unknown"
          },
          "output_refused": {
            "default": false,
            "description": "``True`` when the model provider declined to complete the answer. Such a run is not accepted and nothing the model wrote is released: it is recorded as ``failed`` with the provider's refusal as the reason, ``governance_pass`` is ``False`` and ``governance_reasons`` names the refusal, ``output_text`` carries that same sentence in place of the answer, and no report or export is built. The platform does not retry the request or send it to another model; rerun it, and if it is declined again, check the record for content the provider's safety policy may flag. ``False`` on every other run (additive).",
            "title": "Output Refused",
            "type": "boolean"
          },
          "output_text": {
            "description": "The model's response text (concatenated text blocks). When a real Bedrock Guardrail blocks the invocation (``False`` governance verdict on a guardrail-enforced pack), the model text is WITHHELD and this carries the structured governance block message instead — fail-closed, no unsafe content reaches the caller (Rule 7).",
            "title": "Output Text",
            "type": "string"
          },
          "output_truncated": {
            "default": false,
            "description": "``True`` when the model stopped because its answer reached the output ceiling, so the answer was cut off before it finished. Such a run is not accepted: it is recorded as ``failed`` with this reason, ``governance_pass`` is ``False`` and ``governance_reasons`` names the cut-off, and no report or export is built from the partial text. Rerun with a smaller record, or split the record into parts. ``False`` on every run whose answer finished (additive — clients that ignore it are unaffected).",
            "title": "Output Truncated",
            "type": "boolean"
          },
          "prompt_id": {
            "description": "Deprecated alias for ``run_id`` — byte-identical value, retained so existing clients keep working. Prefer ``run_id``: it is the name the rest of the run API (and the async invoke) uses for this same identifier.",
            "title": "Prompt Id",
            "type": "string"
          },
          "refusal_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The category the model provider gave for declining (a short word such as ``bio`` or ``cyber``) when ``output_refused`` is ``True`` and the provider named one; ``None`` otherwise.",
            "title": "Refusal Category"
          },
          "run_id": {
            "description": "The run's canonical identifier (UUIDv4) — the id every downstream run capability takes: ``GET /api/v2/pack-runs/{run_id}``, ``POST /api/v2/pack-runs/{run_id}/revise``, ``POST /api/v2/pack-runs/{run_id}/share`` and the evidence export routes. Identical to the async invoke's ``run_id`` (``?async=true``), so both paths hand back the same handle under the same name.",
            "title": "Run Id",
            "type": "string"
          },
          "run_url": {
            "description": "Canonical, browser-openable permalink to this run's detail page (``{app-origin}/runs/{run_id}``) — what a human wants to open, and what to paste into a ticket or a message.",
            "title": "Run Url",
            "type": "string"
          },
          "slug": {
            "description": "The pack slug that was invoked.",
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "run_id",
          "run_url",
          "prompt_id",
          "output_text",
          "model_id_used",
          "governance_pass"
        ],
        "title": "InvokeResponse",
        "type": "object"
      },
      "JourneyAskRead": {
        "additionalProperties": false,
        "description": "What a paused journey is waiting for, stated so someone can act on it.",
        "properties": {
          "addressee": {
            "description": "Who can act on it: human, connector, or time.",
            "title": "Addressee",
            "type": "string"
          },
          "kind": {
            "description": "The kind of ask: external_response, missing_input, route_to_specialist, or data_movement.",
            "title": "Kind",
            "type": "string"
          },
          "raised_at": {
            "description": "When the journey paused.",
            "format": "date-time",
            "title": "Raised At",
            "type": "string"
          },
          "requirement_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The first data requirement the journey waits on, by its stable id in the pack's data contract. Null for an ask that is not about data.",
            "title": "Requirement Id"
          },
          "requirement_ids": {
            "description": "Every data requirement the journey waits on, in the contract's order. The journey resumes on its own once all of them have arrived.",
            "items": {
              "type": "string"
            },
            "title": "Requirement Ids",
            "type": "array"
          },
          "resumes_on": {
            "description": "The signals that resume the journey.",
            "items": {
              "$ref": "#/components/schemas/JourneyResumeSignalRead"
            },
            "title": "Resumes On",
            "type": "array"
          },
          "stage_index": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Position of the step the journey stopped before, from 0.",
            "title": "Stage Index"
          },
          "stage_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Stable identifier of the step the journey stopped before.",
            "title": "Stage Key"
          },
          "summary": {
            "description": "What is waiting, on what, and the next action.",
            "title": "Summary",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "addressee",
          "summary",
          "raised_at"
        ],
        "title": "JourneyAskRead",
        "type": "object"
      },
      "JourneyComputeExecutionRead": {
        "additionalProperties": false,
        "description": "The recorded platform-code attempt, without its inputs or output.",
        "properties": {
          "compute_ref": {
            "pattern": "^[A-Za-z0-9_.:-]{1,128}$",
            "title": "Compute Ref",
            "type": "string"
          },
          "compute_run_id": {
            "format": "uuid",
            "title": "Compute Run Id",
            "type": "string"
          },
          "on_report": {
            "default": false,
            "description": "True when the attempt was made once on a person's report that the round's submission arrived, outside the round's advance: the step stays pending and the round halted.",
            "title": "On Report",
            "type": "boolean"
          }
        },
        "required": [
          "compute_run_id",
          "compute_ref"
        ],
        "title": "JourneyComputeExecutionRead",
        "type": "object"
      },
      "JourneyEventRead": {
        "additionalProperties": false,
        "description": "One job-level beat of the journey, derived from its recorded steps.\n\nEvents name what is being worked — the step, its kind, the acting agent\n— never the content an agent produced. Agent output is available on the\nrun itself, where its governance disposition controls what is shown.",
        "properties": {
          "acting_agent": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StageAgentRead"
              },
              {
                "type": "null"
              }
            ],
            "description": "The agent performing this step, for agent-run steps. Null for human, wait and compute steps, and when no attribution was recorded."
          },
          "at": {
            "description": "When it happened.",
            "format": "date-time",
            "title": "At",
            "type": "string"
          },
          "kind": {
            "description": "What happened: journey_started, step_paused, step_resumed, step_started, step_completed, step_failed, step_skipped, journey_completed, journey_halted, or journey_cancelled.",
            "title": "Kind",
            "type": "string"
          },
          "outcome": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How the step finished, on closing beats — succeeded/failed for a run, completed/declined for human work, met/breached for a wait, cancelled when the case was closed first. Null on starting beats.",
            "title": "Outcome"
          },
          "stage_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The recorded stage this beat derives from. Null for journey-level beats.",
            "title": "Stage Id"
          },
          "stage_index": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Position of the step in the declared order, from 0.",
            "title": "Stage Index"
          },
          "stage_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Stable identifier of the declared step.",
            "title": "Stage Key"
          },
          "stage_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the step does: run, human, watch, or compute (a step the platform performed in code, with no agent).",
            "title": "Stage Kind"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The declared title of the step, as the timeline shows it.",
            "title": "Title"
          }
        },
        "required": [
          "kind",
          "at"
        ],
        "title": "JourneyEventRead",
        "type": "object"
      },
      "JourneyFactsConsistencyRead": {
        "additionalProperties": false,
        "description": "One declared check of a step's stated facts against the case record.\n\nA step can declare checks that what it states agrees with facts recorded\nearlier on the case, such as \"every undetermined ticket stays\nundetermined\". This is one check's verdict: which check, which stated fact\nit read, what it found, and which entries of the stated list disagreed, by\ntheir position in that list. The entries' ids and values are never\nincluded.",
        "properties": {
          "missing": {
            "default": 0,
            "description": "Recorded entries the statement left out (entries.match).",
            "title": "Missing",
            "type": "integer"
          },
          "outcome": {
            "anyOf": [
              {
                "enum": [
                  "passed",
                  "violated",
                  "not_applicable",
                  "unexaminable",
                  "not_examined"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "passed; violated (the statement contradicts the record); not_applicable (nothing to compare); unexaminable (the record the check reads was not carried, which stops the journey like a contradiction); or not_examined (no record was available to read, such as a record left off an over-long turn), which is neither a pass nor a failure.",
            "title": "Outcome"
          },
          "positions": {
            "description": "Zero-based positions of the stated entries that disagreed: in the stated list for entries.match, in the declared equalities for totals.match.",
            "items": {
              "type": "integer"
            },
            "title": "Positions",
            "type": "array"
          },
          "ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The check's registered function, such as entries.match. Null when unknown.",
            "title": "Ref"
          },
          "stated_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The stated fact the check read. Null when unknown.",
            "title": "Stated Key"
          }
        },
        "title": "JourneyFactsConsistencyRead",
        "type": "object"
      },
      "JourneyPositionProof": {
        "additionalProperties": false,
        "properties": {
          "case_id": {
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "consumers": {
            "items": {
              "$ref": "#/components/schemas/ConsumerRead"
            },
            "title": "Consumers",
            "type": "array"
          },
          "contracts": {
            "items": {
              "$ref": "#/components/schemas/PositionContract"
            },
            "title": "Contracts",
            "type": "array"
          },
          "journey_id": {
            "format": "uuid",
            "title": "Journey Id",
            "type": "string"
          },
          "journey_status": {
            "title": "Journey Status",
            "type": "string"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "positions": {
            "items": {
              "$ref": "#/components/schemas/PositionRead"
            },
            "title": "Positions",
            "type": "array"
          },
          "profile_id": {
            "title": "Profile Id",
            "type": "string"
          },
          "served_build_sha": {
            "title": "Served Build Sha",
            "type": "string"
          },
          "stages_revision": {
            "title": "Stages Revision",
            "type": "string"
          }
        },
        "required": [
          "case_id",
          "journey_id",
          "pack_slug",
          "stages_revision",
          "journey_status",
          "served_build_sha",
          "profile_id",
          "contracts",
          "positions",
          "consumers"
        ],
        "title": "JourneyPositionProof",
        "type": "object"
      },
      "JourneyRead": {
        "description": "A case's journey: where it stands and every stage in declared order.",
        "properties": {
          "case_id": {
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "crew_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The pack's crew display label — how this pack's team of agents is named in the catalog. Null when the catalog declares none.",
            "title": "Crew Label"
          },
          "current_stage_index": {
            "description": "Index of the stage in progress; equals the stage count when all are closed.",
            "title": "Current Stage Index",
            "type": "integer"
          },
          "events": {
            "description": "The journey's job-level beats in the order they happened, derived entirely from the recorded steps: the journey starting, each step being entered and closed, and the journey finishing or stopping. Every beat cites the recorded step it derives from; none carries agent output.",
            "items": {
              "$ref": "#/components/schemas/JourneyEventRead"
            },
            "title": "Events",
            "type": "array"
          },
          "halt_cause": {
            "anyOf": [
              {
                "enum": [
                  "capability",
                  "policy",
                  "outcome_reached"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "What kind of stop it was, when the journey halted: 'outcome_reached' means the work FINISHED EARLY — the recorded facts established the job was done, so the remaining steps had nothing left to do, and the case carries on to its outcome as a completed job. 'policy' means a safeguard withheld a step's output, or what it stated contradicted the case's record; 'capability' means a step could not finish its work. Null while the journey is running, on clean completion, and on a halt recorded before this field existed.",
            "title": "Halt Cause"
          },
          "halt_reason_kind": {
            "anyOf": [
              {
                "enum": [
                  "output_truncated",
                  "provider_refusal",
                  "contradicts_record",
                  "document_not_on_turn",
                  "preparation_conflict",
                  "pickup_expired",
                  "execution_expired",
                  "deadline",
                  "owner_failed",
                  "owner_shutdown",
                  "actor_denied",
                  "claim_denied",
                  "crew_not_enabled",
                  "wait_expired",
                  "crew_version_moved"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The typed reason beside `halt_cause`, when the step that stopped the journey recorded one: 'output_truncated' (the answer was cut off at its output limit), 'provider_refusal' (the model provider declined to finish the answer), 'contradicts_record' (what the step stated contradicts facts recorded earlier on the case, so none of it was used), 'document_not_on_turn' (none of the step's documents reached it and it stated values only a document could show, so none of it was used; the step runs again when one of its documents arrives), 'preparation_conflict' (the case's data changed while the step worked), or why the step's execution was retired ('pickup_expired', 'execution_expired', 'deadline', 'owner_failed', 'owner_shutdown', 'actor_denied', 'claim_denied'), or 'crew_not_enabled' (the workspace is no longer enabled for the crew, so the step did not run). Null for every other stop, and while the journey is not halted.",
            "title": "Halt Reason Kind"
          },
          "halted_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the journey stopped, when it halted, as recorded for audit. Apart from an early finish it can name internal step keys, so describe a stop to a person from `halt_cause` and `halt_reason_kind` instead.",
            "title": "Halted Reason"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "paused_ask": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/JourneyAskRead"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the journey is waiting for while paused — the kind of ask, who can act on it, the data requirement it waits on and the signals that resume it. Null unless the journey is paused."
          },
          "principal_seat": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PrincipalSeatRead"
              },
              {
                "type": "null"
              }
            ],
            "description": "The human sign-off seat on this workflow, when the pack declares approvals: the minimum approver tier those declared gates require. Names a tier, never a person — no designated approver exists on the case. Null when the pack declares no strict approval gate (there is then no sign-off seat to show)."
          },
          "proof_holds": {
            "items": {
              "$ref": "#/components/schemas/CompletionProofHoldRead"
            },
            "title": "Proof Holds",
            "type": "array"
          },
          "resume_allowed": {
            "default": false,
            "description": "Whether the ordinary missing-input waiver can continue this paused journey.",
            "title": "Resume Allowed",
            "type": "boolean"
          },
          "round": {
            "default": 1,
            "description": "Which round of the case this journey runs, from 1. A case whose crew works in rounds holds one journey per round, at most one of them live.",
            "title": "Round",
            "type": "integer"
          },
          "round_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why this round started, for a round after the first: person (a person started it by hand) or next_round_due (the due-round job started it on the claim's next-round date). Null for a first round and for a round started before the reason was recorded. Codes may be added; read one you do not know as a reason not named here.",
            "title": "Round Reason"
          },
          "runs_in_rounds": {
            "default": false,
            "description": "Whether this journey's crew works its cases in rounds: it registered a round policy and declares stages. Such a crew may hold the case for a person's decision after any round, the first included. False for a crew that keeps one workflow per case.",
            "title": "Runs In Rounds",
            "type": "boolean"
          },
          "stage_count": {
            "title": "Stage Count",
            "type": "integer"
          },
          "stages": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/JourneyStageRead"
            },
            "title": "Stages",
            "type": "array"
          },
          "stages_revision": {
            "description": "The stage list this journey was started against, pinned so a later edit never rewrites a journey already in flight.",
            "title": "Stages Revision",
            "type": "string"
          },
          "started_at": {
            "format": "date-time",
            "title": "Started At",
            "type": "string"
          },
          "status": {
            "description": "active | completed | halted | paused | cancelled. 'cancelled' means the case was closed while its job was still open, whether it was abandoned or resolved: no further step ran, and a step still running at that moment finished without its result being added to the case.",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "case_id",
          "pack_slug",
          "stages_revision",
          "status",
          "current_stage_index",
          "stage_count",
          "started_at"
        ],
        "title": "JourneyRead",
        "type": "object"
      },
      "JourneyResumeSignalRead": {
        "additionalProperties": false,
        "description": "One thing that resumes a paused journey.",
        "properties": {
          "requirement_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The data requirement this signal waits on, for requirement_acquired.",
            "title": "Requirement Id"
          },
          "signal": {
            "description": "What resumes the journey: requirement_acquired (the named input arrives on the case), work_item_completed, clock_fired, or person (someone chooses to continue).",
            "title": "Signal",
            "type": "string"
          }
        },
        "required": [
          "signal"
        ],
        "title": "JourneyResumeSignalRead",
        "type": "object"
      },
      "JourneyRoundRead": {
        "description": "One round of a case: its journey, where it ended and when.",
        "properties": {
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "halt_cause": {
            "anyOf": [
              {
                "enum": [
                  "capability",
                  "policy",
                  "outcome_reached"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Halt Cause"
          },
          "id": {
            "description": "The round's journey.",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "notes": {
            "description": "What the round's steps refused, each in the sentence the step recorded, in step order: a claim the claim register did not close, or a submission not sent. Only a refusal with a recorded sentence is listed, and the same sentence once. Empty when there is none.",
            "items": {
              "$ref": "#/components/schemas/RoundNoteRead"
            },
            "title": "Notes",
            "type": "array"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "round": {
            "description": "Which round of the case this is, from 1.",
            "title": "Round",
            "type": "integer"
          },
          "round_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why this round started, for a round after the first: person (a person started it by hand) or next_round_due (the due-round job started it on the claim's next-round date). Null for a first round and for a round started before the reason was recorded. Codes may be added; read one you do not know as a reason not named here.",
            "title": "Round Reason"
          },
          "stages_revision": {
            "title": "Stages Revision",
            "type": "string"
          },
          "started_at": {
            "format": "date-time",
            "title": "Started At",
            "type": "string"
          },
          "status": {
            "description": "active | completed | halted | paused | cancelled.",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "round",
          "pack_slug",
          "stages_revision",
          "status",
          "started_at"
        ],
        "title": "JourneyRoundRead",
        "type": "object"
      },
      "JourneyStageFactsRead": {
        "additionalProperties": false,
        "description": "Why a step's declared facts handoff was not usable, without the values.\n\nA step can declare facts it must hand to the steps after it. When its\noutput does not satisfy that declaration the journey stops, and this is\nwhat the check found: the typed reason, how many handoff blocks were seen\nand how many could be read, which declared facts were never stated, and —\nfor a fact whose value failed its schema — the failing location and the\nrule it broke, such as `$.missing_documents[2]: longer than 200\ncharacters`. The values themselves are never included: each message is\nrebuilt from its path and its constraint, so the content of a fact cannot\nride out on the explanation of why it was rejected.",
        "properties": {
          "blocks_parsed": {
            "default": 0,
            "description": "How many of those could be read. Fewer than seen means one was malformed.",
            "title": "Blocks Parsed",
            "type": "integer"
          },
          "blocks_seen": {
            "default": 0,
            "description": "How many facts blocks the step's output carried.",
            "title": "Blocks Seen",
            "type": "integer"
          },
          "consistency": {
            "description": "Each declared check of the stated facts against the facts the step was handed, in declared order. Empty for a step that declares none.",
            "items": {
              "$ref": "#/components/schemas/JourneyFactsConsistencyRead"
            },
            "title": "Consistency",
            "type": "array"
          },
          "invalid": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "description": "Facts whose value failed the shape they were declared to have, each with the failing locations and the rules they broke. The values are never included.",
            "title": "Invalid",
            "type": "object"
          },
          "missing_keys": {
            "description": "Facts the step declared it would hand on but never stated.",
            "items": {
              "type": "string"
            },
            "title": "Missing Keys",
            "type": "array"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the handoff was not usable: no_facts_block, facts_block_unparseable, ambiguous_facts, facts_invalid, facts_missing_keys, output_unavailable, or facts_contradict_record (what the step stated contradicts facts recorded earlier on the case), or facts_stated_without_document (none of the step's documents reached its turn, and it stated values only a document could show). Null when the check passed.",
            "title": "Reason"
          }
        },
        "title": "JourneyStageFactsRead",
        "type": "object"
      },
      "JourneyStageInputContractRead": {
        "additionalProperties": false,
        "description": "Declared inputs and products at the journey's pinned revision.\n\nThese are requirements, not a claim that a step consumed or produced them.",
        "properties": {
          "compute_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compute Ref"
          },
          "produces": {
            "items": {
              "type": "string"
            },
            "maxItems": 100,
            "title": "Produces",
            "type": "array"
          },
          "requires": {
            "items": {
              "type": "string"
            },
            "maxItems": 100,
            "title": "Requires",
            "type": "array"
          }
        },
        "required": [
          "requires",
          "produces"
        ],
        "title": "JourneyStageInputContractRead",
        "type": "object"
      },
      "JourneyStageRead": {
        "description": "One stage of a journey, as the timeline renders it.",
        "properties": {
          "accepted_run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The successful run accepted as this run stage's output, including an approved revision. Null before acceptance or for legacy records without that identity. The originally fired run remains in pack_run_id.",
            "title": "Accepted Run Id"
          },
          "acting_agent": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StageAgentRead"
              },
              {
                "type": "null"
              }
            ],
            "description": "The agent performing this stage, for agent-run stages — the identity recorded when the stage was entered, resolved against the pack's roster. Null for human, wait and compute stages, and when no attribution was recorded."
          },
          "clock_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The deadline this stage is waiting on, when it is a wait stage.",
            "title": "Clock Id"
          },
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "compute_execution": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/JourneyComputeExecutionRead"
              },
              {
                "type": "null"
              }
            ],
            "description": "Recorded code execution. Null when no usable attempt reference was saved."
          },
          "entered_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entered At"
          },
          "facts_check": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/JourneyStageFactsRead"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why this step's declared facts handoff was not usable, when the step was checked against one — the evidence behind a journey that stopped because a step 'completed without a usable facts block'. Names the failing locations and the rules they broke, never the values. Null for a step that declares no facts, and for one recorded before this check existed."
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "input_contract": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/JourneyStageInputContractRead"
              },
              {
                "type": "null"
              }
            ],
            "description": "Declared handoff at the pinned revision. Null when that declaration is unavailable."
          },
          "outcome": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How the stage finished — succeeded/failed for a run or a compute step, completed/declined for human work, met/breached for a wait, cancelled (state skipped) when the case was closed while the stage was in progress. Null while the stage is pending or still in progress.",
            "title": "Outcome"
          },
          "pack_run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The governed run this stage fired, when it is a run stage.",
            "title": "Pack Run Id"
          },
          "paused_ask": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/JourneyAskRead"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the journey was waiting for when it paused before this step — kept on the step's record after the journey continues, so the history reads the same whether the pause is live or past. Null when the journey never paused here."
          },
          "paused_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the journey paused before this step because the step's inputs were not there. Null when it never did.",
            "title": "Paused At"
          },
          "phase_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The step of the pack's published workflow this stage carries out, when the pack maps its stages onto that workflow. Matches the workflow-map entries on the pack's catalog page, so a case's progress can be read against the pack's own step-by-step description. Null when the stage declares no mapping.",
            "title": "Phase Slug"
          },
          "proceeded_without": {
            "description": "Data requirements a person chose to continue without at this step, by their stable ids. Empty unless someone resumed the journey with inputs still missing.",
            "items": {
              "type": "string"
            },
            "title": "Proceeded Without",
            "type": "array"
          },
          "resumed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the journey continued past that pause. Null while still paused.",
            "title": "Resumed At"
          },
          "resumed_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "What continued it: requirement_acquired (the named input arrived) or person (someone chose to continue).",
            "title": "Resumed By"
          },
          "revision_needed": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StepRevisionRead"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set while this run step waits on a revision: the sign-off on its held run was returned with notes, or expired before anyone decided. The step and the workflow stay open; a revision of that run that is signed off and finishes closes the step. Null otherwise, including while a revision is in progress or waiting on its own sign-off."
          },
          "stage_index": {
            "description": "Position in the declared order, from 0.",
            "title": "Stage Index",
            "type": "integer"
          },
          "stage_key": {
            "description": "Stable identifier of the declared stage.",
            "title": "Stage Key",
            "type": "string"
          },
          "stage_kind": {
            "description": "What the stage does: 'run' (a governed agent run), 'human' (a piece of typed human work), 'watch' (waiting on something outside the platform), or 'compute' (a deterministic step the platform performed in code — no agent, no model).",
            "title": "Stage Kind",
            "type": "string"
          },
          "state": {
            "description": "pending | active | completed | skipped | failed.",
            "title": "State",
            "type": "string"
          },
          "stop_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why this code step failed, in the words its function recorded: it can name a row, a column or a document on the case file. Set only on a failed compute step that recorded a reason; null otherwise. The same words the journey's `halted_reason` carries after the step key, without the key.",
            "title": "Stop Reason"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "work_item_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The work item this stage created, when it is a human stage.",
            "title": "Work Item Id"
          }
        },
        "required": [
          "id",
          "stage_index",
          "stage_key",
          "stage_kind",
          "title",
          "state"
        ],
        "title": "JourneyStageRead",
        "type": "object"
      },
      "JourneyStartRequest": {
        "properties": {
          "restart_inputs_reviewed": {
            "default": false,
            "title": "Restart Inputs Reviewed",
            "type": "boolean"
          }
        },
        "title": "JourneyStartRequest",
        "type": "object"
      },
      "KnowledgeUnitDetail": {
        "description": "One learned unit in full: what the situation was, what was done, what happened.",
        "properties": {
          "action_taken": {
            "description": "What was actually done on the source case.",
            "title": "Action Taken",
            "type": "string"
          },
          "content_mode": {
            "description": "How the unit's text was produced: 'deterministic' means it restates exactly what the case recorded, with no model involved.",
            "title": "Content Mode",
            "type": "string"
          },
          "content_schema_version": {
            "description": "Version of the structure this unit follows.",
            "title": "Content Schema Version",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "favorable_after_grounding_count": {
            "description": "Of the runs this unit informed, how many sat on cases that then closed with a favorable outcome. 'After', not 'because of' — the unit was one of several things informing that work.",
            "title": "Favorable After Grounding Count",
            "type": "integer"
          },
          "favorable_after_grounding_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The share of informed runs whose case then closed favorably, out of 'grounded_run_count'. Null until at least 'trust_minimum_sample' runs have been informed: a share drawn from one or two runs would read as a measurement when it is not one. This is a correlation and not evidence that the unit caused any outcome — read it alongside its denominator, never alone.",
            "title": "Favorable After Grounding Rate"
          },
          "grounded_run_count": {
            "description": "How many agent runs this unit informed that have since reached a recorded resolution. This is the denominator behind 'favorable_after_grounding_rate'.",
            "title": "Grounded Run Count",
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "outcome_recorded": {
            "description": "What the recorded outcome was, in words.",
            "title": "Outcome Recorded",
            "type": "string"
          },
          "outcome_valence": {
            "description": "How this unit may be trusted: 'favorable' (the recorded outcome was achieved), 'unfavorable' (it was not — a record of what did NOT work), or 'unknown' (the recorded outcome carries no verdict).",
            "title": "Outcome Valence",
            "type": "string"
          },
          "pack_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The pack the source case was primarily worked with, when it had one.",
            "title": "Pack Slug"
          },
          "provenance": {
            "additionalProperties": true,
            "description": "How the unit's text was derived (source runs, closure-detail keys).",
            "title": "Provenance",
            "type": "object"
          },
          "resolution_outcome": {
            "description": "The outcome recorded when the source case was closed — the ground truth this unit is verified by.",
            "title": "Resolution Outcome",
            "type": "string"
          },
          "retired_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the unit was withdrawn, when it has been.",
            "title": "Retired Reason"
          },
          "situation": {
            "description": "What the work was — the situation this unit covers.",
            "title": "Situation",
            "type": "string"
          },
          "situation_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The entity-and-pack this unit answers for. At most one active unit exists per situation in a workspace.",
            "title": "Situation Key"
          },
          "source_case_id": {
            "description": "The resolved case this unit was learned from.",
            "format": "uuid",
            "title": "Source Case Id",
            "type": "string"
          },
          "source_case_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The quotable reference of the source case.",
            "title": "Source Case Ref"
          },
          "status": {
            "description": "'active' (currently the workspace's best record for this situation), 'superseded' (a later resolution replaced it), or 'retired' (withdrawn from use).",
            "title": "Status",
            "type": "string"
          },
          "superseded_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Superseded At"
          },
          "superseded_by_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The later unit that replaced this one, if any.",
            "title": "Superseded By Id"
          },
          "supersedes_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The earlier unit this one replaced, if any.",
            "title": "Supersedes Id"
          },
          "title": {
            "description": "Short label for what this unit is about.",
            "title": "Title",
            "type": "string"
          },
          "trust_minimum_sample": {
            "default": 5,
            "description": "Fewest informed runs before a rate is reported at all. Below it the counts are still shown and the rate stays null.",
            "title": "Trust Minimum Sample",
            "type": "integer"
          },
          "trust_updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When these counts last changed. Null while the unit has not yet informed any run that reached a resolution.",
            "title": "Trust Updated At"
          }
        },
        "required": [
          "id",
          "title",
          "resolution_outcome",
          "outcome_valence",
          "status",
          "content_mode",
          "source_case_id",
          "grounded_run_count",
          "favorable_after_grounding_count",
          "created_at",
          "situation",
          "action_taken",
          "outcome_recorded",
          "provenance",
          "content_schema_version"
        ],
        "title": "KnowledgeUnitDetail",
        "type": "object"
      },
      "KnowledgeUnitListResponse": {
        "description": "A page of learned units.",
        "properties": {
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "description": "Total units matching the filters, ignoring pagination.",
            "title": "Total",
            "type": "integer"
          },
          "units": {
            "items": {
              "$ref": "#/components/schemas/KnowledgeUnitSummary"
            },
            "title": "Units",
            "type": "array"
          }
        },
        "required": [
          "units",
          "total",
          "limit",
          "offset"
        ],
        "title": "KnowledgeUnitListResponse",
        "type": "object"
      },
      "KnowledgeUnitRetireRequest": {
        "additionalProperties": false,
        "description": "Withdraw a unit from use, on the record.",
        "properties": {
          "reason": {
            "description": "Why this unit should no longer inform future work.",
            "maxLength": 200,
            "minLength": 1,
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "reason"
        ],
        "title": "KnowledgeUnitRetireRequest",
        "type": "object"
      },
      "KnowledgeUnitSummary": {
        "description": "One learned unit, as listed.",
        "properties": {
          "content_mode": {
            "description": "How the unit's text was produced: 'deterministic' means it restates exactly what the case recorded, with no model involved.",
            "title": "Content Mode",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "favorable_after_grounding_count": {
            "description": "Of the runs this unit informed, how many sat on cases that then closed with a favorable outcome. 'After', not 'because of' — the unit was one of several things informing that work.",
            "title": "Favorable After Grounding Count",
            "type": "integer"
          },
          "favorable_after_grounding_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The share of informed runs whose case then closed favorably, out of 'grounded_run_count'. Null until at least 'trust_minimum_sample' runs have been informed: a share drawn from one or two runs would read as a measurement when it is not one. This is a correlation and not evidence that the unit caused any outcome — read it alongside its denominator, never alone.",
            "title": "Favorable After Grounding Rate"
          },
          "grounded_run_count": {
            "description": "How many agent runs this unit informed that have since reached a recorded resolution. This is the denominator behind 'favorable_after_grounding_rate'.",
            "title": "Grounded Run Count",
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "outcome_valence": {
            "description": "How this unit may be trusted: 'favorable' (the recorded outcome was achieved), 'unfavorable' (it was not — a record of what did NOT work), or 'unknown' (the recorded outcome carries no verdict).",
            "title": "Outcome Valence",
            "type": "string"
          },
          "pack_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The pack the source case was primarily worked with, when it had one.",
            "title": "Pack Slug"
          },
          "resolution_outcome": {
            "description": "The outcome recorded when the source case was closed — the ground truth this unit is verified by.",
            "title": "Resolution Outcome",
            "type": "string"
          },
          "source_case_id": {
            "description": "The resolved case this unit was learned from.",
            "format": "uuid",
            "title": "Source Case Id",
            "type": "string"
          },
          "source_case_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The quotable reference of the source case.",
            "title": "Source Case Ref"
          },
          "status": {
            "description": "'active' (currently the workspace's best record for this situation), 'superseded' (a later resolution replaced it), or 'retired' (withdrawn from use).",
            "title": "Status",
            "type": "string"
          },
          "superseded_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Superseded At"
          },
          "title": {
            "description": "Short label for what this unit is about.",
            "title": "Title",
            "type": "string"
          },
          "trust_minimum_sample": {
            "default": 5,
            "description": "Fewest informed runs before a rate is reported at all. Below it the counts are still shown and the rate stays null.",
            "title": "Trust Minimum Sample",
            "type": "integer"
          },
          "trust_updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When these counts last changed. Null while the unit has not yet informed any run that reached a resolution.",
            "title": "Trust Updated At"
          }
        },
        "required": [
          "id",
          "title",
          "resolution_outcome",
          "outcome_valence",
          "status",
          "content_mode",
          "source_case_id",
          "grounded_run_count",
          "favorable_after_grounding_count",
          "created_at"
        ],
        "title": "KnowledgeUnitSummary",
        "type": "object"
      },
      "KpiSummaryResponse": {
        "description": "Top-level internal KPI summary response.",
        "properties": {
          "as_of": {
            "description": "UTC ISO-8601 timestamp the summary was computed at.",
            "title": "As Of",
            "type": "string"
          },
          "growth": {
            "$ref": "#/components/schemas/GrowthMetricsResponse"
          },
          "product": {
            "$ref": "#/components/schemas/ProductMetricsResponse"
          },
          "window_days": {
            "description": "Look-back window for movement + usage metrics.",
            "title": "Window Days",
            "type": "integer"
          }
        },
        "required": [
          "window_days",
          "as_of",
          "growth",
          "product"
        ],
        "title": "KpiSummaryResponse",
        "type": "object"
      },
      "LateDocumentRead": {
        "description": "A readable document filed after the case's workflow ended.",
        "properties": {
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "filename"
        ],
        "title": "LateDocumentRead",
        "type": "object"
      },
      "LifecycleSweepResponse": {
        "description": "Aggregate counts from one sweep pass (logged in CloudWatch; never\nuser-facing). ``attempted`` = non-deduped sends routed to the transport,\neach either ``delivered`` (SES live) or ``suppressed`` (dark mode).",
        "properties": {
          "attempted": {
            "title": "Attempted",
            "type": "integer"
          },
          "by_template": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "By Template",
            "type": "object"
          },
          "deduped": {
            "title": "Deduped",
            "type": "integer"
          },
          "delivered": {
            "title": "Delivered",
            "type": "integer"
          },
          "errors": {
            "title": "Errors",
            "type": "integer"
          },
          "skipped_no_owner": {
            "title": "Skipped No Owner",
            "type": "integer"
          },
          "suppressed": {
            "title": "Suppressed",
            "type": "integer"
          },
          "tenants_scanned": {
            "title": "Tenants Scanned",
            "type": "integer"
          }
        },
        "required": [
          "tenants_scanned",
          "skipped_no_owner",
          "attempted",
          "delivered",
          "suppressed",
          "deduped",
          "errors",
          "by_template"
        ],
        "title": "LifecycleSweepResponse",
        "type": "object"
      },
      "LookAgainRange": {
        "description": "The first and last day a person may look at the claim again on.",
        "properties": {
          "first": {
            "format": "date",
            "title": "First",
            "type": "string"
          },
          "last": {
            "format": "date",
            "title": "Last",
            "type": "string"
          }
        },
        "required": [
          "first",
          "last"
        ],
        "title": "LookAgainRange",
        "type": "object"
      },
      "MemberAdd": {
        "description": "Add an existing workspace user to a queue.",
        "properties": {
          "skills": {
            "description": "This member's skill tags (must be within the queue's declared skills).",
            "items": {
              "maxLength": 64,
              "type": "string"
            },
            "maxItems": 32,
            "title": "Skills",
            "type": "array"
          },
          "user_id": {
            "description": "The workspace user to add.",
            "format": "uuid",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id"
        ],
        "title": "MemberAdd",
        "type": "object"
      },
      "MemberRead": {
        "description": "One queue membership.",
        "properties": {
          "added_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Added By User Id"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "skills": {
            "items": {
              "type": "string"
            },
            "title": "Skills",
            "type": "array"
          },
          "user_id": {
            "format": "uuid",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "skills",
          "added_by_user_id",
          "created_at"
        ],
        "title": "MemberRead",
        "type": "object"
      },
      "MemberRow": {
        "description": "One seat on the roster — an active member OR an outstanding invitation.",
        "properties": {
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "id": {
            "description": "The user id (member) or invitation id.",
            "title": "Id",
            "type": "string"
          },
          "joined_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the member joined / the invite was sent (UTC ISO-8601).",
            "title": "Joined At"
          },
          "kind": {
            "description": "'member' = an active teammate; 'invitation' = a pending invite.",
            "enum": [
              "member",
              "invitation"
            ],
            "title": "Kind",
            "type": "string"
          },
          "role": {
            "enum": [
              "owner",
              "admin",
              "supervisor",
              "member",
              "practitioner",
              "viewer",
              "auditor"
            ],
            "title": "Role",
            "type": "string"
          },
          "status": {
            "description": "'active' member, 'pending' invite, or 'expired' invite awaiting cleanup.",
            "enum": [
              "active",
              "pending",
              "expired"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "id",
          "email",
          "role",
          "status"
        ],
        "title": "MemberRow",
        "type": "object"
      },
      "NamedOverrideCommand": {
        "additionalProperties": false,
        "properties": {
          "band_id": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Band Id",
            "type": "string"
          },
          "baseline_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Baseline Sha256",
            "type": "string"
          },
          "claim_key": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Claim Key",
            "type": "string"
          },
          "expected_parent_event_id": {
            "format": "uuid",
            "title": "Expected Parent Event Id",
            "type": "string"
          },
          "expected_policy_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Expected Policy Sha256",
            "type": "string"
          },
          "operation_key": {
            "format": "uuid",
            "title": "Operation Key",
            "type": "string"
          },
          "reason": {
            "maxLength": 1000,
            "minLength": 1,
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "operation_key",
          "expected_parent_event_id",
          "expected_policy_sha256",
          "claim_key",
          "baseline_sha256",
          "band_id",
          "reason"
        ],
        "title": "NamedOverrideCommand",
        "type": "object"
      },
      "NetworkPackCatalog": {
        "description": "Paginated-by-implication wrapper around the list.\n\nPagination is not surfaced in the wire shape yet — the full catalog\nstill ships as a single response; the field is reserved (`total`) so\na future paginated response stays backwards-compatible.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/NetworkPackRead"
            },
            "title": "Items",
            "type": "array"
          },
          "ordered_by": {
            "default": "static",
            "description": "`segment_fit` when the items were re-ranked for the calling tenant's declared segment (matching packs first, then horizontals, then mismatched — nothing hidden); `static` when the legacy catalog declaration order was preserved (no tenant segment configured, or the tenant lookup was unavailable).",
            "title": "Ordered By",
            "type": "string"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "NetworkPackCatalog",
        "type": "object"
      },
      "NetworkPackDataContract": {
        "description": "Wire shape for ``GET /{slug}/data-contract``.",
        "properties": {
          "declared": {
            "description": "Whether the pack declares a data contract at all. False for packs awaiting backfill; an empty contract (declared, zero items) means the pack needs no standing intake data.",
            "title": "Declared",
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/DataRequirementRead"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "declared",
          "items",
          "total"
        ],
        "title": "NetworkPackDataContract",
        "type": "object"
      },
      "NetworkPackGuidance": {
        "description": "Wire shape for ``GET /{slug}/guidance`` — the pack's per-agent guidance.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/AgentGuidanceRead"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "NetworkPackGuidance",
        "type": "object"
      },
      "NetworkPackMaterials": {
        "description": "Wire shape for ``GET /{slug}/materials`` — the pack's expected inputs.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/RequiredMaterialRead"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "NetworkPackMaterials",
        "type": "object"
      },
      "NetworkPackModels": {
        "description": "Wire shape for ``GET /{slug}/models`` — the pack's model picker options.",
        "properties": {
          "default_label": {
            "description": "Friendly label for the default when it is a selectable tier, else the generic 'Recommended'.",
            "title": "Default Label",
            "type": "string"
          },
          "default_model_id": {
            "description": "The pack's recommended model — what runs if the user picks nothing.",
            "title": "Default Model Id",
            "type": "string"
          },
          "options": {
            "description": "The selectable Claude tiers a user may choose from.",
            "items": {
              "$ref": "#/components/schemas/SelectableModelWire"
            },
            "title": "Options",
            "type": "array"
          }
        },
        "required": [
          "default_model_id",
          "default_label",
          "options"
        ],
        "title": "NetworkPackModels",
        "type": "object"
      },
      "NetworkPackRead": {
        "description": "Wire shape for one NetworkPack catalog row.\n\nMirrors :class:`velerian.products.agenticx.registry.NetworkPackSummary`\none-for-one; we still declare a Pydantic class (rather than returning\nthe dataclass directly) so FastAPI can stamp the OpenAPI schema and\nso downstream client generation has a stable contract.",
        "properties": {
          "assisted_payer_filing": {
            "default": false,
            "description": "True when the pack explicitly declares the assisted payer-filing workspace. Display capability only; each workspace operation enforces its own authorization and filing prerequisites.",
            "title": "Assisted Payer Filing",
            "type": "boolean"
          },
          "brand_color": {
            "description": "Hex color for the pack tile accent.",
            "title": "Brand Color",
            "type": "string"
          },
          "case_label": {
            "default": "Case",
            "description": "The word this pack's practitioners use for one piece of durable work — rendered wherever a case is shown in this pack's context (for example Claim, Matter, Filing). Display vocabulary only: identifiers, references, and API fields always use `case`.",
            "title": "Case Label",
            "type": "string"
          },
          "crew_label": {
            "default": "Crew",
            "description": "The customer-facing name of this pack's agent team — the crew the roster agents belong to (for example Denials Crew, Underwriting Crew). Display vocabulary only: the API noun for the roster stays `agents`. `Crew` when the pack declares no sharper name.",
            "title": "Crew Label",
            "type": "string"
          },
          "data_input_count": {
            "default": 0,
            "description": "How many named data inputs the pack's declared data contract lists — the compact catalog affordance behind the full `GET /{slug}/data-contract` read. Zero when the pack has not published a contract, or needs no standing intake data.",
            "title": "Data Input Count",
            "type": "integer"
          },
          "data_source_kinds": {
            "description": "The distinct ways the declared data inputs can arrive, in first-appearance order across the contract: connector | tenant_store | upload | manual. Empty when `data_input_count` is zero.",
            "items": {
              "type": "string"
            },
            "title": "Data Source Kinds",
            "type": "array"
          },
          "description": {
            "description": "One-line marketing line.",
            "title": "Description",
            "type": "string"
          },
          "design_partner_validated": {
            "default": false,
            "description": "DISTINCT from `maturity`. `maturity == 'production-ready'` means the pack is generally available: it runs the real model under full governance. `design_partner_validated` is True only when a *real* design partner ran a workflow and signed off. False for every pack today; the source of truth is velerian/products/agenticx/partner_validation.py.",
            "title": "Design Partner Validated",
            "type": "boolean"
          },
          "display_name": {
            "description": "Public name shown in the UI.",
            "title": "Display Name",
            "type": "string"
          },
          "industry": {
            "description": "High-level vertical bucket.",
            "title": "Industry",
            "type": "string"
          },
          "maturity": {
            "description": "`alpha` | `beta` | `production-ready`.",
            "title": "Maturity",
            "type": "string"
          },
          "offers_sample_case": {
            "default": false,
            "description": "True when this crew's one-click sample is a seeded case: `GET /api/v2/agent-networks/{slug}/sample-case` returns its example records, which the caller files on a new case before starting the case's journey. The sample runs the crew's real stages and spends what a run of them spends.",
            "title": "Offers Sample Case",
            "type": "boolean"
          },
          "persona_label": {
            "description": "Role this pack is built for.",
            "title": "Persona Label",
            "type": "string"
          },
          "regulated": {
            "default": false,
            "description": "True for packs scoped to regulated workloads (FS/legal/HR/health).",
            "title": "Regulated",
            "type": "boolean"
          },
          "saved_remittance_review": {
            "default": false,
            "description": "True when the pack explicitly declares saved-remittance review. Feature availability only; source operations enforce their own authorization, custody and currentness requirements.",
            "title": "Saved Remittance Review",
            "type": "boolean"
          },
          "segment_fit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How this pack fits the CALLING tenant's declared segment — `match` | `generic` | `mismatch`. Only set on the catalog list when the tenant has a segment configured (PUT /api/v2/admin/catalog-segment); `null` otherwise. Mismatched packs are de-ranked in the list order, never hidden.",
            "title": "Segment Fit"
          },
          "slug": {
            "description": "Kebab-case pack slug.",
            "title": "Slug",
            "type": "string"
          },
          "submit_opens_journey": {
            "default": false,
            "description": "True when a submit that names no case opens a JOB on this pack: the case's stage-by-stage workflow starts and the invoke answers 202 with the first stage's run and the workflow (journey_id / journey_url), whatever the async flag says. A per-request model tier or oversight selection is refused on that path. False for a pack with no declared stages, or whose first stage is not a run stage — those keep the single governed pass.",
            "title": "Submit Opens Journey",
            "type": "boolean"
          },
          "submit_skips_stages": {
            "default": false,
            "description": "True when the pack declares stages but a submit that names no case cannot reach them, because the first stage is not a run stage: the submit is one governed pass over its prompt and attachments, outside the crew's workflow. A prompt-only sample on such a pack has nothing to work from, so no one-click sample is offered for it. False for a pack with no declared stages, or whose submit opens a job (`submit_opens_journey`).",
            "title": "Submit Skips Stages",
            "type": "boolean"
          },
          "tags": {
            "description": "Free-form tag list (industry, regulated flag, etc.).",
            "items": {
              "type": "string"
            },
            "title": "Tags",
            "type": "array"
          },
          "target_segments": {
            "description": "The buyer segments this pack's positioning copy targets (e.g. `p_and_c_carrier`, `hospital_health_system`, `generic_b2b`). Source of truth: velerian/products/agenticx/segments.py. Drives the segment-fit catalog ordering for tenants with a declared segment.",
            "items": {
              "type": "string"
            },
            "title": "Target Segments",
            "type": "array"
          },
          "workflow_phases": {
            "description": "The ordered steps of the pack's automated workflow — what the pack does on every case, step by step. Populated on the single-pack detail read; the catalog list returns an empty list to keep list rows light.",
            "items": {
              "$ref": "#/components/schemas/WorkflowPhaseRead"
            },
            "title": "Workflow Phases",
            "type": "array"
          }
        },
        "required": [
          "slug",
          "display_name",
          "description",
          "persona_label",
          "industry",
          "maturity",
          "brand_color"
        ],
        "title": "NetworkPackRead",
        "type": "object"
      },
      "NetworkPackWorkflowMap": {
        "description": "Wire shape for ``GET /{slug}/workflow-map`` — the pack's automation boundary.\n\nThe step-by-step answer to \"what does the agent do, and where does\nthe work hand off to a human?\": each workflow step carries what the\nagent performs, the enforcement-backed gates the platform derives\nfrom the pack's own governance, and the human handoffs the pack\ndeclares. Steps come back in workflow order.",
        "properties": {
          "phases": {
            "description": "Per-step workflow entries in workflow order.",
            "items": {
              "$ref": "#/components/schemas/WorkflowMapPhaseRead"
            },
            "title": "Phases",
            "type": "array"
          },
          "slug": {
            "description": "The pack this map describes.",
            "title": "Slug",
            "type": "string"
          },
          "total": {
            "description": "Number of workflow steps.",
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "slug",
          "phases",
          "total"
        ],
        "title": "NetworkPackWorkflowMap",
        "type": "object"
      },
      "NextRoundRead": {
        "description": "Whether this caller could start the case's next round now.\n\nAdvisory: it is read without locks, and it asks the crew's own rules but\nnot admission, so ``POST /cases/{case_id}/journey/next-round`` still\ndecides and may refuse when this says it is available.",
        "properties": {
          "available": {
            "title": "Available",
            "type": "boolean"
          },
          "refusal": {
            "anyOf": [
              {
                "enum": [
                  "role_not_permitted",
                  "case_closed",
                  "crew_not_in_rounds",
                  "not_started",
                  "round_live",
                  "round_not_completed",
                  "round_ran_another_crew",
                  "crew_refused"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why it is not available, in the order the start checks: role_not_permitted (the caller's role may not start a round), case_closed, crew_not_in_rounds (the case's crew keeps one workflow per case), not_started (no first round yet), round_live (the current round is running or paused), round_not_completed (the current round stopped before it finished), round_ran_another_crew, crew_refused (the crew's own rules refuse it now: for a claims crew, a person holds the claim). Null when available.",
            "title": "Refusal"
          }
        },
        "required": [
          "available"
        ],
        "title": "NextRoundRead",
        "type": "object"
      },
      "NotificationListResponse": {
        "description": "Paginated list response — mirrors the ABP registry shape.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/NotificationSummary"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "NotificationListResponse",
        "type": "object"
      },
      "NotificationSummary": {
        "description": "Per-row wire shape returned by the list + mark-read endpoints.\n\n`payload` is producer-shaped JSONB — callers should not assume any\nspecific keys. The inbox UI treats it as opaque metadata.",
        "properties": {
          "actor_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor User Id"
          },
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "payload": {
            "additionalProperties": true,
            "title": "Payload",
            "type": "object"
          },
          "read_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Read At"
          },
          "subject": {
            "title": "Subject",
            "type": "string"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "type": {
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "actor_user_id",
          "type",
          "subject",
          "body",
          "payload",
          "read_at",
          "created_at"
        ],
        "title": "NotificationSummary",
        "type": "object"
      },
      "OfferDeclined": {
        "description": "Offer-decline outcome: the item, the case, and the re-route result.",
        "properties": {
          "case_status": {
            "description": "The case's status (unchanged by an offer decline).",
            "title": "Case Status",
            "type": "string"
          },
          "reoffered": {
            "description": "True when the item was immediately offered to the next candidate; otherwise it waits for the routing sweep (skill relaxation or the no-candidate fallback).",
            "title": "Reoffered",
            "type": "boolean"
          },
          "work_item": {
            "$ref": "#/components/schemas/WorkItemRead"
          }
        },
        "required": [
          "work_item",
          "case_status",
          "reoffered"
        ],
        "title": "OfferDeclined",
        "type": "object"
      },
      "OnboardWorkspaceRequest": {
        "additionalProperties": false,
        "description": "A client workspace to create. Takes no tier and no price.",
        "properties": {
          "crews": {
            "description": "The crews to grant, by slug.",
            "items": {
              "maxLength": 64,
              "minLength": 1,
              "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
              "type": "string"
            },
            "maxItems": 25,
            "minItems": 1,
            "title": "Crews",
            "type": "array"
          },
          "name": {
            "description": "The client company's name.",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "owner_email": {
            "description": "Who receives the invitation as its first owner.",
            "format": "email",
            "title": "Owner Email",
            "type": "string"
          },
          "seats": {
            "description": "How many seats the workspace includes. The owner's invitation takes one.",
            "maximum": 500.0,
            "minimum": 1.0,
            "title": "Seats",
            "type": "integer"
          },
          "slug": {
            "description": "The workspace's short name, unique across Velerian.",
            "maxLength": 64,
            "minLength": 1,
            "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "name",
          "slug",
          "owner_email",
          "crews",
          "seats"
        ],
        "title": "OnboardWorkspaceRequest",
        "type": "object"
      },
      "OnboardedWorkspace": {
        "properties": {
          "crews": {
            "items": {
              "type": "string"
            },
            "title": "Crews",
            "type": "array"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "owner_invitation": {
            "$ref": "#/components/schemas/OwnerInvitation"
          },
          "seats": {
            "title": "Seats",
            "type": "integer"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "tenant_id",
          "name",
          "slug",
          "crews",
          "seats",
          "owner_invitation"
        ],
        "title": "OnboardedWorkspace",
        "type": "object"
      },
      "OnboardingVerticalRequest": {
        "additionalProperties": false,
        "description": "The vertical the tenant picked at first-run onboarding.",
        "properties": {
          "vertical": {
            "description": "The tenant's vertical — one of `healthcare` | `none`. `none` grants the default trial pack set, which is empty, and leaves the catalog in its static order.",
            "maxLength": 32,
            "title": "Vertical",
            "type": "string"
          }
        },
        "required": [
          "vertical"
        ],
        "title": "OnboardingVerticalRequest",
        "type": "object"
      },
      "OnboardingVerticalResult": {
        "description": "What the pick did: the vertical, the packs granted, the ranking segment.",
        "properties": {
          "catalog_segment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The single buyer segment written to the tenant's `catalog_segment` (the vertical's primary ranking segment), or null for the `none` vertical (the declaration is cleared and the catalog stays static).",
            "title": "Catalog Segment"
          },
          "granted_packs": {
            "description": "The pack slugs granted a time-boxed entitlement for this vertical. Empty where the environment grants no self-serve trial (production).",
            "items": {
              "type": "string"
            },
            "title": "Granted Packs",
            "type": "array"
          },
          "vertical": {
            "description": "The vertical that was applied.",
            "title": "Vertical",
            "type": "string"
          }
        },
        "required": [
          "vertical"
        ],
        "title": "OnboardingVerticalResult",
        "type": "object"
      },
      "OrganizationSummary": {
        "description": "Consultancy or enterprise organization grouping workspaces.",
        "properties": {
          "branding_config": {
            "additionalProperties": true,
            "title": "Branding Config",
            "type": "object"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "organization_id": {
            "format": "uuid",
            "title": "Organization Id",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "organization_id",
          "name",
          "slug"
        ],
        "title": "OrganizationSummary",
        "type": "object"
      },
      "OutcomeBaselinePack": {
        "description": "The governance-pass vs outcome-met split for ONE pack.\n\nThe two verdicts side by side, never merged. ``governance_pass_rate``\nis the share of runs whose governance verdict passed (``governance_pass IS\nTRUE``); it is null when the pack has no run with a governance verdict yet (so\nthe UI shows \"not evaluated\" rather than a misleading 0%). ``outcome_met_rate``\nis the share of SCORED runs (``met + partial + incomplete`` — everything\nexcept ``not_scored``) whose outcome was ``met``; null when nothing has been\nscored yet. The four verdict counts always sum to ``total`` (a NULL/older\nverdict is counted honestly as ``not_scored``, never as a met).",
        "properties": {
          "governance_pass_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Governance Pass Rate"
          },
          "governance_passed": {
            "title": "Governance Passed",
            "type": "integer"
          },
          "incomplete": {
            "title": "Incomplete",
            "type": "integer"
          },
          "met": {
            "title": "Met",
            "type": "integer"
          },
          "not_scored": {
            "title": "Not Scored",
            "type": "integer"
          },
          "outcome_met_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Outcome Met Rate"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "partial": {
            "title": "Partial",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "pack_slug",
          "total",
          "governance_passed",
          "governance_pass_rate",
          "met",
          "partial",
          "incomplete",
          "not_scored",
          "outcome_met_rate"
        ],
        "title": "OutcomeBaselinePack",
        "type": "object"
      },
      "OutcomeBaselineSummary": {
        "description": "The per-pack governance-pass vs outcome-met baseline.\n\nThe honest dashboard split now that outcome contracts are live on every pack:\nper pack (and estate-wide) the governance-pass rate SEPARATE from the\noutcome-met rate + the full met/partial/incomplete/not_scored distribution.\nRLS-scoped to the calling tenant. Factual + ADVISORY: it counts\nwhat the advisory scorer recorded — nothing enforces on it, and it makes no\nregulatory-conformance claim. It is the INPUT to a later\nenforcement-posture decision, not a decision itself.",
        "properties": {
          "by_pack": {
            "items": {
              "$ref": "#/components/schemas/OutcomeBaselinePack"
            },
            "title": "By Pack",
            "type": "array"
          },
          "totals": {
            "$ref": "#/components/schemas/OutcomeBaselineTotals"
          }
        },
        "required": [
          "totals",
          "by_pack"
        ],
        "title": "OutcomeBaselineSummary",
        "type": "object"
      },
      "OutcomeBaselineTotals": {
        "description": "Estate-wide roll-up of the same split across every pack.",
        "properties": {
          "governance_pass_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Governance Pass Rate"
          },
          "governance_passed": {
            "title": "Governance Passed",
            "type": "integer"
          },
          "incomplete": {
            "title": "Incomplete",
            "type": "integer"
          },
          "met": {
            "title": "Met",
            "type": "integer"
          },
          "not_scored": {
            "title": "Not Scored",
            "type": "integer"
          },
          "outcome_met_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Outcome Met Rate"
          },
          "partial": {
            "title": "Partial",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "governance_passed",
          "governance_pass_rate",
          "met",
          "partial",
          "incomplete",
          "not_scored",
          "outcome_met_rate"
        ],
        "title": "OutcomeBaselineTotals",
        "type": "object"
      },
      "OutcomeContractRead": {
        "description": "The agent's declared outcome contract — presence + counts only.",
        "properties": {
          "completionCriterionCount": {
            "description": "Qualitative completion criteria in the effective contract.",
            "title": "Completioncriterioncount",
            "type": "integer"
          },
          "present": {
            "description": "Whether an outcome contract is declared.",
            "title": "Present",
            "type": "boolean"
          },
          "requiredSectionCount": {
            "description": "Deterministically-checkable required sections in the effective contract.",
            "title": "Requiredsectioncount",
            "type": "integer"
          },
          "tenantSectionCount": {
            "description": "Elements (sections + criteria) the tenant's outcome overlay added; 0 when the contract is entirely the declared base.",
            "title": "Tenantsectioncount",
            "type": "integer"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The contract's deterministic content-hash version; null when absent.",
            "title": "Version"
          }
        },
        "required": [
          "present",
          "requiredSectionCount",
          "completionCriterionCount",
          "tenantSectionCount"
        ],
        "title": "OutcomeContractRead",
        "type": "object"
      },
      "OutcomeGap": {
        "description": "One named thing the run's output is missing.\n\nThe structured unit of the missing-information contract — the input to a\nfuture revision run. Mirrors\n:class:`velerian.core.outcome.models.OutcomeGap`: ``label`` is the\ncustomer-facing name of the missing section/criterion (plain language, no\njargon), ``detail`` is a one-line why/what, ``source`` is the mechanism that\nflagged it (``structure`` = a deterministic section check; ``criterion`` =\nthe rubric judge). Empty on a ``met`` / ``not_scored`` run.",
        "properties": {
          "detail": {
            "title": "Detail",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "source": {
            "title": "Source",
            "type": "string"
          }
        },
        "required": [
          "label",
          "detail",
          "source"
        ],
        "title": "OutcomeGap",
        "type": "object"
      },
      "OutcomeMixResponse": {
        "description": "The outcome-verdict mix across the tenant's governed runs.",
        "properties": {
          "incomplete": {
            "description": "Runs that did not meet it (gaps recorded).",
            "title": "Incomplete",
            "type": "integer"
          },
          "met": {
            "description": "Runs that met the pack's outcome contract.",
            "title": "Met",
            "type": "integer"
          },
          "notScored": {
            "description": "Runs not scored against an outcome contract (advisory / older / withheld).",
            "title": "Notscored",
            "type": "integer"
          },
          "partial": {
            "description": "Runs that partially met it (gaps recorded).",
            "title": "Partial",
            "type": "integer"
          }
        },
        "required": [
          "met",
          "partial",
          "incomplete",
          "notScored"
        ],
        "title": "OutcomeMixResponse",
        "type": "object"
      },
      "OutcomeSummaryResponse": {
        "description": "Aggregate outcome KPI response (see ``core/kpi/outcome_summary``).",
        "properties": {
          "as_of": {
            "description": "UTC ISO-8601 timestamp the summary was computed at.",
            "title": "As Of",
            "type": "string"
          },
          "incomplete": {
            "description": "Runs that did not meet it (named gaps recorded).",
            "title": "Incomplete",
            "type": "integer"
          },
          "met": {
            "description": "Runs whose output met the pack's declared outcome contract.",
            "title": "Met",
            "type": "integer"
          },
          "met_rate_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "met / scored_runs * 100 — the P5 value-realized-vs-promised headline. null when no run was scored (render 'no scored runs yet', never '0%').",
            "title": "Met Rate Pct"
          },
          "not_scored": {
            "description": "Runs with the explicit 'not_scored' verdict OR a NULL verdict (never measured). The four buckets sum to total_runs.",
            "title": "Not Scored",
            "type": "integer"
          },
          "partial": {
            "description": "Runs that partially met it (named gaps recorded).",
            "title": "Partial",
            "type": "integer"
          },
          "per_pack": {
            "description": "Per-pack met-rate rows (scored-volume DESC), capped at `per_pack`. Only packs with >= 1 scored run appear.",
            "items": {
              "$ref": "#/components/schemas/PackOutcomeRateResponse"
            },
            "title": "Per Pack",
            "type": "array"
          },
          "resolution": {
            "$ref": "#/components/schemas/CaseResolutionRollupResponse",
            "description": "The per-case resolution rollup: real-world outcomes recorded when cases were closed, alongside the runs' own verdicts — so 'the work product looked right but reality disagreed' is visible. Uses the same [since, until) bounds, applied to when each case was closed."
          },
          "scorable_runs": {
            "default": 0,
            "description": "total_runs − unscorable_runs — the runs that COULD have been scored. scored_runs <= scorable_runs always.",
            "title": "Scorable Runs",
            "type": "integer"
          },
          "scored_coverage_of_scorable_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "scored_runs / scorable_runs * 100 — the HONEST coverage number: of the runs that could be scored, how many were. This excludes by-design-unscorable runs, so a structural-unscorable population is not mistaken for a coverage gap. null when there were no scorable runs in-window.",
            "title": "Scored Coverage Of Scorable Pct"
          },
          "scored_coverage_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "scored_runs / total_runs * 100 — the RAW, total-based share of run volume that was measured. Kept unchanged for continuity; its denominator includes by-design-unscorable runs, so it under-reads coverage on a platform with many such runs. null when there were no runs in-window.",
            "title": "Scored Coverage Pct"
          },
          "scored_runs": {
            "description": "met + partial + incomplete — runs actually measured against a contract.",
            "title": "Scored Runs",
            "type": "integer"
          },
          "top_gaps": {
            "description": "Most-frequent gap labels in-window (occurrences DESC), capped at `top_gaps`.",
            "items": {
              "$ref": "#/components/schemas/GapLabelCountResponse"
            },
            "title": "Top Gaps",
            "type": "array"
          },
          "total_runs": {
            "description": "All pack_runs in-window (the verdict-mix denominator).",
            "title": "Total Runs",
            "type": "integer"
          },
          "unscorable_runs": {
            "default": 0,
            "description": "Runs that CAN'T carry a scored outcome verdict by design — a Preview sample-stub, a governance- or tenant-policy-withheld output, or a blank output (no work product to measure). Reported for transparency; a subset of not_scored.",
            "title": "Unscorable Runs",
            "type": "integer"
          },
          "window_end": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Exclusive upper bound (UTC ISO-8601) on run created_at used, or null when unbounded.",
            "title": "Window End"
          },
          "window_start": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Inclusive lower bound (UTC ISO-8601) on run created_at used, or null when unbounded (no `since`).",
            "title": "Window Start"
          }
        },
        "required": [
          "as_of",
          "total_runs",
          "met",
          "partial",
          "incomplete",
          "not_scored",
          "scored_runs"
        ],
        "title": "OutcomeSummaryResponse",
        "type": "object"
      },
      "OversightModeRead": {
        "description": "One oversight mode in the four-mode vocabulary.",
        "properties": {
          "label": {
            "description": "Display label, e.g. `Human in the loop`.",
            "title": "Label",
            "type": "string"
          },
          "summary": {
            "description": "One-line description of the mode.",
            "title": "Summary",
            "type": "string"
          },
          "value": {
            "description": "Wire value, e.g. `human_in_the_loop`.",
            "title": "Value",
            "type": "string"
          }
        },
        "required": [
          "value",
          "label",
          "summary"
        ],
        "title": "OversightModeRead",
        "type": "object"
      },
      "OversightPlanRead": {
        "description": "Per-phase oversight plan for one pack, derived from its manifest.\n\nThe visible answer to \"where is the human in this workflow?\": each pack\nphase carries the oversight mode its declared governance actually gives it\n— human IN the loop (a reviewer approves the gated step before it\nproceeds), ON the loop (live monitoring with enforced checks that hold\nnon-conforming output), OVER the loop (work proceeds, flagged for review\nafterwards with the evidence pack), or OUT of the loop (autonomous where\npolicy allows, still recorded). Derived from the same constraints a real\nrun evaluates — never a hand-maintained map.",
        "properties": {
          "modes": {
            "description": "The four-mode vocabulary, least to most restrictive.",
            "items": {
              "$ref": "#/components/schemas/OversightModeRead"
            },
            "title": "Modes",
            "type": "array"
          },
          "phases": {
            "description": "Per-phase oversight entries in workflow order.",
            "items": {
              "$ref": "#/components/schemas/PhaseOversightRead"
            },
            "title": "Phases",
            "type": "array"
          },
          "slug": {
            "description": "The pack this plan describes.",
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "modes",
          "phases"
        ],
        "title": "OversightPlanRead",
        "type": "object"
      },
      "OversightSettingRead": {
        "description": "One workflow step's oversight setting for this workspace.\n\n``floor_mode`` is the pack's built-in baseline, derived from its declared\nsafeguards — the floor. ``selected_mode`` is the mode this workspace chose\nfor the step — always strictly above the floor, or ``null`` when the step\nsits at the pack's own baseline (the default). ``effective_mode`` is what\nruns inherit: the selection when one is stored, otherwise the baseline.",
        "properties": {
          "basis": {
            "description": "The declared safeguards the baseline derives from.",
            "items": {
              "type": "string"
            },
            "title": "Basis",
            "type": "array"
          },
          "display_name": {
            "description": "Phase label shown in the UI.",
            "title": "Display Name",
            "type": "string"
          },
          "effective_mode": {
            "description": "The mode runs inherit: the selection when stored, else the baseline.",
            "title": "Effective Mode",
            "type": "string"
          },
          "floor_mode": {
            "description": "The pack's baseline oversight mode for this phase, derived from its declared governance — the floor a workspace selection can tighten but never loosen.",
            "title": "Floor Mode",
            "type": "string"
          },
          "ordinal": {
            "description": "Sort order across phases.",
            "title": "Ordinal",
            "type": "integer"
          },
          "phase_slug": {
            "description": "The pack workflow phase this entry describes.",
            "title": "Phase Slug",
            "type": "string"
          },
          "selected_mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "This workspace's stored selection for the phase, or null when the phase sits at the pack's own baseline (the default).",
            "title": "Selected Mode"
          },
          "tighten_options": {
            "description": "Modes this workspace may set the phase to (strictly above the baseline).",
            "items": {
              "type": "string"
            },
            "title": "Tighten Options",
            "type": "array"
          }
        },
        "required": [
          "phase_slug",
          "display_name",
          "ordinal",
          "floor_mode",
          "effective_mode"
        ],
        "title": "OversightSettingRead",
        "type": "object"
      },
      "OversightSettingWrite": {
        "description": "Set one workflow step's oversight for this workspace.\n\n``mode`` must be at least as strict as the step's built-in baseline — a\nlooser mode is rejected. Setting the mode EQUAL to the baseline removes\nthe workspace's own added oversight: the step returns to the pack's\nbaseline, which is the only \"relax\" that exists — nothing goes below it.",
        "properties": {
          "mode": {
            "description": "The oversight mode for this phase (tighten-only over the pack's baseline; equal to the baseline clears the workspace's tightening).",
            "maxLength": 64,
            "title": "Mode",
            "type": "string"
          }
        },
        "required": [
          "mode"
        ],
        "title": "OversightSettingWrite",
        "type": "object"
      },
      "OversightSettingsRead": {
        "description": "The workspace's standing per-step oversight settings for one pack.\n\nEvery workflow step with its built-in baseline and this workspace's\nstored setting, plus the four-mode vocabulary for rendering. Settings\npersist per workspace, pack and step, and every run of the pack inherits\nthem; a single run can still add more oversight on top of its own.",
        "properties": {
          "modes": {
            "description": "The four-mode vocabulary, least to most restrictive.",
            "items": {
              "$ref": "#/components/schemas/OversightModeRead"
            },
            "title": "Modes",
            "type": "array"
          },
          "phases": {
            "description": "Per-phase dial entries in workflow order.",
            "items": {
              "$ref": "#/components/schemas/OversightSettingRead"
            },
            "title": "Phases",
            "type": "array"
          },
          "slug": {
            "description": "The pack this dial describes.",
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "modes",
          "phases"
        ],
        "title": "OversightSettingsRead",
        "type": "object"
      },
      "OwnerInvitation": {
        "properties": {
          "email": {
            "title": "Email",
            "type": "string"
          },
          "email_delivered": {
            "description": "Whether the invitation email went out.",
            "title": "Email Delivered",
            "type": "boolean"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "invite_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Present only when the email did not go out, so it can be sent by hand. The link alone admits no one: the owner accepts by signing up with the invited address, which Cognito verifies.",
            "title": "Invite Url"
          }
        },
        "required": [
          "id",
          "email",
          "expires_at",
          "email_delivered"
        ],
        "title": "OwnerInvitation",
        "type": "object"
      },
      "PackAdoptionRowResponse": {
        "description": "Per-pack adoption row for this account.",
        "properties": {
          "invocation_count": {
            "title": "Invocation Count",
            "type": "integer"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          }
        },
        "required": [
          "pack_slug",
          "invocation_count"
        ],
        "title": "PackAdoptionRowResponse",
        "type": "object"
      },
      "PackClockRollupResponse": {
        "description": "Per-pack deadline exposure + concluded-deadline outcomes.",
        "properties": {
          "breach_rate_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "closed_breached / closed_clocks * 100 (2dp) — of this pack's deadlines that concluded in-window, how many were missed. null when none concluded in-window.",
            "title": "Breach Rate Pct"
          },
          "closed_breached": {
            "description": "Concluded deadlines that were missed.",
            "title": "Closed Breached",
            "type": "integer"
          },
          "closed_clocks": {
            "description": "Deadlines concluded in-window (stamped when their case closed).",
            "title": "Closed Clocks",
            "type": "integer"
          },
          "closed_met": {
            "description": "Concluded deadlines that were met.",
            "title": "Closed Met",
            "type": "integer"
          },
          "near_breach_rate_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "(open_warning + open_breached) / open_clocks * 100 (2dp) — the share of this pack's live deadlines needing attention now. null when the pack has no live deadlines (render 'no live deadlines', never '0%').",
            "title": "Near Breach Rate Pct"
          },
          "open_breached": {
            "description": "Live deadlines already past due while the case is still open.",
            "title": "Open Breached",
            "type": "integer"
          },
          "open_clocks": {
            "description": "Live deadlines on this pack's open cases right now.",
            "title": "Open Clocks",
            "type": "integer"
          },
          "open_ok": {
            "description": "Live deadlines comfortably inside their window.",
            "title": "Open Ok",
            "type": "integer"
          },
          "open_warning": {
            "description": "Live deadlines inside their warning zone — close to due.",
            "title": "Open Warning",
            "type": "integer"
          },
          "pack_slug": {
            "description": "The pack whose cases these deadlines belong to.",
            "title": "Pack Slug",
            "type": "string"
          }
        },
        "required": [
          "pack_slug",
          "open_clocks",
          "open_ok",
          "open_warning",
          "open_breached",
          "closed_clocks",
          "closed_met",
          "closed_breached"
        ],
        "title": "PackClockRollupResponse",
        "type": "object"
      },
      "PackEntitlementResponse": {
        "description": "One active per-pack entitlement the calling tenant currently holds.",
        "properties": {
          "is_trial": {
            "description": "True when the grant is time-boxed (valid_until is not null) — the shape the self-serve trial is written with. Heuristic, not a billing source of truth: a paid subscription scheduled to end also reads as time-boxed.",
            "title": "Is Trial",
            "type": "boolean"
          },
          "pack_slug": {
            "description": "The pack the tenant is entitled to invoke (e.g. 'flowfile').",
            "title": "Pack Slug",
            "type": "string"
          },
          "tier": {
            "description": "Access level for this pack (starter | professional | enterprise). Legacy identifiers kept for API compatibility, not published plans or prices.",
            "title": "Tier",
            "type": "string"
          },
          "valid_until": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "UTC ISO-8601 instant the entitlement expires, or null for an open-ended (active, not-yet-cancelled) grant. A non-null value means time-boxed access (see is_trial).",
            "title": "Valid Until"
          }
        },
        "required": [
          "pack_slug",
          "tier",
          "is_trial"
        ],
        "title": "PackEntitlementResponse",
        "type": "object"
      },
      "PackNeedsYouTotal": {
        "description": "One pack's needs-you count.",
        "properties": {
          "pack_slug": {
            "description": "The pack these cases are running.",
            "title": "Pack Slug",
            "type": "string"
          },
          "total": {
            "description": "How many of its cases need you right now.",
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "pack_slug",
          "total"
        ],
        "title": "PackNeedsYouTotal",
        "type": "object"
      },
      "PackOutcomeRateResponse": {
        "description": "Per-pack outcome met-rate row (the depth-per-pack proxy).",
        "properties": {
          "met": {
            "description": "Scored runs of this pack whose verdict was 'met'.",
            "title": "Met",
            "type": "integer"
          },
          "met_rate_pct": {
            "description": "met / scored_runs * 100 (2dp).",
            "title": "Met Rate Pct",
            "type": "number"
          },
          "pack_slug": {
            "description": "The pack the runs belong to.",
            "title": "Pack Slug",
            "type": "string"
          },
          "scored_runs": {
            "description": "Runs of this pack with a scored verdict (met/partial/incomplete) — the met-rate denominator.",
            "title": "Scored Runs",
            "type": "integer"
          }
        },
        "required": [
          "pack_slug",
          "scored_runs",
          "met",
          "met_rate_pct"
        ],
        "title": "PackOutcomeRateResponse",
        "type": "object"
      },
      "PackRunDetail": {
        "properties": {
          "approvals": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/RunApproval"
            },
            "title": "Approvals",
            "type": "array"
          },
          "awaiting_approval": {
            "default": false,
            "title": "Awaiting Approval",
            "type": "boolean"
          },
          "case_evidence_mode": {
            "anyOf": [
              {
                "enum": [
                  "real",
                  "synthetic"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Evidence Mode"
          },
          "case_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Id"
          },
          "case_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Ref"
          },
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "confidence": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RunConfidence"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "data_provenance_degraded": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RunDataProvenanceDegradedRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "degraded": {
            "default": false,
            "title": "Degraded",
            "type": "boolean"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "evidence_content_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evidence Content Path"
          },
          "evidence_download_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evidence Download Url"
          },
          "evidence_storage_status": {
            "anyOf": [
              {
                "enum": [
                  "stored",
                  "pending",
                  "conflict",
                  "missing",
                  "unknown"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evidence Storage Status"
          },
          "governance_checks": {
            "items": {
              "$ref": "#/components/schemas/GovernanceCheck"
            },
            "title": "Governance Checks",
            "type": "array"
          },
          "governance_pass": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Governance Pass"
          },
          "governance_reasons": {
            "items": {
              "type": "string"
            },
            "title": "Governance Reasons",
            "type": "array"
          },
          "governance_scorecard": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GovernanceScorecard"
              },
              {
                "type": "null"
              }
            ]
          },
          "human_approval_decision": {
            "anyOf": [
              {
                "enum": [
                  "approved",
                  "rejected",
                  "timed_out",
                  "superseded"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Human Approval Decision"
          },
          "human_approval_pending": {
            "default": false,
            "title": "Human Approval Pending",
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "integrity_proof": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/IntegrityProof"
              },
              {
                "type": "null"
              }
            ]
          },
          "knowledge_grounding": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RunKnowledgeGroundingRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          },
          "outcome": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RunOutcome"
              },
              {
                "type": "null"
              }
            ]
          },
          "outcome_verdict": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Outcome Verdict"
          },
          "output_origin": {
            "$ref": "#/components/schemas/RunOrigin",
            "default": "unknown"
          },
          "output_refused": {
            "default": false,
            "title": "Output Refused",
            "type": "boolean"
          },
          "output_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Text"
          },
          "output_truncated": {
            "default": false,
            "title": "Output Truncated",
            "type": "boolean"
          },
          "oversight": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RunOversightRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "parent_run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Run Id"
          },
          "prompt_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt Text"
          },
          "region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region"
          },
          "revision_gaps": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Revision Gaps",
            "type": "array"
          },
          "revisions": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/RevisionLink"
            },
            "title": "Revisions",
            "type": "array"
          },
          "signoffs": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/SharedSignoff"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signoffs"
          },
          "stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stage"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tenant_policy_revision_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Policy Revision Id"
          },
          "tokens_in": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tokens In"
          },
          "tokens_out": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tokens Out"
          }
        },
        "required": [
          "id",
          "pack_slug",
          "status",
          "model_id",
          "governance_pass",
          "tokens_in",
          "tokens_out",
          "created_at",
          "completed_at",
          "prompt_text",
          "output_text",
          "governance_reasons",
          "governance_checks",
          "error",
          "evidence_download_url"
        ],
        "title": "PackRunDetail",
        "type": "object"
      },
      "PackRunList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PackRunSummary"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "PackRunList",
        "type": "object"
      },
      "PackRunSummary": {
        "properties": {
          "case_evidence_mode": {
            "anyOf": [
              {
                "enum": [
                  "real",
                  "synthetic"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Evidence Mode"
          },
          "case_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Id"
          },
          "case_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Ref"
          },
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "degraded": {
            "default": false,
            "title": "Degraded",
            "type": "boolean"
          },
          "governance_pass": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Governance Pass"
          },
          "human_approval_decision": {
            "anyOf": [
              {
                "enum": [
                  "approved",
                  "rejected",
                  "timed_out",
                  "superseded"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Human Approval Decision"
          },
          "human_approval_pending": {
            "default": false,
            "title": "Human Approval Pending",
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          },
          "outcome_verdict": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Outcome Verdict"
          },
          "output_origin": {
            "$ref": "#/components/schemas/RunOrigin",
            "default": "unknown"
          },
          "output_refused": {
            "default": false,
            "title": "Output Refused",
            "type": "boolean"
          },
          "output_truncated": {
            "default": false,
            "title": "Output Truncated",
            "type": "boolean"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region"
          },
          "stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stage"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tokens_in": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tokens In"
          },
          "tokens_out": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tokens Out"
          }
        },
        "required": [
          "id",
          "pack_slug",
          "status",
          "model_id",
          "governance_pass",
          "tokens_in",
          "tokens_out",
          "created_at",
          "completed_at"
        ],
        "title": "PackRunSummary",
        "type": "object"
      },
      "PackSelectionResponse": {
        "description": "The entitlement the calling tenant holds for the pack after a self-serve selection.\n\nTwo shapes share this model: a GRANT (201, ``granted: true`` —\nthe starter trial this call just wrote) and a NO-OP (200, ``granted: false``\n— the workspace already held a grant that outranks the trial; that existing\ngrant is echoed untouched, so ``tier`` / ``valid_until`` / ``is_trial``\ndescribe what the tenant actually has, never a fiction of what was asked).",
        "properties": {
          "granted": {
            "default": true,
            "description": "True when this call wrote a starter trial entitlement (HTTP 201). False when the workspace already held a grant for the pack that outranks a starter trial on tier / expiry, so nothing was written (HTTP 200) — a self-serve click never downgrades a comped or paid grant.",
            "title": "Granted",
            "type": "boolean"
          },
          "is_trial": {
            "default": true,
            "description": "True when the held entitlement is time-boxed (always true for a granted trial); false when the call was a no-op over an open-ended grant.",
            "title": "Is Trial",
            "type": "boolean"
          },
          "pack_slug": {
            "description": "The pack the selection was for.",
            "title": "Pack Slug",
            "type": "string"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Human-readable explanation when granted=false (why the existing grant was left untouched); null on a grant.",
            "title": "Reason"
          },
          "tier": {
            "description": "Entitlement tier the calling tenant holds for this pack after the call: 'starter' when the self-serve trial was granted, or the EXISTING (higher-ranked) tier when the call was a no-op (granted=false).",
            "title": "Tier",
            "type": "string"
          },
          "valid_until": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "UTC ISO-8601 instant the entitlement expires. Always set when granted=true (the trial is time-boxed — see is_trial on GET /me); null only when granted=false and the existing grant is open-ended (no expiry).",
            "title": "Valid Until"
          }
        },
        "required": [
          "pack_slug",
          "tier"
        ],
        "title": "PackSelectionResponse",
        "type": "object"
      },
      "PackUsageRowResponse": {
        "description": "Per-pack usage rollup row.",
        "properties": {
          "active_tenants": {
            "title": "Active Tenants",
            "type": "integer"
          },
          "cost_estimate_usd": {
            "title": "Cost Estimate Usd",
            "type": "number"
          },
          "invocation_count": {
            "title": "Invocation Count",
            "type": "integer"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "tokens_in": {
            "title": "Tokens In",
            "type": "integer"
          },
          "tokens_out": {
            "title": "Tokens Out",
            "type": "integer"
          }
        },
        "required": [
          "pack_slug",
          "invocation_count",
          "active_tenants",
          "tokens_in",
          "tokens_out",
          "cost_estimate_usd"
        ],
        "title": "PackUsageRowResponse",
        "type": "object"
      },
      "PartnerFeedbackCreate": {
        "description": "A design-partner feedback-widget submission body.",
        "properties": {
          "category": {
            "default": "general",
            "description": "The kind of feedback: 'bug' | 'idea' | 'general'.",
            "enum": [
              "bug",
              "idea",
              "general"
            ],
            "title": "Category",
            "type": "string"
          },
          "message": {
            "description": "The free-text feedback body. Required, non-empty (whitespace trimmed).",
            "maxLength": 4000,
            "minLength": 1,
            "title": "Message",
            "type": "string"
          },
          "source_url": {
            "anyOf": [
              {
                "maxLength": 512,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional page/route the widget was on (e.g. the current pathname), auto-captured by the client for triage.",
            "title": "Source Url"
          }
        },
        "required": [
          "message"
        ],
        "title": "PartnerFeedbackCreate",
        "type": "object"
      },
      "PartnerFeedbackCreated": {
        "description": "The created design-partner-feedback row's identifier.",
        "properties": {
          "id": {
            "description": "The created feedback row's UUID.",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "title": "PartnerFeedbackCreated",
        "type": "object"
      },
      "PatientDataReadinessView": {
        "description": "The platform's patient-data readiness record.",
        "properties": {
          "complete": {
            "description": "True when every condition is recorded met. Until then a business associate agreement can be recorded only for an internal tenant or one with an unexpired override.",
            "title": "Complete",
            "type": "boolean"
          },
          "conditions": {
            "items": {
              "$ref": "#/components/schemas/ReadinessConditionView"
            },
            "title": "Conditions",
            "type": "array"
          },
          "unmet_conditions": {
            "items": {
              "type": "string"
            },
            "title": "Unmet Conditions",
            "type": "array"
          }
        },
        "required": [
          "complete",
          "unmet_conditions",
          "conditions"
        ],
        "title": "PatientDataReadinessView",
        "type": "object"
      },
      "PhaseAgentRead": {
        "description": "One roster agent a workflow step activates, as the pack declares it.\n\nThe identity triple the crew surfaces render a head from: the durable\n``agent_slug``, the roster's customer-facing name, and the shared-cast\n``archetype`` the head is drawn through. Same shape as the journey's\n``StageAgentRead`` so one renderer serves both. Only agents the roster\nactually declares appear here — an activation naming an unknown slug is\ndropped, never invented.",
        "properties": {
          "agent_slug": {
            "description": "Stable identifier of the agent on the pack's roster.",
            "title": "Agent Slug",
            "type": "string"
          },
          "archetype": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The role this agent plays in the pack's crew — lead, intake, analyst, strategist, writer, tracker, or monitor — or null when the roster declares none.",
            "title": "Archetype"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The agent's customer-facing name from the pack's roster.",
            "title": "Display Name"
          }
        },
        "required": [
          "agent_slug"
        ],
        "title": "PhaseAgentRead",
        "type": "object"
      },
      "PhaseOversightRead": {
        "description": "The oversight posture of one pack workflow phase.",
        "properties": {
          "basis": {
            "description": "The declared safeguards this mode derives from (customer-facing descriptions of the constraints that bear on the phase).",
            "items": {
              "type": "string"
            },
            "title": "Basis",
            "type": "array"
          },
          "display_name": {
            "description": "Phase label shown in the UI.",
            "title": "Display Name",
            "type": "string"
          },
          "mode": {
            "description": "The phase's baseline oversight mode, derived from the pack's declared governance — the floor a run selection can tighten but never loosen.",
            "title": "Mode",
            "type": "string"
          },
          "ordinal": {
            "description": "Sort order across phases.",
            "title": "Ordinal",
            "type": "integer"
          },
          "phase_slug": {
            "description": "The pack phase this entry describes.",
            "title": "Phase Slug",
            "type": "string"
          },
          "tighten_options": {
            "description": "Modes an operator may promote this phase to for their own run (strictly above the baseline; empty when the baseline is already human-in-the-loop).",
            "items": {
              "type": "string"
            },
            "title": "Tighten Options",
            "type": "array"
          }
        },
        "required": [
          "phase_slug",
          "display_name",
          "ordinal",
          "mode"
        ],
        "title": "PhaseOversightRead",
        "type": "object"
      },
      "PilotScope": {
        "additionalProperties": false,
        "description": "PRI area 1 — the pilot's shop, line, and call-forwarding path.",
        "properties": {
          "call_forwarding": {
            "anyOf": [
              {
                "maxLength": 1000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Call Forwarding"
          },
          "reception_line": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reception Line"
          },
          "shop_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shop Name"
          }
        },
        "title": "PilotScope",
        "type": "object"
      },
      "PlacementConfiguration": {
        "additionalProperties": false,
        "properties": {
          "currency_record_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency Record Id"
          },
          "financial_review_queue_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Financial Review Queue Id"
          },
          "policy_record_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Policy Record Id"
          }
        },
        "title": "PlacementConfiguration",
        "type": "object"
      },
      "PolicyCreate": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "maxLength": 256,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "rules": {
            "items": {
              "$ref": "#/components/schemas/PolicyRule"
            },
            "title": "Rules",
            "type": "array"
          },
          "scoped_abp_ids": {
            "anyOf": [
              {
                "items": {
                  "format": "uuid",
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scoped Abp Ids"
          },
          "type": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "name",
          "type"
        ],
        "title": "PolicyCreate",
        "type": "object"
      },
      "PolicyDiffRead": {
        "description": "What the candidate policy changes versus the currently-saved one.",
        "properties": {
          "added_fields": {
            "description": "Fields the change would newly require.",
            "items": {
              "type": "string"
            },
            "title": "Added Fields",
            "type": "array"
          },
          "enforcement_after": {
            "description": "The candidate choice ('strict'/'advisory').",
            "title": "Enforcement After",
            "type": "string"
          },
          "enforcement_before": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your saved choice ('strict'/'advisory'), or null if none saved yet.",
            "title": "Enforcement Before"
          },
          "fields_after": {
            "description": "The fields the candidate policy would require.",
            "items": {
              "type": "string"
            },
            "title": "Fields After",
            "type": "array"
          },
          "fields_before": {
            "description": "The fields your saved policy requires today (empty if none saved yet).",
            "items": {
              "type": "string"
            },
            "title": "Fields Before",
            "type": "array"
          },
          "has_baseline": {
            "description": "False when no policy is saved for this scope yet (this is a first policy).",
            "title": "Has Baseline",
            "type": "boolean"
          },
          "removed_fields": {
            "description": "Fields the change would stop requiring.",
            "items": {
              "type": "string"
            },
            "title": "Removed Fields",
            "type": "array"
          }
        },
        "required": [
          "enforcement_after",
          "has_baseline"
        ],
        "title": "PolicyDiffRead",
        "type": "object"
      },
      "PolicyDocument": {
        "description": "One policy document in the workspace's library.",
        "properties": {
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "extraction_status": {
            "description": "Whether the document's text could be read: 'ok' (text available), 'pending' (not read yet), 'unsupported' (kept, but no text could be read from this file type), or 'failed'.",
            "title": "Extraction Status",
            "type": "string"
          },
          "filename": {
            "description": "The document's original file name.",
            "title": "Filename",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "latest_derivation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DerivationSummary"
              },
              {
                "type": "null"
              }
            ],
            "description": "The latest rule-proposal attempt for this document, or null if none has run yet."
          },
          "sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Integrity fingerprint of the stored document bytes (set once stored).",
            "title": "Sha256"
          },
          "size_bytes": {
            "title": "Size Bytes",
            "type": "integer"
          },
          "status": {
            "description": "Upload state: 'pending' while the upload is in flight, 'stored' once kept.",
            "title": "Status",
            "type": "string"
          },
          "superseded": {
            "description": "True when a newer upload has replaced this document.",
            "title": "Superseded",
            "type": "boolean"
          },
          "superseded_by_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The id of the document that replaced this one, if any.",
            "title": "Superseded By Id"
          },
          "uploaded_at": {
            "format": "date-time",
            "title": "Uploaded At",
            "type": "string"
          },
          "uploaded_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who uploaded the document.",
            "title": "Uploaded By User Id"
          }
        },
        "required": [
          "id",
          "filename",
          "content_type",
          "size_bytes",
          "status",
          "extraction_status",
          "sha256",
          "superseded",
          "superseded_by_id",
          "uploaded_by_user_id",
          "uploaded_at"
        ],
        "title": "PolicyDocument",
        "type": "object"
      },
      "PolicyDocumentList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PolicyDocument"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "PolicyDocumentList",
        "type": "object"
      },
      "PolicyList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PolicyRead"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "PolicyList",
        "type": "object"
      },
      "PolicyRead": {
        "description": "Policy as exposed to API clients.",
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "rules": {
            "items": {
              "$ref": "#/components/schemas/PolicyRule"
            },
            "title": "Rules",
            "type": "array"
          },
          "scoped_abp_ids": {
            "anyOf": [
              {
                "items": {
                  "format": "uuid",
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scoped Abp Ids"
          },
          "tenant_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Id"
          },
          "type": {
            "title": "Type",
            "type": "string"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "name",
          "type",
          "description",
          "rules",
          "scoped_abp_ids"
        ],
        "title": "PolicyRead",
        "type": "object"
      },
      "PolicyRule": {
        "additionalProperties": false,
        "description": "One assertion within a design-time governance policy.\n\n`field` is a dot-notation path into the ABP (e.g., `metadata.description`,\n`governance.0.kind`, `evidence.capture_inputs`). The resolver walks the\nABP as a nested dict/list/object tree — see `operators.resolve_field`.\n\n`value` is operator-specific:\n- `exists` / `not_exists`         : ignored\n- `equals` / `not_equals`         : the comparand\n- `contains` / `not_contains`     : substring (for strings) or member (for arrays)\n- `matches`                       : a regex pattern\n- `count_gte` / `count_lte`       : an integer threshold (field must be an array)\n- `numeric_gte` / `numeric_lte`   : a float threshold; the field is coerced to\n                                   float and a non-numeric / missing field fails\n                                   closed (produces a violation)\n- `includes_type` / `not_includes_type`: a string compared against array items'\n                                   `.type` attribute",
        "properties": {
          "field": {
            "maxLength": 256,
            "minLength": 1,
            "title": "Field",
            "type": "string"
          },
          "id": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Id",
            "type": "string"
          },
          "message": {
            "maxLength": 1024,
            "minLength": 1,
            "title": "Message",
            "type": "string"
          },
          "operator": {
            "$ref": "#/components/schemas/RuleOperator"
          },
          "severity": {
            "$ref": "#/components/schemas/Severity"
          },
          "value": {
            "anyOf": [
              {
                "x-max-serialized-bytes": 8192
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          }
        },
        "required": [
          "id",
          "field",
          "operator",
          "severity",
          "message"
        ],
        "title": "PolicyRule",
        "type": "object"
      },
      "PolicyUpdate": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 256,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "rules": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/PolicyRule"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rules"
          },
          "scoped_abp_ids": {
            "anyOf": [
              {
                "items": {
                  "format": "uuid",
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scoped Abp Ids"
          },
          "type": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type"
          }
        },
        "title": "PolicyUpdate",
        "type": "object"
      },
      "PortalLaunchRequest": {
        "additionalProperties": false,
        "properties": {
          "expected_preparation_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Expected Preparation Sha256",
            "type": "string"
          },
          "expected_route_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Expected Route Sha256",
            "type": "string"
          }
        },
        "required": [
          "expected_preparation_sha256",
          "expected_route_sha256"
        ],
        "title": "PortalLaunchRequest",
        "type": "object"
      },
      "PortalSessionReport": {
        "additionalProperties": false,
        "properties": {
          "action_revision": {
            "maximum": 2147483647.0,
            "minimum": 1.0,
            "title": "Action Revision",
            "type": "integer"
          },
          "destination_approved": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Destination Approved"
          },
          "observation": {
            "const": "person_reported",
            "default": "person_reported",
            "title": "Observation",
            "type": "string"
          },
          "observed_host": {
            "anyOf": [
              {
                "maxLength": 253,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Observed Host"
          },
          "operation_key": {
            "format": "uuid",
            "title": "Operation Key",
            "type": "string"
          },
          "preparation_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Preparation Sha256",
            "type": "string"
          },
          "reported_at": {
            "format": "date-time",
            "title": "Reported At",
            "type": "string"
          },
          "route_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Route Sha256",
            "type": "string"
          },
          "state": {
            "enum": [
              "expired_session",
              "permission_denied",
              "wrong_organization",
              "unexpected_redirect",
              "access_rechecked"
            ],
            "title": "State",
            "type": "string"
          },
          "user_id": {
            "format": "uuid",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "operation_key",
          "action_revision",
          "user_id",
          "reported_at",
          "state",
          "preparation_sha256",
          "route_sha256"
        ],
        "title": "PortalSessionReport",
        "type": "object"
      },
      "PortalSessionReportRequest": {
        "additionalProperties": false,
        "properties": {
          "expected_preparation_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Expected Preparation Sha256",
            "type": "string"
          },
          "expected_revision": {
            "maximum": 2147483647.0,
            "minimum": 1.0,
            "title": "Expected Revision",
            "type": "integer"
          },
          "expected_route_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Expected Route Sha256",
            "type": "string"
          },
          "observed_host": {
            "anyOf": [
              {
                "maxLength": 253,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Observed Host"
          },
          "operation_key": {
            "format": "uuid",
            "title": "Operation Key",
            "type": "string"
          },
          "state": {
            "enum": [
              "expired_session",
              "permission_denied",
              "wrong_organization",
              "unexpected_redirect",
              "access_rechecked"
            ],
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "expected_preparation_sha256",
          "expected_route_sha256",
          "operation_key",
          "expected_revision",
          "state"
        ],
        "title": "PortalSessionReportRequest",
        "type": "object"
      },
      "PositionContract": {
        "additionalProperties": false,
        "properties": {
          "accepted_run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accepted Run Id"
          },
          "compute_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compute Ref"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "produces": {
            "items": {
              "type": "string"
            },
            "title": "Produces",
            "type": "array"
          },
          "requires": {
            "items": {
              "type": "string"
            },
            "title": "Requires",
            "type": "array"
          },
          "stage_id": {
            "format": "uuid",
            "title": "Stage Id",
            "type": "string"
          },
          "stage_index": {
            "title": "Stage Index",
            "type": "integer"
          },
          "stage_key": {
            "title": "Stage Key",
            "type": "string"
          }
        },
        "required": [
          "stage_id",
          "stage_key",
          "stage_index",
          "kind",
          "requires",
          "produces",
          "compute_ref"
        ],
        "title": "PositionContract",
        "type": "object"
      },
      "PositionRead": {
        "additionalProperties": false,
        "properties": {
          "accepted_run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accepted Run Id"
          },
          "compute_run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compute Run Id"
          },
          "fact_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fact Id"
          },
          "fact_key": {
            "title": "Fact Key",
            "type": "string"
          },
          "producer_stage_id": {
            "format": "uuid",
            "title": "Producer Stage Id",
            "type": "string"
          },
          "producer_stage_key": {
            "title": "Producer Stage Key",
            "type": "string"
          },
          "projection_id": {
            "title": "Projection Id",
            "type": "string"
          },
          "projection_schema": {
            "additionalProperties": true,
            "title": "Projection Schema",
            "type": "object"
          },
          "projection_sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Projection Sha256"
          },
          "reason": {
            "anyOf": [
              {
                "const": "not_accepted",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "schema_id": {
            "title": "Schema Id",
            "type": "string"
          },
          "source_schema": {
            "additionalProperties": true,
            "title": "Source Schema",
            "type": "object"
          },
          "source_schema_sha256": {
            "title": "Source Schema Sha256",
            "type": "string"
          },
          "source_value_sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Value Sha256"
          },
          "state": {
            "enum": [
              "accepted",
              "unavailable"
            ],
            "title": "State",
            "type": "string"
          },
          "value": {
            "title": "Value"
          }
        },
        "required": [
          "fact_key",
          "producer_stage_id",
          "producer_stage_key",
          "state",
          "schema_id",
          "source_schema",
          "source_schema_sha256",
          "projection_id",
          "projection_schema"
        ],
        "title": "PositionRead",
        "type": "object"
      },
      "PreferencesRead": {
        "properties": {
          "notification_email": {
            "title": "Notification Email",
            "type": "boolean"
          },
          "notification_in_app": {
            "title": "Notification In App",
            "type": "boolean"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "theme": {
            "anyOf": [
              {
                "enum": [
                  "light",
                  "dark",
                  "system"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The display theme stored on the account: light, dark or system. Null when the user has not chosen one on their account.",
            "title": "Theme"
          },
          "timezone": {
            "title": "Timezone",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "user_id": {
            "format": "uuid",
            "title": "User Id",
            "type": "string"
          },
          "weekly_digest_email": {
            "title": "Weekly Digest Email",
            "type": "boolean"
          }
        },
        "required": [
          "user_id",
          "tenant_id",
          "timezone",
          "notification_email",
          "notification_in_app",
          "weekly_digest_email",
          "updated_at"
        ],
        "title": "PreferencesRead",
        "type": "object"
      },
      "PreferencesUpdate": {
        "description": "PATCH body for /me/preferences. All fields optional.",
        "properties": {
          "notification_email": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notification Email"
          },
          "notification_in_app": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notification In App"
          },
          "theme": {
            "anyOf": [
              {
                "enum": [
                  "light",
                  "dark",
                  "system"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Store a display theme on the account: light, dark or system.",
            "title": "Theme"
          },
          "timezone": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timezone"
          },
          "weekly_digest_email": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Weekly Digest Email"
          }
        },
        "title": "PreferencesUpdate",
        "type": "object"
      },
      "PrefillAttachmentRef": {
        "description": "One attached document on a run, for the re-run-with-changes prefill.\n\nA lightweight reference so the run form can show + re-link what the original\nrun was run with. ``attachment_id`` is the ``run_attachments`` id the new run\nre-attaches; ``filename`` / ``content_type`` label it in the form.",
        "properties": {
          "attachment_id": {
            "format": "uuid",
            "title": "Attachment Id",
            "type": "string"
          },
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          }
        },
        "required": [
          "attachment_id",
          "filename",
          "content_type"
        ],
        "title": "PrefillAttachmentRef",
        "type": "object"
      },
      "PrepareActionRequest": {
        "additionalProperties": false,
        "properties": {
          "action_kind": {
            "enum": [
              "reconsideration",
              "appeal",
              "resubmission"
            ],
            "title": "Action Kind",
            "type": "string"
          },
          "case_id": {
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "channel": {
            "enum": [
              "assisted_portal",
              "api"
            ],
            "title": "Channel",
            "type": "string"
          },
          "claim_keys": {
            "items": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^\\S(?:.*\\S)?$",
              "type": "string"
            },
            "maxItems": 20,
            "minItems": 1,
            "title": "Claim Keys",
            "type": "array"
          },
          "connector_input_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connector Input Attachment Id"
          },
          "connector_manifest_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connector Manifest Attachment Id"
          },
          "drafting_run_id": {
            "format": "uuid",
            "title": "Drafting Run Id",
            "type": "string"
          },
          "enclosure_attachment_ids": {
            "default": [],
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 20,
            "title": "Enclosure Attachment Ids",
            "type": "array"
          },
          "expected_connector_input_sha256": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 64,
                "pattern": "^[a-f0-9]{64}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Connector Input Sha256"
          },
          "expected_connector_manifest_sha256": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 64,
                "pattern": "^[a-f0-9]{64}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Connector Manifest Sha256"
          },
          "expected_final_packet_sha256": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 64,
                "pattern": "^[a-f0-9]{64}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Final Packet Sha256"
          },
          "expected_procedure_evidence_sha256": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 64,
                "pattern": "^[a-f0-9]{64}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Procedure Evidence Sha256"
          },
          "export_kind": {
            "enum": [
              "reconsideration-letters-pdf",
              "reconsideration-letters-docx",
              "formal-appeal-pdf",
              "formal-appeal-docx",
              "coding-reconsideration-pdf",
              "coding-reconsideration-docx",
              "paid-claim-correction-pdf",
              "paid-claim-correction-docx"
            ],
            "title": "Export Kind",
            "type": "string"
          },
          "final_packet_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Final Packet Attachment Id"
          },
          "final_packet_attestation": {
            "anyOf": [
              {
                "const": "completed_from_reviewed_template",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Final Packet Attestation"
          },
          "operation_key": {
            "format": "uuid",
            "title": "Operation Key",
            "type": "string"
          },
          "prior_action_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prior Action Id"
          },
          "procedure_evidence_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Procedure Evidence Attachment Id"
          },
          "procedure_stage": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Procedure Stage",
            "type": "string"
          },
          "route_selection": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RouteSelection"
              },
              {
                "type": "null"
              }
            ]
          },
          "schema_version": {
            "const": "underpayments.action-preparation.v1",
            "default": "underpayments.action-preparation.v1",
            "title": "Schema Version",
            "type": "string"
          }
        },
        "required": [
          "operation_key",
          "action_kind",
          "procedure_stage",
          "channel",
          "claim_keys",
          "case_id",
          "drafting_run_id",
          "export_kind"
        ],
        "title": "PrepareActionRequest",
        "type": "object"
      },
      "PresignedUrlRequest": {
        "properties": {
          "format": {
            "enum": [
              "json",
              "pdf"
            ],
            "title": "Format",
            "type": "string"
          }
        },
        "required": [
          "format"
        ],
        "title": "PresignedUrlRequest",
        "type": "object"
      },
      "PresignedUrlResponse": {
        "properties": {
          "expires_in": {
            "default": 900,
            "description": "URL TTL in seconds.",
            "title": "Expires In",
            "type": "integer"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "title": "PresignedUrlResponse",
        "type": "object"
      },
      "PreviewRequest": {
        "description": "A sample input to dry-run against the scope's saved policy.",
        "properties": {
          "metadata": {
            "additionalProperties": true,
            "description": "Sample structured fields to test (the same envelope a real run sends).",
            "title": "Metadata",
            "type": "object",
            "x-max-serialized-bytes": 8192
          },
          "prompt_text": {
            "default": "",
            "description": "A sample prompt to test against your policy.",
            "maxLength": 20000,
            "title": "Prompt Text",
            "type": "string"
          }
        },
        "title": "PreviewRequest",
        "type": "object"
      },
      "PreviewResponse": {
        "description": "Whether the sample input would pass the scope's policy (customer-facing).",
        "properties": {
          "has_policy": {
            "description": "False when your team has saved no required-field policy for this scope yet.",
            "title": "Has Policy",
            "type": "boolean"
          },
          "messages": {
            "description": "Human-readable explanation of why the input would or would not pass.",
            "items": {
              "type": "string"
            },
            "title": "Messages",
            "type": "array"
          },
          "missing_fields": {
            "description": "The required fields absent from the sample input (empty when it would pass).",
            "items": {
              "type": "string"
            },
            "title": "Missing Fields",
            "type": "array"
          },
          "would_pass": {
            "description": "True if a real run with this input would satisfy your required fields.",
            "title": "Would Pass",
            "type": "boolean"
          }
        },
        "required": [
          "would_pass",
          "has_policy"
        ],
        "title": "PreviewResponse",
        "type": "object"
      },
      "PrincipalSeatRead": {
        "additionalProperties": false,
        "description": "The case's human sign-off seat, derived from the pack's declared approvals.\n\nNames the minimum approver tier those approvals require — a tier, never\na person: no designated approver exists on the case. Present exactly\nwhen the pack declares an approval that pauses a run for a person's\nsign-off; absent otherwise, so a surface never renders a seat that no\ndeclared approval backs.",
        "properties": {
          "tier": {
            "description": "The minimum approver tier the pack's declared approvals require — 'member' or 'admin'. When gates declare different tiers, this is the strictest; a gate that declares none requires member tier (the default every approver clears).",
            "title": "Tier",
            "type": "string"
          }
        },
        "required": [
          "tier"
        ],
        "title": "PrincipalSeatRead",
        "type": "object"
      },
      "ProcedureSummary": {
        "additionalProperties": false,
        "properties": {
          "anchor_at": {
            "format": "date-time",
            "title": "Anchor At",
            "type": "string"
          },
          "claims": {
            "items": {
              "$ref": "#/components/schemas/ProcedureSummaryClaim"
            },
            "maxItems": 20,
            "minItems": 1,
            "title": "Claims",
            "type": "array"
          },
          "deadline_at": {
            "format": "date-time",
            "title": "Deadline At",
            "type": "string"
          },
          "prior_receipt_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prior Receipt Attachment Id"
          },
          "provider_action": {
            "enum": [
              "formal_appeal",
              "coding_reconsideration",
              "paid_claim_correction"
            ],
            "title": "Provider Action",
            "type": "string"
          },
          "title": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Title",
            "type": "string"
          },
          "window_source_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Window Source Sha256",
            "type": "string"
          }
        },
        "required": [
          "provider_action",
          "title",
          "claims",
          "prior_receipt_attachment_id",
          "deadline_at",
          "anchor_at",
          "window_source_sha256"
        ],
        "title": "ProcedureSummary",
        "type": "object"
      },
      "ProcedureSummaryClaim": {
        "additionalProperties": false,
        "properties": {
          "changes": {
            "items": {
              "$ref": "#/components/schemas/CorrectedField"
            },
            "maxItems": 20,
            "title": "Changes",
            "type": "array"
          },
          "claim_key": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Claim Key",
            "type": "string"
          },
          "coding_adjustment_code": {
            "anyOf": [
              {
                "maxLength": 128,
                "minLength": 1,
                "pattern": "^\\S(?:.*\\S)?$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Coding Adjustment Code"
          },
          "coding_line_number": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Coding Line Number"
          },
          "original_icn": {
            "anyOf": [
              {
                "maxLength": 128,
                "minLength": 1,
                "pattern": "^\\S(?:.*\\S)?$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Original Icn"
          }
        },
        "required": [
          "claim_key",
          "original_icn",
          "coding_line_number",
          "coding_adjustment_code",
          "changes"
        ],
        "title": "ProcedureSummaryClaim",
        "type": "object"
      },
      "ProductMetricsResponse": {
        "description": "Product-engagement metrics (see ``core/kpi/summary.ProductMetrics``).",
        "properties": {
          "activated_tenants": {
            "description": "Tenants with >= 1 metered invocation ever (crossed activation).",
            "title": "Activated Tenants",
            "type": "integer"
          },
          "activation_rate_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "activated_tenants / total_tenants * 100. null when no tenants.",
            "title": "Activation Rate Pct"
          },
          "pack_usage": {
            "description": "Per-pack usage rollup, ordered by invocation_count DESC.",
            "items": {
              "$ref": "#/components/schemas/PackUsageRowResponse"
            },
            "title": "Pack Usage",
            "type": "array"
          },
          "total_invocations_window": {
            "description": "All metered invocations within the window.",
            "title": "Total Invocations Window",
            "type": "integer"
          },
          "total_tenants": {
            "description": "All tenants (activation denominator).",
            "title": "Total Tenants",
            "type": "integer"
          },
          "weekly_active_tenants": {
            "description": "Tenants with >= 1 metered invocation in the trailing 7 days (WAU).",
            "title": "Weekly Active Tenants",
            "type": "integer"
          }
        },
        "required": [
          "total_tenants",
          "activated_tenants",
          "weekly_active_tenants",
          "total_invocations_window"
        ],
        "title": "ProductMetricsResponse",
        "type": "object"
      },
      "ProfileRead": {
        "description": "Joined profile envelope returned to the settings surface.\n\nCombines the `users` row (id, email, display name) with the calling\nuser's tenant (id + name from the directory) and a session-level MFA\nsignal derived from the JWT's `amr` claim.",
        "properties": {
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "mfa_enabled": {
            "description": "True when the account has an MFA factor enrolled and enabled, read live from the identity provider on each request (with a session-level fallback when the live read is unavailable). False for machine credentials.",
            "title": "Mfa Enabled",
            "type": "boolean"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          },
          "tenant_name": {
            "title": "Tenant Name",
            "type": "string"
          },
          "user_id": {
            "format": "uuid",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "email",
          "display_name",
          "mfa_enabled",
          "tenant_id",
          "tenant_name",
          "role"
        ],
        "title": "ProfileRead",
        "type": "object"
      },
      "ProfileUpdate": {
        "description": "PATCH body for /me/profile. Only `display_name` is editable here.",
        "properties": {
          "display_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          }
        },
        "title": "ProfileUpdate",
        "type": "object"
      },
      "ProofDetailRead": {
        "properties": {
          "basis": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BasisRevisionRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "basis_history": {
            "items": {
              "$ref": "#/components/schemas/BasisRevisionRead"
            },
            "title": "Basis History",
            "type": "array"
          },
          "basis_revision_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Basis Revision Id"
          },
          "candidate": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EvidenceRevisionRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "candidate_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Candidate Attachment Id"
          },
          "candidate_revision_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Candidate Revision Id"
          },
          "capabilities": {
            "additionalProperties": {
              "$ref": "#/components/schemas/CapabilityRead"
            },
            "title": "Capabilities",
            "type": "object"
          },
          "case_id": {
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "case_version": {
            "default": 0,
            "title": "Case Version",
            "type": "integer"
          },
          "consumptions": {
            "items": {
              "$ref": "#/components/schemas/ConsumptionRead"
            },
            "title": "Consumptions",
            "type": "array"
          },
          "continuation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ContinuationRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "contract_revision": {
            "title": "Contract Revision",
            "type": "string"
          },
          "covered_line_ids": {
            "items": {
              "type": "string"
            },
            "title": "Covered Line Ids",
            "type": "array"
          },
          "eligible": {
            "default": false,
            "title": "Eligible",
            "type": "boolean"
          },
          "enrolled": {
            "title": "Enrolled",
            "type": "boolean"
          },
          "enrollment": {
            "enum": [
              "legacy",
              "required"
            ],
            "title": "Enrollment",
            "type": "string"
          },
          "event": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event"
          },
          "evidence_mode": {
            "default": "real",
            "enum": [
              "real",
              "synthetic"
            ],
            "title": "Evidence Mode",
            "type": "string"
          },
          "evidence_revisions": {
            "items": {
              "$ref": "#/components/schemas/EvidenceRevisionRead"
            },
            "title": "Evidence Revisions",
            "type": "array"
          },
          "field_checks": {
            "$ref": "#/components/schemas/FieldChecksRead"
          },
          "history": {
            "items": {
              "$ref": "#/components/schemas/ValidationAttemptRead"
            },
            "title": "History",
            "type": "array"
          },
          "holds": {
            "items": {
              "type": "string"
            },
            "title": "Holds",
            "type": "array"
          },
          "method": {
            "anyOf": [
              {
                "enum": [
                  "human_attested",
                  "connector_verified"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          },
          "next_action": {
            "const": "review_proof",
            "default": "review_proof",
            "title": "Next Action",
            "type": "string"
          },
          "policy": {
            "$ref": "#/components/schemas/ProofPolicyRead"
          },
          "policy_revision": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Policy Revision"
          },
          "policy_revision_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Policy Revision Id"
          },
          "requirement_id": {
            "title": "Requirement Id",
            "type": "string"
          },
          "requirement_satisfied": {
            "default": false,
            "title": "Requirement Satisfied",
            "type": "boolean"
          },
          "retainable_attachments": {
            "items": {
              "$ref": "#/components/schemas/RetainableAttachmentRead"
            },
            "title": "Retainable Attachments",
            "type": "array"
          },
          "review_path": {
            "title": "Review Path",
            "type": "string"
          },
          "state": {
            "enum": [
              "not_evaluated",
              "validating",
              "document_validated",
              "validated",
              "rejected",
              "ambiguous",
              "invalidated"
            ],
            "title": "State",
            "type": "string"
          },
          "terminal_event": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Terminal Event"
          },
          "terminal_outcome": {
            "default": false,
            "title": "Terminal Outcome",
            "type": "boolean"
          },
          "unresolved_line_ids": {
            "items": {
              "type": "string"
            },
            "title": "Unresolved Line Ids",
            "type": "array"
          },
          "validation_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Validation Id"
          },
          "version": {
            "default": 0,
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "contract_revision",
          "enrollment",
          "state",
          "review_path",
          "case_id",
          "requirement_id",
          "enrolled",
          "candidate",
          "evidence_revisions",
          "basis",
          "basis_history",
          "policy",
          "history",
          "consumptions",
          "capabilities"
        ],
        "title": "ProofDetailRead",
        "type": "object"
      },
      "ProofPolicyRead": {
        "properties": {
          "allowed_completion_methods": {
            "items": {
              "enum": [
                "human_attested",
                "connector_verified"
              ],
              "type": "string"
            },
            "title": "Allowed Completion Methods",
            "type": "array"
          },
          "contract_revision": {
            "title": "Contract Revision",
            "type": "string"
          },
          "id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "revision": {
            "title": "Revision",
            "type": "string"
          }
        },
        "required": [
          "id",
          "revision",
          "contract_revision",
          "allowed_completion_methods"
        ],
        "title": "ProofPolicyRead",
        "type": "object"
      },
      "ProofSummaryRead": {
        "properties": {
          "basis_revision_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Basis Revision Id"
          },
          "candidate_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Candidate Attachment Id"
          },
          "candidate_revision_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Candidate Revision Id"
          },
          "case_version": {
            "default": 0,
            "title": "Case Version",
            "type": "integer"
          },
          "continuation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ContinuationRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "contract_revision": {
            "title": "Contract Revision",
            "type": "string"
          },
          "covered_line_ids": {
            "items": {
              "type": "string"
            },
            "title": "Covered Line Ids",
            "type": "array"
          },
          "eligible": {
            "default": false,
            "title": "Eligible",
            "type": "boolean"
          },
          "enrollment": {
            "enum": [
              "legacy",
              "required"
            ],
            "title": "Enrollment",
            "type": "string"
          },
          "event": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event"
          },
          "evidence_mode": {
            "default": "real",
            "enum": [
              "real",
              "synthetic"
            ],
            "title": "Evidence Mode",
            "type": "string"
          },
          "field_checks": {
            "$ref": "#/components/schemas/FieldChecksRead"
          },
          "holds": {
            "items": {
              "type": "string"
            },
            "title": "Holds",
            "type": "array"
          },
          "method": {
            "anyOf": [
              {
                "enum": [
                  "human_attested",
                  "connector_verified"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          },
          "next_action": {
            "const": "review_proof",
            "default": "review_proof",
            "title": "Next Action",
            "type": "string"
          },
          "policy_revision": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Policy Revision"
          },
          "policy_revision_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Policy Revision Id"
          },
          "requirement_satisfied": {
            "default": false,
            "title": "Requirement Satisfied",
            "type": "boolean"
          },
          "review_path": {
            "title": "Review Path",
            "type": "string"
          },
          "state": {
            "enum": [
              "not_evaluated",
              "validating",
              "document_validated",
              "validated",
              "rejected",
              "ambiguous",
              "invalidated"
            ],
            "title": "State",
            "type": "string"
          },
          "terminal_event": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Terminal Event"
          },
          "terminal_outcome": {
            "default": false,
            "title": "Terminal Outcome",
            "type": "boolean"
          },
          "unresolved_line_ids": {
            "items": {
              "type": "string"
            },
            "title": "Unresolved Line Ids",
            "type": "array"
          },
          "validation_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Validation Id"
          },
          "version": {
            "default": 0,
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "contract_revision",
          "enrollment",
          "state",
          "review_path"
        ],
        "title": "ProofSummaryRead",
        "type": "object"
      },
      "ProvisionFederatedBody": {
        "description": "Payload posted by the Cognito pre-signup and pre-token-gen Lambdas.\n\nSnake_case field names — the (stdlib-only) Lambdas emit matching snake_case\nJSON keys, for the same reason as :class:`ProvisionSignupBody`: we own both\nends of this internal call. ``provider_user_name`` (``<ProviderName>_<subject>``)\nnames the workspace IdP; ``email`` is the address the IdP asserts\n(``custom:idp_email``). The pre-signup call has no ``cognito_sub`` (Cognito\nhas not created the user) and only admits or denies; the pre-token-gen call\nsends it and provisions.",
        "properties": {
          "cognito_sub": {
            "anyOf": [
              {
                "maxLength": 255,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cognito Sub"
          },
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "email_verified": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "maxLength": 16,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email Verified"
          },
          "family_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Family Name"
          },
          "given_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Given Name"
          },
          "provider_user_name": {
            "maxLength": 512,
            "minLength": 3,
            "title": "Provider User Name",
            "type": "string"
          }
        },
        "required": [
          "email",
          "provider_user_name"
        ],
        "title": "ProvisionFederatedBody",
        "type": "object"
      },
      "ProvisionFederatedResponse": {
        "description": "Result returned to the Lambda (logged in CloudWatch; never user-facing).",
        "properties": {
          "created": {
            "title": "Created",
            "type": "boolean"
          },
          "pending_link": {
            "default": false,
            "title": "Pending Link",
            "type": "boolean"
          },
          "tenant_created": {
            "title": "Tenant Created",
            "type": "boolean"
          },
          "tenant_id": {
            "title": "Tenant Id",
            "type": "string"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          }
        },
        "required": [
          "tenant_id",
          "user_id",
          "created",
          "tenant_created"
        ],
        "title": "ProvisionFederatedResponse",
        "type": "object"
      },
      "ProvisionSignupBody": {
        "description": "Payload posted by the post-confirmation Lambda.\n\nSnake_case field names — the (stdlib-only) Lambda emits matching snake_case\nJSON keys. We own both ends of this internal call, so snake_case on the wire\nis simplest and most robust.",
        "properties": {
          "cognito_sub": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Cognito Sub",
            "type": "string"
          },
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "family_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Family Name"
          },
          "given_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Given Name"
          },
          "invite_token": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invite Token"
          },
          "tenant_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Name"
          }
        },
        "required": [
          "cognito_sub",
          "email"
        ],
        "title": "ProvisionSignupBody",
        "type": "object"
      },
      "ProvisionSignupResponse": {
        "description": "Result returned to the Lambda (logged in CloudWatch; never user-facing).",
        "properties": {
          "created": {
            "title": "Created",
            "type": "boolean"
          },
          "tenant_id": {
            "title": "Tenant Id",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "tenant_id",
          "user_id",
          "created"
        ],
        "title": "ProvisionSignupResponse",
        "type": "object"
      },
      "QueueCreate": {
        "description": "A declarative routing queue definition.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 4000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "description": "Queue name, unique per tenant.",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "offer_timeout_seconds": {
            "default": 14400,
            "description": "How long an offer stands before the sweep expires and re-routes it.",
            "maximum": 604800.0,
            "minimum": 60.0,
            "title": "Offer Timeout Seconds",
            "type": "integer"
          },
          "relaxation_timeout_seconds": {
            "default": 3600,
            "description": "Seconds a routed item waits per stepwise skill relaxation. Each step drops the last required skill tag, so escalations never starve on an over-narrow skill match.",
            "maximum": 604800.0,
            "minimum": 60.0,
            "title": "Relaxation Timeout Seconds",
            "type": "integer"
          },
          "required_role": {
            "default": "member",
            "description": "Minimum workspace role a member must currently hold to receive offers from this queue.",
            "enum": [
              "owner",
              "admin",
              "member"
            ],
            "title": "Required Role",
            "type": "string"
          },
          "skills": {
            "description": "The queue's declared skill-tag vocabulary. Work items routed to the queue may only require a subset of these tags.",
            "items": {
              "maxLength": 64,
              "type": "string"
            },
            "maxItems": 32,
            "title": "Skills",
            "type": "array"
          }
        },
        "required": [
          "name"
        ],
        "title": "QueueCreate",
        "type": "object"
      },
      "QueueDetail": {
        "description": "A queue with its member roster.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By User Id"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "members": {
            "items": {
              "$ref": "#/components/schemas/MemberRead"
            },
            "title": "Members",
            "type": "array"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "offer_timeout_seconds": {
            "title": "Offer Timeout Seconds",
            "type": "integer"
          },
          "relaxation_timeout_seconds": {
            "title": "Relaxation Timeout Seconds",
            "type": "integer"
          },
          "required_role": {
            "title": "Required Role",
            "type": "string"
          },
          "skills": {
            "items": {
              "type": "string"
            },
            "title": "Skills",
            "type": "array"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "required_role",
          "skills",
          "offer_timeout_seconds",
          "relaxation_timeout_seconds",
          "created_by_user_id",
          "created_at",
          "updated_at",
          "members"
        ],
        "title": "QueueDetail",
        "type": "object"
      },
      "QueueList": {
        "description": "The tenant's queues.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/QueueRead"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "QueueList",
        "type": "object"
      },
      "QueueRead": {
        "description": "One queue definition.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By User Id"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "offer_timeout_seconds": {
            "title": "Offer Timeout Seconds",
            "type": "integer"
          },
          "relaxation_timeout_seconds": {
            "title": "Relaxation Timeout Seconds",
            "type": "integer"
          },
          "required_role": {
            "title": "Required Role",
            "type": "string"
          },
          "skills": {
            "items": {
              "type": "string"
            },
            "title": "Skills",
            "type": "array"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "required_role",
          "skills",
          "offer_timeout_seconds",
          "relaxation_timeout_seconds",
          "created_by_user_id",
          "created_at",
          "updated_at"
        ],
        "title": "QueueRead",
        "type": "object"
      },
      "QueueUpdate": {
        "description": "Partial queue update; omitted fields keep their current value.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 4000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "offer_timeout_seconds": {
            "anyOf": [
              {
                "maximum": 604800.0,
                "minimum": 60.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Offer Timeout Seconds"
          },
          "relaxation_timeout_seconds": {
            "anyOf": [
              {
                "maximum": 604800.0,
                "minimum": 60.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Relaxation Timeout Seconds"
          },
          "required_role": {
            "anyOf": [
              {
                "enum": [
                  "owner",
                  "admin",
                  "member"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Required Role"
          },
          "skills": {
            "anyOf": [
              {
                "items": {
                  "maxLength": 64,
                  "type": "string"
                },
                "maxItems": 32,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skills"
          }
        },
        "title": "QueueUpdate",
        "type": "object"
      },
      "QuoteEvidencePacket": {
        "properties": {
          "accepted_day": {
            "format": "date",
            "title": "Accepted Day",
            "type": "string"
          },
          "census_date": {
            "format": "date",
            "title": "Census Date",
            "type": "string"
          },
          "census_through": {
            "format": "date",
            "title": "Census Through",
            "type": "string"
          },
          "dependents": {
            "title": "Dependents",
            "type": "integer"
          },
          "period_end": {
            "format": "date",
            "title": "Period End",
            "type": "string"
          },
          "period_start": {
            "format": "date",
            "title": "Period Start",
            "type": "string"
          },
          "policy_date": {
            "format": "date",
            "title": "Policy Date",
            "type": "string"
          },
          "quote": {
            "title": "Quote",
            "type": "string"
          },
          "report": {
            "title": "Report",
            "type": "string"
          },
          "subscribers": {
            "title": "Subscribers",
            "type": "integer"
          },
          "system": {
            "title": "System",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "workers": {
            "title": "Workers",
            "type": "integer"
          },
          "x_date": {
            "format": "date",
            "title": "X Date",
            "type": "string"
          }
        },
        "required": [
          "title",
          "quote",
          "workers",
          "subscribers",
          "dependents",
          "census_date",
          "census_through",
          "policy_date",
          "x_date",
          "accepted_day",
          "period_start",
          "period_end",
          "system",
          "report"
        ],
        "title": "QuoteEvidencePacket",
        "type": "object"
      },
      "QuoteHandoffChange": {
        "additionalProperties": false,
        "properties": {
          "action": {
            "enum": [
              "accept",
              "start",
              "check",
              "change_census",
              "review_census",
              "advance_date"
            ],
            "title": "Action",
            "type": "string"
          },
          "csv_text": {
            "anyOf": [
              {
                "maxLength": 3072,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Csv Text"
          },
          "reviewed": {
            "default": false,
            "title": "Reviewed",
            "type": "boolean"
          },
          "revision": {
            "minimum": 0.0,
            "title": "Revision",
            "type": "integer"
          },
          "sample": {
            "anyOf": [
              {
                "enum": [
                  "detail",
                  "summary",
                  "wrong_period"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sample"
          },
          "scenario": {
            "enum": [
              "april",
              "july"
            ],
            "title": "Scenario",
            "type": "string"
          }
        },
        "required": [
          "scenario",
          "action",
          "revision"
        ],
        "title": "QuoteHandoffChange",
        "type": "object"
      },
      "QuoteHandoffResult": {
        "properties": {
          "census_date": {
            "format": "date",
            "title": "Census Date",
            "type": "string"
          },
          "census_status": {
            "title": "Census Status",
            "type": "string"
          },
          "census_valid_through": {
            "format": "date",
            "title": "Census Valid Through",
            "type": "string"
          },
          "dependents": {
            "title": "Dependents",
            "type": "integer"
          },
          "first_pay_target": {
            "format": "date",
            "title": "First Pay Target",
            "type": "string"
          },
          "handoff": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AcceptedQuoteHandoff"
              },
              {
                "type": "null"
              }
            ]
          },
          "message": {
            "default": "",
            "title": "Message",
            "type": "string"
          },
          "period_end": {
            "format": "date",
            "title": "Period End",
            "type": "string"
          },
          "period_start": {
            "format": "date",
            "title": "Period Start",
            "type": "string"
          },
          "policy_source_date": {
            "format": "date",
            "title": "Policy Source Date",
            "type": "string"
          },
          "question": {
            "title": "Question",
            "type": "string"
          },
          "quote": {
            "title": "Quote",
            "type": "string"
          },
          "report": {
            "title": "Report",
            "type": "string"
          },
          "revision": {
            "title": "Revision",
            "type": "integer"
          },
          "run_id": {
            "format": "uuid",
            "title": "Run Id",
            "type": "string"
          },
          "scenario": {
            "enum": [
              "april",
              "july"
            ],
            "title": "Scenario",
            "type": "string"
          },
          "subscribers": {
            "title": "Subscribers",
            "type": "integer"
          },
          "system": {
            "title": "System",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "workers": {
            "title": "Workers",
            "type": "integer"
          }
        },
        "required": [
          "run_id",
          "scenario",
          "revision",
          "title",
          "quote",
          "workers",
          "subscribers",
          "dependents",
          "census_date",
          "census_valid_through",
          "policy_source_date",
          "first_pay_target",
          "period_start",
          "period_end",
          "system",
          "report",
          "question",
          "census_status",
          "handoff"
        ],
        "title": "QuoteHandoffResult",
        "type": "object"
      },
      "QuoteHandoffRun": {
        "properties": {
          "run_id": {
            "format": "uuid",
            "title": "Run Id",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "run_id",
          "title"
        ],
        "title": "QuoteHandoffRun",
        "type": "object"
      },
      "ReadinessConditionMetRequest": {
        "description": "Body for recording a condition as met.",
        "properties": {
          "evidence_ref": {
            "description": "Where the evidence is: a ticket comment, a run, a document URL.",
            "maxLength": 500,
            "minLength": 1,
            "title": "Evidence Ref",
            "type": "string"
          }
        },
        "required": [
          "evidence_ref"
        ],
        "title": "ReadinessConditionMetRequest",
        "type": "object"
      },
      "ReadinessConditionView": {
        "description": "One condition and its latest recorded entry.",
        "properties": {
          "evidence_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The evidence recorded when it was met.",
            "title": "Evidence Ref"
          },
          "key": {
            "title": "Key",
            "type": "string"
          },
          "met": {
            "title": "Met",
            "type": "boolean"
          },
          "recorded_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recorded At"
          },
          "recorded_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recorded By User Id"
          },
          "ticket": {
            "title": "Ticket",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "withdrawn_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why it was withdrawn, when it was.",
            "title": "Withdrawn Reason"
          }
        },
        "required": [
          "key",
          "ticket",
          "title",
          "met",
          "evidence_ref",
          "withdrawn_reason",
          "recorded_by_user_id",
          "recorded_at"
        ],
        "title": "ReadinessConditionView",
        "type": "object"
      },
      "ReadinessOverrideRequest": {
        "description": "Body for a time-boxed override for one tenant.",
        "properties": {
          "expires_at": {
            "description": "When the override ends. Must carry a timezone, be in the future and be at most 72 hours away.",
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          },
          "reason": {
            "description": "Why the override is needed.",
            "maxLength": 500,
            "minLength": 1,
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "reason",
          "expires_at"
        ],
        "title": "ReadinessOverrideRequest",
        "type": "object"
      },
      "ReadinessOverrideView": {
        "description": "A granted override.",
        "properties": {
          "expires_at": {
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          },
          "recorded_at": {
            "format": "date-time",
            "title": "Recorded At",
            "type": "string"
          },
          "recorded_by_user_id": {
            "format": "uuid",
            "title": "Recorded By User Id",
            "type": "string"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "reason",
          "expires_at",
          "recorded_by_user_id",
          "recorded_at"
        ],
        "title": "ReadinessOverrideView",
        "type": "object"
      },
      "ReasonRequest": {
        "additionalProperties": false,
        "properties": {
          "reason": {
            "maxLength": 1000,
            "minLength": 12,
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "reason"
        ],
        "title": "ReasonRequest",
        "type": "object",
        "x-max-serialized-bytes": 6144
      },
      "ReceiptAttachment": {
        "additionalProperties": false,
        "description": "One reported prepared-document outcome, without verification authority.",
        "properties": {
          "attachment_id": {
            "format": "uuid",
            "title": "Attachment Id",
            "type": "string"
          },
          "provider_status": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Provider Status",
            "type": "string"
          },
          "rejection_code": {
            "anyOf": [
              {
                "maxLength": 128,
                "minLength": 1,
                "pattern": "^\\S(?:.*\\S)?$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rejection Code"
          },
          "rejection_details": {
            "anyOf": [
              {
                "maxLength": 1024,
                "minLength": 1,
                "pattern": "^\\S(?:.*\\S)?$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rejection Details"
          },
          "sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Sha256",
            "type": "string"
          },
          "transport": {
            "enum": [
              "pending",
              "unknown",
              "acknowledged",
              "rejected"
            ],
            "title": "Transport",
            "type": "string"
          }
        },
        "required": [
          "attachment_id",
          "sha256",
          "provider_status",
          "transport"
        ],
        "title": "ReceiptAttachment",
        "type": "object"
      },
      "ReceiptClaim": {
        "additionalProperties": false,
        "properties": {
          "claim_id": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Claim Id",
            "type": "string"
          },
          "claim_key": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Claim Key",
            "type": "string"
          },
          "currency": {
            "anyOf": [
              {
                "maxLength": 3,
                "minLength": 3,
                "pattern": "^[A-Z]{3}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "decision": {
            "enum": [
              "pending",
              "unknown",
              "upheld",
              "denied",
              "partially_paid",
              "paid",
              "withdrawn"
            ],
            "title": "Decision",
            "type": "string"
          },
          "payee_id": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Payee Id",
            "type": "string"
          },
          "payer_id": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Payer Id",
            "type": "string"
          },
          "provider_status": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Provider Status",
            "type": "string"
          },
          "reported_amount_cents": {
            "anyOf": [
              {
                "maximum": 9000000000000000.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reported Amount Cents"
          },
          "row_number": {
            "maximum": 40.0,
            "minimum": 1.0,
            "title": "Row Number",
            "type": "integer"
          },
          "transport": {
            "enum": [
              "pending",
              "unknown",
              "acknowledged",
              "rejected"
            ],
            "title": "Transport",
            "type": "string"
          }
        },
        "required": [
          "row_number",
          "claim_key",
          "payer_id",
          "payee_id",
          "claim_id",
          "provider_status",
          "transport",
          "decision"
        ],
        "title": "ReceiptClaim",
        "type": "object"
      },
      "ReceiptImportRequest": {
        "additionalProperties": false,
        "properties": {
          "attachment_id": {
            "format": "uuid",
            "title": "Attachment Id",
            "type": "string"
          },
          "expected_source_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Expected Source Sha256",
            "type": "string"
          },
          "preview": {
            "$ref": "#/components/schemas/ReceiptPreview"
          }
        },
        "required": [
          "attachment_id",
          "expected_source_sha256",
          "preview"
        ],
        "title": "ReceiptImportRequest",
        "type": "object"
      },
      "ReceiptPreview": {
        "additionalProperties": false,
        "description": "Parsed source meaning; this public value cannot declare itself verified.",
        "properties": {
          "action_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Action Sha256",
            "type": "string"
          },
          "attachments": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/ReceiptAttachment"
            },
            "maxItems": 21,
            "title": "Attachments",
            "type": "array"
          },
          "claims": {
            "items": {
              "$ref": "#/components/schemas/ReceiptClaim"
            },
            "maxItems": 40,
            "title": "Claims",
            "type": "array"
          },
          "occurred_at": {
            "format": "date-time",
            "title": "Occurred At",
            "type": "string"
          },
          "packet_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Packet Sha256",
            "type": "string"
          },
          "payer_id": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Payer Id",
            "type": "string"
          },
          "provider_reference": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Provider Reference",
            "type": "string"
          },
          "provider_status": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Provider Status",
            "type": "string"
          },
          "schema_version": {
            "const": "underpayments.receipt-preview.v1",
            "default": "underpayments.receipt-preview.v1",
            "title": "Schema Version",
            "type": "string"
          },
          "sequence": {
            "anyOf": [
              {
                "maximum": 9000000000000000.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sequence"
          },
          "sequence_scope": {
            "anyOf": [
              {
                "maxLength": 128,
                "minLength": 1,
                "pattern": "^\\S(?:.*\\S)?$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sequence Scope"
          },
          "source_event_id": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Source Event Id",
            "type": "string"
          },
          "transport": {
            "enum": [
              "pending",
              "unknown",
              "acknowledged",
              "rejected"
            ],
            "title": "Transport",
            "type": "string"
          }
        },
        "required": [
          "source_event_id",
          "action_sha256",
          "packet_sha256",
          "payer_id",
          "provider_reference",
          "provider_status",
          "transport",
          "occurred_at",
          "claims"
        ],
        "title": "ReceiptPreview",
        "type": "object"
      },
      "ReceiptResolutionRequest": {
        "additionalProperties": false,
        "properties": {
          "confirm_resolution": {
            "const": true,
            "title": "Confirm Resolution",
            "type": "boolean"
          },
          "expected_preparation_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Expected Preparation Sha256",
            "type": "string"
          },
          "expected_revision": {
            "maximum": 2147483647.0,
            "minimum": 1.0,
            "title": "Expected Revision",
            "type": "integer"
          },
          "expected_selected_evidence_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Expected Selected Evidence Sha256",
            "type": "string"
          },
          "expected_variants_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Expected Variants Sha256",
            "type": "string"
          },
          "operation_key": {
            "format": "uuid",
            "title": "Operation Key",
            "type": "string"
          },
          "reason": {
            "maxLength": 1000,
            "minLength": 1,
            "title": "Reason",
            "type": "string"
          },
          "selected_receipt_id": {
            "format": "uuid",
            "title": "Selected Receipt Id",
            "type": "string"
          },
          "source_event_key_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Source Event Key Sha256",
            "type": "string"
          }
        },
        "required": [
          "operation_key",
          "expected_preparation_sha256",
          "expected_revision",
          "source_event_key_sha256",
          "selected_receipt_id",
          "expected_selected_evidence_sha256",
          "expected_variants_sha256",
          "reason",
          "confirm_resolution"
        ],
        "title": "ReceiptResolutionRequest",
        "type": "object"
      },
      "ReceiptSupersessionRequest": {
        "additionalProperties": false,
        "description": "Supersede one unsafe source event's complete retained set.\n\nOnly an event with no safe variant (for example a receipt transcribed\nagainst the wrong payer) can be superseded; originals are retained.",
        "properties": {
          "confirm_supersession": {
            "const": true,
            "title": "Confirm Supersession",
            "type": "boolean"
          },
          "expected_preparation_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Expected Preparation Sha256",
            "type": "string"
          },
          "expected_revision": {
            "maximum": 2147483647.0,
            "minimum": 1.0,
            "title": "Expected Revision",
            "type": "integer"
          },
          "expected_variants_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Expected Variants Sha256",
            "type": "string"
          },
          "operation_key": {
            "format": "uuid",
            "title": "Operation Key",
            "type": "string"
          },
          "reason": {
            "maxLength": 1000,
            "minLength": 1,
            "title": "Reason",
            "type": "string"
          },
          "source_event_key_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Source Event Key Sha256",
            "type": "string"
          }
        },
        "required": [
          "operation_key",
          "expected_preparation_sha256",
          "expected_revision",
          "source_event_key_sha256",
          "expected_variants_sha256",
          "reason",
          "confirm_supersession"
        ],
        "title": "ReceiptSupersessionRequest",
        "type": "object"
      },
      "RecoveryCensus": {
        "properties": {
          "active_examined": {
            "default": 0,
            "title": "Active Examined",
            "type": "integer"
          },
          "crews": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/CrewRecoveryCensus"
            },
            "title": "Crews",
            "type": "array"
          },
          "on_hold_active": {
            "default": 0,
            "title": "On Hold Active",
            "type": "integer"
          },
          "on_hold_halted": {
            "default": 0,
            "title": "On Hold Halted",
            "type": "integer"
          },
          "on_hold_open_clocks": {
            "default": 0,
            "title": "On Hold Open Clocks",
            "type": "integer"
          },
          "on_hold_paused": {
            "default": 0,
            "title": "On Hold Paused",
            "type": "integer"
          },
          "paused_examined": {
            "default": 0,
            "title": "Paused Examined",
            "type": "integer"
          },
          "stranded_active": {
            "default": 0,
            "title": "Stranded Active",
            "type": "integer"
          },
          "stranded_halted": {
            "default": 0,
            "title": "Stranded Halted",
            "type": "integer"
          },
          "stranded_paused": {
            "default": 0,
            "title": "Stranded Paused",
            "type": "integer"
          }
        },
        "title": "RecoveryCensus",
        "type": "object"
      },
      "RecoveryRead": {
        "properties": {
          "available_revision": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Available Revision"
          },
          "crew_on_hold": {
            "default": false,
            "title": "Crew On Hold",
            "type": "boolean"
          },
          "documents_carried": {
            "default": 0,
            "title": "Documents Carried",
            "type": "integer"
          },
          "late_document": {
            "default": false,
            "title": "Late Document",
            "type": "boolean"
          },
          "late_documents": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/LateDocumentRead"
            },
            "title": "Late Documents",
            "type": "array"
          },
          "pinned_revision": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pinned Revision"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "replacement_case_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Replacement Case Id"
          },
          "restart_answered": {
            "default": false,
            "title": "Restart Answered",
            "type": "boolean"
          },
          "restart_available": {
            "default": false,
            "title": "Restart Available",
            "type": "boolean"
          },
          "source_case_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Case Id"
          },
          "stranded": {
            "default": false,
            "title": "Stranded",
            "type": "boolean"
          }
        },
        "title": "RecoveryRead",
        "type": "object"
      },
      "RecoveryReading": {
        "properties": {
          "as_of": {
            "title": "As Of",
            "type": "string"
          },
          "capabilities": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "boolean"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Capabilities"
          },
          "holds": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Holds",
            "type": "array"
          },
          "items": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Items",
            "type": "array"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "observed_at": {
            "title": "Observed At",
            "type": "string"
          },
          "period": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Period",
            "type": "object"
          },
          "posting_sources": {
            "default": [],
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Posting Sources",
            "type": "array"
          },
          "revision": {
            "title": "Revision",
            "type": "integer"
          },
          "summary": {
            "$ref": "#/components/schemas/RecoverySummary"
          }
        },
        "required": [
          "observed_at",
          "as_of",
          "period",
          "revision",
          "summary",
          "items"
        ],
        "title": "RecoveryReading",
        "type": "object"
      },
      "RecoverySummary": {
        "description": "Distinct USD totals for the reading; synthetic events are in none of them.\n\nNull means the total is unknown because a claim's figures disagree or are\nmissing, never zero.",
        "properties": {
          "event_count": {
            "default": 0,
            "title": "Event Count",
            "type": "integer"
          },
          "expected_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Contract-expected reimbursement, once per claim.",
            "title": "Expected Cents"
          },
          "held_remittance_count": {
            "default": 0,
            "description": "Later payments whose claim basis is held; counted, not summed.",
            "title": "Held Remittance Count",
            "type": "integer"
          },
          "held_reversal_count": {
            "default": 0,
            "description": "Other reversals not netted from posted recovery; counted, not summed.",
            "title": "Held Reversal Count",
            "type": "integer"
          },
          "ineligible_count": {
            "default": 0,
            "title": "Ineligible Count",
            "type": "integer"
          },
          "interest_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Interest Cents"
          },
          "opportunity_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Opportunity Cents"
          },
          "posted_recovery_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Posted Recovery Cents"
          },
          "remaining_disputed_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Remaining Disputed Cents"
          },
          "remittance_paid_cents": {
            "default": 0,
            "description": "Later payer payments bound to their claim by a posting, effective in the period, whether or not the posting is verified yet. The claim's original adjudicated payment is excluded.",
            "title": "Remittance Paid Cents",
            "type": "integer"
          },
          "reversed_cents": {
            "default": 0,
            "description": "Reversals and recoupments netted from an eligible posted payment, effective in the period.",
            "title": "Reversed Cents",
            "type": "integer"
          },
          "selected_principal_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Principal selected for dispute, once per claim.",
            "title": "Selected Principal Cents"
          },
          "submitted_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Submitted Cents"
          },
          "synthetic_count": {
            "default": 0,
            "title": "Synthetic Count",
            "type": "integer"
          },
          "unbound_remittance_count": {
            "default": 0,
            "description": "Remittances not bound to one claim; counted, not summed.",
            "title": "Unbound Remittance Count",
            "type": "integer"
          },
          "unmatched_reversal_count": {
            "default": 0,
            "description": "Reversals not matched to an original payment; counted, not summed.",
            "title": "Unmatched Reversal Count",
            "type": "integer"
          },
          "unresolved_count": {
            "default": 0,
            "title": "Unresolved Count",
            "type": "integer"
          }
        },
        "title": "RecoverySummary",
        "type": "object"
      },
      "RecurrenceFacetCount": {
        "description": "One facet bucket in a recurrence view: a value and its case count.",
        "properties": {
          "case_count": {
            "description": "How many cases in the window fall in this bucket.",
            "title": "Case Count",
            "type": "integer"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The bucket's value — a pack slug, a case status, or a recorded outcome. Null groups the cases where the value was never set (for example cases that are not resolved yet).",
            "title": "Value"
          }
        },
        "required": [
          "value",
          "case_count"
        ],
        "title": "RecurrenceFacetCount",
        "type": "object"
      },
      "ReopenRequest": {
        "additionalProperties": false,
        "description": "Why a person reopens a claim case closed paid.",
        "properties": {
          "reason": {
            "description": "Why the case is being reopened, at most 500 characters. Do not include patient details. Kept on the claim's history and the case's audit row, and nowhere else.",
            "maxLength": 500,
            "minLength": 1,
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "reason"
        ],
        "title": "ReopenRequest",
        "type": "object"
      },
      "ReplaceActionRequest": {
        "additionalProperties": false,
        "properties": {
          "action_kind": {
            "enum": [
              "reconsideration",
              "appeal",
              "resubmission"
            ],
            "title": "Action Kind",
            "type": "string"
          },
          "case_id": {
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "channel": {
            "enum": [
              "assisted_portal",
              "api"
            ],
            "title": "Channel",
            "type": "string"
          },
          "claim_keys": {
            "items": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^\\S(?:.*\\S)?$",
              "type": "string"
            },
            "maxItems": 20,
            "minItems": 1,
            "title": "Claim Keys",
            "type": "array"
          },
          "connector_input_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connector Input Attachment Id"
          },
          "connector_manifest_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connector Manifest Attachment Id"
          },
          "drafting_run_id": {
            "format": "uuid",
            "title": "Drafting Run Id",
            "type": "string"
          },
          "enclosure_attachment_ids": {
            "default": [],
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 20,
            "title": "Enclosure Attachment Ids",
            "type": "array"
          },
          "expected_connector_input_sha256": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 64,
                "pattern": "^[a-f0-9]{64}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Connector Input Sha256"
          },
          "expected_connector_manifest_sha256": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 64,
                "pattern": "^[a-f0-9]{64}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Connector Manifest Sha256"
          },
          "expected_final_packet_sha256": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 64,
                "pattern": "^[a-f0-9]{64}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Final Packet Sha256"
          },
          "expected_procedure_evidence_sha256": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 64,
                "pattern": "^[a-f0-9]{64}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Procedure Evidence Sha256"
          },
          "export_kind": {
            "enum": [
              "reconsideration-letters-pdf",
              "reconsideration-letters-docx",
              "formal-appeal-pdf",
              "formal-appeal-docx",
              "coding-reconsideration-pdf",
              "coding-reconsideration-docx",
              "paid-claim-correction-pdf",
              "paid-claim-correction-docx"
            ],
            "title": "Export Kind",
            "type": "string"
          },
          "final_packet_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Final Packet Attachment Id"
          },
          "final_packet_attestation": {
            "anyOf": [
              {
                "const": "completed_from_reviewed_template",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Final Packet Attestation"
          },
          "operation_key": {
            "format": "uuid",
            "title": "Operation Key",
            "type": "string"
          },
          "prior_action_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prior Action Id"
          },
          "procedure_evidence_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Procedure Evidence Attachment Id"
          },
          "procedure_stage": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Procedure Stage",
            "type": "string"
          },
          "reason": {
            "maxLength": 1000,
            "minLength": 1,
            "title": "Reason",
            "type": "string"
          },
          "route_selection": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RouteSelection"
              },
              {
                "type": "null"
              }
            ]
          },
          "schema_version": {
            "const": "underpayments.action-preparation.v1",
            "default": "underpayments.action-preparation.v1",
            "title": "Schema Version",
            "type": "string"
          }
        },
        "required": [
          "operation_key",
          "action_kind",
          "procedure_stage",
          "channel",
          "claim_keys",
          "case_id",
          "drafting_run_id",
          "export_kind",
          "reason"
        ],
        "title": "ReplaceActionRequest",
        "type": "object"
      },
      "ReplayFlipRead": {
        "description": "One past run whose result would change under the candidate policy.",
        "properties": {
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "missing_fields": {
            "description": "The required fields this run did not provide, behind the change.",
            "items": {
              "type": "string"
            },
            "title": "Missing Fields",
            "type": "array"
          },
          "new_verdict": {
            "description": "'pass' or 'withheld' under the candidate policy.",
            "title": "New Verdict",
            "type": "string"
          },
          "old_verdict": {
            "description": "'pass' or 'withheld' under your saved policy.",
            "title": "Old Verdict",
            "type": "string"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "prompt_excerpt": {
            "default": "",
            "description": "A short, one-line preview of the run's request.",
            "title": "Prompt Excerpt",
            "type": "string"
          },
          "reasons": {
            "description": "Why this run's result changes: the plain-language reason for each field rule that holds it — the candidate policy's when it would now be held, or your saved policy's when the change lets it through.",
            "items": {
              "type": "string"
            },
            "title": "Reasons",
            "type": "array"
          },
          "run_id": {
            "title": "Run Id",
            "type": "string"
          }
        },
        "required": [
          "run_id",
          "pack_slug",
          "created_at",
          "old_verdict",
          "new_verdict"
        ],
        "title": "ReplayFlipRead",
        "type": "object"
      },
      "ReplayRequest": {
        "description": "A candidate required-fields policy to preview against recent run history.\n\nThe window over which to replay is either the most recent runs (``limit``,\nalways applied) and/or a date range (``since`` / ``until``, both optional).\nSupplying a range narrows to runs whose time falls inside it, still newest\nfirst and still capped at ``limit`` — so \"my last 200 runs since Monday\" is\none request. All read-only: previewing never activates anything.",
        "properties": {
          "candidate": {
            "$ref": "#/components/schemas/RequiredFieldsWrite",
            "description": "The edited policy to preview — the fields + choice you're considering saving."
          },
          "limit": {
            "default": 50,
            "description": "How many of your most recent runs to check the change against.",
            "maximum": 200.0,
            "minimum": 1.0,
            "title": "Limit",
            "type": "integer"
          },
          "since": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Only check runs at or after this time (optional). Omit to go back as far as needed.",
            "title": "Since"
          },
          "until": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Only check runs at or before this time (optional). Omit to include your newest runs.",
            "title": "Until"
          }
        },
        "required": [
          "candidate"
        ],
        "title": "ReplayRequest",
        "type": "object"
      },
      "ReplayResponse": {
        "description": "The diff + the impact of the candidate policy over your recent runs.\n\n``runs_considered`` is how many recent runs we looked at; ``runs_evaluated``\nis how many we could faithfully re-check from saved history; the difference,\n``not_determinable``, is runs whose original inputs aren't retained in enough\ndetail to judge this change — we count them separately and NEVER guess a\nresult for them.",
        "properties": {
          "diff": {
            "$ref": "#/components/schemas/PolicyDiffRead"
          },
          "flipped_to_pass": {
            "description": "Runs that were withheld under your saved policy but would now pass.",
            "title": "Flipped To Pass",
            "type": "integer"
          },
          "flipped_to_withheld": {
            "description": "Runs that passed under your saved policy but would now be withheld.",
            "title": "Flipped To Withheld",
            "type": "integer"
          },
          "flips": {
            "description": "The runs whose result changes (drill-down).",
            "items": {
              "$ref": "#/components/schemas/ReplayFlipRead"
            },
            "title": "Flips",
            "type": "array"
          },
          "not_determinable": {
            "title": "Not Determinable",
            "type": "integer"
          },
          "runs_considered": {
            "title": "Runs Considered",
            "type": "integer"
          },
          "runs_evaluated": {
            "title": "Runs Evaluated",
            "type": "integer"
          },
          "scope_note": {
            "default": "",
            "description": "Plain-language note on what this preview could and couldn't cover.",
            "title": "Scope Note",
            "type": "string"
          },
          "would_pass_after": {
            "title": "Would Pass After",
            "type": "integer"
          },
          "would_pass_before": {
            "title": "Would Pass Before",
            "type": "integer"
          },
          "would_withhold_after": {
            "title": "Would Withhold After",
            "type": "integer"
          },
          "would_withhold_before": {
            "title": "Would Withhold Before",
            "type": "integer"
          }
        },
        "required": [
          "diff",
          "runs_considered",
          "runs_evaluated",
          "not_determinable",
          "would_pass_before",
          "would_withhold_before",
          "would_pass_after",
          "would_withhold_after",
          "flipped_to_withheld",
          "flipped_to_pass"
        ],
        "title": "ReplayResponse",
        "type": "object"
      },
      "RequiredFieldsRead": {
        "description": "The current required-input policy for one scope (customer-facing copy).",
        "properties": {
          "derived_from": {
            "description": "The policy documents this scope's required-input rules were derived from — empty for a purely hand-authored policy.",
            "items": {
              "$ref": "#/components/schemas/DerivedFromRead"
            },
            "title": "Derived From",
            "type": "array"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your team's own label for this policy (optional).",
            "title": "Description"
          },
          "enforcement": {
            "default": "strict",
            "description": "'strict' blocks a run missing a required field; 'advisory' only flags it. Defaults to strict.",
            "title": "Enforcement",
            "type": "string"
          },
          "pack_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The pack this policy scopes to, or null for a tenant-wide policy.",
            "title": "Pack Slug"
          },
          "required_fields": {
            "description": "The input fields your team requires before a run may proceed.",
            "items": {
              "type": "string"
            },
            "title": "Required Fields",
            "type": "array"
          },
          "revision_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Id of the newest saved version of this policy, or null if none saved yet.",
            "title": "Revision Id"
          }
        },
        "title": "RequiredFieldsRead",
        "type": "object"
      },
      "RequiredFieldsWrite": {
        "description": "Declare (replace) the required-input policy for one scope.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "An optional label for this policy.",
            "title": "Description"
          },
          "enforcement": {
            "default": "strict",
            "description": "'strict' (block) or 'advisory' (flag only). Defaults to strict.",
            "maxLength": 32,
            "title": "Enforcement",
            "type": "string"
          },
          "required_fields": {
            "description": "The input fields your team requires (at least one).",
            "items": {
              "maxLength": 128,
              "type": "string"
            },
            "minItems": 1,
            "title": "Required Fields",
            "type": "array"
          }
        },
        "required": [
          "required_fields"
        ],
        "title": "RequiredFieldsWrite",
        "type": "object"
      },
      "RequiredMaterialRead": {
        "description": "One material a pack expects with a complete intake.\n\nMirrors a pack manifest's ``metadata['required_materials']`` entry\none-for-one. The run surface renders these as a per-pack checklist and\nrecognizes attached documents by ``filename_hints``; nothing here gates\nthe run — a run may start with materials missing, and the checklist's job\nis to make that explicit BEFORE it does.",
        "properties": {
          "content_type_hints": {
            "description": "MIME types this material is expected to arrive as (e.g. text/csv for a line-level extract). Advisory only: a content type states the form a document takes, never which material it is, so a type on its own never recognizes a material. Packs commonly declare one type across every material, where it distinguishes nothing.",
            "items": {
              "type": "string"
            },
            "title": "Content Type Hints",
            "type": "array"
          },
          "description": {
            "description": "What the document is, in the pack persona's working vocabulary.",
            "title": "Description",
            "type": "string"
          },
          "filename_hints": {
            "description": "Case-insensitive words matched against attached filenames on word boundaries to recognize this material among the uploaded documents. The ONLY signal that recognizes a material.",
            "items": {
              "type": "string"
            },
            "title": "Filename Hints",
            "type": "array"
          },
          "id": {
            "description": "Stable kebab-case material id, unique within the pack.",
            "title": "Id",
            "type": "string"
          },
          "label": {
            "description": "Customer-facing name of the material.",
            "title": "Label",
            "type": "string"
          },
          "why_needed": {
            "description": "Which conclusions are limited when this material is absent — the text behind the missing-input callout and the partial-coverage statement, so it must be specific and actionable.",
            "title": "Why Needed",
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "description",
          "why_needed"
        ],
        "title": "RequiredMaterialRead",
        "type": "object"
      },
      "Resolution": {
        "additionalProperties": false,
        "properties": {
          "event_id": {
            "format": "uuid",
            "title": "Event Id",
            "type": "string"
          },
          "expected_revision": {
            "minimum": 1.0,
            "title": "Expected Revision",
            "type": "integer"
          },
          "observation_revision": {
            "minimum": 1.0,
            "title": "Observation Revision",
            "type": "integer"
          },
          "reason": {
            "maxLength": 1000,
            "minLength": 12,
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "event_id",
          "expected_revision",
          "observation_revision",
          "reason"
        ],
        "title": "Resolution",
        "type": "object"
      },
      "ResolutionOutcomeCountResponse": {
        "description": "One recorded resolution outcome + resolved-case count.",
        "properties": {
          "cases": {
            "description": "Resolved cases in-window carrying this outcome.",
            "title": "Cases",
            "type": "integer"
          },
          "outcome": {
            "description": "The real-world result recorded when the case was closed. The vocabulary is open — 'achieved', 'not_achieved', 'overtaken', and 'unknown' are the recommended values; values are grouped exactly as recorded.",
            "title": "Outcome",
            "type": "string"
          }
        },
        "required": [
          "outcome",
          "cases"
        ],
        "title": "ResolutionOutcomeCountResponse",
        "type": "object"
      },
      "ResolutionRevisionsCountResponse": {
        "description": "Achieved-after-N-revisions histogram row.",
        "properties": {
          "cases": {
            "description": "Achieved cases that took exactly this many revisions.",
            "title": "Cases",
            "type": "integer"
          },
          "revisions": {
            "description": "How many revision attempts the case took beyond its first run before the real-world outcome was achieved. 0 means the first run was enough.",
            "title": "Revisions",
            "type": "integer"
          }
        },
        "required": [
          "revisions",
          "cases"
        ],
        "title": "ResolutionRevisionsCountResponse",
        "type": "object"
      },
      "ResolvedBlueprintManifest": {
        "description": "Resolved declarative UI & workflow manifest for a workspace.",
        "properties": {
          "blueprint_id": {
            "format": "uuid",
            "title": "Blueprint Id",
            "type": "string"
          },
          "blueprint_name": {
            "title": "Blueprint Name",
            "type": "string"
          },
          "blueprint_slug": {
            "title": "Blueprint Slug",
            "type": "string"
          },
          "blueprint_version": {
            "title": "Blueprint Version",
            "type": "integer"
          },
          "config_overrides": {
            "additionalProperties": true,
            "title": "Config Overrides",
            "type": "object"
          },
          "effective_branding": {
            "additionalProperties": true,
            "title": "Effective Branding",
            "type": "object"
          },
          "instance_id": {
            "format": "uuid",
            "title": "Instance Id",
            "type": "string"
          },
          "instance_name": {
            "title": "Instance Name",
            "type": "string"
          },
          "instance_status": {
            "title": "Instance Status",
            "type": "string"
          },
          "organization_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Organization Id"
          },
          "spec": {
            "$ref": "#/components/schemas/BlueprintSpec"
          },
          "workspace_id": {
            "format": "uuid",
            "title": "Workspace Id",
            "type": "string"
          },
          "workspace_kind": {
            "title": "Workspace Kind",
            "type": "string"
          },
          "workspace_name": {
            "title": "Workspace Name",
            "type": "string"
          },
          "workspace_slug": {
            "title": "Workspace Slug",
            "type": "string"
          }
        },
        "required": [
          "workspace_id",
          "workspace_name",
          "workspace_slug",
          "workspace_kind",
          "instance_id",
          "instance_name",
          "instance_status",
          "blueprint_id",
          "blueprint_slug",
          "blueprint_name",
          "blueprint_version",
          "spec"
        ],
        "title": "ResolvedBlueprintManifest",
        "type": "object"
      },
      "RestartCaseRead": {
        "properties": {
          "case_id": {
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "case_ref": {
            "title": "Case Ref",
            "type": "string"
          }
        },
        "required": [
          "case_id",
          "case_ref"
        ],
        "title": "RestartCaseRead",
        "type": "object"
      },
      "ResumeResult": {
        "description": "Outcome of the resume-after-approval re-run.\n\nPresent on a ``decide``=approve response; ``None`` on a reject. When the\nre-run could not proceed (no captured payload, ABP no longer deployed, …)\n``resumed`` is False + ``reason`` explains — the approval decision still\nstands; only the re-run was skipped.",
        "properties": {
          "evidence_pack_chain_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evidence Pack Chain Hash"
          },
          "evidence_pack_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evidence Pack Id"
          },
          "evidence_status": {
            "anyOf": [
              {
                "enum": [
                  "sealed",
                  "unavailable"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evidence Status"
          },
          "invocation_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invocation Id"
          },
          "is_allowed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Allowed"
          },
          "model_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Error"
          },
          "outcome": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Outcome"
          },
          "output": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "resumed": {
            "title": "Resumed",
            "type": "boolean"
          },
          "withheld": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Withheld"
          }
        },
        "required": [
          "resumed"
        ],
        "title": "ResumeResult",
        "type": "object"
      },
      "RetainableAttachmentRead": {
        "properties": {
          "attachment_id": {
            "format": "uuid",
            "title": "Attachment Id",
            "type": "string"
          },
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          }
        },
        "required": [
          "attachment_id",
          "filename",
          "content_type"
        ],
        "title": "RetainableAttachmentRead",
        "type": "object"
      },
      "ReviewRequest": {
        "description": "Approve / reject a proposed rule, optionally with a note.",
        "properties": {
          "review_note": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "An optional note recording why.",
            "title": "Review Note"
          }
        },
        "title": "ReviewRequest",
        "type": "object"
      },
      "ReviseRunRequest": {
        "description": "Wire shape for ``POST /api/v2/pack-runs/{run_id}/revise``.",
        "properties": {
          "attachment_ids": {
            "description": "Optional: ids of previously-uploaded run attachments (see POST /api/v2/run-attachments) to ride the revision as first-class documents — e.g. the late-arriving pathology report the parent run was held for. Merged with the parent run's own attachments (which are always carried into the revision's context) and injected into the governed run input exactly like an initial run's attachments. Only the calling tenant's own stored attachments are loaded (RLS); unknown/foreign ids are silently skipped. The MERGED set (inherited plus new) is what counts against the pack's per-run document limit; the bound in this schema is the platform ceiling.",
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 25,
            "title": "Attachment Ids",
            "type": "array"
          },
          "gaps": {
            "anyOf": [
              {
                "items": {
                  "maxLength": 500,
                  "type": "string"
                },
                "maxItems": 50,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional: the named gaps (labels, from the parent run's outcome verdict) this revision sets out to close — a snapshot of intent recorded on the new run (`revision_gaps`).",
            "title": "Gaps"
          },
          "model_id": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional: the Claude tier to run the revision on (see the invoke route's model selector). Omit to use the pack's recommended model.",
            "title": "Model Id"
          },
          "prompt_text": {
            "description": "The revision intake: the missing info the user is supplying, or the section-redo they're requesting. Runs through the SAME governed pipeline as any prompt — advisory pass-through of the gap list for now (the gaps are not auto-seeded into the prompt).",
            "maxLength": 20000,
            "minLength": 1,
            "title": "Prompt Text",
            "type": "string"
          }
        },
        "required": [
          "prompt_text"
        ],
        "title": "ReviseRunRequest",
        "type": "object"
      },
      "RevisionLink": {
        "description": "A minimal pointer to one revision in a run's lineage.\n\nA revision run is an ordinary governed run that carries a ``parent_run_id``\n(the run it revises). Run-detail surfaces the lineage BOTH directions — the\nparent (``PackRunDetail.parent_run_id``) upward and the direct children\n(``PackRunDetail.revisions``) downward — so the record composes across the\nrevision chain in the UI. Each link is just enough to render + navigate: the\nchild's ``id``, its ``status``, and its ``outcome_verdict`` (the second\nverdict — so a chain reads \"partial → met\" at a glance). Not recursive:\nonly DIRECT children are listed; the UI walks deeper by following each link.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "outcome_verdict": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Outcome Verdict"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "created_at"
        ],
        "title": "RevisionLink",
        "type": "object"
      },
      "RevisionRead": {
        "description": "One saved version of a scope's policy (revision history).",
        "properties": {
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "created_by_user_id": {
            "title": "Created By User Id",
            "type": "string"
          },
          "enforcement": {
            "title": "Enforcement",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "required_fields": {
            "items": {
              "type": "string"
            },
            "title": "Required Fields",
            "type": "array"
          },
          "revision": {
            "title": "Revision",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "revision",
          "required_fields",
          "enforcement",
          "created_by_user_id",
          "created_at"
        ],
        "title": "RevisionRead",
        "type": "object"
      },
      "RevisionRequest": {
        "additionalProperties": false,
        "properties": {
          "expected_digest": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Expected Digest",
            "type": "string"
          }
        },
        "required": [
          "expected_digest"
        ],
        "title": "RevisionRequest",
        "type": "object"
      },
      "RevokeRequest": {
        "additionalProperties": false,
        "properties": {
          "expected_version": {
            "minimum": 1.0,
            "title": "Expected Version",
            "type": "integer"
          },
          "reason": {
            "maxLength": 1000,
            "minLength": 12,
            "title": "Reason",
            "type": "string"
          },
          "validation_id": {
            "format": "uuid",
            "title": "Validation Id",
            "type": "string"
          }
        },
        "required": [
          "validation_id",
          "expected_version",
          "reason"
        ],
        "title": "RevokeRequest",
        "type": "object",
        "x-max-serialized-bytes": 6144
      },
      "RoundNoteRead": {
        "description": "Something a step of the round refused, in the sentence it recorded.",
        "properties": {
          "code": {
            "description": "The recorded code, for example newer_files_pending: a later sweep brought the claim newer files while the round ran. Codes may be added.",
            "maxLength": 64,
            "title": "Code",
            "type": "string"
          },
          "sentence": {
            "description": "The sentence the step recorded beside the code, to show as it is.",
            "maxLength": 300,
            "title": "Sentence",
            "type": "string"
          },
          "step_key": {
            "description": "The step that recorded it.",
            "maxLength": 64,
            "title": "Step Key",
            "type": "string"
          }
        },
        "required": [
          "step_key",
          "code",
          "sentence"
        ],
        "title": "RoundNoteRead",
        "type": "object"
      },
      "RouteOption": {
        "additionalProperties": false,
        "properties": {
          "action_kind": {
            "title": "Action Kind",
            "type": "string"
          },
          "approved_redirect_hosts": {
            "items": {
              "type": "string"
            },
            "title": "Approved Redirect Hosts",
            "type": "array"
          },
          "effective_from": {
            "format": "date-time",
            "title": "Effective From",
            "type": "string"
          },
          "effective_until": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective Until"
          },
          "export_options": {
            "items": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^\\S(?:.*\\S)?$",
              "type": "string"
            },
            "maxItems": 8,
            "title": "Export Options",
            "type": "array"
          },
          "holds": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/WorkspaceHold"
            },
            "title": "Holds",
            "type": "array"
          },
          "label": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Label",
            "type": "string"
          },
          "official_entry_url": {
            "title": "Official Entry Url",
            "type": "string"
          },
          "permission_requirements": {
            "items": {
              "type": "string"
            },
            "title": "Permission Requirements",
            "type": "array"
          },
          "procedure_stage": {
            "title": "Procedure Stage",
            "type": "string"
          },
          "products": {
            "items": {
              "type": "string"
            },
            "title": "Products",
            "type": "array"
          },
          "provider_action": {
            "title": "Provider Action",
            "type": "string"
          },
          "requires_procedure_input": {
            "title": "Requires Procedure Input",
            "type": "boolean"
          },
          "route_id": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Route Id",
            "type": "string"
          },
          "route_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Route Sha256",
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/RouteSourceBinding"
          },
          "source_reviews": {
            "items": {
              "$ref": "#/components/schemas/RouteSourceReview"
            },
            "title": "Source Reviews",
            "type": "array"
          },
          "source_urls": {
            "items": {
              "type": "string"
            },
            "title": "Source Urls",
            "type": "array"
          },
          "states": {
            "items": {
              "type": "string"
            },
            "title": "States",
            "type": "array"
          },
          "supported": {
            "title": "Supported",
            "type": "boolean"
          },
          "verification": {
            "const": "documented_configuration",
            "default": "documented_configuration",
            "title": "Verification",
            "type": "string"
          },
          "verification_owner": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Verification Owner",
            "type": "string"
          },
          "verified_at": {
            "format": "date-time",
            "title": "Verified At",
            "type": "string"
          },
          "verify_before": {
            "format": "date-time",
            "title": "Verify Before",
            "type": "string"
          }
        },
        "required": [
          "route_id",
          "label",
          "source",
          "route_sha256",
          "official_entry_url",
          "approved_redirect_hosts",
          "source_urls",
          "source_reviews",
          "effective_from",
          "effective_until",
          "products",
          "states",
          "action_kind",
          "procedure_stage",
          "provider_action",
          "verified_at",
          "verify_before",
          "verification_owner",
          "permission_requirements",
          "supported",
          "export_options",
          "requires_procedure_input"
        ],
        "title": "RouteOption",
        "type": "object"
      },
      "RouteRequest": {
        "description": "Bind a pending work item to a routing queue.",
        "properties": {
          "queue_id": {
            "description": "The queue to route through.",
            "format": "uuid",
            "title": "Queue Id",
            "type": "string"
          },
          "required_skills": {
            "description": "Ordered skill tags the item requires, most essential first (they must be within the queue's declared skills). If the item waits, tags relax from the end of the list on the queue's clock, so it never starves.",
            "items": {
              "maxLength": 64,
              "type": "string"
            },
            "maxItems": 32,
            "title": "Required Skills",
            "type": "array"
          }
        },
        "required": [
          "queue_id"
        ],
        "title": "RouteRequest",
        "type": "object"
      },
      "RouteSelection": {
        "additionalProperties": false,
        "properties": {
          "expected_payload_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Expected Payload Sha256",
            "type": "string"
          },
          "expected_record_id": {
            "format": "uuid",
            "title": "Expected Record Id",
            "type": "string"
          },
          "expected_route_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Expected Route Sha256",
            "type": "string"
          },
          "expected_version_id": {
            "format": "uuid",
            "title": "Expected Version Id",
            "type": "string"
          },
          "product": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Product",
            "type": "string"
          },
          "route_id": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Route Id",
            "type": "string"
          },
          "state": {
            "maxLength": 2,
            "minLength": 2,
            "pattern": "^[A-Z]{2}$",
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "route_id",
          "expected_record_id",
          "expected_version_id",
          "expected_payload_sha256",
          "expected_route_sha256",
          "product",
          "state"
        ],
        "title": "RouteSelection",
        "type": "object"
      },
      "RouteSourceBinding": {
        "additionalProperties": false,
        "properties": {
          "payload_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Payload Sha256",
            "type": "string"
          },
          "record_id": {
            "format": "uuid",
            "title": "Record Id",
            "type": "string"
          },
          "version_id": {
            "format": "uuid",
            "title": "Version Id",
            "type": "string"
          },
          "version_no": {
            "maximum": 2147483647.0,
            "minimum": 1.0,
            "title": "Version No",
            "type": "integer"
          }
        },
        "required": [
          "record_id",
          "version_id",
          "version_no",
          "payload_sha256"
        ],
        "title": "RouteSourceBinding",
        "type": "object"
      },
      "RouteSourceReview": {
        "additionalProperties": false,
        "properties": {
          "checked_at": {
            "format": "date-time",
            "title": "Checked At",
            "type": "string"
          },
          "digest_domain": {
            "enum": [
              "raw_http_response_body",
              "reviewed_web_excerpt",
              "not_captured"
            ],
            "title": "Digest Domain",
            "type": "string"
          },
          "note": {
            "default": "",
            "maxLength": 512,
            "title": "Note",
            "type": "string"
          },
          "owner": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Owner",
            "type": "string"
          },
          "sha256": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 64,
                "pattern": "^[a-f0-9]{64}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sha256"
          },
          "status": {
            "enum": [
              "reviewed",
              "verification_needed"
            ],
            "title": "Status",
            "type": "string"
          },
          "url": {
            "maxLength": 2048,
            "minLength": 1,
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url",
          "digest_domain",
          "sha256",
          "checked_at",
          "status",
          "owner"
        ],
        "title": "RouteSourceReview",
        "type": "object"
      },
      "RouteVersion": {
        "additionalProperties": false,
        "properties": {
          "configuration_valid": {
            "title": "Configuration Valid",
            "type": "boolean"
          },
          "effective_from": {
            "format": "date",
            "title": "Effective From",
            "type": "string"
          },
          "effective_to": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective To"
          },
          "is_current": {
            "title": "Is Current",
            "type": "boolean"
          },
          "official_entry_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Official Entry Url"
          },
          "payload_sha256": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 64,
                "pattern": "^[a-f0-9]{64}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payload Sha256"
          },
          "route_present": {
            "title": "Route Present",
            "type": "boolean"
          },
          "selected_for_action": {
            "title": "Selected For Action",
            "type": "boolean"
          },
          "source_reviews": {
            "items": {
              "$ref": "#/components/schemas/RouteSourceReview"
            },
            "title": "Source Reviews",
            "type": "array"
          },
          "version_id": {
            "format": "uuid",
            "title": "Version Id",
            "type": "string"
          },
          "version_no": {
            "maximum": 2147483647.0,
            "minimum": 1.0,
            "title": "Version No",
            "type": "integer"
          }
        },
        "required": [
          "version_id",
          "version_no",
          "effective_from",
          "effective_to",
          "payload_sha256",
          "selected_for_action",
          "is_current",
          "configuration_valid",
          "route_present",
          "official_entry_url",
          "source_reviews"
        ],
        "title": "RouteVersion",
        "type": "object"
      },
      "RuleOperator": {
        "description": "Operators usable in a PolicyRule (design-time, against ABP structure).\n\nThe structural operators test for the presence, equality, containment or\ncount of a resolved field.\n\nNUMERIC_GTE / NUMERIC_LTE coerce the resolved field to a float and compare\nit against a float threshold, failing closed on a non-numeric or missing\nfield.",
        "enum": [
          "exists",
          "not_exists",
          "equals",
          "not_equals",
          "contains",
          "not_contains",
          "matches",
          "count_gte",
          "count_lte",
          "numeric_gte",
          "numeric_lte",
          "includes_type",
          "not_includes_type"
        ],
        "title": "RuleOperator",
        "type": "string"
      },
      "RunApproval": {
        "description": "One human sign-off on this run — the oversight-trail entry.\n\nA strict approval gate (pack-declared, or requested in the run's\noversight plan) pauses the run before any model work and records a row\nhere for a reviewer to decide. ``status`` is ``pending`` (awaiting the\nreviewer), ``approved`` (the run may proceed as a linked follow-up run),\nor ``rejected`` (returned with notes — see ``notes``). Decide via\n``POST /api/v2/approvals/{id}/decide``.",
        "properties": {
          "approver_tier_blocked": {
            "default": false,
            "title": "Approver Tier Blocked",
            "type": "boolean"
          },
          "decided_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Decided At"
          },
          "decided_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Decided By User Id"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "gate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gate"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "input_flagged": {
            "default": false,
            "title": "Input Flagged",
            "type": "boolean"
          },
          "may_withdraw": {
            "default": false,
            "title": "May Withdraw",
            "type": "boolean"
          },
          "no_eligible_approver": {
            "default": false,
            "title": "No Eligible Approver",
            "type": "boolean"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "phase": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phase"
          },
          "requested_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requested At"
          },
          "requested_by_operator": {
            "default": false,
            "title": "Requested By Operator",
            "type": "boolean"
          },
          "requested_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requested By User Id"
          },
          "required_approver_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Required Approver Tier"
          },
          "resume_prompt_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resume Prompt Text"
          },
          "self_approval_blocked": {
            "default": false,
            "title": "Self Approval Blocked",
            "type": "boolean"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status"
        ],
        "title": "RunApproval",
        "type": "object"
      },
      "RunConfidence": {
        "description": "The structured per-finding confidence signal for a run.\n\nA run's findings carry a structured confidence + uncertainty signal so the\nrun UI can render a confidence chip UNIFORMLY across packs — not only when a\npack emits an inline ``Confidence:`` line, which most packs (claimforge\nincluded) never do. Parsed at invoke time from the model's\nmachine-readable ````confidence``` block and persisted to ``pack_runs``.\n\n``overall`` is the run-level band (or null); ``findings`` is the per-claim\nlist (possibly empty when only ``overall`` was stated). Null on the whole\nfield (see ``PackRunDetail.confidence``) when the run stated no confidence —\nevery older run, and any run whose model emitted no block, so older runs\nwithout it still render (backward-compatible).",
        "properties": {
          "findings": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/ConfidenceFinding"
            },
            "title": "Findings",
            "type": "array"
          },
          "overall": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Overall"
          }
        },
        "title": "RunConfidence",
        "type": "object"
      },
      "RunDataProvenanceDegradedRead": {
        "description": "Why this run's evidence pack has no data-sources section.\n\nPresent only when the read that assembles that section actually failed on\nthis run — which is worth saying out loud, because the finished evidence\npack cannot tell you: a pack that omits the section because the read broke\nlooks exactly like a pack that omits it because there was genuinely nothing\nto report, and the pack is sealed and unchangeable once written.\n\nNull is therefore a statement, not an absence: this run's data-sources\nsection is missing for an ordinary reason, or is not missing at all. It\nspeaks only for that one section.",
        "properties": {
          "error": {
            "title": "Error",
            "type": "string"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "source",
          "error"
        ],
        "title": "RunDataProvenanceDegradedRead",
        "type": "object"
      },
      "RunInputAttachmentPage": {
        "description": "A bounded page of run references and, when permitted, current case documents.",
        "properties": {
          "case_context": {
            "enum": [
              "included",
              "no_case",
              "pack_scope_limited"
            ],
            "title": "Case Context",
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/RunInputAttachmentRead"
            },
            "title": "Items",
            "type": "array"
          },
          "next_offset": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Offset"
          },
          "truncated": {
            "default": false,
            "title": "Truncated",
            "type": "boolean"
          }
        },
        "required": [
          "case_context"
        ],
        "title": "RunInputAttachmentPage",
        "type": "object"
      },
      "RunInputAttachmentRead": {
        "additionalProperties": false,
        "description": "Document identity and current ingestion state, never a saved text snapshot.",
        "properties": {
          "attachment_id": {
            "format": "uuid",
            "title": "Attachment Id",
            "type": "string"
          },
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "current_extraction_status": {
            "title": "Current Extraction Status",
            "type": "string"
          },
          "current_status": {
            "title": "Current Status",
            "type": "string"
          },
          "document_kind": {
            "title": "Document Kind",
            "type": "string"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "historical_content": {
            "const": "not_pinned",
            "default": "not_pinned",
            "title": "Historical Content",
            "type": "string"
          },
          "relationship": {
            "enum": [
              "selected_run_reference",
              "case_file_only"
            ],
            "title": "Relationship",
            "type": "string"
          },
          "text_use": {
            "enum": [
              "unknown",
              "reference_only"
            ],
            "title": "Text Use",
            "type": "string"
          }
        },
        "required": [
          "attachment_id",
          "filename",
          "content_type",
          "document_kind",
          "created_at",
          "current_status",
          "current_extraction_status",
          "relationship",
          "text_use"
        ],
        "title": "RunInputAttachmentRead",
        "type": "object"
      },
      "RunInputsRead": {
        "description": "What is recorded about a run's sources, with historical limits explicit.\n\nA document reference is not proof its text reached a model. Case facts and\ndocument ingestion fields describe the current case, not the run's saved\nvalues. Acquisition provenance comes only from verified saved evidence.",
        "properties": {
          "acquisition": {
            "$ref": "#/components/schemas/SealedAcquisitionRead"
          },
          "attachments": {
            "$ref": "#/components/schemas/RunInputAttachmentPage"
          },
          "case_facts": {
            "$ref": "#/components/schemas/CaseFactReferencePage"
          },
          "case_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Id"
          },
          "parent_run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Run Id"
          },
          "run_id": {
            "format": "uuid",
            "title": "Run Id",
            "type": "string"
          }
        },
        "required": [
          "run_id",
          "attachments",
          "case_facts",
          "acquisition"
        ],
        "title": "RunInputsRead",
        "type": "object"
      },
      "RunKnowledgeGroundingRead": {
        "description": "What this workspace had already learned that informed this run.\n\nPresent only when the run was actually informed by something. Every unit\nlisted reached the model; a unit the size budget dropped is not listed,\nbecause it did not inform the answer.",
        "properties": {
          "truncated": {
            "default": false,
            "title": "Truncated",
            "type": "boolean"
          },
          "unit_count": {
            "title": "Unit Count",
            "type": "integer"
          },
          "units": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/RunKnowledgeUnitRead"
            },
            "title": "Units",
            "type": "array"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "unit_count"
        ],
        "title": "RunKnowledgeGroundingRead",
        "type": "object"
      },
      "RunKnowledgeUnitRead": {
        "description": "One thing this workspace had already learned that informed this run.\n\nUnits are recorded when a case closes with a verified outcome, and are\npresented back to later runs on similar work. Listed in the order the run\nactually saw them, most specific and most recent first.\n\n``outcome_valence`` is the part to read carefully: ``favorable`` means the\nsource case achieved its recorded outcome and the unit was presented as\nusable precedent; ``unfavorable`` means it did NOT, and the unit was\npresented explicitly as a record of what to avoid — never as something that\nworked. A unit whose outcome carried no verdict is never presented at all.",
        "properties": {
          "match": {
            "title": "Match",
            "type": "string"
          },
          "outcome_valence": {
            "title": "Outcome Valence",
            "type": "string"
          },
          "pack_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pack Slug"
          },
          "position": {
            "title": "Position",
            "type": "integer"
          },
          "rank": {
            "title": "Rank",
            "type": "integer"
          },
          "situation_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Situation Key"
          },
          "source_case_id": {
            "format": "uuid",
            "title": "Source Case Id",
            "type": "string"
          },
          "source_case_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Case Ref"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "unit_id": {
            "format": "uuid",
            "title": "Unit Id",
            "type": "string"
          }
        },
        "required": [
          "unit_id",
          "title",
          "outcome_valence",
          "match",
          "rank",
          "position",
          "source_case_id"
        ],
        "title": "RunKnowledgeUnitRead",
        "type": "object"
      },
      "RunOrigin": {
        "enum": [
          "model",
          "sample",
          "no_model",
          "unknown"
        ],
        "title": "RunOrigin",
        "type": "string"
      },
      "RunOutcome": {
        "description": "The SECOND verdict on a governed run.\n\nDid the run accomplish what the pack exists to do? — scored after the run\ncompletes against the pack's declared outcome contract, advisory-only and\nSEPARATE from the governance verdict (conduct: safe/compliant/evidenced),\nnever merged.\n\n``verdict`` is ``met`` | ``partial`` | ``incomplete`` | ``unreached`` |\n``not_scored``. ``not_scored`` is the honest \"we did not measure this\"\nstate — a pack with no outcome contract, a governance-withheld run (no work\nproduct to score), or a run recorded before outcome scoring existed.\n``unreached`` means the completion review could not evaluate one or more of\nthe contract's criteria on this run, so no completion determination was\nreached — recorded explicitly, never silently folded into ``met``. ``gaps``\nare the named missing pieces, populated on ``partial`` / ``incomplete``.\n``scored_at`` / ``scorer_version`` are the provenance (when scored + the\n``<logic>:<contract-hash>`` version for run-to-run comparability); null\nwhen never scored.\n\n``disposition`` records what KIND of answer the run rendered —\n``determination`` when the run produced the pack's declared determination\nartifact, ``refusal`` when it instead declined because the supplied record\ncould not support an answer. Null when the pack declares no disposition\nsignal, and for runs scored before the signal existed. Independent of\n``verdict``: a correct refusal can satisfy every completion criterion and\nstill be a refusal.",
        "properties": {
          "disposition": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disposition"
          },
          "gaps": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/OutcomeGap"
            },
            "title": "Gaps",
            "type": "array"
          },
          "scored_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scored At"
          },
          "scorer_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scorer Version"
          },
          "verdict": {
            "title": "Verdict",
            "type": "string"
          }
        },
        "required": [
          "verdict"
        ],
        "title": "RunOutcome",
        "type": "object"
      },
      "RunOversightRead": {
        "description": "The oversight plan this run executed under.\n\n``phase`` names the pack workflow phase the run's request named (a run a\ncase's workflow starts names its step's phase; any other caller states\nits own, and the platform does not check it against a case's workflow);\n``phase_modes`` maps phase slugs to the oversight mode in force for them —\nthe pack's derived baseline plus any operator tightening (tighten-only:\nthe manifest is the floor). Recorded at run time; a revision run inherits\nits parent's plan server-side, so a resume can never drop a requested\napproval checkpoint.",
        "properties": {
          "phase": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phase"
          },
          "phase_modes": {
            "additionalProperties": {
              "type": "string"
            },
            "default": {},
            "title": "Phase Modes",
            "type": "object"
          },
          "tenant_phase_modes": {
            "additionalProperties": {
              "type": "string"
            },
            "default": {},
            "title": "Tenant Phase Modes",
            "type": "object"
          }
        },
        "title": "RunOversightRead",
        "type": "object"
      },
      "RunOversightSelection": {
        "description": "The oversight plan a run executes under.\n\n``phase`` names the pack workflow phase the caller asks this run to work\n(one of the pack's declared phases — see ``GET /{slug}/oversight-plan``).\nThat phase's oversight applies to the run. It is the caller's statement:\nthe platform records it as sent and does not check it against a case's\nworkflow. A run a case's workflow starts names its step's phase itself.\n``phase_modes`` maps phase slugs to the oversight mode requested for them.\nTighten-only: each requested mode must be at least as restrictive as the\npack's derived baseline for that phase — the manifest is the floor, and a\nlooser request is rejected. Promoting the run's own phase to\n``human_in_the_loop`` adds an approval checkpoint: the run pauses before\nany model work in that phase until a reviewer approves it.",
        "properties": {
          "phase": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The pack workflow phase the caller asks this run to work; its oversight applies to the run. Recorded as sent, not checked against a case's workflow.",
            "title": "Phase"
          },
          "phase_modes": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Requested oversight mode per phase slug (tighten-only over the pack's baseline).",
            "title": "Phase Modes",
            "type": "object",
            "x-max-serialized-bytes": 8192
          }
        },
        "title": "RunOversightSelection",
        "type": "object"
      },
      "RunPrefill": {
        "description": "The original intake of a run, for \"re-run with changes\".\n\nReturned by ``GET /api/v2/pack-runs/{run_id}/prefill``: everything the run\nform needs to open a NEW intake pre-filled from this run — the pack to invoke,\nthe ``prompt_text`` the run was submitted with, the ``model_id`` it ran on (so\nthe model picker pre-selects it), and the document attachments it carried. The\nuser edits any of it before submitting; the new run is an ordinary governed run\n(this endpoint reads intake only — it launches nothing).",
        "properties": {
          "attachments": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/PrefillAttachmentRef"
            },
            "title": "Attachments",
            "type": "array"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "prompt_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt Text"
          },
          "run_id": {
            "format": "uuid",
            "title": "Run Id",
            "type": "string"
          }
        },
        "required": [
          "run_id",
          "pack_slug",
          "prompt_text",
          "model_id"
        ],
        "title": "RunPrefill",
        "type": "object"
      },
      "RunReportResponse": {
        "description": "Return shape for the work-product report export (mirrors ExportResponse).\n\n``download_url`` is valid for ~1h. ``delivery: \"presigned\"``: a direct\nlink to object storage. ``delivery: \"stream\"``: the document is held\nencrypted under the workspace's own key and ``download_url`` is\n``GET /api/v2/exports/{export_id}/content``, which needs the caller's\ncredentials.",
        "properties": {
          "delivery": {
            "default": "presigned",
            "description": "'presigned': download_url is a short-lived direct link. 'stream': download_url is an API path that returns the file to an authenticated caller until expires_at.",
            "enum": [
              "presigned",
              "stream"
            ],
            "title": "Delivery",
            "type": "string"
          },
          "download_url": {
            "title": "Download Url",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          },
          "export_id": {
            "format": "uuid",
            "title": "Export Id",
            "type": "string"
          },
          "format": {
            "title": "Format",
            "type": "string"
          },
          "run_id": {
            "format": "uuid",
            "title": "Run Id",
            "type": "string"
          },
          "s3_key": {
            "title": "S3 Key",
            "type": "string"
          }
        },
        "required": [
          "run_id",
          "export_id",
          "format",
          "s3_key",
          "download_url",
          "expires_at"
        ],
        "title": "RunReportResponse",
        "type": "object"
      },
      "RunWorkProductPreview": {
        "properties": {
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "preview": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkProductPreview"
              },
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "run_id": {
            "format": "uuid",
            "title": "Run Id",
            "type": "string"
          }
        },
        "required": [
          "run_id",
          "pack_slug"
        ],
        "title": "RunWorkProductPreview",
        "type": "object"
      },
      "SampleCaseFileOut": {
        "properties": {
          "content_base64": {
            "title": "Content Base64",
            "type": "string"
          },
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "requirement_id": {
            "description": "The crew's data requirement this file supplies.",
            "title": "Requirement Id",
            "type": "string"
          }
        },
        "required": [
          "filename",
          "content_type",
          "requirement_id",
          "content_base64"
        ],
        "title": "SampleCaseFileOut",
        "type": "object"
      },
      "SampleCaseOut": {
        "properties": {
          "files": {
            "items": {
              "$ref": "#/components/schemas/SampleCaseFileOut"
            },
            "title": "Files",
            "type": "array"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "prepared_at": {
            "description": "The instant the records are dated for. Positions are measured from it, so start the case's journey straight away.",
            "format": "date-time",
            "title": "Prepared At",
            "type": "string"
          },
          "title": {
            "description": "The title to open the sample case with.",
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "pack_slug",
          "title",
          "prepared_at",
          "files"
        ],
        "title": "SampleCaseOut",
        "type": "object"
      },
      "SavedRemittanceCandidate": {
        "additionalProperties": false,
        "properties": {
          "byte_length": {
            "maximum": 2097152.0,
            "minimum": 1.0,
            "title": "Byte Length",
            "type": "integer"
          },
          "import_authorized": {
            "const": false,
            "default": false,
            "title": "Import Authorized",
            "type": "boolean"
          },
          "is_original_file": {
            "const": false,
            "default": false,
            "title": "Is Original File",
            "type": "boolean"
          },
          "response_index": {
            "const": 0,
            "default": 0,
            "title": "Response Index",
            "type": "integer"
          },
          "sha256": {
            "pattern": "^[0-9a-f]{64}$",
            "title": "Sha256",
            "type": "string"
          },
          "source_kind": {
            "const": "json-derived-x12",
            "default": "json-derived-x12",
            "title": "Source Kind",
            "type": "string"
          }
        },
        "required": [
          "sha256",
          "byte_length"
        ],
        "title": "SavedRemittanceCandidate",
        "type": "object"
      },
      "SavedRemittanceCheck": {
        "additionalProperties": false,
        "properties": {
          "check_number": {
            "maxLength": 256,
            "minLength": 1,
            "title": "Check Number",
            "type": "string"
          },
          "npi": {
            "maxLength": 256,
            "minLength": 1,
            "title": "Npi",
            "type": "string"
          },
          "payer_id": {
            "maxLength": 256,
            "minLength": 1,
            "title": "Payer Id",
            "type": "string"
          },
          "tax_id": {
            "maxLength": 256,
            "minLength": 1,
            "title": "Tax Id",
            "type": "string"
          }
        },
        "required": [
          "check_number",
          "tax_id",
          "npi",
          "payer_id"
        ],
        "title": "SavedRemittanceCheck",
        "type": "object"
      },
      "SavedRemittanceCommand": {
        "additionalProperties": false,
        "properties": {
          "expected_check": {
            "$ref": "#/components/schemas/SavedRemittanceCheck"
          },
          "schema_version": {
            "const": "underpayments.saved-remittance-command.v1",
            "title": "Schema Version",
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/SavedRemittanceSourcePin"
          }
        },
        "required": [
          "schema_version",
          "source",
          "expected_check"
        ],
        "title": "SavedRemittanceCommand",
        "type": "object"
      },
      "SavedRemittanceDownloadCommand": {
        "additionalProperties": false,
        "properties": {
          "expected_check": {
            "$ref": "#/components/schemas/SavedRemittanceCheck"
          },
          "expected_preview_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[0-9a-f]{64}$",
            "title": "Expected Preview Sha256",
            "type": "string"
          },
          "schema_version": {
            "const": "underpayments.saved-remittance-command.v1",
            "title": "Schema Version",
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/SavedRemittanceSourcePin"
          }
        },
        "required": [
          "schema_version",
          "source",
          "expected_check",
          "expected_preview_sha256"
        ],
        "title": "SavedRemittanceDownloadCommand",
        "type": "object"
      },
      "SavedRemittanceInvalid": {
        "additionalProperties": false,
        "properties": {
          "detail": {
            "$ref": "#/components/schemas/SavedRemittanceInvalidDetail"
          }
        },
        "title": "SavedRemittanceInvalid",
        "type": "object"
      },
      "SavedRemittanceInvalidDetail": {
        "additionalProperties": false,
        "properties": {
          "error": {
            "const": "remittance_command_invalid",
            "default": "remittance_command_invalid",
            "title": "Error",
            "type": "string"
          },
          "message": {
            "const": "Saved remittance request is invalid.",
            "default": "Saved remittance request is invalid.",
            "title": "Message",
            "type": "string"
          },
          "retryable": {
            "const": false,
            "default": false,
            "title": "Retryable",
            "type": "boolean"
          }
        },
        "title": "SavedRemittanceInvalidDetail",
        "type": "object"
      },
      "SavedRemittancePreview": {
        "additionalProperties": false,
        "properties": {
          "candidate": {
            "$ref": "#/components/schemas/SavedRemittanceCandidate"
          },
          "preview_sha256": {
            "pattern": "^[0-9a-f]{64}$",
            "title": "Preview Sha256",
            "type": "string"
          },
          "profile_version": {
            "const": "underpayments.availity-saved-check-x12.local.v1",
            "title": "Profile Version",
            "type": "string"
          },
          "schema_version": {
            "const": "underpayments.saved-remittance-preview.v1",
            "title": "Schema Version",
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/SavedRemittanceSource"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "schema_version",
          "profile_version",
          "tenant_id",
          "source",
          "candidate",
          "preview_sha256"
        ],
        "title": "SavedRemittancePreview",
        "type": "object"
      },
      "SavedRemittanceSource": {
        "additionalProperties": false,
        "properties": {
          "attachment_id": {
            "format": "uuid",
            "title": "Attachment Id",
            "type": "string"
          },
          "byte_length": {
            "maximum": 16777216.0,
            "minimum": 1.0,
            "title": "Byte Length",
            "type": "integer"
          },
          "custody_version": {
            "maximum": 9.223372036854776e+18,
            "minimum": 1.0,
            "title": "Custody Version",
            "type": "integer"
          },
          "sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[0-9a-f]{64}$",
            "title": "Sha256",
            "type": "string"
          }
        },
        "required": [
          "sha256",
          "byte_length",
          "custody_version",
          "attachment_id"
        ],
        "title": "SavedRemittanceSource",
        "type": "object"
      },
      "SavedRemittanceSourcePin": {
        "additionalProperties": false,
        "properties": {
          "byte_length": {
            "maximum": 16777216.0,
            "minimum": 1.0,
            "title": "Byte Length",
            "type": "integer"
          },
          "custody_version": {
            "maximum": 9.223372036854776e+18,
            "minimum": 1.0,
            "title": "Custody Version",
            "type": "integer"
          },
          "sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[0-9a-f]{64}$",
            "title": "Sha256",
            "type": "string"
          }
        },
        "required": [
          "sha256",
          "byte_length",
          "custody_version"
        ],
        "title": "SavedRemittanceSourcePin",
        "type": "object"
      },
      "SavedRemittanceUnsupported": {
        "additionalProperties": false,
        "properties": {
          "detail": {
            "$ref": "#/components/schemas/SavedRemittanceUnsupportedDetail"
          }
        },
        "title": "SavedRemittanceUnsupported",
        "type": "object"
      },
      "SavedRemittanceUnsupportedDetail": {
        "additionalProperties": false,
        "properties": {
          "error": {
            "const": "remittance_response_unsupported",
            "default": "remittance_response_unsupported",
            "title": "Error",
            "type": "string"
          },
          "message": {
            "const": "Saved remittance response is unsupported.",
            "default": "Saved remittance response is unsupported.",
            "title": "Message",
            "type": "string"
          },
          "retryable": {
            "const": false,
            "default": false,
            "title": "Retryable",
            "type": "boolean"
          }
        },
        "title": "SavedRemittanceUnsupportedDetail",
        "type": "object"
      },
      "SavedScenarioCreate": {
        "description": "Wire shape for ``POST /api/v2/saved-scenarios``.",
        "properties": {
          "attachment_refs": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/AttachmentRef"
                },
                "maxItems": 25,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional snapshot of attached documents; omit when none.",
            "title": "Attachment Refs"
          },
          "intake": {
            "$ref": "#/components/schemas/ScenarioIntake",
            "description": "The intake payload to save (prompt + model)."
          },
          "name": {
            "description": "The user's display name for the scenario.",
            "maxLength": 128,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "pack_slug": {
            "description": "The pack this scenario is for.",
            "maxLength": 64,
            "minLength": 1,
            "title": "Pack Slug",
            "type": "string"
          }
        },
        "required": [
          "pack_slug",
          "name",
          "intake"
        ],
        "title": "SavedScenarioCreate",
        "type": "object"
      },
      "SavedScenarioList": {
        "description": "A user's saved scenarios, newest first.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SavedScenarioRead"
            },
            "title": "Items",
            "type": "array"
          }
        },
        "title": "SavedScenarioList",
        "type": "object"
      },
      "SavedScenarioRead": {
        "description": "One saved scenario.",
        "properties": {
          "attachment_refs": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/AttachmentRef"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Snapshot of attached documents; null when none.",
            "title": "Attachment Refs"
          },
          "created_at": {
            "description": "When the scenario was saved.",
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "description": "The saved-scenario row's UUID.",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "intake": {
            "$ref": "#/components/schemas/ScenarioIntake",
            "description": "The saved intake payload (prompt + model)."
          },
          "name": {
            "description": "The user's display name for the scenario.",
            "title": "Name",
            "type": "string"
          },
          "pack_slug": {
            "description": "The pack this scenario is for.",
            "title": "Pack Slug",
            "type": "string"
          },
          "updated_at": {
            "description": "When the scenario was last updated.",
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "pack_slug",
          "name",
          "intake",
          "created_at",
          "updated_at"
        ],
        "title": "SavedScenarioRead",
        "type": "object"
      },
      "ScenarioIntake": {
        "description": "The intake payload a saved scenario carries.\n\nWhat the run form pre-fills from: the ``prompt_text`` the user typed and the\noptional ``model_id`` they ran with. Deliberately small + pack-agnostic — the\nsame fields the invoke route accepts.",
        "properties": {
          "model_id": {
            "anyOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional saved model tier (omit to run the pack's recommended model).",
            "title": "Model Id"
          },
          "prompt_text": {
            "description": "The saved intake prompt the run form pre-fills with.",
            "maxLength": 20000,
            "minLength": 1,
            "title": "Prompt Text",
            "type": "string"
          }
        },
        "required": [
          "prompt_text"
        ],
        "title": "ScenarioIntake",
        "type": "object"
      },
      "ScheduleCreateRequest": {
        "additionalProperties": false,
        "description": "Body for ``POST /api/v2/scheduled-runs``.",
        "properties": {
          "caseId": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional: the case every run of this schedule works. Each run works that case and reads its documents and facts, as a run started from the case does. Without it, each run opens a case of its own. The case must belong to this workspace (otherwise 404), be open, and have a crew that is not on hold (otherwise 409). The case is fixed when the schedule is created.",
            "title": "Caseid"
          },
          "cronExpression": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Cronexpression",
            "type": "string"
          },
          "name": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "packSlug": {
            "maxLength": 64,
            "minLength": 1,
            "title": "Packslug",
            "type": "string"
          },
          "promptText": {
            "maxLength": 20000,
            "minLength": 1,
            "title": "Prompttext",
            "type": "string"
          },
          "timezone": {
            "default": "UTC",
            "maxLength": 64,
            "title": "Timezone",
            "type": "string"
          }
        },
        "required": [
          "name",
          "packSlug",
          "promptText",
          "cronExpression"
        ],
        "title": "ScheduleCreateRequest",
        "type": "object"
      },
      "ScheduleList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ScheduleRead"
            },
            "title": "Items",
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "title": "ScheduleList",
        "type": "object"
      },
      "ScheduleRead": {
        "description": "One schedule in a response. NEVER carries the bound key's secret.\n\n``api_key_id`` is surfaced (it is the revocable anchor a UI can cross-link\nto the keys list), but the secret itself was discarded at mint and is not\nretrievable.",
        "properties": {
          "api_key_id": {
            "format": "uuid",
            "title": "Api Key Id",
            "type": "string"
          },
          "case_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The case every run of this schedule works, or null when each run opens its own.",
            "title": "Case Id"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "cron_expression": {
            "title": "Cron Expression",
            "type": "string"
          },
          "enabled": {
            "title": "Enabled",
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "last_run_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Run At"
          },
          "last_run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Run Id"
          },
          "last_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Status"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "next_run_at": {
            "format": "date-time",
            "title": "Next Run At",
            "type": "string"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "prompt_text": {
            "title": "Prompt Text",
            "type": "string"
          },
          "timezone": {
            "title": "Timezone",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "pack_slug",
          "prompt_text",
          "cron_expression",
          "timezone",
          "api_key_id",
          "enabled",
          "next_run_at",
          "last_run_at",
          "last_run_id",
          "last_status",
          "created_at",
          "updated_at"
        ],
        "title": "ScheduleRead",
        "type": "object"
      },
      "ScheduleUpdateRequest": {
        "additionalProperties": false,
        "description": "Body for ``PATCH /api/v2/scheduled-runs/{id}`` — every field optional.",
        "properties": {
          "cronExpression": {
            "anyOf": [
              {
                "maxLength": 128,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cronexpression"
          },
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enabled"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 128,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "promptText": {
            "anyOf": [
              {
                "maxLength": 20000,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompttext"
          },
          "timezone": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timezone"
          }
        },
        "title": "ScheduleUpdateRequest",
        "type": "object"
      },
      "ScimTokenCreate": {
        "description": "Request to mint a SCIM provisioning token.",
        "properties": {
          "name": {
            "description": "A human label for the token, e.g. 'Okta production'.",
            "maxLength": 128,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "ScimTokenCreate",
        "type": "object"
      },
      "ScimTokenCreated": {
        "description": "Mint response — carries the full token EXACTLY ONCE.",
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "revoked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "token": {
            "description": "The SCIM bearer token. Shown only here, never again — store it in your identity provider's SCIM configuration now.",
            "title": "Token",
            "type": "string"
          },
          "token_prefix": {
            "description": "The public, non-secret token prefix.",
            "title": "Token Prefix",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "token_prefix",
          "status",
          "token"
        ],
        "title": "ScimTokenCreated",
        "type": "object"
      },
      "ScimTokenList": {
        "properties": {
          "tokens": {
            "items": {
              "$ref": "#/components/schemas/ScimTokenRow"
            },
            "title": "Tokens",
            "type": "array"
          }
        },
        "required": [
          "tokens"
        ],
        "title": "ScimTokenList",
        "type": "object"
      },
      "ScimTokenRow": {
        "description": "Token metadata (never includes secret material).",
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "revoked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "token_prefix": {
            "description": "The public, non-secret token prefix.",
            "title": "Token Prefix",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "token_prefix",
          "status"
        ],
        "title": "ScimTokenRow",
        "type": "object"
      },
      "SealedAcquisitionRead": {
        "additionalProperties": false,
        "description": "Saved acquisition provenance, distinct from exact model-input use.",
        "properties": {
          "basis": {
            "const": "acquisition_at_seal",
            "default": "acquisition_at_seal",
            "title": "Basis",
            "type": "string"
          },
          "requirements": {
            "items": {
              "$ref": "#/components/schemas/AcquisitionRequirementRead"
            },
            "title": "Requirements",
            "type": "array"
          },
          "status": {
            "enum": [
              "available",
              "not_sealed",
              "artifact_unavailable",
              "too_large",
              "integrity_mismatch",
              "malformed",
              "not_recorded",
              "read_degraded"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "SealedAcquisitionRead",
        "type": "object"
      },
      "SelectableModelWire": {
        "description": "One Claude tier a customer can pick for a governed run.\n\nMirrors :class:`velerian.core.runtime.models.SelectableModel` one-for-one.",
        "properties": {
          "label": {
            "description": "Customer-facing product name, e.g. 'Claude Sonnet 4.6'.",
            "title": "Label",
            "type": "string"
          },
          "model_id": {
            "description": "Full inference-profile id passed to Bedrock.",
            "title": "Model Id",
            "type": "string"
          },
          "tagline": {
            "description": "Short customer-facing description of the tier.",
            "title": "Tagline",
            "type": "string"
          },
          "tier": {
            "description": "Stable key: 'haiku' | 'sonnet' | 'opus'.",
            "title": "Tier",
            "type": "string"
          }
        },
        "required": [
          "model_id",
          "label",
          "tier",
          "tagline"
        ],
        "title": "SelectableModelWire",
        "type": "object"
      },
      "SendOutcomeRecorded": {
        "description": "What the person's record wrote.",
        "properties": {
          "filing_not_recorded": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FilingNotRecorded"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it arrived and the claim's own state means no filing is recorded (paid, no longer carried, another crew's or case's, out of follow-ups, or no payer): why. The arrival is saved. The item closes when the claim is paid, no longer carried or another case's, and otherwise stays open with its choices. Null otherwise."
          },
          "item": {
            "$ref": "#/components/schemas/HeldItemRead"
          },
          "item_closed_because": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FilingNotRecorded"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it did not arrive and the claim is paid, no longer carried or another case's: why the report also closed the item, nothing being left to decide. Null otherwise."
          },
          "next_round_on": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it arrived and its filing was recorded: the day the claim's next round is due, as the filing's rule sets it (it may already have passed; the due-round job then takes the claim up at its next pass). Null otherwise.",
            "title": "Next Round On"
          },
          "send": {
            "$ref": "#/components/schemas/SendRead"
          }
        },
        "required": [
          "send",
          "item",
          "next_round_on"
        ],
        "title": "SendOutcomeRecorded",
        "type": "object"
      },
      "SendOutcomeRequest": {
        "additionalProperties": false,
        "description": "What the person found out from the receiver.",
        "properties": {
          "arrived": {
            "description": "Whether the receiver has the submission.",
            "title": "Arrived",
            "type": "boolean"
          },
          "note": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Without arrived: why it did not arrive, at most 2000 characters. Required. Kept on the send's record only.",
            "title": "Note"
          },
          "reference": {
            "anyOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "With arrived: the receiver's reference for it, such as a tracking number, at most 200 characters. Optional. Kept on the send's record only.",
            "title": "Reference"
          }
        },
        "required": [
          "arrived"
        ],
        "title": "SendOutcomeRequest",
        "type": "object"
      },
      "SendRead": {
        "description": "The send's record after this request.",
        "properties": {
          "idempotency_key": {
            "title": "Idempotency Key",
            "type": "string"
          },
          "phase": {
            "enum": [
              "outcome",
              "abandoned"
            ],
            "title": "Phase",
            "type": "string"
          },
          "recorded_at": {
            "format": "date-time",
            "title": "Recorded At",
            "type": "string"
          },
          "recorded_by": {
            "format": "uuid",
            "title": "Recorded By",
            "type": "string"
          },
          "source_mode": {
            "anyOf": [
              {
                "const": "person_reported",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "person_reported on an outcome a person recorded; null on an abandonment.",
            "title": "Source Mode"
          }
        },
        "required": [
          "idempotency_key",
          "phase",
          "recorded_by",
          "recorded_at",
          "source_mode"
        ],
        "title": "SendRead",
        "type": "object"
      },
      "SetCompleted": {
        "description": "A set approval's result, item by item, in the order the request named them.",
        "properties": {
          "approval_set_id": {
            "format": "uuid",
            "title": "Approval Set Id",
            "type": "string"
          },
          "completed": {
            "title": "Completed",
            "type": "integer"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/SetItemOutcome"
            },
            "title": "Items",
            "type": "array"
          },
          "refused": {
            "title": "Refused",
            "type": "integer"
          },
          "set_size": {
            "title": "Set Size",
            "type": "integer"
          }
        },
        "required": [
          "approval_set_id",
          "set_size",
          "completed",
          "refused",
          "items"
        ],
        "title": "SetCompleted",
        "type": "object"
      },
      "SetItemOutcome": {
        "description": "What happened to one item of the set.",
        "properties": {
          "case_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The case's status after a completion.",
            "title": "Case Status"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "outcome": {
            "enum": [
              "completed",
              "refused"
            ],
            "title": "Outcome",
            "type": "string"
          },
          "refusal": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the item was not completed; null when it was: card_stale (its card changed after it was shown), card_unavailable, insufficient_approver_tier, requested_a_run_in_round, case_policy_admission_held, operation_busy (its case is being changed; try again), approval_set_out_of_time (the set ran out of time before it; try again), review_advises_against (its review advises against it: approve it on its own, or decline it), work_item_not_actionable or wait_expired. A refused item stays as it was.",
            "title": "Refusal"
          },
          "work_item": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkItemRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "work_item_id": {
            "format": "uuid",
            "title": "Work Item Id",
            "type": "string"
          }
        },
        "required": [
          "work_item_id",
          "outcome"
        ],
        "title": "SetItemOutcome",
        "type": "object"
      },
      "Severity": {
        "description": "Violation severity. `error` blocks approval; `warning` surfaces only.",
        "enum": [
          "error",
          "warning"
        ],
        "title": "Severity",
        "type": "string"
      },
      "ShareIntegrity": {
        "description": "The integrity seal of the run's evidence record, checked when the link was opened.",
        "properties": {
          "bundle_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "SHA-256 of the sealed evidence record's contents.",
            "title": "Bundle Hash"
          },
          "chain_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "SHA-256 linking this record to the previous record in the chain.",
            "title": "Chain Hash"
          },
          "reason": {
            "anyOf": [
              {
                "const": "record_malformed",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the check failed: record_malformed when seal is failed, else null. A failed check reports the seal recorded on the run, never the malformed record's own values.",
            "title": "Reason"
          },
          "seal": {
            "description": "intact: the stored evidence record recomputes to its own seal and matches the seal recorded when the run finished. not_sealed: the record predates the integrity seal. mismatch: the stored record does not match its seal. failed: the stored record is malformed, so its seal cannot be checked (see reason). unavailable: no stored record could be read.",
            "enum": [
              "intact",
              "not_sealed",
              "mismatch",
              "failed",
              "unavailable"
            ],
            "title": "Seal",
            "type": "string"
          }
        },
        "required": [
          "seal"
        ],
        "title": "ShareIntegrity",
        "type": "object"
      },
      "ShareLinkCreated": {
        "description": "Mint response — the ONLY place the full share token ever appears.",
        "properties": {
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "members_only": {
            "default": false,
            "title": "Members Only",
            "type": "boolean"
          },
          "token": {
            "title": "Token",
            "type": "string"
          },
          "token_prefix": {
            "title": "Token Prefix",
            "type": "string"
          }
        },
        "required": [
          "token",
          "token_prefix",
          "expires_at"
        ],
        "title": "ShareLinkCreated",
        "type": "object"
      },
      "ShareLinkMetadata": {
        "description": "The active share link's metadata (NEVER the full token — it's hashed).",
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "exists": {
            "title": "Exists",
            "type": "boolean"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "members_only": {
            "default": false,
            "title": "Members Only",
            "type": "boolean"
          },
          "token_prefix": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token Prefix"
          }
        },
        "required": [
          "exists"
        ],
        "title": "ShareLinkMetadata",
        "type": "object"
      },
      "SharedEvidenceView": {
        "description": "The VIEW-ONLY, EVIDENCE-FOCUSED view returned to an anonymous visitor.\n\nDeliberately omits ``tenant_id`` / ``user_id`` / token internals AND the raw\n``prompt_text`` / ``output_text`` — the evidence-pack link is a compliance\nPROOF surface: the governance verdict + the downloadable evidence bundle,\nnothing about the run's inputs/outputs or who owns it.",
        "properties": {
          "access": {
            "default": "content",
            "enum": [
              "content",
              "verification"
            ],
            "title": "Access",
            "type": "string"
          },
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "evidence_download_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evidence Download Url"
          },
          "evidence_storage_status": {
            "anyOf": [
              {
                "enum": [
                  "stored",
                  "pending",
                  "conflict",
                  "missing",
                  "unknown"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evidence Storage Status"
          },
          "governance_pass": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Governance Pass"
          },
          "governance_reasons": {
            "items": {
              "type": "string"
            },
            "title": "Governance Reasons",
            "type": "array"
          },
          "governance_unevaluated_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Governance Unevaluated Count"
          },
          "human_approval_decision": {
            "anyOf": [
              {
                "enum": [
                  "approved",
                  "rejected",
                  "timed_out",
                  "superseded"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Human Approval Decision"
          },
          "human_approval_pending": {
            "title": "Human Approval Pending",
            "type": "boolean"
          },
          "integrity": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ShareIntegrity"
              },
              {
                "type": "null"
              }
            ]
          },
          "members_only": {
            "default": false,
            "title": "Members Only",
            "type": "boolean"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          },
          "output_origin": {
            "$ref": "#/components/schemas/RunOrigin",
            "default": "unknown"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "signoffs": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/SharedSignoff"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signoffs"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "viewer": {
            "default": "anonymous",
            "enum": [
              "anonymous",
              "workspace_member",
              "other_workspace"
            ],
            "title": "Viewer",
            "type": "string"
          }
        },
        "required": [
          "pack_slug",
          "status",
          "governance_pass",
          "human_approval_pending",
          "governance_reasons",
          "model_id",
          "created_at",
          "completed_at",
          "evidence_download_url"
        ],
        "title": "SharedEvidenceView",
        "type": "object"
      },
      "SharedRunView": {
        "description": "The REDACTED, read-only run view returned to an anonymous visitor.\n\nDeliberately omits ``tenant_id`` / ``user_id`` / token internals — a public\nlink must expose the work product + governance verdict + evidence, nothing\nabout who owns it.",
        "properties": {
          "access": {
            "default": "content",
            "enum": [
              "content",
              "verification"
            ],
            "title": "Access",
            "type": "string"
          },
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "evidence_download_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evidence Download Url"
          },
          "governance_pass": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Governance Pass"
          },
          "governance_reasons": {
            "items": {
              "type": "string"
            },
            "title": "Governance Reasons",
            "type": "array"
          },
          "governance_unevaluated_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Governance Unevaluated Count"
          },
          "human_approval_decision": {
            "anyOf": [
              {
                "enum": [
                  "approved",
                  "rejected",
                  "timed_out",
                  "superseded"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Human Approval Decision"
          },
          "human_approval_pending": {
            "title": "Human Approval Pending",
            "type": "boolean"
          },
          "integrity": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ShareIntegrity"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_sample": {
            "title": "Is Sample",
            "type": "boolean"
          },
          "members_only": {
            "default": false,
            "title": "Members Only",
            "type": "boolean"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          },
          "output_origin": {
            "$ref": "#/components/schemas/RunOrigin",
            "default": "unknown"
          },
          "output_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Text"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "prompt_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt Text"
          },
          "signoffs": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/SharedSignoff"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signoffs"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "viewer": {
            "default": "anonymous",
            "enum": [
              "anonymous",
              "workspace_member",
              "other_workspace"
            ],
            "title": "Viewer",
            "type": "string"
          }
        },
        "required": [
          "pack_slug",
          "status",
          "governance_pass",
          "human_approval_pending",
          "governance_reasons",
          "output_text",
          "prompt_text",
          "model_id",
          "created_at",
          "completed_at",
          "evidence_download_url",
          "is_sample"
        ],
        "title": "SharedRunView",
        "type": "object"
      },
      "SharedSignoff": {
        "description": "One sign-off on a step that follows the run, as a page lists it.\n\nHolds no user id, name, email or note: the person is named only by their\nrole. ``download_url`` is null where the caller may not download the\nsealed record.",
        "properties": {
          "basis": {
            "enum": [
              "single",
              "set"
            ],
            "title": "Basis",
            "type": "string"
          },
          "card_digest": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Card Digest"
          },
          "card_digest_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Card Digest Version"
          },
          "download_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Download Url"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "set_size": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Set Size"
          },
          "signed_at": {
            "format": "date-time",
            "title": "Signed At",
            "type": "string"
          },
          "signoff_id": {
            "format": "uuid",
            "title": "Signoff Id",
            "type": "string"
          },
          "step_index": {
            "title": "Step Index",
            "type": "integer"
          },
          "step_key": {
            "title": "Step Key",
            "type": "string"
          },
          "step_title": {
            "title": "Step Title",
            "type": "string"
          }
        },
        "required": [
          "signoff_id",
          "step_key",
          "step_title",
          "step_index",
          "signed_at",
          "role",
          "basis"
        ],
        "title": "SharedSignoff",
        "type": "object"
      },
      "SignOffRequest": {
        "description": "Body for ``POST /reports/{kind}/{date}/sign-off``.\n\n``notes`` is optional auditor-visible context the admin can attach\nat sign-off time (e.g. \"Reviewed against vendor SOC2 attestation\n#4421\"). Empty / null is fine — the signoff itself is the load-bearing\nrecord.",
        "properties": {
          "notes": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          }
        },
        "title": "SignOffRequest",
        "type": "object"
      },
      "SignOffResponse": {
        "description": "Response for ``POST /reports/{kind}/{date}/sign-off``.\n\nMirrors the enrichment shape on ``ComplianceReport.signed_by`` /\n``signed_at`` so the frontend can update the row in place from this\npayload without a second list-reports round-trip.",
        "properties": {
          "as_of_date": {
            "format": "date",
            "title": "As Of Date",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "enum": [
              "access-review",
              "provisioning-audit"
            ],
            "title": "Kind",
            "type": "string"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "signed_at": {
            "description": "ISO-8601 timestamp of the signoff.",
            "title": "Signed At",
            "type": "string"
          },
          "signed_by": {
            "description": "Display name (or email fallback) of the signing user.",
            "title": "Signed By",
            "type": "string"
          },
          "signed_by_user_id": {
            "format": "uuid",
            "title": "Signed By User Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "as_of_date",
          "signed_by_user_id",
          "signed_by",
          "signed_at",
          "notes"
        ],
        "title": "SignOffResponse",
        "type": "object"
      },
      "SourceDigest": {
        "additionalProperties": false,
        "properties": {
          "attachment_id": {
            "format": "uuid",
            "title": "Attachment Id",
            "type": "string"
          },
          "byte_length": {
            "minimum": 0.0,
            "title": "Byte Length",
            "type": "integer"
          },
          "custody_version": {
            "minimum": 0.0,
            "title": "Custody Version",
            "type": "integer"
          },
          "schema_version": {
            "const": "underpayments.source-digest.v1",
            "title": "Schema Version",
            "type": "string"
          },
          "sha256": {
            "pattern": "^[0-9a-f]{64}$",
            "title": "Sha256",
            "type": "string"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "schema_version",
          "tenant_id",
          "attachment_id",
          "sha256",
          "byte_length",
          "custody_version"
        ],
        "title": "SourceDigest",
        "type": "object"
      },
      "SourceVersionRead": {
        "description": "A source version named in the saved evidence, without its payload.",
        "properties": {
          "effective_from": {
            "format": "date",
            "title": "Effective From",
            "type": "string"
          },
          "effective_to": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective To"
          },
          "payload_sha256": {
            "pattern": "^[a-f0-9]{64}$",
            "title": "Payload Sha256",
            "type": "string"
          },
          "version_id": {
            "format": "uuid",
            "title": "Version Id",
            "type": "string"
          },
          "version_no": {
            "minimum": 1.0,
            "title": "Version No",
            "type": "integer"
          }
        },
        "required": [
          "version_id",
          "version_no",
          "effective_from",
          "effective_to",
          "payload_sha256"
        ],
        "title": "SourceVersionRead",
        "type": "object"
      },
      "SpamHandling": {
        "additionalProperties": false,
        "description": "PRI area 5 — how unwanted / robocall traffic should be treated.",
        "properties": {
          "known_spam_numbers": {
            "items": {
              "maxLength": 255,
              "type": "string"
            },
            "title": "Known Spam Numbers",
            "type": "array"
          },
          "notes": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "preference": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SpamPreference"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "title": "SpamHandling",
        "type": "object"
      },
      "SpamPreference": {
        "description": "How the shop wants unwanted / robocall traffic treated.\n\nDeliberately business-language values — the intake asks \"how should we\nhandle spam and robocalls?\", never a technical question about STIR/SHAKEN\nattestation. The runtime spam screener (see\n:mod:`velerian.core.voice.spam_screener`) is conservative regardless; this\npreference tunes how aggressively an ambiguous call is declined vs. let\nthrough to a person.",
        "enum": [
          "lenient",
          "balanced",
          "strict"
        ],
        "title": "SpamPreference",
        "type": "string"
      },
      "SsoConfigCreate": {
        "additionalProperties": false,
        "description": "Body for ``POST /api/v2/sso/config`` (create or upsert by ``idp_id``).",
        "properties": {
          "acsUrl": {
            "anyOf": [
              {
                "maxLength": 1024,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Acsurl"
          },
          "clientId": {
            "anyOf": [
              {
                "maxLength": 512,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Clientid"
          },
          "discoveryUrl": {
            "anyOf": [
              {
                "maxLength": 1024,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discoveryurl"
          },
          "enabled": {
            "default": false,
            "title": "Enabled",
            "type": "boolean"
          },
          "idpDomain": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Idpdomain"
          },
          "idpId": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Idpid",
            "type": "string"
          },
          "metadataUrl": {
            "anyOf": [
              {
                "maxLength": 1024,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadataurl"
          },
          "oidcClientSecret": {
            "anyOf": [
              {
                "maxLength": 512,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Oidcclientsecret"
          },
          "providerName": {
            "maxLength": 128,
            "minLength": 1,
            "title": "Providername",
            "type": "string"
          },
          "providerType": {
            "maxLength": 64,
            "title": "Providertype",
            "type": "string"
          },
          "spEntityId": {
            "anyOf": [
              {
                "maxLength": 512,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spentityid"
          }
        },
        "required": [
          "providerType",
          "providerName",
          "idpId"
        ],
        "title": "SsoConfigCreate",
        "type": "object"
      },
      "SsoConfigDeleted": {
        "properties": {
          "cognito_sync": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CognitoSyncStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "deleted": {
            "title": "Deleted",
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "deleted"
        ],
        "title": "SsoConfigDeleted",
        "type": "object"
      },
      "SsoConfigList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SsoConfigRead"
            },
            "title": "Items",
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "title": "SsoConfigList",
        "type": "object"
      },
      "SsoConfigRead": {
        "description": "One IdP config in a response. NEVER carries secret material.\n\nThe OIDC client secret is redacted to the boolean ``has_client_secret`` —\nthe API confirms WHETHER a secret is stored without ever returning it.",
        "properties": {
          "acs_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Acs Url"
          },
          "client_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Id"
          },
          "cognito_sync": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CognitoSyncStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "discovery_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discovery Url"
          },
          "enabled": {
            "title": "Enabled",
            "type": "boolean"
          },
          "has_client_secret": {
            "title": "Has Client Secret",
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "idp_domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Idp Domain"
          },
          "idp_id": {
            "title": "Idp Id",
            "type": "string"
          },
          "metadata_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata Url"
          },
          "provider_name": {
            "title": "Provider Name",
            "type": "string"
          },
          "provider_type": {
            "title": "Provider Type",
            "type": "string"
          },
          "sp_entity_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sp Entity Id"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "provider_type",
          "provider_name",
          "idp_id",
          "idp_domain",
          "metadata_url",
          "sp_entity_id",
          "acs_url",
          "discovery_url",
          "client_id",
          "has_client_secret",
          "enabled",
          "created_at",
          "updated_at"
        ],
        "title": "SsoConfigRead",
        "type": "object"
      },
      "SsoConfigReconcileItem": {
        "description": "Per-config outcome of a reconcile sweep.",
        "properties": {
          "cognito_sync": {
            "$ref": "#/components/schemas/CognitoSyncStatus"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "idp_id": {
            "title": "Idp Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "idp_id",
          "cognito_sync"
        ],
        "title": "SsoConfigReconcileItem",
        "type": "object"
      },
      "SsoConfigReconcileResult": {
        "description": "Aggregate outcome of re-applying a tenant's stored IdP config to Cognito.\n\nThe live registration on a write is BEST-EFFORT —\na Cognito blip leaves the config of record durably stored but the live\nprovider un-registered (``cognito_sync.ok == false`` on the original write).\nThis re-sync re-applies every ENABLED config of record to Cognito so an admin\n(or a future sweep) can converge the live pool back onto the stored intent\nWITHOUT re-entering any secret. Idempotent: re-registering an already-correct\nprovider is a no-op update. NEVER carries secret material.",
        "properties": {
          "failed": {
            "title": "Failed",
            "type": "integer"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/SsoConfigReconcileItem"
            },
            "title": "Items",
            "type": "array"
          },
          "ok": {
            "title": "Ok",
            "type": "integer"
          },
          "reconciled": {
            "title": "Reconciled",
            "type": "integer"
          }
        },
        "required": [
          "reconciled",
          "ok",
          "failed",
          "items"
        ],
        "title": "SsoConfigReconcileResult",
        "type": "object"
      },
      "SsoLinkAbort": {
        "description": "Close a link whose round trip came back without a code.",
        "properties": {
          "intent_id": {
            "description": "The link intent's id.",
            "format": "uuid",
            "title": "Intent Id",
            "type": "string"
          },
          "state": {
            "description": "The returned OAuth state.",
            "maxLength": 160,
            "minLength": 1,
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "intent_id",
          "state"
        ],
        "title": "SsoLinkAbort",
        "type": "object"
      },
      "SsoLinkAborted": {
        "description": "The link is closed; nothing was linked.",
        "properties": {
          "closed": {
            "title": "Closed",
            "type": "boolean"
          }
        },
        "required": [
          "closed"
        ],
        "title": "SsoLinkAborted",
        "type": "object"
      },
      "SsoLinkComplete": {
        "description": "Complete a link with the round trip's ID token.",
        "properties": {
          "id_token": {
            "description": "The ID token Cognito issued for this round trip's code.",
            "maxLength": 6000,
            "minLength": 1,
            "title": "Id Token",
            "type": "string"
          },
          "intent_id": {
            "description": "The link intent's id.",
            "format": "uuid",
            "title": "Intent Id",
            "type": "string"
          },
          "state": {
            "description": "The returned OAuth state.",
            "maxLength": 160,
            "minLength": 1,
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "intent_id",
          "state",
          "id_token"
        ],
        "title": "SsoLinkComplete",
        "type": "object"
      },
      "SsoLinkCompleted": {
        "description": "The identity is linked; the next single sign-on signs in to this account.",
        "properties": {
          "linked": {
            "title": "Linked",
            "type": "boolean"
          }
        },
        "required": [
          "linked"
        ],
        "title": "SsoLinkCompleted",
        "type": "object"
      },
      "SsoLinkProvider": {
        "description": "An identity provider of the caller's workspace that can be linked.",
        "properties": {
          "idp_id": {
            "description": "The identity provider's id in this workspace.",
            "title": "Idp Id",
            "type": "string"
          },
          "name": {
            "description": "The identity provider's display name.",
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "idp_id",
          "name"
        ],
        "title": "SsoLinkProvider",
        "type": "object"
      },
      "SsoLinkProviderList": {
        "description": "The workspace's enabled identity providers.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SsoLinkProvider"
            },
            "title": "Items",
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "title": "SsoLinkProviderList",
        "type": "object"
      },
      "SsoLinkStart": {
        "description": "Start a link from this signed-in browser.",
        "properties": {
          "idp_id": {
            "description": "The provider to link.",
            "maxLength": 128,
            "minLength": 1,
            "title": "Idp Id",
            "type": "string"
          },
          "state_sha256": {
            "description": "SHA-256 (hex) of the OAuth state this browser holds for the round trip.",
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[0-9a-f]{64}$",
            "title": "State Sha256",
            "type": "string"
          }
        },
        "required": [
          "idp_id",
          "state_sha256"
        ],
        "title": "SsoLinkStart",
        "type": "object"
      },
      "SsoLinkStarted": {
        "description": "The open link intent and what the authorize request must carry.",
        "properties": {
          "expires_at": {
            "description": "When the intent closes unused.",
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          },
          "identity_provider": {
            "description": "The Cognito identity provider name.",
            "title": "Identity Provider",
            "type": "string"
          },
          "intent_id": {
            "description": "The link intent's id.",
            "format": "uuid",
            "title": "Intent Id",
            "type": "string"
          },
          "nonce": {
            "description": "The one-time nonce to send on the authorize request.",
            "title": "Nonce",
            "type": "string"
          }
        },
        "required": [
          "intent_id",
          "identity_provider",
          "nonce",
          "expires_at"
        ],
        "title": "SsoLinkStarted",
        "type": "object"
      },
      "StageAgentRead": {
        "additionalProperties": false,
        "description": "The agent performing (or having performed) a journey stage.",
        "properties": {
          "agent_slug": {
            "description": "Stable identifier of the agent on the pack's roster.",
            "title": "Agent Slug",
            "type": "string"
          },
          "archetype": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The role this agent plays in the pack's crew — lead, intake, analyst, strategist, writer, tracker, or monitor. Null when the roster does not declare one.",
            "title": "Archetype"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The agent's display name from the pack's roster. Null when the roster no longer lists this agent — the recorded identity is kept even after a roster change.",
            "title": "Display Name"
          }
        },
        "required": [
          "agent_slug"
        ],
        "title": "StageAgentRead",
        "type": "object"
      },
      "StallAnalyticsResponse": {
        "description": "Case lifecycle sensors read off the audit trail.",
        "properties": {
          "active_cases": {
            "description": "Distinct cases live at any point in the window.",
            "title": "Active Cases",
            "type": "integer"
          },
          "as_of": {
            "description": "UTC ISO-8601 timestamp the summary was computed at — also the instant a still-open state or still-pending work item is measured to.",
            "title": "As Of",
            "type": "string"
          },
          "human_time_drift": {
            "$ref": "#/components/schemas/StallHumanTimeDriftResponse",
            "description": "The human-time drift monitor — the share of case wall-clock held by a human, per tenant, across periods."
          },
          "live_seconds": {
            "description": "Total in-window wall-clock across live case states — the share_pct denominator.",
            "title": "Live Seconds",
            "type": "number"
          },
          "per_pack": {
            "description": "Per-pack rollup rows, most human-held first, capped at `per_pack`.",
            "items": {
              "$ref": "#/components/schemas/StallPackRollupResponse"
            },
            "title": "Per Pack",
            "type": "array"
          },
          "time_in_state": {
            "description": "The state mix — live states first, then closed states.",
            "items": {
              "$ref": "#/components/schemas/StallStateTimeResponse"
            },
            "title": "Time In State",
            "type": "array"
          },
          "unattributed_active_cases": {
            "default": 0,
            "description": "Of those, cases with no pack attribution — included in the totals, reported here so the per-pack rows visibly don't sum to the totals when unattributed work exists.",
            "title": "Unattributed Active Cases",
            "type": "integer"
          },
          "window_end": {
            "description": "Exclusive window end (UTC ISO-8601).",
            "title": "Window End",
            "type": "string"
          },
          "window_start": {
            "description": "Inclusive window start (UTC ISO-8601). Always resolved: every number here is wall-clock clipped to the window.",
            "title": "Window Start",
            "type": "string"
          }
        },
        "required": [
          "window_start",
          "window_end",
          "as_of",
          "active_cases",
          "live_seconds",
          "human_time_drift"
        ],
        "title": "StallAnalyticsResponse",
        "type": "object"
      },
      "StallHumanTimeDriftResponse": {
        "description": "The human-time drift monitor: is human time trending down per tenant?",
        "properties": {
          "bucket_seconds": {
            "description": "The period width the window was divided into.",
            "title": "Bucket Seconds",
            "type": "integer"
          },
          "per_tenant": {
            "description": "Per-tenant trends — tenants whose human time is trending up first, then by current human share. Capped at `per_tenant`.",
            "items": {
              "$ref": "#/components/schemas/StallHumanTimeTrendResponse"
            },
            "title": "Per Tenant",
            "type": "array"
          },
          "periods": {
            "description": "How many periods the window produced.",
            "title": "Periods",
            "type": "integer"
          },
          "platform": {
            "$ref": "#/components/schemas/StallHumanTimeTrendResponse",
            "description": "The platform-wide trend (every tenant folded together)."
          },
          "tenants_drifting_up": {
            "default": 0,
            "description": "How many tenants in per_tenant have direction 'up' — the count that makes the signal legible at a glance.",
            "title": "Tenants Drifting Up",
            "type": "integer"
          }
        },
        "required": [
          "bucket_seconds",
          "periods",
          "platform"
        ],
        "title": "StallHumanTimeDriftResponse",
        "type": "object"
      },
      "StallHumanTimePeriodResponse": {
        "description": "One period of the human-time drift monitor.",
        "properties": {
          "active_cases": {
            "description": "Distinct cases live at any point in the period.",
            "title": "Active Cases",
            "type": "integer"
          },
          "case_seconds": {
            "description": "Total live case wall-clock in this period — the denominator.",
            "title": "Case Seconds",
            "type": "number"
          },
          "human_seconds": {
            "description": "Case wall-clock held by a human in this period — time in the needs-a-human state plus time held by a pending work item, counted once where those overlap.",
            "title": "Human Seconds",
            "type": "number"
          },
          "human_share_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "human_seconds / case_seconds * 100 (2dp). null when there was no case activity in the period — an idle period is reported as unknown, never as a perfect 0%.",
            "title": "Human Share Pct"
          },
          "period_end": {
            "description": "Exclusive period end (UTC ISO-8601). The last period is clipped to the window end, so it may be shorter than the bucket.",
            "title": "Period End",
            "type": "string"
          },
          "period_start": {
            "description": "Inclusive period start (UTC ISO-8601).",
            "title": "Period Start",
            "type": "string"
          }
        },
        "required": [
          "period_start",
          "period_end",
          "human_seconds",
          "case_seconds",
          "active_cases"
        ],
        "title": "StallHumanTimePeriodResponse",
        "type": "object"
      },
      "StallHumanTimeTrendResponse": {
        "description": "The human-time reading for one series — a tenant, or the whole platform.",
        "properties": {
          "change_pct_points": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "latest_share_pct - first_share_pct (2dp). Negative is the healthy direction. null with fewer than two defined periods.",
            "title": "Change Pct Points"
          },
          "direction": {
            "description": "down, flat, up, or insufficient_data — read straight off the slope, with a small dead band around zero so a genuinely flat series is not dressed up as either direction.",
            "title": "Direction",
            "type": "string"
          },
          "first_share_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The first period whose human share is defined (periods with no case activity are skipped, never read as 0).",
            "title": "First Share Pct"
          },
          "latest_share_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The most recent period whose human share is defined.",
            "title": "Latest Share Pct"
          },
          "periods": {
            "description": "Per-period readings, oldest first.",
            "items": {
              "$ref": "#/components/schemas/StallHumanTimePeriodResponse"
            },
            "title": "Periods",
            "type": "array"
          },
          "slope_pct_points_per_period": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Least-squares slope of the human share against period index (2dp). Negative means human time is trending down. null with fewer than two defined periods.",
            "title": "Slope Pct Points Per Period"
          },
          "tenant_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The tenant this series belongs to; null for the platform-wide series.",
            "title": "Tenant Id"
          }
        },
        "required": [
          "direction"
        ],
        "title": "StallHumanTimeTrendResponse",
        "type": "object"
      },
      "StallPackRollupResponse": {
        "description": "Per-pack stall rollup — time-in-state, revision loops, escalations.",
        "properties": {
          "active_cases": {
            "description": "Distinct cases of this pack live at any point in the window — the denominator for the rates below.",
            "title": "Active Cases",
            "type": "integer"
          },
          "cases_escalated": {
            "description": "How many of active_cases were escalated at least once.",
            "title": "Cases Escalated",
            "type": "integer"
          },
          "cases_with_revision_loop": {
            "description": "How many of active_cases looped at least once.",
            "title": "Cases With Revision Loop",
            "type": "integer"
          },
          "escalation_rate_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "cases_escalated / active_cases * 100 (2dp) — the share of cases that needed a human at all.",
            "title": "Escalation Rate Pct"
          },
          "escalations": {
            "description": "Escalations raised to a human in-window on this pack's cases.",
            "title": "Escalations",
            "type": "integer"
          },
          "escalations_per_case": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "escalations / active_cases (2dp) — the escalation rate. null when the pack had no active case.",
            "title": "Escalations Per Case"
          },
          "live_seconds": {
            "description": "Total in-window wall-clock across this pack's live case states.",
            "title": "Live Seconds",
            "type": "number"
          },
          "needs_human_seconds": {
            "description": "In-window wall-clock in the needs-a-human state.",
            "title": "Needs Human Seconds",
            "type": "number"
          },
          "needs_human_share_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "needs_human_seconds / live_seconds * 100 (2dp). null when the pack had no live time in-window. This is the lifecycle-state share only; the human-time drift monitor additionally counts time held by pending work items and reports it per tenant per period.",
            "title": "Needs Human Share Pct"
          },
          "open_seconds": {
            "description": "In-window wall-clock in the open state.",
            "title": "Open Seconds",
            "type": "number"
          },
          "pack_slug": {
            "description": "The pack whose cases these are.",
            "title": "Pack Slug",
            "type": "string"
          },
          "revision_loop_rate_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "cases_with_revision_loop / active_cases * 100 (2dp). null when the pack had no active case.",
            "title": "Revision Loop Rate Pct"
          },
          "revision_loops": {
            "description": "Times a case re-entered a lifecycle state it had already been in — the 'we went round again' signal — counted on the in-window re-entry.",
            "title": "Revision Loops",
            "type": "integer"
          },
          "waiting_external_seconds": {
            "description": "In-window wall-clock waiting on an external party.",
            "title": "Waiting External Seconds",
            "type": "number"
          }
        },
        "required": [
          "pack_slug",
          "active_cases",
          "live_seconds",
          "open_seconds",
          "waiting_external_seconds",
          "needs_human_seconds",
          "revision_loops",
          "cases_with_revision_loop",
          "escalations",
          "cases_escalated"
        ],
        "title": "StallPackRollupResponse",
        "type": "object"
      },
      "StallStateTimeResponse": {
        "description": "Wall-clock the platform's cases spent in one lifecycle state.",
        "properties": {
          "avg_seconds_per_case": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "seconds / cases (2dp). null when no case was in this state.",
            "title": "Avg Seconds Per Case"
          },
          "cases": {
            "description": "Distinct cases that were in this state during the window. For a closed state this reads as how many cases reached it in-window.",
            "title": "Cases",
            "type": "integer"
          },
          "seconds": {
            "description": "Case wall-clock in this state during the window. A case that entered before the window contributes only its in-window share. Always 0 for a closed state — a closed case accrues no more time.",
            "title": "Seconds",
            "type": "number"
          },
          "share_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "This state's share of all live case time in the window (2dp). null when there was no live case time (render 'no activity', never '0%').",
            "title": "Share Pct"
          },
          "status": {
            "description": "The case lifecycle state (open, waiting for an external party, needs a human, resolved, abandoned).",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status",
          "seconds",
          "cases"
        ],
        "title": "StallStateTimeResponse",
        "type": "object"
      },
      "StatementRequest": {
        "additionalProperties": false,
        "properties": {
          "month": {
            "maxLength": 7,
            "minLength": 7,
            "pattern": "^\\d{4}-(0[1-9]|1[0-2])$",
            "title": "Month",
            "type": "string"
          }
        },
        "required": [
          "month"
        ],
        "title": "StatementRequest",
        "type": "object"
      },
      "StatementView": {
        "properties": {
          "as_of": {
            "format": "date-time",
            "title": "As Of",
            "type": "string"
          },
          "content_sha256": {
            "title": "Content Sha256",
            "type": "string"
          },
          "csv_sha256": {
            "title": "Csv Sha256",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "issued_at": {
            "format": "date-time",
            "title": "Issued At",
            "type": "string"
          },
          "ledger_watermark": {
            "title": "Ledger Watermark",
            "type": "integer"
          },
          "month": {
            "title": "Month",
            "type": "string"
          },
          "revision": {
            "title": "Revision",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "month",
          "as_of",
          "revision",
          "content_sha256",
          "csv_sha256",
          "issued_at",
          "ledger_watermark"
        ],
        "title": "StatementView",
        "type": "object"
      },
      "StepRevisionRead": {
        "description": "A run step waiting on a revision, because its held run's sign-off came back.",
        "properties": {
          "cause": {
            "description": "Why the step waits on a revision: 'returned' (a reviewer returned the sign-off with notes) or 'expired' (the sign-off expired before anyone decided).",
            "enum": [
              "returned",
              "expired"
            ],
            "title": "Cause",
            "type": "string"
          },
          "decided_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the sign-off was returned or expired.",
            "title": "Decided At"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The reviewer's notes on a returned sign-off. Always null when the sign-off expired, because nobody decided.",
            "title": "Notes"
          },
          "run_id": {
            "description": "The held run. Revise it and submit it again: once the revision's sign-off is approved and the revision finishes, the step closes.",
            "format": "uuid",
            "title": "Run Id",
            "type": "string"
          }
        },
        "required": [
          "cause",
          "run_id"
        ],
        "title": "StepRevisionRead",
        "type": "object"
      },
      "StructuredExportDescriptor": {
        "description": "One downloadable structured-export shape available for a run.\n\n``kind`` is the stable identifier used in the download URL; ``label`` and\n``description`` are display text; ``format`` / ``content_type`` describe\nthe file; ``filename`` is the suggested download name.",
        "properties": {
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "description": {
            "title": "Description",
            "type": "string"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "format": {
            "title": "Format",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "label",
          "description",
          "format",
          "content_type",
          "filename"
        ],
        "title": "StructuredExportDescriptor",
        "type": "object"
      },
      "StructuredExportList": {
        "description": "The structured exports available for THIS RUN.\n\n``kinds`` is empty when there is nothing to offer — the pack declares no\nstructured exports (most packs' work products are documents, not\nmachine-loadable records), or this particular run's output carries nothing\nthe declared kinds are built from.\n\nWhen ``kinds`` is empty, ``reason`` says WHICH of those it is, and\n``detail`` carries the pack's own explanation where it states one. Both are\n``null`` whenever ``kinds`` is non-empty: they exist to give an empty\nanswer a checkable basis, not to annotate a full one.\n\n``not_offered`` lists every export the pack declares that this run's output\ncannot be rendered into, each with its own reason and the pack's own\nexplanation — so a run that produces some of its pack's files but not all\nof them says which are missing and why. Empty when every declared export is\noffered; for a run that has not finished it is empty too, because\n``reason`` already answers for every kind at once.",
        "properties": {
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "kinds": {
            "items": {
              "$ref": "#/components/schemas/StructuredExportDescriptor"
            },
            "title": "Kinds",
            "type": "array"
          },
          "not_offered": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/StructuredExportNotOffered"
            },
            "title": "Not Offered",
            "type": "array"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "run_id": {
            "format": "uuid",
            "title": "Run Id",
            "type": "string"
          }
        },
        "required": [
          "run_id",
          "pack_slug",
          "kinds"
        ],
        "title": "StructuredExportList",
        "type": "object"
      },
      "StructuredExportNotOffered": {
        "description": "One export the run's pack declares that this particular run cannot produce.\n\n``kind`` and ``label`` identify the export; ``reason`` is the same closed\nvocabulary an empty list uses; ``detail`` is the pack's own explanation of\nwhy this run's output cannot be rendered into this file, where the pack\nstates one — and what to do differently — or ``null`` where it does not.",
        "properties": {
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "label",
          "reason"
        ],
        "title": "StructuredExportNotOffered",
        "type": "object"
      },
      "StructuredExportResponse": {
        "description": "A rendered structured export ready to download.\n\n``download_url`` is valid for about an hour. ``delivery: \"presigned\"``:\na direct link to the rendered file in storage. ``delivery: \"stream\"``: the\nfile is held encrypted under the workspace's own key and ``download_url``\nis ``GET /api/v2/exports/{export_id}/content``, which needs the caller's\ncredentials.\n\n``warnings`` is empty for the ordinary clean export. When it is not, the\nfile is still sound and still downloadable — but each entry names something\nabout this run's result that whoever loads the file needs to know, and says\nwhether the file itself carries it.",
        "properties": {
          "content_type": {
            "title": "Content Type",
            "type": "string"
          },
          "delivery": {
            "default": "presigned",
            "description": "'presigned': download_url is a short-lived direct link. 'stream': download_url is an API path that returns the file to an authenticated caller until expires_at.",
            "enum": [
              "presigned",
              "stream"
            ],
            "title": "Delivery",
            "type": "string"
          },
          "download_url": {
            "title": "Download Url",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          },
          "export_id": {
            "format": "uuid",
            "title": "Export Id",
            "type": "string"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "format": {
            "title": "Format",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "run_id": {
            "format": "uuid",
            "title": "Run Id",
            "type": "string"
          },
          "s3_key": {
            "title": "S3 Key",
            "type": "string"
          },
          "warnings": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/StructuredExportWarning"
            },
            "title": "Warnings",
            "type": "array"
          }
        },
        "required": [
          "run_id",
          "kind",
          "export_id",
          "format",
          "content_type",
          "filename",
          "s3_key",
          "download_url",
          "expires_at"
        ],
        "title": "StructuredExportResponse",
        "type": "object"
      },
      "StructuredExportWarning": {
        "description": "A notice that must reach whoever takes this export.\n\nThe export is sound — a notice is not a block — but something about how the\nrun's work product was resolved needs to travel with the file. ``kind`` is\na stable identifier a client may branch on; ``detail`` is the customer-\nfacing text. ``carried_in_file`` is False when the rendered file does NOT\ncontain this notice, because its shape cannot hold one without breaking the\nsystem that imports it — then this response is the only place the notice\nexists, and ``detail`` says so in plain language.",
        "properties": {
          "carried_in_file": {
            "title": "Carried In File",
            "type": "boolean"
          },
          "detail": {
            "title": "Detail",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "detail",
          "carried_in_file"
        ],
        "title": "StructuredExportWarning",
        "type": "object"
      },
      "SubjectCaseRead": {
        "description": "One case in a subject's cross-case history.",
        "properties": {
          "case_id": {
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "case_opened_at": {
            "description": "When the case was opened.",
            "format": "date-time",
            "title": "Case Opened At",
            "type": "string"
          },
          "case_ref": {
            "description": "The case's quotable reference, e.g. C-000123.",
            "title": "Case Ref",
            "type": "string"
          },
          "linked_at": {
            "description": "When the entity was attached to the case.",
            "format": "date-time",
            "title": "Linked At",
            "type": "string"
          },
          "linked_via": {
            "description": "Which automated source attached the entity to the case.",
            "title": "Linked Via",
            "type": "string"
          },
          "resolution_outcome": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The recorded ground-truth outcome, once the case is resolved.",
            "title": "Resolution Outcome"
          },
          "role": {
            "description": "What this entity is to the case: 'primary', 'affected', 'counterparty', or 'referenced'.",
            "title": "Role",
            "type": "string"
          },
          "status": {
            "description": "The case's lifecycle status: open, waiting_external, needs_human, resolved, or abandoned.",
            "title": "Status",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "case_id",
          "case_ref",
          "title",
          "status",
          "resolution_outcome",
          "role",
          "linked_via",
          "case_opened_at",
          "linked_at"
        ],
        "title": "SubjectCaseRead",
        "type": "object"
      },
      "SubjectDetail": {
        "description": "One entity with its full cross-case history, newest case first.",
        "properties": {
          "attributes": {
            "additionalProperties": true,
            "title": "Attributes",
            "type": "object"
          },
          "cases": {
            "description": "Every case this entity is linked to, newest first — the entity's history across your workspace (recurring problems on one policy, every case touching one payer account, and so on).",
            "items": {
              "$ref": "#/components/schemas/SubjectCaseRead"
            },
            "title": "Cases",
            "type": "array"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "first_seen_via": {
            "title": "First Seen Via",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "natural_key": {
            "title": "Natural Key",
            "type": "string"
          },
          "subject_type": {
            "title": "Subject Type",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "subject_type",
          "natural_key",
          "display_name",
          "attributes",
          "first_seen_via",
          "cases",
          "created_at",
          "updated_at"
        ],
        "title": "SubjectDetail",
        "type": "object"
      },
      "SubjectList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SubjectListItem"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "SubjectList",
        "type": "object"
      },
      "SubjectListItem": {
        "description": "One entity in the registry, as listed.",
        "properties": {
          "attributes": {
            "additionalProperties": true,
            "description": "Facts gathered about the entity from the sources that observed it.",
            "title": "Attributes",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "display_name": {
            "description": "Human-readable label for the entity.",
            "title": "Display Name",
            "type": "string"
          },
          "first_seen_via": {
            "description": "Which automated source first observed this entity: 'intake', 'attachment', 'connector', or 'run'. Subjects are always created automatically from your work's own inputs — never typed in by hand.",
            "title": "First Seen Via",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "linked_case_count": {
            "description": "How many cases this entity is linked to across its history.",
            "title": "Linked Case Count",
            "type": "integer"
          },
          "linked_via": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Only present when listing a case's subjects: which automated source attached the entity to that case.",
            "title": "Linked Via"
          },
          "natural_key": {
            "description": "The entity's stable real-world identifier (for example a policy number, an NPI, or a source-qualified record id), normalized so the same entity always resolves to one subject.",
            "title": "Natural Key",
            "type": "string"
          },
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Only present when listing a case's subjects: what the entity is to that case — 'primary', 'affected', 'counterparty', or 'referenced'.",
            "title": "Role"
          },
          "subject_type": {
            "description": "What kind of entity this is: 'policy', 'patient', 'provider', 'account', or 'system'.",
            "title": "Subject Type",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "subject_type",
          "natural_key",
          "display_name",
          "attributes",
          "first_seen_via",
          "linked_case_count",
          "created_at",
          "updated_at"
        ],
        "title": "SubjectListItem",
        "type": "object"
      },
      "SubjectRecurrence": {
        "description": "One entity's windowed case history with grouped counts — the\n'how often does this keep coming back?' read.",
        "properties": {
          "by_pack": {
            "description": "The window's cases grouped by the pack that owns each case, busiest first. A null value groups cases with no owning pack.",
            "items": {
              "$ref": "#/components/schemas/RecurrenceFacetCount"
            },
            "title": "By Pack",
            "type": "array"
          },
          "by_resolution": {
            "description": "The window's cases grouped by their recorded real-world outcome, largest group first. A null value groups cases not resolved yet.",
            "items": {
              "$ref": "#/components/schemas/RecurrenceFacetCount"
            },
            "title": "By Resolution",
            "type": "array"
          },
          "by_status": {
            "description": "The window's cases grouped by lifecycle status, largest group first.",
            "items": {
              "$ref": "#/components/schemas/RecurrenceFacetCount"
            },
            "title": "By Status",
            "type": "array"
          },
          "cases": {
            "description": "The window's cases, newest first, capped by the request's limit (total_cases still counts everything in the window).",
            "items": {
              "$ref": "#/components/schemas/SubjectCaseRead"
            },
            "title": "Cases",
            "type": "array"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "natural_key": {
            "title": "Natural Key",
            "type": "string"
          },
          "subject_id": {
            "format": "uuid",
            "title": "Subject Id",
            "type": "string"
          },
          "subject_type": {
            "title": "Subject Type",
            "type": "string"
          },
          "total_cases": {
            "description": "How many distinct cases touched this entity inside the window.",
            "title": "Total Cases",
            "type": "integer"
          },
          "window_days": {
            "description": "The look-back window this view covers, in days.",
            "title": "Window Days",
            "type": "integer"
          },
          "window_start": {
            "description": "Cases opened at or after this moment are counted.",
            "format": "date-time",
            "title": "Window Start",
            "type": "string"
          }
        },
        "required": [
          "subject_id",
          "subject_type",
          "natural_key",
          "display_name",
          "window_days",
          "window_start",
          "total_cases",
          "by_pack",
          "by_status",
          "by_resolution",
          "cases"
        ],
        "title": "SubjectRecurrence",
        "type": "object"
      },
      "SupersedeRequest": {
        "description": "Mark a policy document as replaced by a newer upload.",
        "properties": {
          "replacement_attachment_id": {
            "description": "The id of the newly uploaded policy document that replaces this one.",
            "format": "uuid",
            "title": "Replacement Attachment Id",
            "type": "string"
          }
        },
        "required": [
          "replacement_attachment_id"
        ],
        "title": "SupersedeRequest",
        "type": "object"
      },
      "SupervisionCases": {
        "description": "Per-case journey state counts across the tenant's cases.",
        "properties": {
          "abandoned": {
            "title": "Abandoned",
            "type": "integer"
          },
          "needs_human": {
            "title": "Needs Human",
            "type": "integer"
          },
          "open": {
            "title": "Open",
            "type": "integer"
          },
          "resolved": {
            "title": "Resolved",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "waiting_external": {
            "title": "Waiting External",
            "type": "integer"
          }
        },
        "required": [
          "open",
          "waiting_external",
          "needs_human",
          "resolved",
          "abandoned",
          "total"
        ],
        "title": "SupervisionCases",
        "type": "object"
      },
      "SupervisionOverview": {
        "description": "The supervision wallboard aggregate: runs, human-input backlog, cases.\n\nOne read gives a supervisor the whole estate: governed runs in flight and\nthe last day's outcomes, the backlog of work waiting on human input with\nits aging profile, and where every case sits in its journey. All counts\nare scoped to the calling workspace.",
        "properties": {
          "cases": {
            "$ref": "#/components/schemas/SupervisionCases"
          },
          "generated_at": {
            "description": "Server time this snapshot was computed.",
            "format": "date-time",
            "title": "Generated At",
            "type": "string"
          },
          "runs": {
            "$ref": "#/components/schemas/SupervisionRuns"
          },
          "work_items": {
            "$ref": "#/components/schemas/SupervisionWorkItems"
          }
        },
        "required": [
          "runs",
          "work_items",
          "cases",
          "generated_at"
        ],
        "title": "SupervisionOverview",
        "type": "object"
      },
      "SupervisionRun": {
        "description": "One recent governed run, as shown on the wallboard's activity strip.",
        "properties": {
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "degraded": {
            "default": false,
            "description": "True when the run is still in progress but has not reported progress for longer than expected. Clears on its own if the run resumes; always false for completed runs.",
            "title": "Degraded",
            "type": "boolean"
          },
          "governance_pass": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether the run passed its policy checks; null while in flight.",
            "title": "Governance Pass"
          },
          "human_approval_decision": {
            "anyOf": [
              {
                "enum": [
                  "approved",
                  "rejected",
                  "timed_out",
                  "superseded"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "For a run that was paused for a sign-off and is no longer waiting, what the sign-off came to: approved, rejected, timed_out, or superseded (closed with its case). Null for a run never paused and while a decision is still outstanding.",
            "title": "Human Approval Decision"
          },
          "human_approval_pending": {
            "default": false,
            "description": "True when the run is paused before its work, waiting for a person to sign off. Such a run has not passed its checks and has not failed them either — no verdict has been reached. False once the sign-off is decided; see human_approval_decision.",
            "title": "Human Approval Pending",
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "outcome_verdict": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The run's outcome verdict (met | partial | incomplete | not_scored); null for runs recorded before outcome scoring.",
            "title": "Outcome Verdict"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "status": {
            "description": "Run lifecycle: queued | running | succeeded | failed.",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "pack_slug",
          "status",
          "governance_pass",
          "outcome_verdict",
          "created_at",
          "completed_at"
        ],
        "title": "SupervisionRun",
        "type": "object"
      },
      "SupervisionRuns": {
        "description": "Governed-run activity: what is in flight and how the last day went.",
        "properties": {
          "active": {
            "description": "Runs currently in flight (queued or running), excluding rows that read-time reconciliation already presents as failed.",
            "title": "Active",
            "type": "integer"
          },
          "degraded": {
            "default": 0,
            "description": "Of the runs in flight, how many have not reported progress for longer than expected. Zero on a healthy workspace; a non-zero value is worth a look.",
            "title": "Degraded",
            "type": "integer"
          },
          "failed_last_24h": {
            "description": "Runs that failed in the last 24 hours, including stranded runs presented as failed at read time.",
            "title": "Failed Last 24H",
            "type": "integer"
          },
          "recent": {
            "description": "The most recent runs, newest first (a small activity strip).",
            "items": {
              "$ref": "#/components/schemas/SupervisionRun"
            },
            "title": "Recent",
            "type": "array"
          },
          "started_last_24h": {
            "description": "Runs started in the last 24 hours.",
            "title": "Started Last 24H",
            "type": "integer"
          },
          "succeeded_last_24h": {
            "description": "Runs that succeeded in the last 24 hours.",
            "title": "Succeeded Last 24H",
            "type": "integer"
          }
        },
        "required": [
          "active",
          "started_last_24h",
          "succeeded_last_24h",
          "failed_last_24h",
          "recent"
        ],
        "title": "SupervisionRuns",
        "type": "object"
      },
      "SupervisionWorkItems": {
        "description": "The human-input backlog: work waiting on a person, and for how long.",
        "properties": {
          "accepted": {
            "description": "Open items accepted and being acted on.",
            "title": "Accepted",
            "type": "integer"
          },
          "age_buckets": {
            "$ref": "#/components/schemas/WorkItemAgeBuckets"
          },
          "offered": {
            "description": "Open items offered and awaiting acceptance.",
            "title": "Offered",
            "type": "integer"
          },
          "oldest_open_age_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Age of the oldest open item, in seconds; null when none are open.",
            "title": "Oldest Open Age Seconds"
          },
          "open_total": {
            "description": "All open items (pending + offered + accepted).",
            "title": "Open Total",
            "type": "integer"
          },
          "pending": {
            "description": "Open items not yet offered to anyone.",
            "title": "Pending",
            "type": "integer"
          }
        },
        "required": [
          "pending",
          "offered",
          "accepted",
          "open_total",
          "oldest_open_age_seconds",
          "age_buckets"
        ],
        "title": "SupervisionWorkItems",
        "type": "object"
      },
      "SupportRequestCreate": {
        "description": "A contact-support submission body.",
        "properties": {
          "context": {
            "anyOf": [
              {
                "maxLength": 512,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional page/route the request was raised from (the current pathname), auto-captured by the client to help triage.",
            "title": "Context"
          },
          "message": {
            "description": "The free-text support message. Required, non-empty (trimmed).",
            "maxLength": 4000,
            "minLength": 1,
            "title": "Message",
            "type": "string"
          },
          "subject": {
            "description": "A short, one-line summary of what the user needs help with.",
            "maxLength": 200,
            "minLength": 1,
            "title": "Subject",
            "type": "string"
          }
        },
        "required": [
          "subject",
          "message"
        ],
        "title": "SupportRequestCreate",
        "type": "object"
      },
      "SupportRequestResult": {
        "description": "The outcome of a support escalation.\n\nTwo shapes, discriminated by ``channel``:\n\n- ``ticket`` — a JSM customer request was created; ``reference`` carries its\n  human-facing key and ``support_email`` is omitted.\n- ``email`` — the request could not be ticketed here; ``support_email``\n  carries the address to reach a human directly and ``reference`` is omitted.",
        "properties": {
          "channel": {
            "description": "The escalation channel used: 'ticket' | 'email'.",
            "title": "Channel",
            "type": "string"
          },
          "ok": {
            "description": "True iff a support ticket was created.",
            "title": "Ok",
            "type": "boolean"
          },
          "reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The created ticket's human-facing reference (ticket channel only).",
            "title": "Reference"
          },
          "support_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The address to email a human directly (email-fallback channel only).",
            "title": "Support Email"
          }
        },
        "required": [
          "ok",
          "channel"
        ],
        "title": "SupportRequestResult",
        "type": "object"
      },
      "SurveyCreate": {
        "description": "A survey-response submission body.",
        "properties": {
          "comment": {
            "anyOf": [
              {
                "maxLength": 4000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional free-text the respondent adds alongside the score.",
            "title": "Comment"
          },
          "context": {
            "anyOf": [
              {
                "maxLength": 512,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional page/route the response was submitted from (e.g. the current pathname), auto-captured by the client for analysis.",
            "title": "Context"
          },
          "score": {
            "description": "The numeric rating. Valid range depends on survey_type: NPS 0–10, CSAT 1–5 (inclusive).",
            "title": "Score",
            "type": "integer"
          },
          "survey_type": {
            "description": "The survey scale: 'nps' (0–10 recommend) | 'csat' (1–5 satisfaction).",
            "enum": [
              "nps",
              "csat"
            ],
            "title": "Survey Type",
            "type": "string"
          }
        },
        "required": [
          "survey_type",
          "score"
        ],
        "title": "SurveyCreate",
        "type": "object"
      },
      "SurveyCreated": {
        "description": "The created survey-response row's identifier.",
        "properties": {
          "id": {
            "description": "The created survey_responses row's UUID.",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "title": "SurveyCreated",
        "type": "object"
      },
      "SurveySummaryResponse": {
        "description": "In-product NPS/CSAT survey rollup (see ``core/kpi/survey``).",
        "properties": {
          "as_of": {
            "description": "UTC ISO-8601 timestamp the summary was computed at.",
            "title": "As Of",
            "type": "string"
          },
          "counts_by_type": {
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Per-survey_type response counts — a DENSE map: every known type ('nps'/'csat') is present, zero-filled.",
            "title": "Counts By Type",
            "type": "object"
          },
          "csat_average": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Mean CSAT score (1–5 scale). null when there were no CSAT responses (undefined).",
            "title": "Csat Average"
          },
          "csat_response_count": {
            "description": "Number of CSAT responses in-window (the CSAT denominator).",
            "title": "Csat Response Count",
            "type": "integer"
          },
          "nps_detractors": {
            "description": "NPS responses scoring 0–6 (detractors).",
            "title": "Nps Detractors",
            "type": "integer"
          },
          "nps_passives": {
            "description": "NPS responses scoring 7–8 (passives).",
            "title": "Nps Passives",
            "type": "integer"
          },
          "nps_promoters": {
            "description": "NPS responses scoring 9–10 (promoters).",
            "title": "Nps Promoters",
            "type": "integer"
          },
          "nps_response_count": {
            "description": "Number of NPS responses in-window (the NPS denominator).",
            "title": "Nps Response Count",
            "type": "integer"
          },
          "nps_score": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Net Promoter Score: round(%promoters − %detractors) over the NPS responses — a whole number in [-100, 100]. null when there were no NPS responses (undefined).",
            "title": "Nps Score"
          },
          "score_distribution": {
            "additionalProperties": {
              "additionalProperties": {
                "type": "integer"
              },
              "type": "object"
            },
            "description": "Per-survey_type score histogram: {survey_type: {score: count}}. DENSE over each type's valid range (NPS 0–10, CSAT 1–5), zero-filled. The score keys are strings (JSON object keys) of the integer scores.",
            "title": "Score Distribution",
            "type": "object"
          },
          "total_responses": {
            "description": "Total survey responses in-window (NPS + CSAT).",
            "title": "Total Responses",
            "type": "integer"
          },
          "window_end": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Exclusive upper bound (UTC ISO-8601) on created_at used, or null when unbounded.",
            "title": "Window End"
          },
          "window_start": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Inclusive lower bound (UTC ISO-8601) on created_at used, or null when unbounded (no `since`).",
            "title": "Window Start"
          }
        },
        "required": [
          "as_of",
          "total_responses",
          "counts_by_type",
          "nps_response_count",
          "nps_promoters",
          "nps_passives",
          "nps_detractors",
          "csat_response_count"
        ],
        "title": "SurveySummaryResponse",
        "type": "object"
      },
      "SweepResult": {
        "description": "What one routing sweep did.",
        "properties": {
          "examined": {
            "description": "Routed items examined for (re-)offering.",
            "title": "Examined",
            "type": "integer"
          },
          "offers_expired": {
            "description": "Standing offers that lapsed and were re-queued.",
            "title": "Offers Expired",
            "type": "integer"
          },
          "offers_made": {
            "description": "New offers placed this pass.",
            "title": "Offers Made",
            "type": "integer"
          },
          "unrouted": {
            "description": "Items with no eligible member even after full relaxation; their case is parked as waiting on the outside world and re-checked every sweep.",
            "title": "Unrouted",
            "type": "integer"
          },
          "waiting": {
            "description": "Items with no match yet whose skill requirements will relax further as they wait.",
            "title": "Waiting",
            "type": "integer"
          }
        },
        "required": [
          "examined",
          "offers_expired",
          "offers_made",
          "waiting",
          "unrouted"
        ],
        "title": "SweepResult",
        "type": "object"
      },
      "SweepReviewRead": {
        "description": "Something the batch states that names no claim, for the person who ran\nthe sweep to check, such as a payer's adjustment.",
        "properties": {
          "reason": {
            "title": "Reason",
            "type": "string"
          },
          "sentence": {
            "title": "Sentence",
            "type": "string"
          }
        },
        "required": [
          "reason",
          "sentence"
        ],
        "title": "SweepReviewRead",
        "type": "object"
      },
      "SweptClaimRead": {
        "description": "What the sweep did with one claim.",
        "properties": {
          "case_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Id"
          },
          "claim_key": {
            "title": "Claim Key",
            "type": "string"
          },
          "disposition": {
            "enum": [
              "opened",
              "unchanged",
              "changed",
              "not_needed",
              "not_yet_due",
              "reappeared_after_close",
              "held",
              "failed",
              "refreshed",
              "pending"
            ],
            "title": "Disposition",
            "type": "string"
          },
          "payer": {
            "title": "Payer",
            "type": "string"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "sentence": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the claim was held, in the crew's own fixed words.",
            "title": "Sentence"
          }
        },
        "required": [
          "claim_key",
          "payer",
          "disposition"
        ],
        "title": "SweptClaimRead",
        "type": "object"
      },
      "TeamRoster": {
        "description": "The tenant's team: seat usage + every member and pending invite.",
        "properties": {
          "members": {
            "items": {
              "$ref": "#/components/schemas/MemberRow"
            },
            "title": "Members",
            "type": "array"
          },
          "seat_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Maximum seats for this workspace, or null for unlimited.",
            "title": "Seat Limit"
          },
          "seats_used": {
            "description": "Occupied seats: active members + non-expired invites.",
            "title": "Seats Used",
            "type": "integer"
          }
        },
        "required": [
          "seats_used"
        ],
        "title": "TeamRoster",
        "type": "object"
      },
      "TenantAdminList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/TenantAdminRow"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "TenantAdminList",
        "type": "object"
      },
      "TenantAdminRow": {
        "description": "One row in the admin tenant-list view.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "subscription_status": {
            "title": "Subscription Status",
            "type": "string"
          },
          "user_count": {
            "description": "Number of `users` rows scoped to this tenant.",
            "title": "User Count",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "subscription_status",
          "created_at",
          "user_count"
        ],
        "title": "TenantAdminRow",
        "type": "object"
      },
      "TenantBaaApprovalRequest": {
        "additionalProperties": false,
        "description": "Body for approving the proposed agreement record.",
        "properties": {
          "body_hash": {
            "description": "The fingerprint of the proposed record you reviewed, as GET reports it.",
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[0-9a-f]{64}$",
            "title": "Body Hash",
            "type": "string"
          }
        },
        "required": [
          "body_hash"
        ],
        "title": "TenantBaaApprovalRequest",
        "type": "object"
      },
      "TenantBaaProposal": {
        "description": "An agreement record one login proposed, waiting for approval from a different login.",
        "properties": {
          "body_hash": {
            "description": "Fingerprint of the proposed record. The approval names it, so it approves exactly this record.",
            "title": "Body Hash",
            "type": "string"
          },
          "proposed_at": {
            "format": "date-time",
            "title": "Proposed At",
            "type": "string"
          },
          "proposed_by_user_id": {
            "description": "Who proposed it. Never its approver.",
            "format": "uuid",
            "title": "Proposed By User Id",
            "type": "string"
          },
          "record": {
            "$ref": "#/components/schemas/TenantBaaRecordRequest",
            "description": "The proposed record, as it will be written."
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "tenant_id",
          "body_hash",
          "proposed_by_user_id",
          "proposed_at",
          "record"
        ],
        "title": "TenantBaaProposal",
        "type": "object"
      },
      "TenantBaaProposalWithdrawal": {
        "additionalProperties": false,
        "description": "Why a pending proposal is discarded. Sent in the body, so it stays out of access logs.",
        "properties": {
          "reason": {
            "description": "Why the proposed record is discarded, for example a wrong reference.",
            "maxLength": 500,
            "minLength": 1,
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "reason"
        ],
        "title": "TenantBaaProposalWithdrawal",
        "type": "object"
      },
      "TenantBaaRecord": {
        "description": "A tenant's recorded business associate agreement and what it allows.",
        "properties": {
          "baa_executed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the agreement was executed; null when none is recorded.",
            "title": "Baa Executed At"
          },
          "baa_notice_window_hours": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The agreement's breach-notice window in hours; null when the agreement states only the 60-day rule or nothing is recorded (see notice_window_basis).",
            "title": "Baa Notice Window Hours"
          },
          "baa_reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Reference for the signed agreement; null when none is recorded.",
            "title": "Baa Reference"
          },
          "is_internal": {
            "description": "Velerian's own demo, QA or acceptance tenant. An internal tenant may upload documents for crews that work on patient records without an agreement.",
            "title": "Is Internal",
            "type": "boolean"
          },
          "notice_window_basis": {
            "description": "Which deadline governs a breach notice: baa_window (the agreement's window above), sixty_day_rule_only (no later than 60 calendar days after discovery), or not_recorded (read the signed agreement).",
            "enum": [
              "baa_window",
              "sixty_day_rule_only",
              "not_recorded"
            ],
            "title": "Notice Window Basis",
            "type": "string"
          },
          "patient_documents_allowed": {
            "description": "Whether this tenant may upload documents for crews that work on patient records: true when it is internal or an agreement is recorded.",
            "title": "Patient Documents Allowed",
            "type": "boolean"
          },
          "pending_proposal": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TenantBaaProposal"
              },
              {
                "type": "null"
              }
            ],
            "description": "A record waiting for a second person's approval; null when none is."
          },
          "phi_notice_channel": {
            "anyOf": [
              {
                "enum": [
                  "secure_file_transfer",
                  "velerian_workspace"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How the list of affected individuals is delivered: the covered entity's own secure file transfer, or a file in its own Velerian workspace. Never email. Null when not recorded.",
            "title": "Phi Notice Channel"
          },
          "phi_notice_contact": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The privacy-officer contact the agreement names for breach notices. Null when not recorded.",
            "title": "Phi Notice Contact"
          },
          "tenant_id": {
            "format": "uuid",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "tenant_id",
          "is_internal",
          "baa_executed_at",
          "baa_reference",
          "patient_documents_allowed",
          "baa_notice_window_hours",
          "notice_window_basis",
          "phi_notice_channel",
          "phi_notice_contact"
        ],
        "title": "TenantBaaRecord",
        "type": "object"
      },
      "TenantBaaRecordRequest": {
        "description": "Body for recording a tenant's business associate agreement.\n\nFor a tenant that is not internal, ``notice_channel`` is required, and so\nis exactly one of ``notice_window_hours`` or ``sixty_day_rule_only``.",
        "properties": {
          "executed_at": {
            "description": "When the agreement was executed. Must carry a timezone and must not be in the future.",
            "format": "date-time",
            "title": "Executed At",
            "type": "string"
          },
          "notice_channel": {
            "anyOf": [
              {
                "enum": [
                  "secure_file_transfer",
                  "velerian_workspace"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How the list of affected individuals is delivered, as the covered entity chose at onboarding: secure_file_transfer (its own) or velerian_workspace (a file placed in its own workspace).",
            "title": "Notice Channel"
          },
          "notice_contact": {
            "anyOf": [
              {
                "maxLength": 500,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The privacy-officer contact the agreement names for breach notices: name, role, email or phone. Never patient data.",
            "title": "Notice Contact"
          },
          "notice_window_hours": {
            "anyOf": [
              {
                "maximum": 1440.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The agreement's breach-notice window converted to hours: five days is 120. Count business days as calendar days, which never overstates the window. At most 1440 (60 days); send sixty_day_rule_only instead when the agreement states no shorter window.",
            "title": "Notice Window Hours"
          },
          "reference": {
            "description": "Reference for the signed agreement, such as its e-signature envelope id.",
            "maxLength": 255,
            "minLength": 1,
            "title": "Reference",
            "type": "string"
          },
          "sixty_day_rule_only": {
            "default": false,
            "description": "True when the agreement states no window shorter than the 60-day rule. Send this or notice_window_hours, not both.",
            "title": "Sixty Day Rule Only",
            "type": "boolean"
          }
        },
        "required": [
          "executed_at",
          "reference"
        ],
        "title": "TenantBaaRecordRequest",
        "type": "object"
      },
      "TenantCreate": {
        "properties": {
          "enterprise_settings": {
            "additionalProperties": true,
            "title": "Enterprise Settings",
            "type": "object",
            "x-max-serialized-bytes": 8192
          },
          "name": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "maxLength": 64,
            "minLength": 1,
            "pattern": "^[a-z0-9-]+$",
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "name",
          "slug"
        ],
        "title": "TenantCreate",
        "type": "object"
      },
      "TenantDataRecordCreate": {
        "additionalProperties": false,
        "description": "Body for ``POST /api/v2/tenant-data``.",
        "properties": {
          "counterparty_key": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional: the counterparty this record belongs to — for a payer contract, the payer identifier on the remittance (a plain identifier). A claim then resolves only its own payer's record, and a payer with none on file is named as a gap. At most one active record per counterparty and kind (409 otherwise).",
            "title": "Counterparty Key"
          },
          "effective_from": {
            "format": "date",
            "title": "Effective From",
            "type": "string"
          },
          "effective_to": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Inclusive; null = open-ended. Must be >= effective_from.",
            "title": "Effective To"
          },
          "entity_kind": {
            "description": "Closed platform entity vocabulary — one of: remittance_835, claim_837, eligibility_271, fee_schedule, payer_contract, provider_roster, clinical_document, correspondence, reference_table, other.",
            "maxLength": 32,
            "title": "Entity Kind",
            "type": "string"
          },
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "origin": {
            "description": "How the data arrived: upload | manual | connector.",
            "maxLength": 16,
            "title": "Origin",
            "type": "string"
          },
          "payload": {
            "additionalProperties": true,
            "description": "The reference data itself (per-kind shape, v1 free-form).",
            "title": "Payload",
            "type": "object",
            "x-max-serialized-bytes": 262144
          },
          "requirement_key": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Required for reference_table / other kinds: the pack contract requirement slug this record fulfils. Must be omitted for every other kind.",
            "title": "Requirement Key"
          }
        },
        "required": [
          "entity_kind",
          "name",
          "origin",
          "payload",
          "effective_from"
        ],
        "title": "TenantDataRecordCreate",
        "type": "object"
      },
      "TenantDataRecordDetail": {
        "description": "A record with every version, newest effective period first.",
        "properties": {
          "counterparty_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The counterparty this record belongs to — for a payer contract, the payer identifier on the remittance. A claim resolves only its own payer's record; null = not keyed to a counterparty.",
            "title": "Counterparty Key"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By User Id"
          },
          "entity_kind": {
            "description": "Closed platform entity vocabulary (fee_schedule, payer_contract, provider_roster, reference_table, ...). Every pack whose contract declares this kind tenant_standing consumes the record.",
            "title": "Entity Kind",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "Customer-facing name (\"Aetna 2026 fee schedule\").",
            "title": "Name",
            "type": "string"
          },
          "origin": {
            "description": "Provenance of the record's establishment: upload | manual | connector.",
            "title": "Origin",
            "type": "string"
          },
          "requirement_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "For reference_table / other records only: the contract requirement slug this record fulfils (those kinds carry no meaning in the kind itself). Null for all other kinds.",
            "title": "Requirement Key"
          },
          "status": {
            "description": "active | retired. Retire is the only exit — no delete.",
            "title": "Status",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "versions": {
            "items": {
              "$ref": "#/components/schemas/TenantDataVersionRead"
            },
            "title": "Versions",
            "type": "array"
          }
        },
        "required": [
          "id",
          "entity_kind",
          "name",
          "status",
          "origin",
          "created_at",
          "updated_at",
          "versions"
        ],
        "title": "TenantDataRecordDetail",
        "type": "object"
      },
      "TenantDataRecordList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/TenantDataRecordSummary"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "TenantDataRecordList",
        "type": "object"
      },
      "TenantDataRecordRead": {
        "description": "One record of the data library — the stable identity.",
        "properties": {
          "counterparty_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The counterparty this record belongs to — for a payer contract, the payer identifier on the remittance. A claim resolves only its own payer's record; null = not keyed to a counterparty.",
            "title": "Counterparty Key"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By User Id"
          },
          "entity_kind": {
            "description": "Closed platform entity vocabulary (fee_schedule, payer_contract, provider_roster, reference_table, ...). Every pack whose contract declares this kind tenant_standing consumes the record.",
            "title": "Entity Kind",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "Customer-facing name (\"Aetna 2026 fee schedule\").",
            "title": "Name",
            "type": "string"
          },
          "origin": {
            "description": "Provenance of the record's establishment: upload | manual | connector.",
            "title": "Origin",
            "type": "string"
          },
          "requirement_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "For reference_table / other records only: the contract requirement slug this record fulfils (those kinds carry no meaning in the kind itself). Null for all other kinds.",
            "title": "Requirement Key"
          },
          "status": {
            "description": "active | retired. Retire is the only exit — no delete.",
            "title": "Status",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "entity_kind",
          "name",
          "status",
          "origin",
          "created_at",
          "updated_at"
        ],
        "title": "TenantDataRecordRead",
        "type": "object"
      },
      "TenantDataRecordRetired": {
        "properties": {
          "already_retired": {
            "default": false,
            "title": "Already Retired",
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "retired": {
            "title": "Retired",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "retired"
        ],
        "title": "TenantDataRecordRetired",
        "type": "object"
      },
      "TenantDataRecordSummary": {
        "description": "A record in the list response, with its version count.",
        "properties": {
          "counterparty_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The counterparty this record belongs to — for a payer contract, the payer identifier on the remittance. A claim resolves only its own payer's record; null = not keyed to a counterparty.",
            "title": "Counterparty Key"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By User Id"
          },
          "entity_kind": {
            "description": "Closed platform entity vocabulary (fee_schedule, payer_contract, provider_roster, reference_table, ...). Every pack whose contract declares this kind tenant_standing consumes the record.",
            "title": "Entity Kind",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "Customer-facing name (\"Aetna 2026 fee schedule\").",
            "title": "Name",
            "type": "string"
          },
          "origin": {
            "description": "Provenance of the record's establishment: upload | manual | connector.",
            "title": "Origin",
            "type": "string"
          },
          "requirement_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "For reference_table / other records only: the contract requirement slug this record fulfils (those kinds carry no meaning in the kind itself). Null for all other kinds.",
            "title": "Requirement Key"
          },
          "status": {
            "description": "active | retired. Retire is the only exit — no delete.",
            "title": "Status",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "version_count": {
            "description": "How many payload versions the record holds.",
            "title": "Version Count",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "entity_kind",
          "name",
          "status",
          "origin",
          "created_at",
          "updated_at",
          "version_count"
        ],
        "title": "TenantDataRecordSummary",
        "type": "object"
      },
      "TenantDataVersionCreate": {
        "additionalProperties": false,
        "description": "Body for ``POST /api/v2/tenant-data/{record_id}/versions``.",
        "properties": {
          "counterparty_key": {
            "anyOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional: the counterparty this version is for. On a keyed record it must equal the record's key (a version never re-keys a record — 422); on an unkeyed record it keys the record once (409 if another active record already holds that counterparty).",
            "title": "Counterparty Key"
          },
          "effective_from": {
            "format": "date",
            "title": "Effective From",
            "type": "string"
          },
          "effective_to": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective To"
          },
          "origin": {
            "maxLength": 16,
            "title": "Origin",
            "type": "string"
          },
          "payload": {
            "additionalProperties": true,
            "title": "Payload",
            "type": "object",
            "x-max-serialized-bytes": 262144
          }
        },
        "required": [
          "origin",
          "payload",
          "effective_from"
        ],
        "title": "TenantDataVersionCreate",
        "type": "object"
      },
      "TenantDataVersionRead": {
        "description": "One immutable payload of a record, effective over a date range.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who loaded this payload (provenance actor).",
            "title": "Created By User Id"
          },
          "effective_from": {
            "description": "First day this version answers (inclusive).",
            "format": "date",
            "title": "Effective From",
            "type": "string"
          },
          "effective_to": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last day (inclusive); null = open-ended.",
            "title": "Effective To"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "origin": {
            "description": "Provenance of this payload: upload | manual | connector.",
            "title": "Origin",
            "type": "string"
          },
          "payload": {
            "additionalProperties": true,
            "description": "The reference data itself, per kind.",
            "title": "Payload",
            "type": "object"
          },
          "version_no": {
            "description": "1-based; a correction is the next version.",
            "title": "Version No",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "version_no",
          "origin",
          "payload",
          "effective_from",
          "created_at"
        ],
        "title": "TenantDataVersionRead",
        "type": "object"
      },
      "TenantDataWriteRead": {
        "description": "A store write's result: the record, the version written, the effect.",
        "properties": {
          "cases_updated": {
            "description": "Open cases whose data-acquisition ledger flipped to acquired because this data is now on file — 'available on N open cases'.",
            "title": "Cases Updated",
            "type": "integer"
          },
          "record": {
            "$ref": "#/components/schemas/TenantDataRecordRead"
          },
          "version": {
            "$ref": "#/components/schemas/TenantDataVersionRead"
          }
        },
        "required": [
          "record",
          "version",
          "cases_updated"
        ],
        "title": "TenantDataWriteRead",
        "type": "object"
      },
      "TenantEntitlementsResponse": {
        "description": "The calling tenant's full set of active per-pack entitlements.",
        "properties": {
          "data_region": {
            "description": "The ENFORCED data-residency region the tenant's hosted invocations physically run in — the AWS region slug the platform pins the run to (e.g. 'us-east-1'). Sourced from the canonical velerian.core.config deploy_region (VELERIAN_DEPLOY_REGION → AWS_REGION → us-east-1), the SAME value the data_residency governance handler enforces against and that is stamped on every governed run. Surfaced so a procurement reviewer or regulator inspecting the entitlement can see where data is processed. Today this is a single deployment-wide region, not a per-tenant column.",
            "title": "Data Region",
            "type": "string"
          },
          "entitlements": {
            "description": "Active per-pack entitlements, ordered by pack_slug. Empty when the tenant holds no active access yet (pre-trial / all expired).",
            "items": {
              "$ref": "#/components/schemas/PackEntitlementResponse"
            },
            "title": "Entitlements",
            "type": "array"
          },
          "self_serve_trials": {
            "default": true,
            "description": "Whether this environment lets a workspace give itself a time-boxed trial of a crew (POST /{slug}/select and the first-run vertical pick). False in production, where crews are added to a workspace by the Velerian team; a client hides its trial offers when false.",
            "title": "Self Serve Trials",
            "type": "boolean"
          },
          "tenant_id": {
            "description": "The calling tenant's UUID (echoed for clients).",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "tenant_id",
          "data_region"
        ],
        "title": "TenantEntitlementsResponse",
        "type": "object"
      },
      "TenantList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/TenantRead"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "TenantList",
        "type": "object"
      },
      "TenantOverlayRead": {
        "description": "The tenant policy-overlay rules that ALSO govern this agent's runs.",
        "properties": {
          "agentScopedRuleCount": {
            "description": "Overlay rules scoped to exactly this agent (pack-scoped rows).",
            "title": "Agentscopedrulecount",
            "type": "integer"
          },
          "kinds": {
            "description": "Distinct constraint kinds across the counted rules. Exposure-gate control-plane rows are excluded, exactly as run evaluation excludes them.",
            "items": {
              "type": "string"
            },
            "title": "Kinds",
            "type": "array"
          },
          "tenantWideRuleCount": {
            "description": "Workspace-wide overlay rules (apply to every agent's runs).",
            "title": "Tenantwiderulecount",
            "type": "integer"
          }
        },
        "required": [
          "tenantWideRuleCount",
          "agentScopedRuleCount",
          "kinds"
        ],
        "title": "TenantOverlayRead",
        "type": "object"
      },
      "TenantRead": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "enterprise_settings": {
            "additionalProperties": true,
            "title": "Enterprise Settings",
            "type": "object"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "subscription_status": {
            "title": "Subscription Status",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "subscription_status",
          "enterprise_settings",
          "created_at",
          "updated_at"
        ],
        "title": "TenantRead",
        "type": "object"
      },
      "TenantUsageSummaryResponse": {
        "description": "The full per-tenant customer usage summary response.",
        "properties": {
          "adoption": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AccountAdoptionResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "Account-level adoption — present only for admin callers."
          },
          "as_of": {
            "description": "UTC ISO-8601 timestamp the summary was computed at.",
            "title": "As Of",
            "type": "string"
          },
          "evidence_packs": {
            "$ref": "#/components/schemas/EvidencePackHistoryResponse"
          },
          "governed_runs": {
            "$ref": "#/components/schemas/GovernedRunUsageResponse"
          },
          "tenant_id": {
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "tenant_id",
          "as_of",
          "governed_runs",
          "evidence_packs"
        ],
        "title": "TenantUsageSummaryResponse",
        "type": "object"
      },
      "TermsAcceptanceRead": {
        "properties": {
          "accepted_at": {
            "format": "date-time",
            "title": "Accepted At",
            "type": "string"
          },
          "document_sha256": {
            "title": "Document Sha256",
            "type": "string"
          },
          "document_version": {
            "title": "Document Version",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "document_version",
          "document_sha256",
          "accepted_at"
        ],
        "title": "TermsAcceptanceRead",
        "type": "object"
      },
      "TermsRead": {
        "properties": {
          "acceptance": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TermsAcceptanceRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "content": {
            "title": "Content",
            "type": "string"
          },
          "document_sha256": {
            "title": "Document Sha256",
            "type": "string"
          },
          "document_version": {
            "title": "Document Version",
            "type": "string"
          }
        },
        "required": [
          "document_version",
          "document_sha256",
          "content",
          "acceptance"
        ],
        "title": "TermsRead",
        "type": "object"
      },
      "ToggleChangeResponse": {
        "description": "One governed-intake toggle flip from the audit trail.",
        "properties": {
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "The AFTER state (true = turned ON). null only for a malformed audit payload (surfaced, never guessed).",
            "title": "Enabled"
          },
          "occurred_at": {
            "description": "UTC ISO-8601 timestamp of the change.",
            "title": "Occurred At",
            "type": "string"
          },
          "tenant_id": {
            "description": "Tenant whose admin flipped the toggle.",
            "title": "Tenant Id",
            "type": "string"
          }
        },
        "required": [
          "occurred_at",
          "tenant_id"
        ],
        "title": "ToggleChangeResponse",
        "type": "object"
      },
      "TokenResponse": {
        "description": "RFC 6749 §5.1 access-token response (client-credentials — no refresh).",
        "properties": {
          "access_token": {
            "title": "Access Token",
            "type": "string"
          },
          "expires_in": {
            "description": "Token lifetime in seconds.",
            "title": "Expires In",
            "type": "integer"
          },
          "scope": {
            "description": "Space-delimited granted scopes.",
            "title": "Scope",
            "type": "string"
          },
          "token_type": {
            "default": "Bearer",
            "title": "Token Type",
            "type": "string"
          }
        },
        "required": [
          "access_token",
          "expires_in",
          "scope"
        ],
        "title": "TokenResponse",
        "type": "object"
      },
      "UnexposeResponse": {
        "properties": {
          "already_disabled": {
            "default": false,
            "title": "Already Disabled",
            "type": "boolean"
          },
          "exposed": {
            "title": "Exposed",
            "type": "boolean"
          },
          "revoked_key_count": {
            "title": "Revoked Key Count",
            "type": "integer"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "exposed",
          "revoked_key_count"
        ],
        "title": "UnexposeResponse",
        "type": "object"
      },
      "UsageByNetworkResponse": {
        "description": "One row of the per-network rollup.",
        "properties": {
          "artifactsNotStored": {
            "default": 0,
            "description": "Of artifactsTotal, the evidence packs whose file is not stored: still waiting to be stored (retried every five minutes), refused because a different file already holds its place, or a custom agent's file that was not written. The rest of artifactsTotal were sealed before storage outcomes were recorded, so whether their file is stored is not known.",
            "title": "Artifactsnotstored",
            "type": "integer"
          },
          "artifactsStored": {
            "default": 0,
            "description": "Of artifactsTotal, the evidence packs whose file is confirmed stored.",
            "title": "Artifactsstored",
            "type": "integer"
          },
          "artifactsTotal": {
            "description": "All-time evidence packs produced by this pack's runs — the metered runs whose evidence pack is sealed on the run record (or recorded by a custom agent), whether or not its file has been stored yet. A pack with runs that produced evidence reads >= 1.",
            "title": "Artifactstotal",
            "type": "integer"
          },
          "lastRunAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "UTC ISO-8601 of the most recent run, or null if never run.",
            "title": "Lastrunat"
          },
          "networkPack": {
            "description": "The NetworkPack slug.",
            "title": "Networkpack",
            "type": "string"
          },
          "runsThisMonth": {
            "description": "Metered invocations of this pack in the current month.",
            "title": "Runsthismonth",
            "type": "integer"
          }
        },
        "required": [
          "networkPack",
          "runsThisMonth",
          "artifactsTotal"
        ],
        "title": "UsageByNetworkResponse",
        "type": "object"
      },
      "UsageQuotaResponse": {
        "description": "Monthly run-limit block for the dashboard.",
        "properties": {
          "currentUsage": {
            "description": "Metered invocations this month.",
            "title": "Currentusage",
            "type": "integer"
          },
          "maxRunsPerMonth": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Monthly governed-run limit. null when unlimited or not set.",
            "title": "Maxrunspermonth"
          },
          "percentUsed": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "currentUsage / maxRunsPerMonth * 100. null when unlimited.",
            "title": "Percentused"
          },
          "resetDate": {
            "description": "UTC ISO-8601 instant the monthly counter resets.",
            "title": "Resetdate",
            "type": "string"
          }
        },
        "required": [
          "currentUsage",
          "resetDate"
        ],
        "title": "UsageQuotaResponse",
        "type": "object"
      },
      "UsageRollupResponse": {
        "description": "The dashboard usage rollup (canonical camelCase wire shape).",
        "properties": {
          "agentRunsCount": {
            "description": "Total metered invocations this month (all packs).",
            "title": "Agentrunscount",
            "type": "integer"
          },
          "byNetwork": {
            "description": "Per-pack rollup, runs-desc then slug-asc.",
            "items": {
              "$ref": "#/components/schemas/UsageByNetworkResponse"
            },
            "title": "Bynetwork",
            "type": "array"
          },
          "integrationsConnected": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Connectors the workspace has connected and not revoked. null when the metric is not tracked — render as a dash, never as 0.",
            "title": "Integrationsconnected"
          },
          "period": {
            "description": "Calendar month the counts cover (YYYY-MM).",
            "title": "Period",
            "type": "string"
          },
          "quota": {
            "$ref": "#/components/schemas/UsageQuotaResponse"
          },
          "seatsUsed": {
            "description": "Distinct users in the tenant.",
            "title": "Seatsused",
            "type": "integer"
          },
          "storageBytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Bytes of uploaded source documents the workspace holds (run_attachments, stored rows). null when the metric is not tracked — render as a dash, never as 0.",
            "title": "Storagebytes"
          }
        },
        "required": [
          "period",
          "agentRunsCount",
          "seatsUsed",
          "integrationsConnected",
          "storageBytes",
          "quota"
        ],
        "title": "UsageRollupResponse",
        "type": "object"
      },
      "UserAdminList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/UserAdminRow"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "UserAdminList",
        "type": "object"
      },
      "UserAdminRow": {
        "description": "One row in the admin per-tenant user-list view.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "last_seen_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Seen At"
          },
          "role": {
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "display_name",
          "role",
          "created_at",
          "last_seen_at"
        ],
        "title": "UserAdminRow",
        "type": "object"
      },
      "UserContextResponse": {
        "description": "Result returned to the pre-token-gen Lambda (logged in CloudWatch; never\nuser-facing).\n\n``network_roles`` is the ``{network_pack: role}`` map for the user's ACTIVE\nmemberships (possibly empty). The Lambda serializes it to the\n``custom:network_roles`` JWT claim shape (a JSON string) so tenant_scope reads\nit exactly as it would from a token minted for an invited user.",
        "properties": {
          "network_roles": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Network Roles",
            "type": "object"
          },
          "tenant_id": {
            "title": "Tenant Id",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "tenant_id",
          "user_id",
          "network_roles"
        ],
        "title": "UserContextResponse",
        "type": "object"
      },
      "UserCreate": {
        "properties": {
          "cognito_sub": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Cognito Sub",
            "type": "string"
          },
          "display_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "role": {
            "default": "member",
            "maxLength": 32,
            "pattern": "^(owner|admin|supervisor|member|practitioner|viewer|auditor)$",
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "email",
          "cognito_sub"
        ],
        "title": "UserCreate",
        "type": "object"
      },
      "UserList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/UserRead"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "UserList",
        "type": "object"
      },
      "UserRead": {
        "properties": {
          "cognito_sub": {
            "title": "Cognito Sub",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "last_seen_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Seen At"
          },
          "role": {
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "cognito_sub",
          "role",
          "display_name",
          "last_seen_at",
          "created_at"
        ],
        "title": "UserRead",
        "type": "object"
      },
      "UserUpdate": {
        "properties": {
          "display_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "role": {
            "anyOf": [
              {
                "maxLength": 32,
                "pattern": "^(owner|admin|supervisor|member|practitioner|viewer|auditor)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          }
        },
        "title": "UserUpdate",
        "type": "object"
      },
      "ValidationAttemptRead": {
        "properties": {
          "actor_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor User Id"
          },
          "citations": {
            "additionalProperties": true,
            "title": "Citations",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "current": {
            "title": "Current",
            "type": "boolean"
          },
          "event": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event"
          },
          "evidence_mode": {
            "enum": [
              "real",
              "synthetic"
            ],
            "title": "Evidence Mode",
            "type": "string"
          },
          "field_checks": {
            "$ref": "#/components/schemas/FieldChecksRead"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "method": {
            "anyOf": [
              {
                "enum": [
                  "human_attested",
                  "connector_verified"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          },
          "state": {
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "id",
          "state",
          "method",
          "evidence_mode",
          "event",
          "field_checks",
          "citations",
          "actor_user_id",
          "reason",
          "created_at",
          "current"
        ],
        "title": "ValidationAttemptRead",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "ValidationRequest": {
        "additionalProperties": false,
        "properties": {
          "basis_revision_id": {
            "format": "uuid",
            "title": "Basis Revision Id",
            "type": "string"
          },
          "candidate_revision_id": {
            "format": "uuid",
            "title": "Candidate Revision Id",
            "type": "string"
          },
          "expected_version": {
            "minimum": 1.0,
            "title": "Expected Version",
            "type": "integer"
          },
          "policy_revision_id": {
            "format": "uuid",
            "title": "Policy Revision Id",
            "type": "string"
          }
        },
        "required": [
          "candidate_revision_id",
          "basis_revision_id",
          "policy_revision_id",
          "expected_version"
        ],
        "title": "ValidationRequest",
        "type": "object",
        "x-max-serialized-bytes": 6144
      },
      "VerdictResolutionCellResponse": {
        "description": "One cell of the run-verdict vs recorded-reality cross-tab.",
        "properties": {
          "cases": {
            "description": "Resolved cases in-window falling in this cell.",
            "title": "Cases",
            "type": "integer"
          },
          "final_verdict": {
            "description": "The newest run's own quality verdict at the time the case was resolved — the platform's self-assessment of its work product ('met' / 'partial' / 'incomplete'; 'not_scored' when the newest run was never measured or the case had no runs).",
            "title": "Final Verdict",
            "type": "string"
          },
          "resolution_outcome": {
            "description": "The real-world result a person recorded when closing the case.",
            "title": "Resolution Outcome",
            "type": "string"
          }
        },
        "required": [
          "final_verdict",
          "resolution_outcome",
          "cases"
        ],
        "title": "VerdictResolutionCellResponse",
        "type": "object"
      },
      "VoiceBookingList": {
        "description": "A tenant's voice bookings, newest first.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/VoiceBookingRead"
            },
            "title": "Items",
            "type": "array"
          }
        },
        "title": "VoiceBookingList",
        "type": "object"
      },
      "VoiceBookingRead": {
        "description": "One persisted voice booking.\n\nThe captured caller fields (``caller_name`` / ``caller_phone`` / ``vehicle``\n/ ``requested_service`` / ``requested_time``) are OPTIONAL: reliable\nstructured capture is a planned enhancement, so they may be null for a\nbooking taken today. ``confirmation_text`` is the\nspoken confirmation the caller heard, and ``status`` is the shop's review\nstate (``pending_review`` on a fresh booking).",
        "properties": {
          "call_id": {
            "description": "The voice_calls id this booking was confirmed on.",
            "format": "uuid",
            "title": "Call Id",
            "type": "string"
          },
          "caller_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Caller name (may be null).",
            "title": "Caller Name"
          },
          "caller_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Caller phone / callback number (may be null).",
            "title": "Caller Phone"
          },
          "confirmation_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The spoken confirmation the caller heard.",
            "title": "Confirmation Text"
          },
          "created_at": {
            "description": "When the booking was persisted.",
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "did": {
            "description": "The dialed tenant line (E.164).",
            "title": "Did",
            "type": "string"
          },
          "id": {
            "description": "The booking row's UUID.",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "requested_service": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Best-effort requested service (may be null).",
            "title": "Requested Service"
          },
          "requested_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Best-effort requested time, free-text (may be null).",
            "title": "Requested Time"
          },
          "status": {
            "description": "Review state: pending_review|confirmed|cancelled.",
            "title": "Status",
            "type": "string"
          },
          "vehicle": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Vehicle description (may be null).",
            "title": "Vehicle"
          }
        },
        "required": [
          "id",
          "call_id",
          "did",
          "status",
          "created_at"
        ],
        "title": "VoiceBookingRead",
        "type": "object"
      },
      "VoiceLeadList": {
        "description": "A tenant's voice leads, newest first.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/VoiceLeadRead"
            },
            "title": "Items",
            "type": "array"
          }
        },
        "title": "VoiceLeadList",
        "type": "object"
      },
      "VoiceLeadRead": {
        "description": "One captured voice lead.\n\nThe captured caller fields (``caller_name`` / ``caller_phone`` /\n``intent_service`` / ``verbatim_ask``) are OPTIONAL best-effort capture —\nthe presented caller id is reliable, a spoken name is a planned enhancement.\n``reason`` records why the lead was captured (``withheld`` | ``take_message``\n| ``out_of_scope`` | ``transfer_unavailable`` | ``mid_call_hangup``);\n``status`` is the shop's review state (``new`` on a fresh lead).",
        "properties": {
          "call_id": {
            "description": "The voice_calls id this lead was captured on.",
            "format": "uuid",
            "title": "Call Id",
            "type": "string"
          },
          "caller_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Caller name (may be null).",
            "title": "Caller Name"
          },
          "caller_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Caller phone / callback number (may be null).",
            "title": "Caller Phone"
          },
          "created_at": {
            "description": "When the lead was captured.",
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "did": {
            "description": "The dialed tenant line (E.164).",
            "title": "Did",
            "type": "string"
          },
          "governance_reasons": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Governance reasons when reason=='withheld' (may be null).",
            "title": "Governance Reasons"
          },
          "id": {
            "description": "The lead row's UUID.",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "intent_service": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Best-effort 'what they wanted' (may be null).",
            "title": "Intent Service"
          },
          "reason": {
            "description": "Why the lead was captured: withheld|take_message|out_of_scope|transfer_unavailable|mid_call_hangup.",
            "title": "Reason",
            "type": "string"
          },
          "status": {
            "description": "Review state: new|reviewed.",
            "title": "Status",
            "type": "string"
          },
          "updated_at": {
            "description": "When the lead was last enriched/updated.",
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "verbatim_ask": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The caller's raw request, verbatim (may be null).",
            "title": "Verbatim Ask"
          }
        },
        "required": [
          "id",
          "call_id",
          "did",
          "reason",
          "status",
          "created_at",
          "updated_at"
        ],
        "title": "VoiceLeadRead",
        "type": "object"
      },
      "VoiceLeadStatusUpdate": {
        "description": "The review-state transition body (mark reviewed / back to new).",
        "properties": {
          "status": {
            "description": "The review state to set: 'reviewed' (worked) or 'new' (reopen).",
            "enum": [
              "new",
              "reviewed"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "VoiceLeadStatusUpdate",
        "type": "object"
      },
      "VoiceLineConfigRead": {
        "description": "A line's current typed config + which apply produced it.\n\n``version``/``source``/``applied_at`` are null for a line provisioned\nbefore versioning existed (migration 071) whose config was rebuilt from the\nlive runtime triad — its FIRST edit starts the history at version 1.",
        "properties": {
          "applied_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Applied At"
          },
          "config": {
            "$ref": "#/components/schemas/VoicedeskConfig"
          },
          "did": {
            "title": "Did",
            "type": "string"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          }
        },
        "required": [
          "did",
          "config"
        ],
        "title": "VoiceLineConfigRead",
        "type": "object"
      },
      "VoiceLineConfigUpdate": {
        "additionalProperties": false,
        "description": "The editor's apply body — the full typed config, re-validated whole.\n\nDeliberately the WHOLE config (not a patch): the editor renders every area,\nand validating the complete shape through the intake contract leaves no\npartially-checked state. ``extra='forbid'`` on every nested model rejects\nunknown fields loudly.",
        "properties": {
          "config": {
            "$ref": "#/components/schemas/VoicedeskConfig"
          }
        },
        "required": [
          "config"
        ],
        "title": "VoiceLineConfigUpdate",
        "type": "object"
      },
      "VoiceLineConfigVersionList": {
        "description": "A line's apply history, newest first.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/VoiceLineConfigVersionRead"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "VoiceLineConfigVersionList",
        "type": "object"
      },
      "VoiceLineConfigVersionRead": {
        "description": "One append-only history row: what was applied, when, by whom, and how.",
        "properties": {
          "applied_at": {
            "format": "date-time",
            "title": "Applied At",
            "type": "string"
          },
          "applied_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Applied By User Id"
          },
          "config": {
            "$ref": "#/components/schemas/VoicedeskConfig"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "source",
          "applied_at",
          "config"
        ],
        "title": "VoiceLineConfigVersionRead",
        "type": "object"
      },
      "VoiceLineList": {
        "description": "List response for the voice-lines surface. Newest line first.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/VoiceLineSummary"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "VoiceLineList",
        "type": "object"
      },
      "VoiceLineSuggestion": {
        "description": "One improvement suggestion for a line, with its countable evidence.\n\n``kind`` is a stable machine token (``add_service`` | ``add_price`` |\n``shorter_greeting`` | ``ask_callback_number``) the client maps to the\nrelevant edit section; ``message`` is fixed plain customer language;\n``evidence_count`` is how many calls in the window showed the signal, and\n``since`` is when the earliest of them happened.",
        "properties": {
          "evidence_count": {
            "description": "How many recent calls showed this signal.",
            "title": "Evidence Count",
            "type": "integer"
          },
          "kind": {
            "description": "Stable suggestion token: add_service | add_price | shorter_greeting | ask_callback_number.",
            "title": "Kind",
            "type": "string"
          },
          "message": {
            "description": "The suggestion, in plain customer language.",
            "title": "Message",
            "type": "string"
          },
          "since": {
            "description": "When the earliest supporting call happened.",
            "format": "date-time",
            "title": "Since",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "message",
          "evidence_count",
          "since"
        ],
        "title": "VoiceLineSuggestion",
        "type": "object"
      },
      "VoiceLineSuggestionList": {
        "description": "The line's current suggestions (strongest evidence first).",
        "properties": {
          "calls_analyzed": {
            "title": "Calls Analyzed",
            "type": "integer"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/VoiceLineSuggestion"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "calls_analyzed"
        ],
        "title": "VoiceLineSuggestionList",
        "type": "object"
      },
      "VoiceLineSummary": {
        "description": "One provisioned voice line (a ``voice_numbers`` row), config-enriched.\n\n``shop_name`` / ``open_items`` are derived from the reception config (see the\nmodule docstring); both may be null / empty for a hand-seeded line whose blob\ncarries neither. ``status`` is a customer-facing token (:data:`STATUS_LABELS`\nmaps it to a display string); ``status_label`` is that display string, carried\non the row so the client never has to re-derive it.",
        "properties": {
          "config": {
            "additionalProperties": true,
            "title": "Config",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "did": {
            "title": "Did",
            "type": "string"
          },
          "enabled": {
            "title": "Enabled",
            "type": "boolean"
          },
          "escalation_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Escalation Number"
          },
          "greeting_override": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Greeting Override"
          },
          "open_items": {
            "items": {
              "type": "string"
            },
            "title": "Open Items",
            "type": "array"
          },
          "pack_slug": {
            "title": "Pack Slug",
            "type": "string"
          },
          "shop_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shop Name"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "status_label": {
            "title": "Status Label",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "did",
          "shop_name",
          "pack_slug",
          "enabled",
          "status",
          "status_label",
          "created_at",
          "updated_at"
        ],
        "title": "VoiceLineSummary",
        "type": "object"
      },
      "VoiceTestBookingPreview": {
        "description": "What the booking row WOULD have carried — never actually written.\n\nMirrors the fields the webhook's ``_persist_booking`` fills, including the\nconfirmed slots (name / callback number / service / time), so the console\nshows exactly the structured record a real call would leave.",
        "properties": {
          "caller_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The confirmed caller name (may be null).",
            "title": "Caller Name"
          },
          "caller_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The confirmed callback number (may be null).",
            "title": "Caller Phone"
          },
          "confirmation_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The spoken confirmation the caller would have heard.",
            "title": "Confirmation Text"
          },
          "requested_service": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The confirmed service (falls back to the raw test utterance).",
            "title": "Requested Service"
          },
          "requested_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The confirmed time, verbatim natural language (may be null).",
            "title": "Requested Time"
          }
        },
        "title": "VoiceTestBookingPreview",
        "type": "object"
      },
      "VoiceTestLeadPreview": {
        "description": "What the lead row WOULD have carried — never actually written.\n\nMirrors the fields the webhook's ``_persist_lead`` fills, including the\nconfirmed slots.",
        "properties": {
          "callback_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The confirmed callback number (may be null).",
            "title": "Callback Number"
          },
          "caller_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The confirmed caller name (may be null).",
            "title": "Caller Name"
          },
          "intent_service": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Best-effort 'what they wanted' (confirmed slot, else the raw ask).",
            "title": "Intent Service"
          },
          "reason": {
            "description": "Why a lead would be captured: withheld|take_message|out_of_scope.",
            "title": "Reason",
            "type": "string"
          },
          "verbatim_ask": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The caller's raw request, verbatim.",
            "title": "Verbatim Ask"
          }
        },
        "required": [
          "reason"
        ],
        "title": "VoiceTestLeadPreview",
        "type": "object"
      },
      "VoiceTestTurnRequest": {
        "additionalProperties": false,
        "description": "One typed test utterance for the console.",
        "properties": {
          "message": {
            "maxLength": 2000,
            "minLength": 1,
            "title": "Message",
            "type": "string"
          },
          "test_call_ref": {
            "anyOf": [
              {
                "maxLength": 128,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Test Call Ref"
          }
        },
        "required": [
          "message"
        ],
        "title": "VoiceTestTurnRequest",
        "type": "object"
      },
      "VoiceTestTurnResponse": {
        "description": "The governed outcome of one test turn, clearly labeled as test.",
        "properties": {
          "action": {
            "title": "Action",
            "type": "string"
          },
          "governance_outcome": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Governance Outcome"
          },
          "governance_reasons": {
            "items": {
              "type": "string"
            },
            "title": "Governance Reasons",
            "type": "array"
          },
          "is_test": {
            "default": true,
            "title": "Is Test",
            "type": "boolean"
          },
          "reply": {
            "title": "Reply",
            "type": "string"
          },
          "test_call_ref": {
            "title": "Test Call Ref",
            "type": "string"
          },
          "turn_index": {
            "title": "Turn Index",
            "type": "integer"
          },
          "withheld": {
            "title": "Withheld",
            "type": "boolean"
          },
          "would_persist": {
            "$ref": "#/components/schemas/VoiceTestWouldPersist"
          }
        },
        "required": [
          "test_call_ref",
          "turn_index",
          "reply",
          "action",
          "withheld"
        ],
        "title": "VoiceTestTurnResponse",
        "type": "object"
      },
      "VoiceTestWouldPersist": {
        "description": "The would-have-persisted outcome of this test turn (nothing is saved).",
        "properties": {
          "booking": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VoiceTestBookingPreview"
              },
              {
                "type": "null"
              }
            ]
          },
          "lead": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VoiceTestLeadPreview"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "title": "VoiceTestWouldPersist",
        "type": "object"
      },
      "VoiceTurnResponse": {
        "description": "The agent's reply + next action for this turn.",
        "properties": {
          "action": {
            "title": "Action",
            "type": "string"
          },
          "call_id": {
            "title": "Call Id",
            "type": "string"
          },
          "ended": {
            "default": false,
            "title": "Ended",
            "type": "boolean"
          },
          "reply": {
            "title": "Reply",
            "type": "string"
          },
          "withheld": {
            "default": false,
            "title": "Withheld",
            "type": "boolean"
          }
        },
        "required": [
          "reply",
          "action",
          "call_id"
        ],
        "title": "VoiceTurnResponse",
        "type": "object"
      },
      "VoicedeskConfig": {
        "additionalProperties": false,
        "description": "The validated result of a voice-PRI intake conversation.\n\nSerializes into the ``voice_numbers`` runtime shape via\n:meth:`to_provisioning_kwargs`. Every PRI area is a nested model that the\nintake driver fills incrementally; ``open_items`` is the acceptance-bar list\nof anything the buyer could not answer — surfaced, never silently defaulted.",
        "properties": {
          "booking_rules": {
            "$ref": "#/components/schemas/BookingRules"
          },
          "greeting_and_escalation": {
            "$ref": "#/components/schemas/GreetingAndEscalation"
          },
          "hours_and_services": {
            "$ref": "#/components/schemas/HoursAndServices"
          },
          "open_item_kinds": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Open Item Kinds",
            "type": "object",
            "x-max-serialized-bytes": 8192
          },
          "open_items": {
            "items": {
              "maxLength": 2000,
              "type": "string"
            },
            "title": "Open Items",
            "type": "array"
          },
          "pack_slug": {
            "default": "voicedesk",
            "maxLength": 64,
            "title": "Pack Slug",
            "type": "string"
          },
          "pilot_scope": {
            "$ref": "#/components/schemas/PilotScope"
          },
          "spam_handling": {
            "$ref": "#/components/schemas/SpamHandling"
          }
        },
        "title": "VoicedeskConfig",
        "type": "object"
      },
      "VoidActionRequest": {
        "additionalProperties": false,
        "properties": {
          "expected_preparation_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Expected Preparation Sha256",
            "type": "string"
          },
          "reason": {
            "maxLength": 1000,
            "minLength": 1,
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "expected_preparation_sha256",
          "reason"
        ],
        "title": "VoidActionRequest",
        "type": "object"
      },
      "WebhookCreate": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "events": {
            "description": "Event names to subscribe to. Closed set: 'run.completed', 'evidence.ready'.",
            "items": {
              "maxLength": 128,
              "type": "string"
            },
            "maxItems": 16,
            "minItems": 1,
            "title": "Events",
            "type": "array"
          },
          "target_url": {
            "format": "uri",
            "maxLength": 2083,
            "minLength": 1,
            "title": "Target Url",
            "type": "string"
          }
        },
        "required": [
          "target_url",
          "events"
        ],
        "title": "WebhookCreate",
        "type": "object"
      },
      "WebhookCreateResponse": {
        "description": "Response shape includes the signing secret ONCE on creation.\n\nSecret is shown exactly one time. Storage: Secrets Manager (in real\ndeployment) or returned to the caller for self-storage.",
        "properties": {
          "signing_secret": {
            "description": "HMAC-SHA256 key. Stored ONCE; not retrievable later.",
            "title": "Signing Secret",
            "type": "string"
          },
          "webhook": {
            "$ref": "#/components/schemas/WebhookRead"
          }
        },
        "required": [
          "webhook",
          "signing_secret"
        ],
        "title": "WebhookCreateResponse",
        "type": "object"
      },
      "WebhookDeliveryList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/WebhookDeliveryRead"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "WebhookDeliveryList",
        "type": "object"
      },
      "WebhookDeliveryRead": {
        "description": "One per-attempt delivery record (secret-free).",
        "properties": {
          "attempt": {
            "title": "Attempt",
            "type": "integer"
          },
          "attempted_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Attempted At"
          },
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "event_id": {
            "format": "uuid",
            "title": "Event Id",
            "type": "string"
          },
          "event_type": {
            "title": "Event Type",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "next_retry_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Retry At"
          },
          "outcome": {
            "title": "Outcome",
            "type": "string"
          },
          "response_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Status"
          },
          "subscription_id": {
            "format": "uuid",
            "title": "Subscription Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "subscription_id",
          "event_id",
          "event_type",
          "attempt",
          "outcome",
          "response_status",
          "next_retry_at",
          "attempted_at",
          "completed_at"
        ],
        "title": "WebhookDeliveryRead",
        "type": "object"
      },
      "WebhookEventsList": {
        "description": "Response for ``GET /api/v2/webhooks/events`` — the subscribable set.\n\nSurfaces the closed event taxonomy so a client UI doesn't have to\nhard-code it. Additive, public-within-tenant discovery surface.",
        "properties": {
          "events": {
            "description": "Subscribable event wire-names.",
            "items": {
              "type": "string"
            },
            "title": "Events",
            "type": "array"
          }
        },
        "required": [
          "events"
        ],
        "title": "WebhookEventsList",
        "type": "object"
      },
      "WebhookList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/WebhookRead"
            },
            "title": "Items",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "title": "WebhookList",
        "type": "object"
      },
      "WebhookRead": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "title": "Events",
            "type": "array"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "target_url": {
            "title": "Target Url",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "target_url",
          "events",
          "status",
          "description",
          "created_at",
          "updated_at"
        ],
        "title": "WebhookRead",
        "type": "object"
      },
      "WebhookTestResult": {
        "description": "Response for ``POST /api/v2/webhooks/{id}/test``.",
        "properties": {
          "attempts": {
            "description": "Number of delivery attempts made (incl. retries).",
            "title": "Attempts",
            "type": "integer"
          },
          "delivered": {
            "description": "True iff the endpoint returned a 2xx.",
            "title": "Delivered",
            "type": "boolean"
          },
          "response_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "HTTP status the endpoint returned (None on transport error).",
            "title": "Response Status"
          },
          "webhook_id": {
            "format": "uuid",
            "title": "Webhook Id",
            "type": "string"
          }
        },
        "required": [
          "webhook_id",
          "delivered",
          "attempts"
        ],
        "title": "WebhookTestResult",
        "type": "object"
      },
      "WebhookUpdate": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "events": {
            "anyOf": [
              {
                "items": {
                  "maxLength": 128,
                  "type": "string"
                },
                "maxItems": 16,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Events"
          },
          "status": {
            "anyOf": [
              {
                "maxLength": 32,
                "pattern": "^(active|paused|failed)$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          }
        },
        "title": "WebhookUpdate",
        "type": "object"
      },
      "WidgetConfigRead": {
        "description": "Client gating config for the calling user's tenant.\n\nThe widget renders only when ``is_design_partner`` AND the feedback window is\nopen — the client makes the final decision from these server-provided fields.",
        "properties": {
          "feedback_widget": {
            "$ref": "#/components/schemas/FeedbackWidgetConfigRead"
          },
          "is_design_partner": {
            "description": "True when the caller's tenant is flagged a design partner.",
            "title": "Is Design Partner",
            "type": "boolean"
          }
        },
        "required": [
          "is_design_partner",
          "feedback_widget"
        ],
        "title": "WidgetConfigRead",
        "type": "object"
      },
      "WithdrawRequest": {
        "additionalProperties": false,
        "properties": {
          "expected_revision": {
            "minimum": 1.0,
            "title": "Expected Revision",
            "type": "integer"
          },
          "reason": {
            "maxLength": 1000,
            "minLength": 12,
            "title": "Reason",
            "type": "string"
          },
          "scope_id": {
            "format": "uuid",
            "title": "Scope Id",
            "type": "string"
          }
        },
        "required": [
          "scope_id",
          "expected_revision",
          "reason"
        ],
        "title": "WithdrawRequest",
        "type": "object"
      },
      "WorkActionList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/WorkActionRow"
            },
            "title": "Items",
            "type": "array"
          },
          "mode": {
            "enum": [
              "actions",
              "cases"
            ],
            "title": "Mode",
            "type": "string"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "observed_at": {
            "format": "date-time",
            "title": "Observed At",
            "type": "string"
          },
          "priority_as_of": {
            "format": "date-time",
            "title": "Priority As Of",
            "type": "string"
          },
          "summary": {
            "$ref": "#/components/schemas/WorkActionSummary"
          }
        },
        "required": [
          "observed_at",
          "priority_as_of",
          "mode",
          "items",
          "summary",
          "next_cursor"
        ],
        "title": "WorkActionList",
        "type": "object"
      },
      "WorkActionRow": {
        "description": "A contribution, or a case row in case mode. Permission is current read advice.\n\nA case row intentionally carries no representative person or action: it may\nhave several independent contributions. Read its contributions by case_id.",
        "properties": {
          "card": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApprovalCardRead"
              },
              {
                "type": "null"
              }
            ],
            "description": "Request rows only, and only for a journey step that opts in to set approval, shown to a person who may approve that step: its approval card, built from computed facts. Absent on every other row."
          },
          "case_group": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Group"
          },
          "case_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Id"
          },
          "case_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Ref"
          },
          "case_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Status"
          },
          "case_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Title"
          },
          "clock_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Clock Id"
          },
          "contribution_count": {
            "minimum": 0.0,
            "title": "Contribution Count",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "deadline_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deadline At"
          },
          "deadline_basis": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deadline Basis"
          },
          "deadline_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deadline Source"
          },
          "deadline_state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deadline State"
          },
          "journey_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Journey Id"
          },
          "key": {
            "title": "Key",
            "type": "string"
          },
          "kind": {
            "enum": [
              "approval",
              "request",
              "pause",
              "case"
            ],
            "title": "Kind",
            "type": "string"
          },
          "offer_expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Offer Expires At"
          },
          "pack_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pack Slug"
          },
          "permitted_actions": {
            "items": {
              "type": "string"
            },
            "title": "Permitted Actions",
            "type": "array"
          },
          "required_role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Required Role"
          },
          "responsibility": {
            "enum": [
              "offered",
              "accepted",
              "unassigned",
              "reviewer_needed",
              "no_eligible_reviewer",
              "connector",
              "time",
              "unknown",
              "none"
            ],
            "title": "Responsibility",
            "type": "string"
          },
          "responsible_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Responsible User Id"
          },
          "review_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Opaque continuation after this row in the same filtered ordering, even if the row later disappears.",
            "title": "Review Cursor"
          },
          "revision_needed": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StepRevisionRead"
              },
              {
                "type": "null"
              }
            ],
            "description": "Case rows only: the case's workflow step waits on a revision because the sign-off on its held run was returned with notes or expired. The same reading as the step on the case's workflow. Null otherwise."
          },
          "run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "source_id": {
            "format": "uuid",
            "title": "Source Id",
            "type": "string"
          },
          "source_status": {
            "title": "Source Status",
            "type": "string"
          },
          "stage_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stage Key"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "unrouted_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unrouted Reason"
          },
          "viewer_relationship": {
            "enum": [
              "offered_to_you",
              "accepted_by_you",
              "eligible_review",
              "withdrawal_only",
              "none"
            ],
            "title": "Viewer Relationship",
            "type": "string"
          },
          "waiting_basis": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Waiting Basis"
          },
          "waiting_since": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Waiting Since"
          }
        },
        "required": [
          "key",
          "kind",
          "source_id",
          "case_id",
          "case_ref",
          "case_title",
          "case_status",
          "pack_slug",
          "source_status",
          "responsibility",
          "viewer_relationship",
          "permitted_actions",
          "created_at",
          "contribution_count"
        ],
        "title": "WorkActionRow",
        "type": "object"
      },
      "WorkActionSummary": {
        "description": "Complete filtered counts, never page lengths. Categories may overlap.\n\nApproval gates, operational requests and current asks count once per source.\nCases/lifecycle cover the whole filtered case cohort, including cases without\nan open contribution in all/all view. Contribution_cases deduplicates the\ncases with selected contributions; standalone approvals have no invented case.\nMy offers/accepted work and\nreview eligibility are different subsets; team requests are not assigned.",
        "properties": {
          "accepted_by_you": {
            "minimum": 0.0,
            "title": "Accepted By You",
            "type": "integer"
          },
          "approvals": {
            "minimum": 0.0,
            "title": "Approvals",
            "type": "integer"
          },
          "cases": {
            "minimum": 0.0,
            "title": "Cases",
            "type": "integer"
          },
          "contribution_cases": {
            "minimum": 0.0,
            "title": "Contribution Cases",
            "type": "integer"
          },
          "contributions": {
            "minimum": 0.0,
            "title": "Contributions",
            "type": "integer"
          },
          "eligible_reviews": {
            "minimum": 0.0,
            "title": "Eligible Reviews",
            "type": "integer"
          },
          "groups": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Groups",
            "type": "object"
          },
          "lifecycle": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Lifecycle",
            "type": "object"
          },
          "no_eligible_reviewer": {
            "minimum": 0.0,
            "title": "No Eligible Reviewer",
            "type": "integer"
          },
          "offered_to_you": {
            "minimum": 0.0,
            "title": "Offered To You",
            "type": "integer"
          },
          "pauses": {
            "minimum": 0.0,
            "title": "Pauses",
            "type": "integer"
          },
          "requests": {
            "minimum": 0.0,
            "title": "Requests",
            "type": "integer"
          },
          "system_waits": {
            "minimum": 0.0,
            "title": "System Waits",
            "type": "integer"
          },
          "unassigned": {
            "minimum": 0.0,
            "title": "Unassigned",
            "type": "integer"
          },
          "unknown_responsibility": {
            "minimum": 0.0,
            "title": "Unknown Responsibility",
            "type": "integer"
          },
          "withdrawable": {
            "minimum": 0.0,
            "title": "Withdrawable",
            "type": "integer"
          }
        },
        "required": [
          "contributions",
          "cases",
          "contribution_cases",
          "approvals",
          "requests",
          "pauses",
          "offered_to_you",
          "accepted_by_you",
          "eligible_reviews",
          "withdrawable",
          "unassigned",
          "no_eligible_reviewer",
          "system_waits",
          "unknown_responsibility",
          "lifecycle"
        ],
        "title": "WorkActionSummary",
        "type": "object"
      },
      "WorkItemAgeBuckets": {
        "description": "How long open work items have been waiting — aging of the WORK itself.",
        "properties": {
          "four_to_twenty_four_hours": {
            "title": "Four To Twenty Four Hours",
            "type": "integer"
          },
          "one_to_four_hours": {
            "title": "One To Four Hours",
            "type": "integer"
          },
          "over_twenty_four_hours": {
            "title": "Over Twenty Four Hours",
            "type": "integer"
          },
          "under_one_hour": {
            "title": "Under One Hour",
            "type": "integer"
          }
        },
        "required": [
          "under_one_hour",
          "one_to_four_hours",
          "four_to_twenty_four_hours",
          "over_twenty_four_hours"
        ],
        "title": "WorkItemAgeBuckets",
        "type": "object"
      },
      "WorkItemCreated": {
        "description": "The created work item + the case status it produced.",
        "properties": {
          "case_status": {
            "description": "The case's status AFTER creation (needs_human).",
            "title": "Case Status",
            "type": "string"
          },
          "work_item": {
            "$ref": "#/components/schemas/WorkItemRead"
          }
        },
        "required": [
          "work_item",
          "case_status"
        ],
        "title": "WorkItemCreated",
        "type": "object"
      },
      "WorkItemDecided": {
        "description": "A terminal transition's result: the item + where the case landed.",
        "properties": {
          "case_status": {
            "description": "The case's status AFTER the transition.",
            "title": "Case Status",
            "type": "string"
          },
          "round_not_started": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A decision only: why the round it asked for did not start (its start was held for a person). The claim stays due, and the due-round job starts it once that person's item is done. Absent otherwise.",
            "title": "Round Not Started"
          },
          "work_item": {
            "$ref": "#/components/schemas/WorkItemRead"
          }
        },
        "required": [
          "work_item",
          "case_status"
        ],
        "title": "WorkItemDecided",
        "type": "object"
      },
      "WorkItemList": {
        "description": "The tenant worklist page: items + total under the active filter.",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/WorkItemRead"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "WorkItemList",
        "type": "object"
      },
      "WorkItemRead": {
        "description": "One work-item row, as surfaced on the worklist and detail endpoints.",
        "properties": {
          "card": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApprovalCardRead"
              },
              {
                "type": "null"
              }
            ],
            "description": "The detail read only: the approval card this item's request row carries on GET /api/v2/work-actions for the same viewer, its review conclusion first. A person sees it when the row offers complete_request (they may act on it now) and their role clears the step's declared tier. Absent on every other read and for every other item and viewer."
          },
          "case_id": {
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "case_prior_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Prior Status"
          },
          "case_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The quotable reference of the request's case (C-000123).",
            "title": "Case Ref"
          },
          "closed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Closed At"
          },
          "closed_by_credential": {
            "anyOf": [
              {
                "enum": [
                  "person",
                  "api_key",
                  "m2m",
                  "system"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Recorded closing credential class. Unknown on older records.",
            "title": "Closed By Credential"
          },
          "closed_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Closed By User Id"
          },
          "closure_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Closure Reason"
          },
          "context": {
            "additionalProperties": true,
            "title": "Context",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By User Id"
          },
          "crew_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The customer-facing name of the crew this request belongs to, resolved when it is read: the crew the request recorded, else its case's crew. Null when neither is a catalog crew.",
            "title": "Crew Label"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "invocation_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invocation Id"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "newer_files_since": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The detail read of an open item only: the day newer files for its case arrived that no round has read; the case's next round reads them. Absent when none wait and on every other read.",
            "title": "Newer Files Since"
          },
          "offer_expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Offer Expires At"
          },
          "offered_to_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Offered To User Id"
          },
          "pack_run_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pack Run Id"
          },
          "queue_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Queue Id"
          },
          "relaxation_level": {
            "title": "Relaxation Level",
            "type": "integer"
          },
          "required_skills": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Required Skills"
          },
          "routed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Routed At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "unrouted_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unrouted Reason"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "what_is_needed": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "What Is Needed"
          },
          "what_was_tried": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "What Was Tried"
          },
          "why_escalated": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Why Escalated"
          }
        },
        "required": [
          "id",
          "case_id",
          "kind",
          "status",
          "what_was_tried",
          "why_escalated",
          "what_is_needed",
          "pack_run_id",
          "invocation_id",
          "context",
          "case_prior_status",
          "created_by_user_id",
          "closed_by_user_id",
          "closed_at",
          "closure_reason",
          "queue_id",
          "required_skills",
          "relaxation_level",
          "routed_at",
          "offered_to_user_id",
          "offer_expires_at",
          "unrouted_reason",
          "created_at",
          "updated_at"
        ],
        "title": "WorkItemRead",
        "type": "object"
      },
      "WorkItemRouted": {
        "description": "Routing outcome: the item, plus whether an offer went out immediately.",
        "properties": {
          "offered": {
            "description": "True when a candidate was offered the item at once.",
            "title": "Offered",
            "type": "boolean"
          },
          "work_item": {
            "$ref": "#/components/schemas/WorkItemRead"
          }
        },
        "required": [
          "work_item",
          "offered"
        ],
        "title": "WorkItemRouted",
        "type": "object"
      },
      "WorkProductPreview": {
        "properties": {
          "basis": {
            "const": "interpreted_run_output",
            "default": "interpreted_run_output",
            "title": "Basis",
            "type": "string"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/WorkProductRow"
            },
            "title": "Rows",
            "type": "array"
          },
          "truncated": {
            "default": false,
            "title": "Truncated",
            "type": "boolean"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "title": "Warnings",
            "type": "array"
          }
        },
        "title": "WorkProductPreview",
        "type": "object"
      },
      "WorkProductRow": {
        "properties": {
          "attention": {
            "default": true,
            "title": "Attention",
            "type": "boolean"
          },
          "basis": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Basis"
          },
          "context": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context"
          },
          "identity": {
            "title": "Identity",
            "type": "string"
          },
          "key": {
            "title": "Key",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "next_step": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Step"
          },
          "position": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Position"
          },
          "sources": {
            "items": {
              "type": "string"
            },
            "title": "Sources",
            "type": "array"
          }
        },
        "required": [
          "key",
          "kind",
          "identity"
        ],
        "title": "WorkProductRow",
        "type": "object"
      },
      "WorkflowMapPhaseRead": {
        "description": "One workflow step: what the agent does, how it's governed, where it hands off.",
        "properties": {
          "agent_does": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the agent actually performs in this step, in one to three sentences. ``null`` when the pack has not published this step's disclosure yet.",
            "title": "Agent Does"
          },
          "derived_gates": {
            "description": "The enforcement-backed gates on this step, computed from the same safeguards a real run evaluates.",
            "items": {
              "$ref": "#/components/schemas/DerivedGateRead"
            },
            "title": "Derived Gates",
            "type": "array"
          },
          "display_name": {
            "description": "Step label shown in the UI.",
            "title": "Display Name",
            "type": "string"
          },
          "has_journey_stage": {
            "default": true,
            "description": "Whether the workflow this pack runs on a case has a stage behind this step. False for a step the pack declares that no stage realises — nothing starts it and nothing closes it, so a surface tracking a case's PROGRESS omits it rather than promising a beat that cannot arrive. The pack's own workflow map still renders it in full: the map is the declared contract, and it is complete. True for every step of a pack that declares no staged workflow at all.",
            "title": "Has Journey Stage",
            "type": "boolean"
          },
          "human_gates": {
            "description": "Where this step hands off to a person, as declared by the pack.",
            "items": {
              "$ref": "#/components/schemas/DeclaredHumanGateRead"
            },
            "title": "Human Gates",
            "type": "array"
          },
          "ordinal": {
            "description": "Sort order across steps.",
            "title": "Ordinal",
            "type": "integer"
          },
          "oversight_label": {
            "description": "Display label for the oversight mode.",
            "title": "Oversight Label",
            "type": "string"
          },
          "oversight_mode": {
            "description": "The step's baseline oversight mode, derived from the pack's declared governance (see the oversight-plan endpoint).",
            "title": "Oversight Mode",
            "type": "string"
          },
          "phase_slug": {
            "description": "The pack phase this entry describes.",
            "title": "Phase Slug",
            "type": "string"
          }
        },
        "required": [
          "phase_slug",
          "display_name",
          "ordinal",
          "oversight_mode",
          "oversight_label"
        ],
        "title": "WorkflowMapPhaseRead",
        "type": "object"
      },
      "WorkflowPhaseRead": {
        "description": "One step in a pack's automated workflow.\n\nThe ordered steps the pack works through on every case: the step's name,\nthe agents that act in it, and the work carried out before the next step\nbegins.",
        "properties": {
          "agent_refs": {
            "description": "The agents that act in this step, in activation order, each with its stable slug and shared-cast archetype. Parallel to ``agents``, which keeps the bare display names.",
            "items": {
              "$ref": "#/components/schemas/PhaseAgentRead"
            },
            "title": "Agent Refs",
            "type": "array"
          },
          "agents": {
            "description": "Display names of the agents that act in this step.",
            "items": {
              "type": "string"
            },
            "title": "Agents",
            "type": "array"
          },
          "display_name": {
            "description": "Step name shown in the UI.",
            "title": "Display Name",
            "type": "string"
          },
          "next_actions": {
            "description": "The work carried out in this step, in plain language.",
            "items": {
              "type": "string"
            },
            "title": "Next Actions",
            "type": "array"
          },
          "ordinal": {
            "description": "Sort order across the workflow's steps.",
            "title": "Ordinal",
            "type": "integer"
          },
          "phase_slug": {
            "description": "Stable identifier for the step.",
            "title": "Phase Slug",
            "type": "string"
          }
        },
        "required": [
          "phase_slug",
          "display_name",
          "ordinal"
        ],
        "title": "WorkflowPhaseRead",
        "type": "object"
      },
      "WorkspaceActionView": {
        "additionalProperties": false,
        "properties": {
          "action_id": {
            "format": "uuid",
            "title": "Action Id",
            "type": "string"
          },
          "can_authorize": {
            "title": "Can Authorize",
            "type": "boolean"
          },
          "can_launch": {
            "title": "Can Launch",
            "type": "boolean"
          },
          "current_route": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RouteOption"
              },
              {
                "type": "null"
              }
            ]
          },
          "filing_closed": {
            "default": false,
            "title": "Filing Closed",
            "type": "boolean"
          },
          "holds": {
            "items": {
              "$ref": "#/components/schemas/WorkspaceHold"
            },
            "title": "Holds",
            "type": "array"
          },
          "needs_completed_packet": {
            "title": "Needs Completed Packet",
            "type": "boolean"
          },
          "needs_reverification": {
            "title": "Needs Reverification",
            "type": "boolean"
          },
          "portal_session_reports": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/PortalSessionReport"
            },
            "title": "Portal Session Reports",
            "type": "array"
          },
          "portal_session_reports_has_more": {
            "default": false,
            "title": "Portal Session Reports Has More",
            "type": "boolean"
          },
          "preparation_sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Preparation Sha256",
            "type": "string"
          },
          "procedure_summary": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProcedureSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "resolution_groups": {
            "default": [],
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Resolution Groups",
            "type": "array"
          },
          "resolutions": {
            "default": [],
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Resolutions",
            "type": "array"
          },
          "resolutions_has_more": {
            "default": false,
            "title": "Resolutions Has More",
            "type": "boolean"
          },
          "route_current": {
            "title": "Route Current",
            "type": "boolean"
          },
          "route_history": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/RouteVersion"
            },
            "title": "Route History",
            "type": "array"
          },
          "route_history_has_more": {
            "default": false,
            "title": "Route History Has More",
            "type": "boolean"
          },
          "route_pin": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AssistedRoutePin"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "action_id",
          "preparation_sha256",
          "route_pin",
          "current_route",
          "route_current",
          "needs_reverification",
          "needs_completed_packet",
          "can_launch",
          "can_authorize",
          "holds"
        ],
        "title": "WorkspaceActionView",
        "type": "object"
      },
      "WorkspaceBrandingResponse": {
        "description": "Persisted workspace branding configuration returned after update.",
        "properties": {
          "branding_config": {
            "additionalProperties": true,
            "title": "Branding Config",
            "type": "object"
          },
          "workspace_id": {
            "format": "uuid",
            "title": "Workspace Id",
            "type": "string"
          }
        },
        "required": [
          "workspace_id"
        ],
        "title": "WorkspaceBrandingResponse",
        "type": "object"
      },
      "WorkspaceBrandingUpdateRequest": {
        "description": "Bounded partial update payload for workspace branding settings.",
        "properties": {
          "accent_color": {
            "anyOf": [
              {
                "maxLength": 7,
                "pattern": "^#[0-9A-Fa-f]{6}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accent Color"
          },
          "display_name": {
            "anyOf": [
              {
                "maxLength": 120,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "logo_url": {
            "anyOf": [
              {
                "maxLength": 512,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Url"
          },
          "tagline": {
            "anyOf": [
              {
                "maxLength": 160,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tagline"
          }
        },
        "title": "WorkspaceBrandingUpdateRequest",
        "type": "object"
      },
      "WorkspaceCase": {
        "additionalProperties": false,
        "properties": {
          "case_ref": {
            "title": "Case Ref",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "id",
          "case_ref",
          "title"
        ],
        "title": "WorkspaceCase",
        "type": "object"
      },
      "WorkspaceClientInviteRequest": {
        "description": "Bounded request payload for creating a client seat invite.",
        "properties": {
          "email": {
            "maxLength": 254,
            "minLength": 3,
            "title": "Email",
            "type": "string"
          },
          "seat_role": {
            "enum": [
              "client_executive",
              "client_reviewer"
            ],
            "title": "Seat Role",
            "type": "string"
          },
          "welcome_note": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Welcome Note"
          }
        },
        "required": [
          "email",
          "seat_role"
        ],
        "title": "WorkspaceClientInviteRequest",
        "type": "object"
      },
      "WorkspaceClientInviteResponse": {
        "description": "Structured receipt returned when a client seat invite is created.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "invite_id": {
            "format": "uuid",
            "title": "Invite Id",
            "type": "string"
          },
          "portal_path": {
            "title": "Portal Path",
            "type": "string"
          },
          "seat_role": {
            "enum": [
              "client_executive",
              "client_reviewer"
            ],
            "title": "Seat Role",
            "type": "string"
          },
          "status": {
            "const": "sent",
            "default": "sent",
            "title": "Status",
            "type": "string"
          },
          "workspace_id": {
            "format": "uuid",
            "title": "Workspace Id",
            "type": "string"
          }
        },
        "required": [
          "invite_id",
          "workspace_id",
          "email",
          "seat_role",
          "portal_path",
          "created_at"
        ],
        "title": "WorkspaceClientInviteResponse",
        "type": "object"
      },
      "WorkspaceCrewDescriptor": {
        "description": "Metadata describing an active Consultancy Blueprint or pivot-core crew.",
        "properties": {
          "blueprint_slug": {
            "title": "Blueprint Slug",
            "type": "string"
          },
          "crew_slug": {
            "title": "Crew Slug",
            "type": "string"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "execution_mode": {
            "enum": [
              "blueprint_direct",
              "agenticx_network"
            ],
            "title": "Execution Mode",
            "type": "string"
          },
          "invoke_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invoke Path"
          },
          "stage_names": {
            "items": {
              "type": "string"
            },
            "title": "Stage Names",
            "type": "array"
          },
          "status": {
            "const": "active",
            "default": "active",
            "title": "Status",
            "type": "string"
          },
          "supports_sample": {
            "default": false,
            "title": "Supports Sample",
            "type": "boolean"
          }
        },
        "required": [
          "crew_slug",
          "display_name",
          "blueprint_slug",
          "execution_mode"
        ],
        "title": "WorkspaceCrewDescriptor",
        "type": "object"
      },
      "WorkspaceCrewIngestRequest": {
        "description": "Request body for uploading and parsing a document for a workspace crew.",
        "properties": {
          "content_text": {
            "description": "Document content as plain text, CSV, EDI 835, or base64-encoded UTF-8.",
            "maxLength": 8000,
            "minLength": 1,
            "title": "Content Text",
            "type": "string"
          },
          "content_type": {
            "default": "text/plain",
            "description": "MIME content type of the uploaded document.",
            "maxLength": 120,
            "minLength": 1,
            "title": "Content Type",
            "type": "string"
          },
          "encoding": {
            "default": "plain",
            "description": "Encoding of content_text: plain UTF-8 text or base64.",
            "enum": [
              "plain",
              "base64"
            ],
            "title": "Encoding",
            "type": "string"
          },
          "filename": {
            "description": "Uploaded document filename.",
            "maxLength": 255,
            "minLength": 1,
            "title": "Filename",
            "type": "string"
          },
          "run_id": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional caller-supplied run identifier; deterministic hash used when omitted.",
            "title": "Run Id"
          }
        },
        "required": [
          "filename",
          "content_text"
        ],
        "title": "WorkspaceCrewIngestRequest",
        "type": "object"
      },
      "WorkspaceCrewIngestResponse": {
        "description": "Structured ingestion summary and optional live execution output for a crew document.",
        "properties": {
          "crew_slug": {
            "title": "Crew Slug",
            "type": "string"
          },
          "execution_output": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Execution Output"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "parsed_summary": {
            "additionalProperties": true,
            "title": "Parsed Summary",
            "type": "object"
          },
          "records_parsed": {
            "title": "Records Parsed",
            "type": "integer"
          },
          "run_id": {
            "title": "Run Id",
            "type": "string"
          },
          "workspace_id": {
            "format": "uuid",
            "title": "Workspace Id",
            "type": "string"
          }
        },
        "required": [
          "run_id",
          "workspace_id",
          "crew_slug",
          "filename",
          "records_parsed"
        ],
        "title": "WorkspaceCrewIngestResponse",
        "type": "object"
      },
      "WorkspaceCrewListResponse": {
        "description": "Listing of executable blueprint crews and active pivot-core slugs for a workspace.",
        "properties": {
          "crews": {
            "items": {
              "$ref": "#/components/schemas/WorkspaceCrewDescriptor"
            },
            "title": "Crews",
            "type": "array"
          },
          "workspace_id": {
            "format": "uuid",
            "title": "Workspace Id",
            "type": "string"
          }
        },
        "required": [
          "workspace_id"
        ],
        "title": "WorkspaceCrewListResponse",
        "type": "object"
      },
      "WorkspaceCrewRunRequest": {
        "description": "Request body for ``POST /api/v2/workspaces/{workspace_id}/crews/{crew_slug}/run``.",
        "properties": {
          "payload": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object",
                "x-max-serialized-bytes": 8192
              },
              {
                "type": "null"
              }
            ],
            "description": "Crew-specific structured input payload (bounded to 8 KiB edge cap).",
            "title": "Payload"
          },
          "run_id": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional caller-supplied run identifier; deterministic hash used when omitted.",
            "title": "Run Id"
          },
          "use_sample": {
            "default": false,
            "description": "When true, executes the crew with its built-in deterministic demo fixture instead of requiring a custom payload.",
            "title": "Use Sample",
            "type": "boolean"
          }
        },
        "title": "WorkspaceCrewRunRequest",
        "type": "object"
      },
      "WorkspaceCrewRunResponse": {
        "description": "Structured output returned after executing a Consultancy Blueprint crew.",
        "properties": {
          "crew_slug": {
            "title": "Crew Slug",
            "type": "string"
          },
          "execution_order": {
            "items": {
              "type": "string"
            },
            "title": "Execution Order",
            "type": "array"
          },
          "output": {
            "additionalProperties": true,
            "title": "Output",
            "type": "object"
          },
          "overall_status": {
            "title": "Overall Status",
            "type": "string"
          },
          "run_id": {
            "title": "Run Id",
            "type": "string"
          },
          "stages": {
            "additionalProperties": true,
            "title": "Stages",
            "type": "object"
          },
          "used_sample": {
            "title": "Used Sample",
            "type": "boolean"
          },
          "workspace_id": {
            "format": "uuid",
            "title": "Workspace Id",
            "type": "string"
          }
        },
        "required": [
          "run_id",
          "workspace_id",
          "crew_slug",
          "used_sample",
          "overall_status"
        ],
        "title": "WorkspaceCrewRunResponse",
        "type": "object"
      },
      "WorkspaceEnclosure": {
        "additionalProperties": false,
        "properties": {
          "artifact_id": {
            "format": "uuid",
            "title": "Artifact Id",
            "type": "string"
          },
          "attachment_id": {
            "format": "uuid",
            "title": "Attachment Id",
            "type": "string"
          },
          "byte_length": {
            "maximum": 26214400.0,
            "minimum": 1.0,
            "title": "Byte Length",
            "type": "integer"
          },
          "content_type": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Content Type",
            "type": "string"
          },
          "custody_version": {
            "maximum": 2147483647.0,
            "minimum": 1.0,
            "title": "Custody Version",
            "type": "integer"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Sha256",
            "type": "string"
          }
        },
        "required": [
          "attachment_id",
          "artifact_id",
          "sha256",
          "custody_version",
          "byte_length",
          "content_type",
          "filename"
        ],
        "title": "WorkspaceEnclosure",
        "type": "object"
      },
      "WorkspaceHold": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Code",
            "type": "string"
          },
          "message": {
            "maxLength": 512,
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "WorkspaceHold",
        "type": "object"
      },
      "WorkspaceListResponse": {
        "description": "Structured workspace + organization listing for the signed-in caller.",
        "properties": {
          "active_workspace_id": {
            "format": "uuid",
            "title": "Active Workspace Id",
            "type": "string"
          },
          "organizations": {
            "items": {
              "$ref": "#/components/schemas/OrganizationSummary"
            },
            "title": "Organizations",
            "type": "array"
          },
          "workspaces": {
            "items": {
              "$ref": "#/components/schemas/WorkspaceSummary"
            },
            "title": "Workspaces",
            "type": "array"
          }
        },
        "required": [
          "active_workspace_id"
        ],
        "title": "WorkspaceListResponse",
        "type": "object"
      },
      "WorkspacePrepareRequest": {
        "additionalProperties": false,
        "properties": {
          "action_kind": {
            "enum": [
              "reconsideration",
              "appeal",
              "resubmission"
            ],
            "title": "Action Kind",
            "type": "string"
          },
          "case_id": {
            "format": "uuid",
            "title": "Case Id",
            "type": "string"
          },
          "channel": {
            "const": "assisted_portal",
            "default": "assisted_portal",
            "title": "Channel",
            "type": "string"
          },
          "claim_keys": {
            "items": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^\\S(?:.*\\S)?$",
              "type": "string"
            },
            "maxItems": 20,
            "minItems": 1,
            "title": "Claim Keys",
            "type": "array"
          },
          "connector_input_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connector Input Attachment Id"
          },
          "connector_manifest_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connector Manifest Attachment Id"
          },
          "drafting_run_id": {
            "format": "uuid",
            "title": "Drafting Run Id",
            "type": "string"
          },
          "enclosure_attachment_ids": {
            "default": [],
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 20,
            "title": "Enclosure Attachment Ids",
            "type": "array"
          },
          "expected_connector_input_sha256": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 64,
                "pattern": "^[a-f0-9]{64}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Connector Input Sha256"
          },
          "expected_connector_manifest_sha256": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 64,
                "pattern": "^[a-f0-9]{64}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Connector Manifest Sha256"
          },
          "expected_final_packet_sha256": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 64,
                "pattern": "^[a-f0-9]{64}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Final Packet Sha256"
          },
          "expected_procedure_evidence_sha256": {
            "anyOf": [
              {
                "maxLength": 64,
                "minLength": 64,
                "pattern": "^[a-f0-9]{64}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Procedure Evidence Sha256"
          },
          "export_kind": {
            "enum": [
              "reconsideration-letters-pdf",
              "reconsideration-letters-docx",
              "formal-appeal-pdf",
              "formal-appeal-docx",
              "coding-reconsideration-pdf",
              "coding-reconsideration-docx",
              "paid-claim-correction-pdf",
              "paid-claim-correction-docx"
            ],
            "title": "Export Kind",
            "type": "string"
          },
          "final_packet_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Final Packet Attachment Id"
          },
          "final_packet_attestation": {
            "anyOf": [
              {
                "const": "completed_from_reviewed_template",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Final Packet Attestation"
          },
          "operation_key": {
            "format": "uuid",
            "title": "Operation Key",
            "type": "string"
          },
          "prior_action_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prior Action Id"
          },
          "procedure_evidence_attachment_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Procedure Evidence Attachment Id"
          },
          "procedure_stage": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Procedure Stage",
            "type": "string"
          },
          "route_selection": {
            "$ref": "#/components/schemas/RouteSelection"
          },
          "schema_version": {
            "const": "underpayments.action-preparation.v1",
            "default": "underpayments.action-preparation.v1",
            "title": "Schema Version",
            "type": "string"
          }
        },
        "required": [
          "operation_key",
          "action_kind",
          "procedure_stage",
          "claim_keys",
          "case_id",
          "drafting_run_id",
          "export_kind",
          "route_selection"
        ],
        "title": "WorkspacePrepareRequest",
        "type": "object"
      },
      "WorkspaceProcedureInput": {
        "additionalProperties": false,
        "properties": {
          "artifact_id": {
            "format": "uuid",
            "title": "Artifact Id",
            "type": "string"
          },
          "attachment_id": {
            "format": "uuid",
            "title": "Attachment Id",
            "type": "string"
          },
          "byte_length": {
            "maximum": 26214400.0,
            "minimum": 1.0,
            "title": "Byte Length",
            "type": "integer"
          },
          "content_type": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^\\S(?:.*\\S)?$",
            "title": "Content Type",
            "type": "string"
          },
          "custody_version": {
            "maximum": 2147483647.0,
            "minimum": 1.0,
            "title": "Custody Version",
            "type": "integer"
          },
          "filename": {
            "title": "Filename",
            "type": "string"
          },
          "provider_action": {
            "enum": [
              "formal_appeal",
              "coding_reconsideration",
              "paid_claim_correction"
            ],
            "title": "Provider Action",
            "type": "string"
          },
          "sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Sha256",
            "type": "string"
          }
        },
        "required": [
          "attachment_id",
          "artifact_id",
          "sha256",
          "custody_version",
          "byte_length",
          "content_type",
          "filename",
          "provider_action"
        ],
        "title": "WorkspaceProcedureInput",
        "type": "object"
      },
      "WorkspaceRouteOptions": {
        "additionalProperties": false,
        "properties": {
          "case": {
            "$ref": "#/components/schemas/WorkspaceCase"
          },
          "claims": {
            "items": {
              "$ref": "#/components/schemas/ClaimBinding"
            },
            "title": "Claims",
            "type": "array"
          },
          "customer_setup_requirements": {
            "default": [
              "Payer product and state",
              "Provider TIN, NPI, organization and service location",
              "Individual portal account, delegated role and permitted claim actions",
              "Customer owner for MFA and permission verification",
              "Official payer route and the required receipt or tracking artifact"
            ],
            "items": {
              "type": "string"
            },
            "title": "Customer Setup Requirements",
            "type": "array"
          },
          "drafting_run_id": {
            "format": "uuid",
            "title": "Drafting Run Id",
            "type": "string"
          },
          "export_options": {
            "items": {
              "enum": [
                "reconsideration-letters-pdf",
                "reconsideration-letters-docx"
              ],
              "type": "string"
            },
            "title": "Export Options",
            "type": "array"
          },
          "has_more": {
            "default": false,
            "title": "Has More",
            "type": "boolean"
          },
          "holds": {
            "items": {
              "$ref": "#/components/schemas/WorkspaceHold"
            },
            "title": "Holds",
            "type": "array"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/RouteOption"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "default": 50,
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "default": 0,
            "title": "Offset",
            "type": "integer"
          },
          "procedure_input_candidates": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/WorkspaceProcedureInput"
            },
            "maxItems": 20,
            "title": "Procedure Input Candidates",
            "type": "array"
          },
          "ready_to_prepare": {
            "title": "Ready To Prepare",
            "type": "boolean"
          },
          "required_enclosures": {
            "items": {
              "$ref": "#/components/schemas/WorkspaceEnclosure"
            },
            "title": "Required Enclosures",
            "type": "array"
          }
        },
        "required": [
          "case",
          "drafting_run_id",
          "claims",
          "required_enclosures",
          "export_options",
          "items",
          "holds",
          "ready_to_prepare"
        ],
        "title": "WorkspaceRouteOptions",
        "type": "object"
      },
      "WorkspaceSelectResponse": {
        "description": "Validated workspace descriptor returned after selecting an active workspace.",
        "properties": {
          "active_workspace_id": {
            "format": "uuid",
            "title": "Active Workspace Id",
            "type": "string"
          },
          "workspace": {
            "$ref": "#/components/schemas/WorkspaceSummary"
          }
        },
        "required": [
          "active_workspace_id",
          "workspace"
        ],
        "title": "WorkspaceSelectResponse",
        "type": "object"
      },
      "WorkspaceSummary": {
        "description": "Authorized workspace descriptor returned by the switcher API.",
        "properties": {
          "branding_config": {
            "additionalProperties": true,
            "title": "Branding Config",
            "type": "object"
          },
          "is_active": {
            "default": false,
            "title": "Is Active",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "organization_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Organization Id"
          },
          "organization_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Organization Name"
          },
          "organization_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Organization Slug"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "workspace_id": {
            "format": "uuid",
            "title": "Workspace Id",
            "type": "string"
          },
          "workspace_kind": {
            "description": "Workspace role within an organization: standard, practice, or client.",
            "title": "Workspace Kind",
            "type": "string"
          }
        },
        "required": [
          "workspace_id",
          "name",
          "slug",
          "workspace_kind",
          "role"
        ],
        "title": "WorkspaceSummary",
        "type": "object"
      },
      "WriteOffRequest": {
        "additionalProperties": false,
        "description": "Why the claim is written off.",
        "properties": {
          "note": {
            "description": "Why the claim is written off. Kept in the claim's history.",
            "maxLength": 2000,
            "minLength": 1,
            "title": "Note",
            "type": "string"
          }
        },
        "required": [
          "note"
        ],
        "title": "WriteOffRequest",
        "type": "object"
      },
      "WriteOffResult": {
        "description": "The claim as the write-off left it.",
        "properties": {
          "case_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The status of the claim's own case after the write-off: ``resolved`` when it was open, as it stood when it was already closed, and none for a claim with no case of its own.",
            "title": "Case Status"
          },
          "closed_on": {
            "format": "date",
            "title": "Closed On",
            "type": "string"
          },
          "closed_reason": {
            "title": "Closed Reason",
            "type": "string"
          },
          "register_id": {
            "format": "uuid",
            "title": "Register Id",
            "type": "string"
          },
          "round_count": {
            "title": "Round Count",
            "type": "integer"
          }
        },
        "required": [
          "register_id",
          "closed_reason",
          "closed_on",
          "round_count"
        ],
        "title": "WriteOffResult",
        "type": "object"
      },
      "velerian__api__routers__approvals__ApprovalList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/velerian__api__routers__approvals__ApprovalRead"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "ApprovalList",
        "type": "object"
      },
      "velerian__api__routers__approvals__ApprovalRead": {
        "properties": {
          "abp_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Abp Id"
          },
          "approver_tier_blocked": {
            "default": false,
            "title": "Approver Tier Blocked",
            "type": "boolean"
          },
          "constraint_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Constraint Ref"
          },
          "context_snapshot": {
            "additionalProperties": true,
            "title": "Context Snapshot",
            "type": "object"
          },
          "decided_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Decided At"
          },
          "decided_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Decided By User Id"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "invocation_id": {
            "format": "uuid",
            "title": "Invocation Id",
            "type": "string"
          },
          "may_withdraw": {
            "default": false,
            "title": "May Withdraw",
            "type": "boolean"
          },
          "no_eligible_approver": {
            "default": false,
            "title": "No Eligible Approver",
            "type": "boolean"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "requested_at": {
            "format": "date-time",
            "title": "Requested At",
            "type": "string"
          },
          "requested_by_user_id": {
            "format": "uuid",
            "title": "Requested By User Id",
            "type": "string"
          },
          "required_approver_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Required Approver Tier"
          },
          "self_approval_blocked": {
            "default": false,
            "title": "Self Approval Blocked",
            "type": "boolean"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "subject_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subject Id"
          },
          "subject_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": "invocation",
            "title": "Subject Type"
          }
        },
        "required": [
          "id",
          "invocation_id",
          "constraint_ref",
          "status",
          "requested_by_user_id",
          "requested_at",
          "decided_by_user_id",
          "decided_at",
          "reason",
          "context_snapshot"
        ],
        "title": "ApprovalRead",
        "type": "object"
      },
      "velerian__api__routers__approvals__DecideRequest": {
        "description": "Approve or reject a pending approval. ``reason`` is the approver's\nrationale (recorded on the row + the audit).",
        "properties": {
          "decision": {
            "enum": [
              "approve",
              "reject"
            ],
            "title": "Decision",
            "type": "string"
          },
          "reason": {
            "anyOf": [
              {
                "maxLength": 4000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "required": [
          "decision"
        ],
        "title": "DecideRequest",
        "type": "object"
      },
      "velerian__api__routers__completion_evidence__BasisRequest": {
        "additionalProperties": false,
        "properties": {
          "expected_version": {
            "minimum": 1.0,
            "title": "Expected Version",
            "type": "integer"
          },
          "explicit_confirmation": {
            "title": "Explicit Confirmation",
            "type": "boolean"
          },
          "field_citations": {
            "additionalProperties": true,
            "title": "Field Citations",
            "type": "object",
            "x-max-serialized-bytes": 6144
          },
          "fields": {
            "additionalProperties": true,
            "title": "Fields",
            "type": "object",
            "x-max-serialized-bytes": 6144
          },
          "reason": {
            "maxLength": 1000,
            "minLength": 12,
            "title": "Reason",
            "type": "string"
          },
          "source_purposes": {
            "additionalProperties": {
              "type": "string"
            },
            "maxProperties": 16,
            "title": "Source Purposes",
            "type": "object",
            "x-max-serialized-bytes": 4096
          },
          "source_revision_ids": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 16,
            "minItems": 1,
            "title": "Source Revision Ids",
            "type": "array"
          }
        },
        "required": [
          "expected_version",
          "source_revision_ids",
          "fields",
          "field_citations",
          "explicit_confirmation",
          "reason"
        ],
        "title": "BasisRequest",
        "type": "object",
        "x-max-serialized-bytes": 6144
      },
      "velerian__api__routers__completion_evidence__PolicyRequest": {
        "additionalProperties": false,
        "properties": {
          "allowed_completion_methods": {
            "items": {
              "enum": [
                "human_attested",
                "connector_verified"
              ],
              "type": "string"
            },
            "maxItems": 2,
            "minItems": 1,
            "title": "Allowed Completion Methods",
            "type": "array"
          },
          "expected_version": {
            "minimum": 1.0,
            "title": "Expected Version",
            "type": "integer"
          },
          "reason": {
            "maxLength": 1000,
            "minLength": 12,
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "expected_version",
          "allowed_completion_methods",
          "reason"
        ],
        "title": "PolicyRequest",
        "type": "object",
        "x-max-serialized-bytes": 6144
      },
      "velerian__api__routers__dsar__ExportResponse": {
        "description": "Self-service export envelope.\n\n``bundle`` is the full JSON-serializable portability bundle\n(:meth:`velerian.compliance.dsar.service.ExportBundle.to_dict`). The\n``request_id`` ties the export to its ``dsar_requests`` ledger row.",
        "properties": {
          "bundle": {
            "additionalProperties": true,
            "title": "Bundle",
            "type": "object"
          },
          "request_id": {
            "format": "uuid",
            "title": "Request Id",
            "type": "string"
          }
        },
        "required": [
          "request_id",
          "bundle"
        ],
        "title": "ExportResponse",
        "type": "object"
      },
      "velerian__api__routers__evidence__ExportResponse": {
        "description": "Return shape for every export endpoint.\n\n``delivery`` says how to fetch the file until ``expires_at``.\n``presigned``: ``download_url`` is a direct link to object storage.\n``stream``: the file is held encrypted under the workspace's own key, and\n``download_url`` is ``GET /api/v2/exports/{export_id}/content``, which needs\nthe caller's credentials and returns the file itself.",
        "properties": {
          "artifact_kind": {
            "title": "Artifact Kind",
            "type": "string"
          },
          "delivery": {
            "default": "presigned",
            "description": "'presigned': download_url is a short-lived direct link. 'stream': download_url is an API path that returns the file to an authenticated caller until expires_at.",
            "enum": [
              "presigned",
              "stream"
            ],
            "title": "Delivery",
            "type": "string"
          },
          "download_url": {
            "title": "Download Url",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          },
          "export_id": {
            "format": "uuid",
            "title": "Export Id",
            "type": "string"
          },
          "format": {
            "title": "Format",
            "type": "string"
          },
          "s3_key": {
            "title": "S3 Key",
            "type": "string"
          }
        },
        "required": [
          "artifact_kind",
          "export_id",
          "format",
          "s3_key",
          "download_url",
          "expires_at"
        ],
        "title": "ExportResponse",
        "type": "object"
      },
      "velerian__api__routers__governance__ApprovalList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/velerian__api__routers__governance__ApprovalRead"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "ApprovalList",
        "type": "object"
      },
      "velerian__api__routers__governance__ApprovalRead": {
        "properties": {
          "abp_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Abp Id"
          },
          "constraint_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Constraint Ref"
          },
          "decided_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Decided At"
          },
          "decided_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Decided By User Id"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "invocation_id": {
            "format": "uuid",
            "title": "Invocation Id",
            "type": "string"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "requested_at": {
            "format": "date-time",
            "title": "Requested At",
            "type": "string"
          },
          "requested_by_user_id": {
            "format": "uuid",
            "title": "Requested By User Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "invocation_id",
          "status",
          "requested_by_user_id",
          "requested_at",
          "decided_by_user_id",
          "decided_at",
          "reason"
        ],
        "title": "ApprovalRead",
        "type": "object"
      },
      "velerian__api__routers__packet_release__BasisRequest": {
        "additionalProperties": false,
        "properties": {
          "candidate_id": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "title": "Candidate Id",
            "type": "string"
          },
          "expected_revision": {
            "minimum": 0.0,
            "title": "Expected Revision",
            "type": "integer"
          },
          "method": {
            "enum": [
              "source_checked",
              "human_confirmed"
            ],
            "title": "Method",
            "type": "string"
          },
          "reason": {
            "maxLength": 1000,
            "minLength": 12,
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "candidate_id",
          "expected_revision",
          "method",
          "reason"
        ],
        "title": "BasisRequest",
        "type": "object"
      },
      "velerian__api__routers__packet_release__PolicyRequest": {
        "additionalProperties": false,
        "properties": {
          "expected_revision": {
            "minimum": 0.0,
            "title": "Expected Revision",
            "type": "integer"
          },
          "require_all": {
            "default": false,
            "title": "Require All",
            "type": "boolean"
          },
          "reviewer_roles": {
            "items": {
              "enum": [
                "admin",
                "owner"
              ],
              "type": "string"
            },
            "minItems": 1,
            "title": "Reviewer Roles",
            "type": "array"
          },
          "threshold_cents": {
            "maximum": 1000000.0,
            "minimum": 0.0,
            "title": "Threshold Cents",
            "type": "integer"
          }
        },
        "required": [
          "expected_revision",
          "threshold_cents"
        ],
        "title": "PolicyRequest",
        "type": "object"
      },
      "velerian__api__routers__work_items__DecideRequest": {
        "additionalProperties": false,
        "description": "A person's decision on an item that is closed by one: the claims crew's\nround decision, the one registered today.",
        "properties": {
          "choice": {
            "description": "look_again (the claim's next round is due on look_again_on), close (the claim is closed for close_reason), or file (its next round starts now and may file, before the claim's deadline).",
            "enum": [
              "look_again",
              "close",
              "file"
            ],
            "title": "Choice",
            "type": "string"
          },
          "close_reason": {
            "anyOf": [
              {
                "enum": [
                  "written_off",
                  "paid_elsewhere",
                  "not_ours",
                  "deadline_passed"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "With close: why the claim is closed.",
            "title": "Close Reason"
          },
          "look_again_on": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "With look_again: the day the next round is due, after today and on or before the claim's filing deadline and the crew's furthest look.",
            "title": "Look Again On"
          },
          "note": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The person's own note, at most 500 characters: kept on the decision's record and the close's audit row, and nowhere else.",
            "title": "Note"
          }
        },
        "required": [
          "choice"
        ],
        "title": "DecideRequest",
        "type": "object"
      }
    }
  },
  "info": {
    "description": "Multi-tenant agent operating system. Combines Intellios (factory) + AgenticX (catalog) under one governance artifact. Phase 1 — platform-core.",
    "title": "Velerian Platform API",
    "version": "0.1.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/": {
      "get": {
        "operationId": "root__get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Root  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Root"
      }
    },
    "/api/agenticx/networks": {
      "get": {
        "description": "Return every NetworkPack the platform currently ships.\n\nThe endpoint takes no filter or pagination parameters: every call\nreturns the full catalog in one response, and clients filter it\nlocally. Each pack's ``industry`` value is the field catalog views\ngroup and filter by, matched exactly as returned.\n\nORDERING. When the calling tenant has a declared buyer\nsegment (``tenants.enterprise_settings['catalog_segment']``, set via\n``PUT /api/v2/admin/catalog-segment``), the list is re-ranked\nserver-side so ALL clients benefit: packs targeting the tenant's\nsegment first, then horizontals (``generic_b2b``), then mismatched\nvertical packs — DE-RANKED, never hidden by the ranking (it drops no\npack and leaves ``total`` unchanged). The sort is stable, so the catalog\ndeclaration order is preserved within each fit tier. When no segment\nis configured (or the tenant lookup is unavailable) the legacy\ndeclaration order is returned byte-for-byte (``ordered_by=\"static\"``).\n\nA pack offered only to the workspaces it has been granted to is listed\nonly for a workspace that holds that grant, and ``total`` counts the\npacks returned.",
        "operationId": "list_networks_api_agenticx_networks_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NetworkPackCatalog"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Networks",
        "tags": [
          "agenticx"
        ]
      }
    },
    "/api/agenticx/networks/{slug}": {
      "get": {
        "description": "Return one NetworkPack by slug or 404.\n\nDetail surface lives at `/agenticx/networks/{slug}` on the frontend;\nthis endpoint is the stable backend hook for that route. Unlike the\ncatalog list, the detail read also carries ``workflow_phases`` — the\nordered steps of the pack's automated workflow, each naming the agents\nthat act in it and the work carried out — so the pack page can show what\nthe pack does before asking anyone to start a case.",
        "operationId": "get_network_api_agenticx_networks__slug__get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NetworkPackRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Network",
        "tags": [
          "agenticx"
        ]
      }
    },
    "/api/agenticx/networks/{slug}/data-contract": {
      "get": {
        "description": "Return the data the pack needs to run end-to-end, and where it comes from.\n\nThe pack's typed data contract: each item names a datum (entity kind,\nthe data points inside it, how often it recurs) with an ordered list of\nthe ways it can arrive — a connector to one of the customer's systems,\nthe tenant's standing reference data, an uploaded document, or manual\nentry. Connector sources carry a code-level ``live`` flag derived from\nthe connector registry; it describes the connector's code, never a\nconnection. Every connector is built and switched on with the customer\nduring onboarding. Static product info declared on the pack manifest —\nno tenant data, so it mirrors the unauthenticated read posture of the\ncatalog GETs above (no role gate).\n\n``declared: false`` (with zero items) means the pack has not published\na contract yet; ``declared: true`` with zero items means the pack\nneeds no standing intake data. The document checklist the run surface\nrenders stays available at ``GET /{slug}/materials`` — that view is\nderived from this contract's upload sources.\n\n404 if ``slug`` is not in the catalog.",
        "operationId": "get_network_data_contract_api_agenticx_networks__slug__data_contract_get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NetworkPackDataContract"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Network Data Contract",
        "tags": [
          "agenticx"
        ]
      }
    },
    "/api/agenticx/networks/{slug}/follow-up-settings": {
      "get": {
        "description": "Return this workspace's follow-up settings for a crew.\n\nA crew that offers none answers ``follows_up: false`` with every other field\nnull. Any workspace member may read the settings of any crew in the catalog,\nas with the oversight settings. 404 if ``slug`` is not in the catalog.",
        "operationId": "get_follow_up_settings_api_agenticx_networks__slug__follow_up_settings_get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FollowUpSettingsRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Follow Up Settings",
        "tags": [
          "agenticx"
        ]
      },
      "put": {
        "description": "Change one or more of this workspace's follow-up settings for a crew.\n\n``every_days`` is a whole number of calendar days from 1 to 90,\n``max_follow_ups`` a number of follow-ups from 1 to 10 and ``max_rechecks`` a\nnumber of rechecks from 1 to 20. A setting left out is unchanged; null returns\nit to the crew's own default. A change applies from the claim's next round,\nnever to a date already set. Refused for a setting the crew does not offer.\n\nAvailable to workspace owners and administrators, signed in as themselves;\neveryone else can read the settings but not change them. Every change is\nrecorded in the workspace's audit trail: who changed which setting, from what\nto what, and when. 409 if others kept changing the settings while these were\nsaved; read them again and retry.",
        "operationId": "put_follow_up_settings_api_agenticx_networks__slug__follow_up_settings_put",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FollowUpSettingWrite"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FollowUpSettingsRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Put Follow Up Settings",
        "tags": [
          "agenticx"
        ]
      }
    },
    "/api/agenticx/networks/{slug}/guidance": {
      "get": {
        "description": "Return the pack's per-agent intake guidance.\n\nStatic product info from the pack's ``ui_manifest.json`` — no tenant\ndata, so it mirrors the unauthenticated read posture of the catalog GETs\nabove (no role gate; the platform auth middleware still applies on the\ndeployed app). The frontend run page renders each agent's\n``context_hint`` / ``question_hint`` beside the intake form, and offers\nthe ``seed_context`` / ``seed_question`` pair as a fill-in-the-blank\nstarting template. An empty list means the pack ships no guidance and\nthe run surface renders nothing.\n\n404 if ``slug`` is not in the catalog.",
        "operationId": "get_network_guidance_api_agenticx_networks__slug__guidance_get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NetworkPackGuidance"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Network Guidance",
        "tags": [
          "agenticx"
        ]
      }
    },
    "/api/agenticx/networks/{slug}/invoke": {
      "post": {
        "description": "Invoke a NetworkPack — synchronously (default) or queued (``?async=true``).\n\nBoth paths fail-fast-validate (404 unknown pack / 400 alpha guard / 403 no\nentitlement — an unentitled caller never records a run) and then record a\n``queued`` ``pack_runs`` row — on its case — BEFORE any model work, so the\nrun is visible from the moment it is accepted, even if it later fails or\nthe process dies mid-run. The synchronous path then runs the pipeline in\nthe request and returns :class:`InvokeResponse` (200); the async path\nschedules it on a background task and returns 202 :class:`InvokeAccepted`\nimmediately. Either way, ``run_id`` names the same run row from queue time\nto its terminal state.\n\nA pack that works a case stage by stage, submitted WITHOUT naming a case,\nopens the case and starts its workflow instead of a single governed pass:\nthe response is always the 202 :class:`InvokeAccepted` shape, ``run_id``\nis the workflow's first stage run (poll it the same way), and\n``journey_id`` / ``journey_url`` name the workflow. The request returns\nbefore any stage has run. Naming a case (``case_id`` / ``case_ref``) or\nrevising a run keeps the single pass; a per-request ``model_id`` or\n``oversight`` selection is refused on the workflow path (422).",
        "operationId": "invoke_network_api_agenticx_networks__slug__invoke_post",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          },
          {
            "description": "Bypass the alpha-pack guard. Required for packs whose maturity is `alpha` (a soft guard against accidental demo invocations). Drops away once the pack reaches `production-ready`.",
            "in": "query",
            "name": "force",
            "required": false,
            "schema": {
              "default": false,
              "description": "Bypass the alpha-pack guard. Required for packs whose maturity is `alpha` (a soft guard against accidental demo invocations). Drops away once the pack reaches `production-ready`.",
              "title": "Force",
              "type": "boolean"
            }
          },
          {
            "description": "Execute the run out-of-band: returns 202 with a run_id immediately; poll /api/v2/pack-runs/{run_id} for the result. Removes the synchronous path's gateway-timeout ceiling on long-running prompts. Default false (synchronous, the pre-existing contract).",
            "in": "query",
            "name": "async",
            "required": false,
            "schema": {
              "default": false,
              "description": "Execute the run out-of-band: returns 202 with a run_id immediately; poll /api/v2/pack-runs/{run_id} for the result. Removes the synchronous path's gateway-timeout ceiling on long-running prompts. Default false (synchronous, the pre-existing contract).",
              "title": "Async",
              "type": "boolean"
            }
          },
          {
            "description": "A client-chosen key (at most 255 characters) that makes this submission safe to resend. A resend with the same key within 24 hours returns the original outcome and starts no second run; the same key with a different request is refused with 422.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 255,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "A client-chosen key (at most 255 characters) that makes this submission safe to resend. A resend with the same key within 24 hours returns the original outcome and starts no second run; the same key with a different request is refused with 422.",
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvokeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvokeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvokeAccepted"
                }
              }
            },
            "description": "Accepted"
          },
          "403": {
            "description": "Refused. Either the caller's role does not allow this action, or the crew works on patient records and the organization has no business associate agreement with Velerian on record (detail.error = patient_data_agreement_required)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyInUse"
                }
              }
            },
            "description": "The keyed request is still running."
          },
          "422": {
            "description": "Idempotency-Key reused with a different request."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionRefusal"
                }
              }
            },
            "description": "Refused by a workspace capacity limit."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionRefusal"
                }
              }
            },
            "description": "Admission could not decide; retry."
          }
        },
        "summary": "Invoke Network",
        "tags": [
          "agenticx"
        ]
      }
    },
    "/api/agenticx/networks/{slug}/materials": {
      "get": {
        "description": "Return the materials a pack expects with a complete intake.\n\nStatic product info declared on the pack manifest — no tenant data, so it\nmirrors the unauthenticated read posture of the catalog GETs above (no\nrole gate). The frontend run page renders ``items`` as a\nrequired-materials checklist, matches attached documents against the\nhints, and calls out anything missing or unreadable BEFORE the run\nstarts. An empty list means the pack declares no expected materials and\nthe run surface simply renders no checklist.\n\n404 if ``slug`` is not in the catalog.",
        "operationId": "get_network_materials_api_agenticx_networks__slug__materials_get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NetworkPackMaterials"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Network Materials",
        "tags": [
          "agenticx"
        ]
      }
    },
    "/api/agenticx/networks/{slug}/models": {
      "get": {
        "description": "Return the model-picker options for one pack.\n\nStatic product info — no tenant data, so it mirrors the unauthenticated\nread posture of the catalog GETs above (no role gate). The frontend run\npage renders ``options`` as a selector and submits the chosen\n``model_id`` on ``POST /{slug}/invoke``; an empty choice omits it and the\npack's ``default_model_id`` runs unchanged.\n\n404 if ``slug`` is not in the catalog.",
        "operationId": "get_network_models_api_agenticx_networks__slug__models_get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NetworkPackModels"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Network Models",
        "tags": [
          "agenticx"
        ]
      }
    },
    "/api/agenticx/networks/{slug}/oversight-plan": {
      "get": {
        "description": "Return the pack's per-phase oversight plan.\n\nEach workflow phase carries the oversight mode the pack's declared\ngovernance gives it — human in the loop (a reviewer approves the gated\nstep before it proceeds), human on the loop (live monitoring with\nenforced checks that hold non-conforming output), human over the loop\n(work proceeds, flagged for review afterwards), or human out of the loop\n(autonomous where policy allows, still recorded) — plus the modes an\noperator may tighten the phase to for their own run. The baseline is the\nfloor: a run can add oversight on top of it, never remove it.\n\nRead-only, tenant-safe platform reference data (same posture as the\nsibling catalog GETs; auth is enforced by the platform middleware at the\nmount). 404 if ``slug`` is not in the catalog.",
        "operationId": "get_network_oversight_plan_api_agenticx_networks__slug__oversight_plan_get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OversightPlanRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Network Oversight Plan",
        "tags": [
          "agenticx"
        ]
      }
    },
    "/api/agenticx/networks/{slug}/oversight-settings": {
      "get": {
        "description": "Return this workspace's standing per-step oversight settings for a pack.\n\nEvery workflow step with the pack's built-in baseline — derived from the\npack's declared safeguards, never hand-assigned — and the workspace's own\nsetting for it, if any. A stored setting the pack has since caught up to\n(the step changed, or its baseline rose to meet the setting) is presented\nas \"at the baseline\" rather than surfaced or failed. Any workspace member\nmay read — the settings are the workspace's visible oversight posture;\nchanging them is gated on the write route. 404 if ``slug`` is not in the\ncatalog.",
        "operationId": "get_network_oversight_settings_api_agenticx_networks__slug__oversight_settings_get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OversightSettingsRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Network Oversight Settings",
        "tags": [
          "agenticx"
        ]
      }
    },
    "/api/agenticx/networks/{slug}/oversight-settings/{phase_slug}": {
      "put": {
        "description": "Set (or return to the baseline) one workflow step's oversight.\n\nTighten-only, enforced by the platform: the requested mode must be at\nleast as strict as the step's built-in baseline — a looser request is\nrejected, and nothing on any surface goes below the baseline. A mode\nEQUAL to the baseline removes the workspace's own added oversight (the\nonly \"relax\" that exists). The setting persists for the whole workspace\nand every run of the pack inherits it; a single run can still add more\noversight on top of its own.\n\nAvailable to workspace owners, administrators and supervisors; everyone\nelse can read the settings but not change them. Every change is recorded\nin the workspace's audit trail — who changed it, from what to what, and\nwhen — in the same transaction as the change itself.",
        "operationId": "put_network_oversight_setting_api_agenticx_networks__slug__oversight_settings__phase_slug__put",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "phase_slug",
            "required": true,
            "schema": {
              "title": "Phase Slug",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OversightSettingWrite"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OversightSettingRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Put Network Oversight Setting",
        "tags": [
          "agenticx"
        ]
      }
    },
    "/api/agenticx/networks/{slug}/report-card": {
      "get": {
        "description": "Return one pack's governance & fairness report card.\n\nRead-only, tenant-safe: the card is platform reference data derived from\nthe committed fairness methodology + the pack's catalog metadata — identical\nfor every tenant, carrying no tenant-scoped data — so it mirrors the\nunauthenticated read posture of the sibling catalog GETs (auth is enforced\nby the platform Cognito middleware at the mount; no cross-tenant surface).\n\n404 if ``slug`` is not in the catalog. The card is honest by construction:\n``methodology_validated`` (never \"audited\") for the packs with a wired\nAIR >= 0.80 CI gate, ``not_evaluated`` for every other pack.",
        "operationId": "get_network_report_card_api_agenticx_networks__slug__report_card_get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FairnessReportCardRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Network Report Card",
        "tags": [
          "agenticx"
        ]
      }
    },
    "/api/agenticx/networks/{slug}/workflow-map": {
      "get": {
        "description": "Return the pack's per-step workflow map — its automation boundary.\n\nThe step-by-step answer to the first question a buyer asks of an\nagent product: what does the agent do, and where does the work hand\noff to a human? Each workflow step carries what the agent performs\n(``agent_does``), the enforcement-backed gates derived from the\npack's own governance — the same safeguards a real run evaluates,\nnever a hand-maintained map — and the human handoffs the pack\ndeclares (a wait on an outside party, a missing input only a person\ncan resolve, a decision routed to a named human function, data a\nperson carries by hand until that system's connection is set up at\nonboarding). Steps come back in workflow order.\n\nRead-only, tenant-safe platform reference data (same posture as the\nsibling catalog GETs; auth is enforced by the platform middleware at\nthe mount). 404 if ``slug`` is not in the catalog.",
        "operationId": "get_network_workflow_map_api_agenticx_networks__slug__workflow_map_get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NetworkPackWorkflowMap"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Network Workflow Map",
        "tags": [
          "agenticx"
        ]
      }
    },
    "/api/intellios/intake/sessions": {
      "get": {
        "description": "The caller's OPEN intake sessions, newest first.\n\n``latest-active`` restores only the single newest ACTIVE session, and the\nvoice-lines surface lists only provisioned ``voice_numbers`` rows. This\nlist is the durable index over everything still awaiting the caller's\naction:\n\n- in-progress drafts (``status = 'active'``) — the onboarding drafts\n  picker lists these so any draft can be resumed, not just the newest;\n- completed voice sessions parked at ``awaiting_confirmation`` — the\n  voice-lines \"Pending confirmation\" section lists these with a Confirm\n  deep-link back into the existing confirm flow.\n\nFinished records (blueprint drafted, line live, abandoned) are never\nlisted. Authz mirrors ``latest-active`` EXACTLY: any authenticated role\n(read-only), scoped to the calling tenant (RLS) AND the calling user\n(``created_by_user_id``). Lightweight rows only — resuming a session\nstill goes through ``GET /sessions/{id}`` for the full snapshot.",
        "operationId": "list_intake_sessions_api_intellios_intake_sessions_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntakeSessionList"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Intake Sessions",
        "tags": [
          "intellios"
        ]
      },
      "post": {
        "description": "Create a fresh intake session for the calling tenant.\n\nEvery conversation lives inside a durable case: with no body a new case\nopens for it; passing ``case_id`` or ``case_ref`` continues scoping\ninside that existing case instead. The response returns the case identity\neither way — pass it to run submit so the conversation and the work it\nleads to stay on one thread.",
        "operationId": "create_intake_session_api_intellios_intake_sessions_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/IntakeSessionCreateRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntakeSessionCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Intake Session",
        "tags": [
          "intellios"
        ]
      }
    },
    "/api/intellios/intake/sessions/latest-active": {
      "get": {
        "description": "The caller's most recent in-progress intake session, or null.\n\nPowers resume-on-return: the intake surface calls this on mount and, when a\nsession comes back, rehydrates the conversation (the snapshot's\n``transcript``) and continues where it left off — no re-greet, no lost\nstate. Scoped to the calling tenant (RLS) AND the calling user\n(``created_by_user_id``); only ``active`` sessions qualify, so a completed\nor explicitly abandoned session never hijacks a fresh start. Multi-session\nusers get the newest.\n\nNOTE: registered BEFORE ``GET /sessions/{session_id}`` — the path segment\n``latest-active`` must match this literal route, not the UUID parameter.",
        "operationId": "read_latest_active_intake_session_api_intellios_intake_sessions_latest_active_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntakeLatestActiveSession"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Read Latest Active Intake Session",
        "tags": [
          "intellios"
        ]
      }
    },
    "/api/intellios/intake/sessions/{session_id}": {
      "get": {
        "operationId": "read_intake_session_api_intellios_intake_sessions__session_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Session Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntakeSessionSnapshot"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read Intake Session",
        "tags": [
          "intellios"
        ]
      }
    },
    "/api/intellios/intake/sessions/{session_id}/abandon": {
      "post": {
        "description": "Explicit \"Start over\": mark an in-progress session abandoned.\n\nThe clean discard behind the resume surface. The conversation record is\nkept (audit trail), but the session leaves the active pool, so\n``latest-active`` never offers it again. Only an ``active`` session can be\nabandoned — a completed session is a finished record (409).",
        "operationId": "abandon_intake_session_api_intellios_intake_sessions__session_id__abandon_post",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Session Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntakeSessionAbandoned"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Abandon Intake Session",
        "tags": [
          "intellios"
        ]
      }
    },
    "/api/intellios/intake/sessions/{session_id}/confirm-voice-line": {
      "post": {
        "description": "Explicit customer confirm → allocate the DID + take the voice line live.\n\nThe action side of the consent gate. A completed voice intake is parked at\n``awaiting_confirmation`` with no number assigned. This route — the ONLY\npath that assigns a recurring-cost DID — runs the existing allocate →\nprovision path on an EXPLICIT customer confirm that acknowledges the cost, and\nwrites the consent (who / when / acknowledged-cost) to the audit log.\n\nIdempotent: a second confirm on an already-``provisioned`` session is a\nno-op — the current live number is returned, never a double-allocate. A\npool-empty confirm yields ``pending_no_did`` without crashing.",
        "operationId": "confirm_voice_line_api_intellios_intake_sessions__session_id__confirm_voice_line_post",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Session Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntakeConfirmVoiceLineRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntakeSessionSnapshot"
                }
              }
            },
            "description": "Successful Response"
          },
          "403": {
            "description": "Refused. Either the caller's role may not confirm a voice line, or the request was made with an API key or a machine token, which cannot (detail.error = person_required)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Confirm Voice Line",
        "tags": [
          "intellios"
        ]
      }
    },
    "/api/intellios/intake/sessions/{session_id}/turns": {
      "post": {
        "description": "Run one intake conversation turn.\n\nLoads the session, steps the conversation, and saves the result. When the\norganization has turned on governed intake\n(PUT /api/v2/admin/intake-governance), each turn additionally runs through\nthe organization's content checks: the message is checked before the model\nis invoked, and the reply is checked before anything is saved. A message\nor reply the checks can't accept is replaced with a plain-language notice;\nanonymized text is used in place of the original wherever the checks\nredact. If the checks themselves can't run, the turn fails safe: nothing\nis added to the conversation and the response is a 503 asking the user to\nretry. If another turn on the same conversation was saved while this one\nwas being answered, the response is a 409 and this turn is likewise not\nadded; send the message again. In both cases the workspace keeps a record\nof the turn that was not added.\n\nIn a workspace cleared for patient records (a business associate agreement\nis recorded for it), every turn is refused with a 403\n(``detail.error = patient_data_surface_closed``) before the conversation is\nloaded or the model is called, because a turn's evidence record keeps the\nmessage word for word.\n\nThe conversation sets up a voice line. Building a custom agent was removed:\nonce a conversation has settled on building an agent rather than setting\nup a voice line, its next turn is refused with a 403 (``detail.error =\ncustom_agent_building_retired``) before the model is called.",
        "operationId": "step_intake_session_api_intellios_intake_sessions__session_id__turns_post",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Session Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntakeTurnRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntakeTurnResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "403": {
            "description": "Refused. Either the caller is not allowed this action, or the workspace is cleared for patient records and this feature is closed to it, because its evidence record keeps content word for word (detail.error = patient_data_surface_closed). Or: the conversation settled on building a custom agent, which was removed (detail.error = custom_agent_building_retired)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Step Intake Session",
        "tags": [
          "intellios"
        ]
      }
    },
    "/api/v2/admin/catalog-segment": {
      "get": {
        "description": "Return the tenant's declared segment (null when never set). Admin-only.",
        "operationId": "get_catalog_segment_api_v2_admin_catalog_segment_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogSegmentRead"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get the calling tenant's declared catalog buyer segment.",
        "tags": [
          "admin",
          "catalog"
        ]
      },
      "put": {
        "description": "Persist the tenant's declared segment + audit the change. Admin-only.\n\nWrites ``tenants.enterprise_settings[catalog_segment]`` via a partial\n``jsonb_set`` update (unrelated keys preserved) and records a\n``tenant.catalog_segment.updated`` audit entry with the before/after\nvalues. A ``segment`` outside the taxonomy is a 422; ``null`` clears\nthe declaration (the catalog reverts to its static order).",
        "operationId": "update_catalog_segment_api_v2_admin_catalog_segment_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CatalogSegment"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogSegmentRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set (or clear) the calling tenant's catalog buyer segment.",
        "tags": [
          "admin",
          "catalog"
        ]
      }
    },
    "/api/v2/admin/compliance/reports": {
      "get": {
        "description": "List the latest SOC2 evidence artifact per kind, enriched with sign-off state.\n\nCurrently returns at most two entries (one per kind in\n``_REPORT_KINDS``). Kinds with no artifact yet are omitted from\nthe response — the frontend renders an empty-state card for those.\n\nSign-off enrichment: each surviving row gets\n``sign_off_state`` ∈ {pending, signed} plus ``signed_by`` +\n``signed_at`` when signed. The lookup is one query per visible\n``(kind, as_of_date)`` — N is bounded to ``len(_REPORT_KINDS)``,\nso we don't bother batching.\n\nImplementation notes:\n- Bucket name derives from ``$VELERIAN_ENV`` via :func:`_get_env`.\n- S3 listing is sync; we wrap it in the async handler signature\n  only because FastAPI prefers that for the OpenAPI generation\n  cohesion.\n- boto3 errors on dev (no bucket / no perms) are swallowed by\n  ``_list_reports_for_kind`` so the dashboard renders gracefully\n  offline; in prod the bucket exists and any 5xx is a real signal.\n- Signoff query runs under the caller's tenant-scoped session (RLS\n  filters to the caller's tenant automatically).",
        "operationId": "list_compliance_reports_api_v2_admin_compliance_reports_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceReportList"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Compliance Reports",
        "tags": [
          "admin",
          "compliance"
        ]
      }
    },
    "/api/v2/admin/compliance/reports/{kind}/{report_date}/sign-off": {
      "post": {
        "description": "Record a SOC2 sign-off for one report instance.\n\nInserts one row in ``audit_signoffs`` keyed by\n``(tenant_id, kind, as_of_date)``. Returns 201 with the new row's\nid + signed_by attribution + signed_at timestamp.\n\nReturns 409 if the ``(kind, date)`` tuple was already signed for\nthis tenant — the unique constraint is the canonical guard and\nwe map the IntegrityError to a clean 409 here. (We could SELECT\nfirst then INSERT, but that's a TOCTOU race; relying on the\nconstraint is correct.)\n\nRole gating: ``require_network_admin`` runs first; non-admins get\n403 before any DB write. The route trusts ``ctx.user_id`` for the\n``signed_by_user_id`` attribution since the auth middleware\npopulated it from the verified JWT.",
        "operationId": "sign_off_compliance_report_api_v2_admin_compliance_reports__kind___report_date__sign_off_post",
        "parameters": [
          {
            "description": "The report kind (access-review | provisioning-audit).",
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "description": "The report kind (access-review | provisioning-audit).",
              "enum": [
                "access-review",
                "provisioning-audit"
              ],
              "title": "Kind",
              "type": "string"
            }
          },
          {
            "description": "The report's as_of date (YYYY-MM-DD).",
            "in": "path",
            "name": "report_date",
            "required": true,
            "schema": {
              "description": "The report's as_of date (YYYY-MM-DD).",
              "format": "date",
              "title": "Report Date",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignOffRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignOffResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Sign Off Compliance Report",
        "tags": [
          "admin",
          "compliance"
        ]
      }
    },
    "/api/v2/admin/compliance/reports/{kind}/{report_date}/url": {
      "post": {
        "description": "Mint a 15-minute presigned GET URL for one artifact.\n\nPath shape: ``/reports/{kind}/{report_date}/url`` with a body that\nselects JSON vs PDF. We use a POST + body (not a GET with a\n?format= query) because the resulting URL is a short-lived\ncapability — POST keeps it out of browser history + access logs\nthe same way audit-log download endpoints do.\n\nThe S3 key is reconstructed deterministically from the inputs:\n``{kind}/{YYYY}/{MM}/{kind}-{YYYY-MM-DD}.{ext}``. We DON'T verify\nexistence first — that's an extra S3 round-trip and the URL is\nfine returning a 404 to the browser if the operator handcrafts a\nstale path. The list endpoint above is the source of truth for\n\"which dates exist\".",
        "operationId": "presigned_report_url_api_v2_admin_compliance_reports__kind___report_date__url_post",
        "parameters": [
          {
            "description": "The report kind (access-review | provisioning-audit).",
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "description": "The report kind (access-review | provisioning-audit).",
              "enum": [
                "access-review",
                "provisioning-audit"
              ],
              "title": "Kind",
              "type": "string"
            }
          },
          {
            "description": "The report's as_of date (YYYY-MM-DD).",
            "in": "path",
            "name": "report_date",
            "required": true,
            "schema": {
              "description": "The report's as_of date (YYYY-MM-DD).",
              "format": "date",
              "title": "Report Date",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PresignedUrlRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PresignedUrlResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Presigned Report Url",
        "tags": [
          "admin",
          "compliance"
        ]
      }
    },
    "/api/v2/admin/feedback": {
      "get": {
        "description": "List recent in-product feedback for triage. Admin-gated.\n\nReturns submissions newest-first (``created_at DESC``, ``id`` as a stable\ntiebreaker), paginated. Each row carries its ``tenant_id`` + ``user_id`` for\nattribution. See the module docstring for the cross-tenant span note.",
        "operationId": "list_feedback_api_v2_admin_feedback_get",
        "parameters": [
          {
            "description": "Page size (1..200).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Page size (1..200).",
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Page offset.",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "description": "Page offset.",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Feedback",
        "tags": [
          "admin",
          "feedback"
        ]
      }
    },
    "/api/v2/admin/intake-addresses": {
      "get": {
        "description": "Every address reserved for this workspace, active and retired. Admin-only.\n\nAddresses are allocated by the platform and unique across all workspaces.\nWhile the platform's inbound mail path is not yet live, an address is a\nreservation: it belongs to your workspace and no one else can claim it,\nand it starts receiving email the moment inbound mail goes live — no\nfurther setup on your side.",
        "operationId": "list_intake_addresses_api_v2_admin_intake_addresses_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntakeAddressList"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List the workspace's inbound case-mail addresses.",
        "tags": [
          "admin",
          "channels"
        ]
      },
      "post": {
        "description": "Allocate the workspace's email address for opening cases. Admin-only.\n\nThe platform chooses the address from your workspace name — nothing is\ntyped and nothing can collide with another workspace's address. The\naddress is reserved immediately; it starts receiving email when inbound\nmail goes live for the platform.",
        "operationId": "create_intake_address_api_v2_admin_intake_addresses_post",
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntakeAddress"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Reserve an inbound case-mail address for the workspace.",
        "tags": [
          "admin",
          "channels"
        ]
      }
    },
    "/api/v2/admin/intake-addresses/{endpoint_id}/deactivate": {
      "post": {
        "description": "Stop an address from routing new mail to the workspace. Admin-only.\n\nRetiring keeps the address's history and keeps the name reserved — it is\nnever reissued to another workspace. Retiring an already-retired address\nchanges nothing. Every retirement is recorded in the workspace's\ntamper-evident audit record.",
        "operationId": "deactivate_intake_address_api_v2_admin_intake_addresses__endpoint_id__deactivate_post",
        "parameters": [
          {
            "in": "path",
            "name": "endpoint_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Endpoint Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntakeAddress"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Retire one of the workspace's inbound case-mail addresses.",
        "tags": [
          "admin",
          "channels"
        ]
      }
    },
    "/api/v2/admin/intake-governance": {
      "get": {
        "description": "Return the governed-intake toggle, defaults merged in. Admin-only.\n\nAn organisation that has never changed the setting reads\n``enabled: false``. ``guardrail_configured`` tells the admin UI whether\nthe platform's content guardrail is provisioned — when it is not,\ncontent checks are advisory until one is.",
        "operationId": "get_intake_governance_api_v2_admin_intake_governance_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntakeGovernanceStatus"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get the calling tenant's governed-intake setting.",
        "tags": [
          "admin",
          "governance"
        ]
      },
      "put": {
        "description": "Turn governed intake on or off for the organisation. Admin-only.\n\nThe change takes effect on the organisation's next intake turn. Every\nchange is recorded in the audit log (``tenant.intake_governance.updated``)\nwith the before/after state, so reviewers can see who changed the setting\nand when.",
        "operationId": "update_intake_governance_api_v2_admin_intake_governance_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntakeGovernanceUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntakeGovernanceStatus"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update the calling tenant's governed-intake setting.",
        "tags": [
          "admin",
          "governance"
        ]
      }
    },
    "/api/v2/admin/kpi/activation-funnel": {
      "get": {
        "description": "Return the onboarding/activation funnel.\n\nCounts the DISTINCT TENANTS that reached each funnel stage at least once in\nthe ``[since, until)`` window, reading the analytics warehouse\n(``analytics_events``) — the SAME system of record every product dashboard\nreads, so the numbers reconcile:\n\n    signed_up  → first_run_started → activated → subscribed\n\nACTIVATION is a tenant's first successful governed run (``run.completed`` —\nthe catalog-pack invoke route AND the custom-ABP runtime both emit it). When\n``since`` is omitted the window is the trailing ``window_days`` ending at\n``until`` (or now). Cross-tenant operator aggregate: like ``/summary``, the\nspan is governed by the session's row visibility — see the module docstring's\ncross-tenant note.",
        "operationId": "get_activation_funnel_api_v2_admin_kpi_activation_funnel_get",
        "parameters": [
          {
            "description": "Inclusive lower bound (UTC ISO-8601) on event occurred_at. Omit to use the trailing `window_days` window ending at `until`.",
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive lower bound (UTC ISO-8601) on event occurred_at. Omit to use the trailing `window_days` window ending at `until`.",
              "title": "Since"
            }
          },
          {
            "description": "Exclusive upper bound (UTC ISO-8601) on event occurred_at. Omit to use now (UTC).",
            "in": "query",
            "name": "until",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclusive upper bound (UTC ISO-8601) on event occurred_at. Omit to use now (UTC).",
              "title": "Until"
            }
          },
          {
            "description": "Trailing window length (days) used to derive `since` when it is omitted. Ignored when an explicit `since` is supplied.",
            "in": "query",
            "name": "window_days",
            "required": false,
            "schema": {
              "default": 30,
              "description": "Trailing window length (days) used to derive `since` when it is omitted. Ignored when an explicit `since` is supplied.",
              "maximum": 365,
              "minimum": 1,
              "title": "Window Days",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivationFunnelResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Activation Funnel",
        "tags": [
          "admin",
          "kpi"
        ]
      }
    },
    "/api/v2/admin/kpi/clocks": {
      "get": {
        "description": "Return the aggregate deadline KPI — the outcome-clock read side.\n\nTwo complementary views over the deadlines cases carry:\n\n- **Live exposure** (point-in-time, never windowed): every deadline still\n  running or on hold across open cases, split into ok / warning /\n  past-due zones exactly as the case surfaces compute them, with the\n  headline ``near_breach_rate_pct`` — the share of live deadlines needing\n  attention right now.\n- **Concluded deadlines** (windowed on when they concluded): deadlines\n  stamped met or missed when their case closed, with the headline\n  ``breach_rate_pct`` — of the deadlines that concluded in-window, how\n  many were missed.\n\nBoth break down per pack (worst exposure first); deadlines on cases with\nno pack attribution are counted in the totals and reported separately.\nLike the other KPI routes, the window is OPTIONAL on both ends. Cross-\ntenant operator aggregate: like ``/summary``, the span is governed by the\nsession's row visibility (see the module docstring's cross-tenant note +\n``core/kpi/clock_summary``).",
        "operationId": "get_clock_summary_api_v2_admin_kpi_clocks_get",
        "parameters": [
          {
            "description": "Inclusive lower bound (UTC ISO-8601) on when concluded deadlines were stamped. Omit for no lower bound (all-time). Live deadlines are never windowed.",
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive lower bound (UTC ISO-8601) on when concluded deadlines were stamped. Omit for no lower bound (all-time). Live deadlines are never windowed.",
              "title": "Since"
            }
          },
          {
            "description": "Exclusive upper bound (UTC ISO-8601) on when concluded deadlines were stamped. Omit for no upper bound (up to now).",
            "in": "query",
            "name": "until",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclusive upper bound (UTC ISO-8601) on when concluded deadlines were stamped. Omit for no upper bound (up to now).",
              "title": "Until"
            }
          },
          {
            "description": "How many per-pack rows to return (1..200).",
            "in": "query",
            "name": "per_pack",
            "required": false,
            "schema": {
              "default": 50,
              "description": "How many per-pack rows to return (1..200).",
              "maximum": 200,
              "minimum": 1,
              "title": "Per Pack",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockSummaryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Clock Summary",
        "tags": [
          "admin",
          "kpi"
        ]
      }
    },
    "/api/v2/admin/kpi/feedback": {
      "get": {
        "description": "Return the in-product feedback-volume rollup.\n\nRolls up the ``feedback`` table (written by ``POST /api/v2/feedback``) over\nthe ``[since, until)`` window on ``created_at``: the total count, a DENSE\nper-``kind`` breakdown (every known kind present, zero-filled), and the N\nmost-recent items (newest first) for an at-a-glance triage peek. Unlike the\nother KPI routes, the window is OPTIONAL on both ends — omit ``since`` for an\nall-time total. Cross-tenant operator aggregate: like ``/summary`` and\n``/activation-funnel``, the span is governed by the session's row visibility\n(see the module docstring's cross-tenant note + ``core/kpi/feedback``).",
        "operationId": "get_feedback_summary_api_v2_admin_kpi_feedback_get",
        "parameters": [
          {
            "description": "Inclusive lower bound (UTC ISO-8601) on feedback created_at. Omit for no lower bound (all-time).",
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive lower bound (UTC ISO-8601) on feedback created_at. Omit for no lower bound (all-time).",
              "title": "Since"
            }
          },
          {
            "description": "Exclusive upper bound (UTC ISO-8601) on feedback created_at. Omit for no upper bound (up to now).",
            "in": "query",
            "name": "until",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclusive upper bound (UTC ISO-8601) on feedback created_at. Omit for no upper bound (up to now).",
              "title": "Until"
            }
          },
          {
            "description": "How many most-recent items to embed in the response (1..100).",
            "in": "query",
            "name": "recent_limit",
            "required": false,
            "schema": {
              "default": 10,
              "description": "How many most-recent items to embed in the response (1..100).",
              "maximum": 100,
              "minimum": 1,
              "title": "Recent Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackSummaryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Feedback Summary",
        "tags": [
          "admin",
          "kpi"
        ]
      }
    },
    "/api/v2/admin/kpi/intake-governance": {
      "get": {
        "description": "Return the governed-intake toggle evidence rollup.\n\nThe evidence for revisiting whether governed intake stays off by default:\n(1) ADOPTION — how many tenants have the toggle ON right now\n(point-in-time share) plus the in-window flip timeline from the\n``tenant.intake_governance.updated`` audit rows; (2) the BUILD FUNNEL,\ngoverned vs ungoverned — of the intake sessions created in the window,\nhow many completed vs abandoned vs are still active, attributed to a mode\nvia the turn events' governed dimension (sessions with no turn-event\nlinkage are surfaced as ``unattributed_sessions``, never\nguessed); (3) INTERVENTIONS when ON — masked-input / masked-output /\nblocked counts from the governed turn events. Pure facts, no invented\nscores. Cross-tenant operator aggregate: the RLS-scoped reads route\nthrough the SECURITY DEFINER ``intake_gov_*`` service functions\n(migration 085), matching the module docstring's cross-tenant note.",
        "operationId": "get_intake_governance_telemetry_api_v2_admin_kpi_intake_governance_get",
        "parameters": [
          {
            "description": "Inclusive lower bound (UTC ISO-8601) for the window-bounded parts (sessions / turns / toggle timeline). Omit to use the trailing `window_days` window ending at `until`.",
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive lower bound (UTC ISO-8601) for the window-bounded parts (sessions / turns / toggle timeline). Omit to use the trailing `window_days` window ending at `until`.",
              "title": "Since"
            }
          },
          {
            "description": "Exclusive upper bound (UTC ISO-8601). Omit to use now (UTC).",
            "in": "query",
            "name": "until",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclusive upper bound (UTC ISO-8601). Omit to use now (UTC).",
              "title": "Until"
            }
          },
          {
            "description": "Trailing window length (days) used to derive `since` when it is omitted. Ignored when an explicit `since` is supplied.",
            "in": "query",
            "name": "window_days",
            "required": false,
            "schema": {
              "default": 30,
              "description": "Trailing window length (days) used to derive `since` when it is omitted. Ignored when an explicit `since` is supplied.",
              "maximum": 365,
              "minimum": 1,
              "title": "Window Days",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntakeGovernanceTelemetryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Intake Governance Telemetry",
        "tags": [
          "admin",
          "kpi"
        ]
      }
    },
    "/api/v2/admin/kpi/outcomes": {
      "get": {
        "description": "Return the aggregate outcome KPI — the VALUE-LEDGER read side.\n\nRolls up ``pack_runs.outcome_*`` (the SECOND, outcome verdict — did the run\naccomplish what the pack exists to do?) over the ``[since, until)``\nwindow on ``created_at`` into the outcome-verdict MIX (met / partial /\nincomplete / not-scored, summing to the run total), the headline\n``met_rate_pct`` (met over the scored runs — the P5\nvalue-realized-vs-promised number), coverage BOTH ways — the raw\n``scored_coverage_pct`` (over all runs, kept for continuity) and the honest\n``scored_coverage_of_scorable_pct`` (over the runs that COULD be scored, i.e.\nexcluding the ``unscorable_runs``), the top recurring gap labels\n(from ``outcome_gaps``), and per-pack met-rate (the depth-per-pack proxy).\n\nThe ``resolution`` block adds the case-level ground truth: for cases closed\nin-window (on close time), the recorded real-world outcome mix, the\nachieved-after-N-revisions histogram, and the cross-tab of the newest run's\nown verdict against recorded reality — the two axes are different by\ndesign (a run verdict grades the work product against its contract; a case\nresolution records what actually happened), and where they disagree is the\nsignal to act on. Like the other KPI routes, the window is OPTIONAL on\nboth ends — omit ``since`` for an all-time rollup. Cross-tenant operator\naggregate: like ``/summary``, the span is governed by the session's row\nvisibility (see the module docstring's cross-tenant note +\n``core/kpi/outcome_summary``).",
        "operationId": "get_outcome_summary_api_v2_admin_kpi_outcomes_get",
        "parameters": [
          {
            "description": "Inclusive lower bound (UTC ISO-8601) on run created_at. Omit for no lower bound (all-time).",
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive lower bound (UTC ISO-8601) on run created_at. Omit for no lower bound (all-time).",
              "title": "Since"
            }
          },
          {
            "description": "Exclusive upper bound (UTC ISO-8601) on run created_at. Omit for no upper bound (up to now).",
            "in": "query",
            "name": "until",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclusive upper bound (UTC ISO-8601) on run created_at. Omit for no upper bound (up to now).",
              "title": "Until"
            }
          },
          {
            "description": "How many top recurring gap labels to return (1..50).",
            "in": "query",
            "name": "top_gaps",
            "required": false,
            "schema": {
              "default": 10,
              "description": "How many top recurring gap labels to return (1..50).",
              "maximum": 50,
              "minimum": 1,
              "title": "Top Gaps",
              "type": "integer"
            }
          },
          {
            "description": "How many per-pack met-rate rows to return (1..200).",
            "in": "query",
            "name": "per_pack",
            "required": false,
            "schema": {
              "default": 50,
              "description": "How many per-pack met-rate rows to return (1..200).",
              "maximum": 200,
              "minimum": 1,
              "title": "Per Pack",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutcomeSummaryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Outcome Summary",
        "tags": [
          "admin",
          "kpi"
        ]
      }
    },
    "/api/v2/admin/kpi/stall-analytics": {
      "get": {
        "description": "Return the case lifecycle sensors, computed from the audit trail.\n\nCases already record every lifecycle move, every work item raised and\nclosed, and every deadline pause in the tamper-evident audit chain. These\nsensors read that chain — nothing new is instrumented and nothing is\nwritten:\n\n- **time-in-state** — how much wall-clock cases spent open, waiting on an\n  external party, or needing a human, clipped to the window, per pack.\n- **human-time drift** — the share of case wall-clock held by a human\n  (needing a human, or held by a pending work item, counted once where\n  those overlap), per tenant, across equal periods. The per-period series\n  plus its slope answers whether human time is trending DOWN, which is the\n  direction a healthy agentic system moves in: agents should be absorbing\n  more of the work over time, not less. A `direction` of `up` on a tenant\n  is the signal to investigate.\n- **revision loops** — how often cases re-enter a lifecycle state they\n  have already been in.\n- **escalation rate** — escalations raised per active case, per pack.\n\nEvery figure aggregates over WORK — cases, packs, tenants. There is no\nper-person breakdown: these measure the health of autonomous work, not\nanyone's throughput.\n\nUnlike the other summaries, the window is always resolved on both ends\n(every number is wall-clock clipped to it). Cross-tenant operator\naggregate: like `/summary`, the span is governed by the session's row\nvisibility (see the module docstring's cross-tenant note).",
        "operationId": "get_stall_analytics_api_v2_admin_kpi_stall_analytics_get",
        "parameters": [
          {
            "description": "Inclusive window start (UTC ISO-8601). Defaults to `bucket_hours` x 8 before the window end.",
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive window start (UTC ISO-8601). Defaults to `bucket_hours` x 8 before the window end.",
              "title": "Since"
            }
          },
          {
            "description": "Exclusive window end (UTC ISO-8601). Defaults to now.",
            "in": "query",
            "name": "until",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclusive window end (UTC ISO-8601). Defaults to now.",
              "title": "Until"
            }
          },
          {
            "description": "Period width in hours for the human-time trend. Defaults to 168 (one week).",
            "in": "query",
            "name": "bucket_hours",
            "required": false,
            "schema": {
              "default": 168,
              "description": "Period width in hours for the human-time trend. Defaults to 168 (one week).",
              "maximum": 8760,
              "minimum": 1,
              "title": "Bucket Hours",
              "type": "integer"
            }
          },
          {
            "description": "How many per-pack rows to return (1..200).",
            "in": "query",
            "name": "per_pack",
            "required": false,
            "schema": {
              "default": 50,
              "description": "How many per-pack rows to return (1..200).",
              "maximum": 200,
              "minimum": 1,
              "title": "Per Pack",
              "type": "integer"
            }
          },
          {
            "description": "How many per-tenant trend series to return (1..200).",
            "in": "query",
            "name": "per_tenant",
            "required": false,
            "schema": {
              "default": 50,
              "description": "How many per-tenant trend series to return (1..200).",
              "maximum": 200,
              "minimum": 1,
              "title": "Per Tenant",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StallAnalyticsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Stall Analytics",
        "tags": [
          "admin",
          "kpi"
        ]
      }
    },
    "/api/v2/admin/kpi/summary": {
      "get": {
        "description": "Return the internal business + product KPI summary.\n\nGrowth: legacy subscription-based revenue estimates; new vs churned\nover the window; retention proxy. These estimates do not determine\ncompleted-work charges under an agreement. Product: activation rate, WAU, per-pack usage. All\ncomputed on read from ``subscriptions`` + ``metering_event`` — no new\ntables, no writes. Each metric's precise definition + data source is\ndocumented on the ``core/kpi`` dataclasses and mirrored on the response\nfield descriptions above.",
        "operationId": "get_kpi_summary_api_v2_admin_kpi_summary_get",
        "parameters": [
          {
            "description": "Look-back window (days) for new/churned/NRR + usage. WAU is always a fixed trailing 7-day window.",
            "in": "query",
            "name": "window_days",
            "required": false,
            "schema": {
              "default": 30,
              "description": "Look-back window (days) for new/churned/NRR + usage. WAU is always a fixed trailing 7-day window.",
              "maximum": 365,
              "minimum": 1,
              "title": "Window Days",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KpiSummaryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Kpi Summary",
        "tags": [
          "admin",
          "kpi"
        ]
      }
    },
    "/api/v2/admin/kpi/surveys": {
      "get": {
        "description": "Return the in-product NPS/CSAT survey rollup.\n\nRolls up the ``survey_responses`` table (written by ``POST /api/v2/surveys``)\nover the ``[since, until)`` window on ``created_at`` into the satisfaction\nheadlines + supporting detail:\n\n- **NPS** over the ``nps`` responses (0–10): ``round(%promoters[9–10] −\n  %detractors[0–6])`` — a whole number in ``[-100, 100]`` (null when no NPS\n  responses);\n- **CSAT** over the ``csat`` responses (1–5): the mean score (null when no\n  CSAT responses);\n- per-type + total response counts;\n- a DENSE per-type score distribution (every valid score present,\n  zero-filled).\n\nLike the other KPI routes, the window is OPTIONAL on both ends — omit\n``since`` for an all-time rollup. Cross-tenant operator aggregate: like\n``/summary``, ``/activation-funnel`` and ``/feedback``, the span is governed\nby the session's row visibility (see the module docstring's cross-tenant note\n+ ``core/kpi/survey``).",
        "operationId": "get_survey_summary_api_v2_admin_kpi_surveys_get",
        "parameters": [
          {
            "description": "Inclusive lower bound (UTC ISO-8601) on survey created_at. Omit for no lower bound (all-time).",
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive lower bound (UTC ISO-8601) on survey created_at. Omit for no lower bound (all-time).",
              "title": "Since"
            }
          },
          {
            "description": "Exclusive upper bound (UTC ISO-8601) on survey created_at. Omit for no upper bound (up to now).",
            "in": "query",
            "name": "until",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclusive upper bound (UTC ISO-8601) on survey created_at. Omit for no upper bound (up to now).",
              "title": "Until"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurveySummaryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Survey Summary",
        "tags": [
          "admin",
          "kpi"
        ]
      }
    },
    "/api/v2/admin/patient-data-readiness": {
      "get": {
        "description": "Read the platform's patient-data readiness record. Platform-admin only.\n\nLists each engineering condition that must hold before a business associate\nagreement is recorded for a tenant that is not internal, whether it is met,\nits evidence and who recorded it.",
        "operationId": "get_patient_data_readiness_api_v2_admin_patient_data_readiness_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientDataReadinessView"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Patient Data Readiness",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v2/admin/patient-data-readiness/conditions/{condition_key}": {
      "delete": {
        "description": "Withdraw a condition recorded as met, with the reason.\n\nPlatform-admin only, with a recent sign-in. 409 when the condition is not\nrecorded as met. Agreements already recorded are untouched. The audit row\n(``patient_data_readiness.condition_withdrawn``) is written in the caller's\nown tenant log in the same transaction.",
        "operationId": "withdraw_readiness_condition_api_v2_admin_patient_data_readiness_conditions__condition_key__delete",
        "parameters": [
          {
            "in": "path",
            "name": "condition_key",
            "required": true,
            "schema": {
              "title": "Condition Key",
              "type": "string"
            }
          },
          {
            "description": "Why the condition no longer holds.",
            "in": "query",
            "name": "reason",
            "required": true,
            "schema": {
              "description": "Why the condition no longer holds.",
              "maxLength": 500,
              "minLength": 1,
              "title": "Reason",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientDataReadinessView"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Withdraw Readiness Condition",
        "tags": [
          "admin"
        ]
      },
      "put": {
        "description": "Record one readiness condition as met, with its evidence.\n\nPlatform-admin only, and the caller must have signed in within the step-up\nwindow (403 ``reauthentication_required`` otherwise). 404 for a key that is\nnot a condition. The entry names the caller; the audit row\n(``patient_data_readiness.condition_met``) is written in the caller's own\ntenant log in the same transaction.",
        "operationId": "record_readiness_condition_met_api_v2_admin_patient_data_readiness_conditions__condition_key__put",
        "parameters": [
          {
            "in": "path",
            "name": "condition_key",
            "required": true,
            "schema": {
              "title": "Condition Key",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReadinessConditionMetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientDataReadinessView"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Record Readiness Condition Met",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v2/admin/slo/targets": {
      "get": {
        "description": "Return the SLI/SLO + error-budget registry and burn-rate policy.\n\nResponse shape::\n\n    {\n      \"services\": {\n        \"platform-api\": [\n          {\n            \"name\": \"platform_api_availability\",\n            \"sli_kind\": \"availability\",\n            \"description\": \"...\",\n            \"objective_pct\": 99.9,\n            \"error_budget_pct\": 0.1,\n            \"window_days\": 30,\n            \"latency_percentile\": null,\n            \"latency_threshold_ms\": null\n          },\n          ...\n        ],\n        ...\n      },\n      \"burn_rate_policy\": [\n        {\"severity\": \"page\", \"threshold\": 14.4,\n         \"long_window_minutes\": 60.0, \"short_window_minutes\": 5.0,\n         \"label\": \"fast-burn (2% budget in 1h)\"},\n        ...\n      ],\n      \"slo_count\": ...,\n      \"service_count\": ...,\n      \"live_burn_rate\": null,\n      \"source\": \"declarative-registry\",\n      \"admission\": {\n        \"environment\": \"prod\",\n        \"mode\": \"measure\",\n        \"enforced\": false,\n        \"reason\": \"unconfigured\"\n      }\n    }\n\n``admission`` says whether this environment enforces request limits.\n``mode`` is ``enforce`` (a request over its limit gets 429 with\n``Retry-After``, and responses carry ``RateLimit-*`` headers), ``measure``\n(no request is refused for rate and no ``RateLimit-*`` header is sent) or\n``off`` (local development only). ``enforced`` is true only for\n``enforce``. ``reason`` is ``configured`` when the environment set its mode\nexplicitly; any other value names why it fell back to ``measure``.\n\nAlways 200 for an in-role caller — the registry is statically defined in\nprocess, so there is no \"not measured yet\" state for the targets\nthemselves.",
        "operationId": "get_slo_targets_api_v2_admin_slo_targets_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Slo Targets Api V2 Admin Slo Targets Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Slo Targets",
        "tags": [
          "admin",
          "slo"
        ]
      }
    },
    "/api/v2/admin/tenants": {
      "get": {
        "description": "List every tenant in the directory + user count per tenant.\n\n``tenants`` is NOT RLS-scoped (it IS the directory), so the tenant\nrows are a direct read. ``users`` IS RLS-scoped, and the request\nsession runs RLS-subject with ``platform.tenant_id`` bound to the\nCALLER's tenant — a direct join silently counts only the caller's\nown users and reports 0 for every other tenant. Counts therefore\ncome from the SECURITY DEFINER directory function (migration 081,\nthe 078 admin-KPI precedent), which spans tenants past RLS. Tenants\nabsent from the function's grouped result have zero users.",
        "operationId": "list_tenants_api_v2_admin_tenants_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantAdminList"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Tenants",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v2/admin/tenants/{tenant_id}/baa": {
      "delete": {
        "description": "Clear a tenant's business associate agreement record. Velerian onboarding staff only.\n\nOne person is enough: clearing stops intake, and it is how intake is\nstopped during an incident. From then on a tenant that is not internal is\nrefused when it uploads a document for a crew that works on patient\nrecords. A record waiting for approval is withdrawn with it; to drop only\nthat, use ``DELETE .../baa/proposal``. Documents\nalready stored are untouched, and so are the agreement's notice terms: the\nduty to notify covers patient data received while the agreement stood. 409\nwhen no agreement is recorded and none is waiting. The audit row\n(``tenant.baa.cleared``, with the reason and the cleared record) is written\nin the tenant's own log in the same transaction.",
        "operationId": "clear_tenant_baa_api_v2_admin_tenants__tenant_id__baa_delete",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "description": "Why the record is cleared, for example that the agreement ended.",
            "in": "query",
            "name": "reason",
            "required": true,
            "schema": {
              "description": "Why the record is cleared, for example that the agreement ended.",
              "maxLength": 500,
              "minLength": 1,
              "title": "Reason",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantBaaRecord"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Clear Tenant Baa",
        "tags": [
          "admin"
        ]
      },
      "get": {
        "description": "Read a tenant's business associate agreement record. Velerian onboarding staff only.\n\nAlso reports whether the tenant may upload documents for crews that work on\npatient records, which is what the agreement decides, the agreement's\nnotice terms (which deadline governs a breach notice, how the list of\naffected individuals is delivered, and whom the notice goes to), and the\nrecord waiting for a second person's approval, if one is.",
        "operationId": "get_tenant_baa_api_v2_admin_tenants__tenant_id__baa_get",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Tenant Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantBaaRecord"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Tenant Baa",
        "tags": [
          "admin"
        ]
      },
      "put": {
        "description": "Propose a tenant's business associate agreement record. Velerian onboarding staff only.\n\nNothing is recorded yet. A different login must approve this exact\nrecord (``POST /admin/tenants/{tenant_id}/baa/approval`` with the\n``body_hash`` returned here) before it replaces any earlier record and the\ntenant may upload documents for crews that work on patient records. A new\nproposal replaces one already waiting. A proposal does not expire;\n``DELETE .../baa/proposal`` discards it.\n\nFor a tenant that is not internal the agreement's notice terms are\nrequired (422 without them): the channel for the list of affected\nindividuals, and either the notice window in hours or\n``sixty_day_rule_only``. The platform's patient-data readiness record\n(``/admin/patient-data-readiness``) must have every condition recorded met,\nor carry an unexpired override for this tenant; otherwise 409 with\n``detail.error = patient_data_readiness_incomplete`` and nothing is\nwritten. Both are checked again at approval. The audit row\n(``tenant.baa.proposed``) is written in the tenant's own log in the same\ntransaction.",
        "operationId": "propose_tenant_baa_api_v2_admin_tenants__tenant_id__baa_put",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Tenant Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantBaaRecordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantBaaProposal"
                }
              }
            },
            "description": "Successful Response"
          },
          "409": {
            "description": "The tenant is not internal and the patient-data readiness record is incomplete (detail.error = patient_data_readiness_incomplete)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Propose Tenant Baa",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v2/admin/tenants/{tenant_id}/baa/approval": {
      "post": {
        "description": "Approve the proposed agreement record, which records it. Velerian onboarding staff only.\n\nThe second person: a login other than the one that proposed the record\napproves the exact record it reviewed, named by its ``body_hash``, the rule\na crew's activation follows. The rule compares logins (``users.id``), not\npeople. The record then replaces any earlier one, notice terms included,\nand the tenant may upload documents for crews that work on patient\nrecords.\n\n- **403** ``approval_by_author`` if you proposed it.\n- **409** ``no_pending_proposal``; ``approval_hash_mismatch`` if the\n  fingerprint is not the pending record's; ``author_unknown`` or\n  ``approver_unknown``; ``patient_data_readiness_incomplete`` when the\n  readiness record no longer clears this tenant.\n\nThe audit row (``tenant.baa.recorded``, with the new and previous record,\nwho proposed it and who approved it) is written in the tenant's own log in\nthe same transaction. A refusal for one of the reasons above, except\nreadiness, is audited too (``tenant.baa.approval_refused``: who tried and\nwhy, never the fingerprint).",
        "operationId": "approve_tenant_baa_api_v2_admin_tenants__tenant_id__baa_approval_post",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Tenant Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantBaaApprovalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantBaaRecord"
                }
              }
            },
            "description": "Successful Response"
          },
          "403": {
            "description": "You proposed the record (detail.error = approval_by_author)."
          },
          "409": {
            "description": "No record is waiting (no_pending_proposal), the fingerprint is not the pending record's (approval_hash_mismatch), a person is not recorded, or the readiness record is incomplete (patient_data_readiness_incomplete)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Approve Tenant Baa",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v2/admin/tenants/{tenant_id}/baa/proposal": {
      "delete": {
        "description": "Discard the pending proposal only. Velerian onboarding staff only.\n\nOne person is enough: discarding records nothing. Any agreement already\nrecorded stays in force, so a mistaken amendment can be dropped without\nstopping the client's patient-data intake. A proposal does not expire on\nits own; this is how one is removed. The reason goes in the JSON body. 409\nwhen no proposal is pending. The audit row (``tenant.baa.proposal_withdrawn``,\nwith the reason and the discarded fingerprint) is written in the tenant's\nown log in the same transaction.",
        "operationId": "withdraw_tenant_baa_proposal_api_v2_admin_tenants__tenant_id__baa_proposal_delete",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Tenant Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantBaaProposalWithdrawal"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantBaaRecord"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Withdraw Tenant Baa Proposal",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v2/admin/tenants/{tenant_id}/patient-data-readiness-override": {
      "post": {
        "description": "Let a business associate agreement be recorded for one tenant before readiness.\n\nPlatform-admin only, with a recent sign-in. Until ``expires_at`` (at most 72\nhours away) the agreement-recording route accepts this tenant while\nconditions are unmet; the override changes no condition and ends by itself.\n404 for an unknown tenant. The audit row\n(``patient_data_readiness.override_granted``) is written in the TARGET\ntenant's log in the same transaction, and the agreement's own audit row\nnames the override it used.",
        "operationId": "grant_readiness_override_api_v2_admin_tenants__tenant_id__patient_data_readiness_override_post",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Tenant Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReadinessOverrideRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadinessOverrideView"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Grant Readiness Override",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v2/admin/tenants/{tenant_id}/users": {
      "get": {
        "description": "List users for one tenant. Platform-admin (staff) only.\n\nAn explicit ``WHERE tenant_id = :t`` is NOT enough here: ``users``\nis RLS-scoped and the request session runs RLS-subject with the\nCALLER's tenant bound, so a direct read of any OTHER tenant's users\nreturns zero rows regardless of the WHERE clause. The read goes\nthrough the SECURITY DEFINER directory function (migration 081)\ninstead, which takes the target tenant explicitly and spans RLS.",
        "operationId": "list_tenant_users_api_v2_admin_tenants__tenant_id__users_get",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Tenant Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserAdminList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Tenant Users",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v2/admin/users/invite": {
      "post": {
        "description": "Provision a new user in a tenant: Cognito + DB row + invite email.\n\nFlow:\n1. Validate the destination tenant exists.\n2. Scope the session to the DESTINATION tenant, ahead of every\n   ``users`` statement, so the tenant-isolation policy admits both\n   the new user row and its audit entry.\n3. Reject a duplicate ``(tenant_id, email)`` with a clean 409.\n4. Refuse with 409 when the destination workspace is at its seat limit,\n   before any account exists. The ``detail`` is what every other way\n   into a workspace says at the limit: how many seats it includes, how\n   to free one, and who to talk to. There is no operator exemption;\n   raise the workspace's seat entitlement first.\n5. Create the Cognito user (suppressed-message, our render is the\n   source of truth) — or short-circuit to a synthetic sub in local\n   dev.\n6. Take the seat under the workspace's seat lock and INSERT the\n   ``users`` row. A pending invite for the address already holds the\n   person a seat: they take that one and the invite is marked accepted.\n   An address a member already has, in any letter case, is refused with\n   409. If anything fails once the Cognito user exists, through the\n   commit, that Cognito user is logged at error level for removal.\n7. Audit-write under the *destination tenant's* log (so the audit\n   trail lives where the new user lives, not on the inviter's\n   tenant — those are different rows in the directory), and commit.\n8. Render + hand off the invite email via the lifecycle email\n   renderer/sender (dark-suppressed unless ``VELERIAN_SES_LIVE``), after\n   the commit; the response reports the render + delivery outcome.",
        "operationId": "invite_user_api_v2_admin_users_invite_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitedUser"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Invite User",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v2/agent-networks/{slug}/invoke": {
      "post": {
        "description": "Invoke a NetworkPack — synchronously (default) or queued (``?async=true``).\n\nBoth paths fail-fast-validate (404 unknown pack / 400 alpha guard / 403 no\nentitlement — an unentitled caller never records a run) and then record a\n``queued`` ``pack_runs`` row — on its case — BEFORE any model work, so the\nrun is visible from the moment it is accepted, even if it later fails or\nthe process dies mid-run. The synchronous path then runs the pipeline in\nthe request and returns :class:`InvokeResponse` (200); the async path\nschedules it on a background task and returns 202 :class:`InvokeAccepted`\nimmediately. Either way, ``run_id`` names the same run row from queue time\nto its terminal state.\n\nA pack that works a case stage by stage, submitted WITHOUT naming a case,\nopens the case and starts its workflow instead of a single governed pass:\nthe response is always the 202 :class:`InvokeAccepted` shape, ``run_id``\nis the workflow's first stage run (poll it the same way), and\n``journey_id`` / ``journey_url`` name the workflow. The request returns\nbefore any stage has run. Naming a case (``case_id`` / ``case_ref``) or\nrevising a run keeps the single pass; a per-request ``model_id`` or\n``oversight`` selection is refused on the workflow path (422).",
        "operationId": "invoke_agent_network",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          },
          {
            "description": "Bypass the alpha-pack guard. Required for packs whose maturity is `alpha` (a soft guard against accidental demo invocations). Drops away once the pack reaches `production-ready`.",
            "in": "query",
            "name": "force",
            "required": false,
            "schema": {
              "default": false,
              "description": "Bypass the alpha-pack guard. Required for packs whose maturity is `alpha` (a soft guard against accidental demo invocations). Drops away once the pack reaches `production-ready`.",
              "title": "Force",
              "type": "boolean"
            }
          },
          {
            "description": "Execute the run out-of-band: returns 202 with a run_id immediately; poll /api/v2/pack-runs/{run_id} for the result. Removes the synchronous path's gateway-timeout ceiling on long-running prompts. Default false (synchronous, the pre-existing contract).",
            "in": "query",
            "name": "async",
            "required": false,
            "schema": {
              "default": false,
              "description": "Execute the run out-of-band: returns 202 with a run_id immediately; poll /api/v2/pack-runs/{run_id} for the result. Removes the synchronous path's gateway-timeout ceiling on long-running prompts. Default false (synchronous, the pre-existing contract).",
              "title": "Async",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvokeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvokeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvokeAccepted"
                }
              }
            },
            "description": "Accepted"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Invoke Agent Network",
        "tags": [
          "agent-networks",
          "agent-networks"
        ]
      }
    },
    "/api/v2/agent-networks/{slug}/sample-case": {
      "get": {
        "description": "The crew's example records, dated for now, to file on a new sample case.\n\nRead-only: nothing is written. Open the case with ``POST /api/v2/cases``,\nfile each record with ``/api/v2/run-attachments`` naming that case, then\nstart the journey with ``POST /api/v2/cases/{id}/journey``. 404 when the\ncrew is not available here or has no seeded sample.",
        "operationId": "get_sample_case_api_v2_agent_networks__slug__sample_case_get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SampleCaseOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get a crew's example records for a one-click sample case",
        "tags": [
          "agenticx"
        ]
      }
    },
    "/api/v2/api-clients": {
      "get": {
        "description": "Every client (incl. revoked, for audit-trail completeness), newest first.\n\nAny authenticated role — the response never includes secret material.",
        "operationId": "list_api_clients_api_v2_api_clients_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiClientList"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List the tenant's M2M API clients (never secrets).",
        "tags": [
          "api-clients"
        ]
      },
      "post": {
        "description": "Register a fresh M2M client. Admin-only, JWT-only.\n\nThe client_secret appears ONLY in this response; the DB stores its SHA-256\nhash. The caller exchanges (client_id, client_secret) at the token endpoint\nfor a scoped, short-lived bearer token.",
        "operationId": "register_api_client_api_v2_api_clients_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiClientCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiClientRegistered"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Register an M2M API client (returns the client_secret exactly once).",
        "tags": [
          "api-clients"
        ]
      }
    },
    "/api/v2/api-clients/{client_row_id}": {
      "delete": {
        "description": "Stamp ``status='revoked'``. Admin-only, JWT-only.\n\nIdempotent: revoking an already-revoked client returns 200 with\n``already_revoked``. 404 only when the id does not exist under the caller's\ntenant (RLS-filtered). A revoked client can mint no new tokens; its live\nshort-lived tokens age out via ``exp``.",
        "operationId": "revoke_api_client_api_v2_api_clients__client_row_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "client_row_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Client Row Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiClientRevoked"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke an M2M API client (soft; subsequent token mint fails).",
        "tags": [
          "api-clients"
        ]
      }
    },
    "/api/v2/api-keys": {
      "get": {
        "description": "Every key (incl. revoked, for audit-trail completeness), newest first.\n\nAny authenticated role — viewers may see what credentials exist (a read\nsurface; the response never includes secret material). Never plan-gated:\na downgraded tenant must still be able to inventory + revoke keys.",
        "operationId": "list_api_keys_api_v2_api_keys_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyList"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List the tenant's API keys (prefixes only — never secrets).",
        "tags": [
          "api-keys"
        ]
      },
      "post": {
        "description": "Mint a fresh ``vk_live_*`` key. Admin-only, JWT-only, plan-gated.\n\nThe full secret appears ONLY in this response; the DB stores its SHA-256\nhash. Plan-gating runs before the write — a denied caller creates no row.",
        "operationId": "create_api_key_api_v2_api_keys_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Mint a platform API key (returns the full secret exactly once).",
        "tags": [
          "api-keys"
        ]
      }
    },
    "/api/v2/api-keys/{key_id}": {
      "delete": {
        "description": "Stamp ``revoked_at = now()``. Admin-only, JWT-only, never plan-gated.\n\nIdempotent: revoking an already-revoked key returns 200 with\n``already_revoked`` (the caller's intent is satisfied). 404 only when the\nid does not exist under the caller's tenant (RLS-filtered).",
        "operationId": "revoke_api_key_api_v2_api_keys__key_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Key Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyRevoked"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke an API key (soft delete; subsequent key auth fails).",
        "tags": [
          "api-keys"
        ]
      }
    },
    "/api/v2/approvals": {
      "get": {
        "description": "Invocation approval inbox, scoped by tenant RLS.\n\nDefault ordering is **pending-first** (the actionable queue), then newest\n``requested_at`` first, so an approver sees what needs a decision at the top.\nPacket subjects use the scoped work-action and exact-detail review surfaces.",
        "operationId": "list_approvals_api_v2_approvals_get",
        "parameters": [
          {
            "description": "Filter by status; omit for the full queue.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^(pending|approved|rejected|timed_out)$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by status; omit for the full queue.",
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/velerian__api__routers__approvals__ApprovalList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Approvals",
        "tags": [
          "approvals"
        ]
      }
    },
    "/api/v2/approvals/grouped": {
      "get": {
        "description": "Grouped approval inbox — gate-rows rolled up under their invocation.\n\nAdditive companion to the flat ``GET /api/v2/approvals``: per-constraint\nscoping surfaces ONE approval row per HUMAN_APPROVAL gate of a multi-gate\ndual-control run, all sharing the run's ``invocation_id``. This\nendpoint groups those rows by ``invocation_id`` and attaches a\n``DualControlProgress`` summary (``gates_total`` is the number of gate rows\nenqueued for the run, plus approved / pending / rejected counts and a\n``fully_approved`` flag that flips True only once EVERY gate is approved).\n\nRLS scopes every row to the calling tenant automatically (same\n``get_tenant_context`` + ``get_session`` deps as the flat inbox — access is\nNOT loosened). Groups are ordered actionable-first: any group with a pending\ngate sorts ahead of fully-decided ones, then by most-recent activity.\nPagination (``limit`` / ``offset``) is over GROUPS, not gate rows. The\noptional ``status`` filter narrows the GATES listed inside each group (a\ngroup with no matching gate is omitted), while ``progress`` is always\ncomputed over ALL of the invocation's gates so the dual-control denominator\nstays correct under a filter.",
        "operationId": "list_approvals_grouped_api_v2_approvals_grouped_get",
        "parameters": [
          {
            "description": "Filter the GATES shown within each group; omit for all gates.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^(pending|approved|rejected|timed_out)$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter the GATES shown within each group; omit for all gates.",
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalGroupList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Approvals Grouped",
        "tags": [
          "approvals"
        ]
      }
    },
    "/api/v2/approvals/{approval_id}": {
      "get": {
        "description": "Read exactly the selected gate, including its closed disposition and current advice.\n\nBounded identity reads replace a scan of the inbox. Tenant RLS and auditor\nconfinement remain in the shared session. Restricted keys require a real\nmatching pack run; snapshot labels and ABP invocation IDs cannot establish\nthat relationship. This read performs no decision, revision or resume.\nAn API key or machine token may read the gate but is offered no actions:\nonly a signed-in person can decide it.",
        "operationId": "get_approval_detail_api_v2_approvals__approval_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "approval_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Approval Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Approval Detail",
        "tags": [
          "approvals"
        ]
      }
    },
    "/api/v2/approvals/{approval_id}/decide": {
      "post": {
        "description": "Approve or reject a pending approval, resuming on approve.\n\nThe approver checks below gate a SIGN-OFF, and ``decision`` is read before\nany of them, because one decision is not a sign-off: the person who\nrequested the invocation may always ``reject`` their own still-pending\nrequest, withdrawing work they started. That path skips both approver\nfloors — neither protects anything when a maker takes back their own\nrequest — records ``self_withdrawn=true``, and writes an\n``approval.withdrawn`` audit row instead of ``approval.decided``, so a\nwithdrawal is never counted as a review that happened. ``approve`` is\nunaffected: approving your own work is exactly what segregation of duties\nexists to prevent, and every check below still applies to it.\n\n- **403** ``person_required`` if the request is made with an API key or a\n  machine (M2M) token, whatever its scopes and whoever created it. Every\n  decision here, including a withdrawal, is recorded as a person's, so\n  only a signed-in person may make one. This is checked first, before the\n  role gate and before the approval is read.\n- **404** if the approval doesn't exist (RLS scopes to the calling tenant).\n- **409** if it is not ``pending`` — a decision is irreversible; reopening\n  requires a new invocation. A request that expired with no answer is\n  refused with the error code ``wait_expired``. The\n  ``(tenant, invocation, constraint_ref)`` unique guard caps each\n  (invocation, gate) at one approval row — a multi-gate ABP has one decidable\n  row PER gate, each cleared independently here.\n- **403** ``self_approval_forbidden`` if the caller requested the invocation\n  AND the tenant has another eligible approver who can actually clear this\n  gate — segregation of duties: the human-approval gate exists so the\n  originator cannot self-approve when someone else could. This is relaxed\n  for a genuine solo-operator tenant (no other admin/member user): there\n  self-approval is allowed and audited as ``self_approved=true``, so a\n  one-person tenant isn't permanently stuck on its own escalations. It is\n  also relaxed for a gate that DECLARES its requester an eligible decider\n  (``requester_may_approve`` on the gate's configuration — segregation of\n  duties is off for that gate by declaration): the requester's own\n  decision is accepted whoever else is in the workspace, and audited as\n  ``self_approved=true`` with ``self_approval_basis`` naming the\n  declaration rather than the solo-operator relaxation.\n- **403** ``no_eligible_approver`` when segregation of duties holds the\n  requester but NO ONE in this workspace meets the gate's required approver\n  tier — the gate cannot be decided by anyone here as things stand. The\n  response names the required tier and the remedy: a workspace admin must\n  give a teammate that role before the work can move.\n- **403** ``insufficient_approver_tier`` if the gate declares a minimum\n  approver tier (``required_approver_tier``) the deciding user's\n  ``users.role`` does not meet — approval-tier RBAC.\n  This check is ADDITIVE: it fires AFTER the coarse role gate and the SoD\n  check, and is INDEPENDENT of the solo-operator relaxation — a member-tier\n  solo operator still cannot clear an admin-tier gate (the tier floor is a\n  real control, not a stuck-queue bug). A gate with no declared\n  tier (NULL) defaults to member-tier behavior, so existing approvals are\n  unaffected.\n\nTransitions ``status`` pending -> approved|rejected, stamps\n``decided_by_user_id`` / ``decided_at`` / ``reason``, and writes an atomic\n``approval.decided`` audit row (Rule 6) — ``approval.withdrawn`` when the\nrequester cancelled their own request.\n\nOn approve, RE-RUNS the withheld invocation in this SAME\ntransaction via ``_resume_invocation`` — the approval decision + the resumed\nrun + their audit/evidence rows all commit (or roll back) together. The\nresumed-run outcome rides back on ``DecideResponse.resume``; a re-run that\ncan't proceed (no captured payload / ABP no longer deployed) leaves the\ndecision standing with ``resume.resumed=False``. Reject does not re-run.",
        "operationId": "decide_approval_api_v2_approvals__approval_id__decide_post",
        "parameters": [
          {
            "in": "path",
            "name": "approval_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Approval Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/velerian__api__routers__approvals__DecideRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DecideResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Decide Approval",
        "tags": [
          "approvals"
        ]
      }
    },
    "/api/v2/audit-log": {
      "get": {
        "description": "List audit log entries for the current tenant, latest first.\n\nAll filters are AND-composed. The `event_at DESC` ordering uses the\ncomposite index `ix_audit_log_tenant_event_at` from migration 001.",
        "operationId": "list_audit_entries_api_v2_audit_log_get",
        "parameters": [
          {
            "description": "Filter by exact action string",
            "in": "query",
            "name": "action",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by exact action string",
              "title": "Action"
            }
          },
          {
            "in": "query",
            "name": "resource_kind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Resource Kind"
            }
          },
          {
            "in": "query",
            "name": "resource_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Resource Id"
            }
          },
          {
            "in": "query",
            "name": "actor_user_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Actor User Id"
            }
          },
          {
            "description": "Inclusive lower bound on event_at",
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive lower bound on event_at",
              "title": "Since"
            }
          },
          {
            "description": "Exclusive upper bound on event_at",
            "in": "query",
            "name": "until",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclusive upper bound on event_at",
              "title": "Until"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Audit Entries",
        "tags": [
          "audit"
        ]
      }
    },
    "/api/v2/audit-log/export": {
      "get": {
        "description": "Stream the matching audit rows for the calling tenant (admin-only).\n\nSIEM-friendly bulk export. Rows are pulled in keyset-paginated batches and\nserialised one row at a time straight to the wire, so the full result set\nnever lives in the API tier's memory. The export is hard-capped at\n:data:`_EXPORT_MAX_ROWS` rows; SIEM operators page by ``since`` / ``until``\ndate range for larger pulls.\n\n**Tenant scoping** is automatic via the ``get_session`` dependency — the\nsession has ``platform.tenant_id`` set and RLS filters cross-tenant rows.\n**Auth** is the network-admin gate (exporting the audit log is an admin,\nexaminer-evidence action — not something every tenant member can do).\n\n**Self-audit:** the export writes an ``audit_log.exported`` entry recording\nwho exported, the format, and the active filters BEFORE streaming. It is\nwritten on the request session (committed at handler teardown, before the\nstream's own session opens) and explicitly flushed, because no query\nfollows it on the request session.",
        "operationId": "export_audit_log_api_v2_audit_log_export_get",
        "parameters": [
          {
            "description": "Output format. ``ndjson`` (default) → application/x-ndjson, one JSON object per line (SIEM-native: Splunk / Elastic / Datadog). ``csv`` → text/csv (RFC 4180; the payload column is JSON-encoded).",
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "default": "ndjson",
              "description": "Output format. ``ndjson`` (default) → application/x-ndjson, one JSON object per line (SIEM-native: Splunk / Elastic / Datadog). ``csv`` → text/csv (RFC 4180; the payload column is JSON-encoded).",
              "pattern": "^(ndjson|csv)$",
              "title": "Format",
              "type": "string"
            }
          },
          {
            "description": "Filter by exact action string",
            "in": "query",
            "name": "action",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by exact action string",
              "title": "Action"
            }
          },
          {
            "in": "query",
            "name": "resource_kind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Resource Kind"
            }
          },
          {
            "in": "query",
            "name": "resource_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Resource Id"
            }
          },
          {
            "in": "query",
            "name": "actor_user_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Actor User Id"
            }
          },
          {
            "description": "Inclusive lower bound on event_at",
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive lower bound on event_at",
              "title": "Since"
            }
          },
          {
            "description": "Exclusive upper bound on event_at",
            "in": "query",
            "name": "until",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclusive upper bound on event_at",
              "title": "Until"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Stream the tenant's filtered audit log as NDJSON or CSV for SIEM export.",
        "tags": [
          "audit"
        ]
      }
    },
    "/api/v2/audit-log/verify": {
      "get": {
        "description": "Walk the tenant's audit chain and return an integrity proof (admin-only).\n\nThe examiner-facing \"prove the log wasn't tampered with\" control. Reuses\nthe SAME hashing primitive :class:`AuditWriter` writes with (via\n:func:`velerian.core.audit.integrity.verify_audit_chain`), so a verify can\nnever diverge from a write. Returns ``valid``, the row count + event-time\nrange, and — when the chain is broken — the first broken link (row id,\nposition, and whether the break is a ``prev_hash`` linkage mismatch, a\n``row_hash`` row-integrity mismatch, a deleted covered row or a deleted\nnewest row). It also reports forks and, when the scan reaches the newest\nrows, how many rows no later row links or covers. Deleting one of those\nwould not be detected, so any such row fails the verification too\n(``uncovered_row``), reported only when nothing was changed or removed.\n\nRead-only; tenant-scoped via RLS + an explicit tenant filter.",
        "operationId": "verify_audit_log_api_v2_audit_log_verify_get",
        "parameters": [
          {
            "description": "Inclusive lower bound on event_at (verify a sub-range).",
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive lower bound on event_at (verify a sub-range).",
              "title": "Since"
            }
          },
          {
            "description": "Exclusive upper bound on event_at (verify a sub-range).",
            "in": "query",
            "name": "until",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclusive upper bound on event_at (verify a sub-range).",
              "title": "Until"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrityProofRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Verify the tenant's audit hash-chain (tamper-evidence proof).",
        "tags": [
          "audit"
        ]
      }
    },
    "/api/v2/auth/accept-terms": {
      "post": {
        "description": "Record explicit acceptance of the document shown, with atomic audit.\n\nIdentity and workspace come only from the platform's verified context.\nAn old form or altered document binding is refused; reload and review the\ncurrent document. Repeated acceptance returns the original receipt. The\nrequest transaction commits before this success response is sent.",
        "operationId": "accept_terms_api_v2_auth_accept_terms_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptTermsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TermsAcceptanceRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Accept Terms",
        "tags": [
          "terms"
        ]
      }
    },
    "/api/v2/auth/terms": {
      "get": {
        "description": "Read the exact current document and the signed-in person's own receipt.",
        "operationId": "get_terms_api_v2_auth_terms_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TermsRead"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Terms",
        "tags": [
          "terms"
        ]
      }
    },
    "/api/v2/cases": {
      "get": {
        "description": "The find-and-filter worklist over your workspace's cases.\n\nEvery filter is applied server-side. Active cases (open /\nwaiting_external / needs_human) always sort before terminal ones — a\nworklist, not a history; ``sort`` orders by ``created_at`` within that.\nFree-text ``q`` matches titles, and a pasted ``case_ref`` (``C-123`` or\n``123``) jumps to that case. ``overdue=true`` narrows to cases with a\nlive deadline already past due, and ``group`` narrows to one workflow\ngroup — the way to page deeper into a group of the grouped worklist. Each\nopen row carries its soonest live deadline as ``clock`` (name, time\nremaining, zone) for at-a-glance countdowns; the full per-deadline\nreadings live on the clocks endpoints. Each row also carries\n``governance`` — whether the work on it passed its checks, and whether any\nattempt did not — so the answer is on the row itself; the full per-check\ndetail stays on the run record.",
        "operationId": "list_cases_api_v2_cases_get",
        "parameters": [
          {
            "description": "Filter by lifecycle status; omit for all.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^(open|waiting_external|needs_human|resolved|abandoned)$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by lifecycle status; omit for all.",
              "title": "Status"
            }
          },
          {
            "description": "Narrow to one workflow group: 'needs_you' (waiting on you — a decision, an action, or an input only you can supply), 'ready_to_close' (the recorded outcomes say the job got done and nothing is running — record how it turned out to close it), 'stalled' (open with nothing running and the job not done), 'waiting' (waiting on someone else, or on an input that arrives on its own), 'in_progress' (a run is executing right now), or 'done' (finished). This is how you page deeper into a group of the grouped worklist.",
            "in": "query",
            "name": "group",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^(needs_you|ready_to_close|stalled|waiting|in_progress|done)$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Narrow to one workflow group: 'needs_you' (waiting on you — a decision, an action, or an input only you can supply), 'ready_to_close' (the recorded outcomes say the job got done and nothing is running — record how it turned out to close it), 'stalled' (open with nothing running and the job not done), 'waiting' (waiting on someone else, or on an input that arrives on its own), 'in_progress' (a run is executing right now), or 'done' (finished). This is how you page deeper into a group of the grouped worklist.",
              "title": "Group"
            }
          },
          {
            "in": "query",
            "name": "primary_pack_slug",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 64,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Primary Pack Slug"
            }
          },
          {
            "in": "query",
            "name": "opened_via",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^(intake|run|api|schedule|email|webhook|manual)$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Opened Via"
            }
          },
          {
            "description": "Free text over case titles; a quoted case_ref (C-000123 / C-123 / 123) additionally matches that exact case.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Free text over case titles; a quoted case_ref (C-000123 / C-123 / 123) additionally matches that exact case.",
              "title": "Q"
            }
          },
          {
            "description": "Only cases created at/after this instant.",
            "in": "query",
            "name": "created_from",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only cases created at/after this instant.",
              "title": "Created From"
            }
          },
          {
            "description": "Only cases created at/before this instant.",
            "in": "query",
            "name": "created_to",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only cases created at/before this instant.",
              "title": "Created To"
            }
          },
          {
            "description": "Only cases with at least one live deadline already past due (the deadline has passed while the case is still open).",
            "in": "query",
            "name": "overdue",
            "required": false,
            "schema": {
              "default": false,
              "description": "Only cases with at least one live deadline already past due (the deadline has passed while the case is still open).",
              "title": "Overdue",
              "type": "boolean"
            }
          },
          {
            "description": "Order within the active/terminal split by created_at: created_desc (default, newest first) or created_asc (oldest first — combine with status=open for an oldest-first worklist).",
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "default": "created_desc",
              "description": "Order within the active/terminal split by created_at: created_desc (default, newest first) or created_asc (oldest first — combine with status=open for an oldest-first worklist).",
              "pattern": "^(created_asc|created_desc)$",
              "title": "Sort",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "The case worklist — server-side filtered, paginated, sorted.",
        "tags": [
          "cases"
        ]
      },
      "post": {
        "description": "Open a new case (status ``open``) and return it including ``case_ref``.\n\nAdmins and members may open cases (viewers are read-only), and API keys\ncarrying ``runs:write`` are first-class openers. The case reference is\nallocated sequentially within your workspace.\n\nA signed-in administrator of an internal development workspace can set\n``practiceFixture=\"peo_quote\"`` on a manual synthetic case without a crew.\nSend an Idempotency-Key. The initial quote and four pending worksheets are\nrecorded as internal journal entries. Opening the case does not assign a reviewer.\n\nA case opened on a pack that declares steps starts its workflow\nautomatically — EXCEPT one you open by hand (``opened_via='manual'``).\nYou are still putting the file together at that point, so the agent waits\nfor you: start it with ``POST /{case_id}/journey`` when the case has what\nit needs. ``journey_startable`` on ``GET /{case_id}`` says when a start is\navailable. Read the workflow back via ``GET /{case_id}/journey``.",
        "operationId": "create_case_api_v2_cases_post",
        "parameters": [
          {
            "description": "A client-chosen key (at most 255 characters) that makes this submission safe to resend. A resend with the same key within 24 hours returns the original outcome and starts no second run; the same key with a different request is refused with 422.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 255,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "A client-chosen key (at most 255 characters) that makes this submission safe to resend. A resend with the same key within 24 hours returns the original outcome and starts no second run; the same key with a different request is refused with 422.",
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaseCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyInUse"
                }
              }
            },
            "description": "The keyed request is still running."
          },
          "422": {
            "description": "Idempotency-Key reused with a different request."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionRefusal"
                }
              }
            },
            "description": "Refused by a workspace capacity limit."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionRefusal"
                }
              }
            },
            "description": "Admission could not decide; retry."
          }
        },
        "summary": "Open a case.",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/by-ref/{case_ref}": {
      "get": {
        "description": "Detail for one case addressed by its quotable reference — the API\naccepts a case id or a case reference wherever a case is addressed.\n\nAccepts every quotable form (``C-000123`` / ``C-123`` / ``123``). A string\nthat is not a case reference, or a number with no case in your workspace,\nis a 404 — a bad reference is never a silent miss.",
        "operationId": "get_case_by_ref_api_v2_cases_by_ref__case_ref__get",
        "parameters": [
          {
            "in": "path",
            "name": "case_ref",
            "required": true,
            "schema": {
              "title": "Case Ref",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get one case by its quotable reference (C-000123).",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/by-ref/{case_ref}/history": {
      "get": {
        "operationId": "get_history_by_ref_api_v2_cases_by_ref__case_ref__history_get",
        "parameters": [
          {
            "in": "path",
            "name": "case_ref",
            "required": true,
            "schema": {
              "title": "Case Ref",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseRecordedHistory"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get History By Ref",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/by-ref/{case_ref}/history/export": {
      "get": {
        "operationId": "export_history_by_ref_api_v2_cases_by_ref__case_ref__history_export_get",
        "parameters": [
          {
            "in": "path",
            "name": "case_ref",
            "required": true,
            "schema": {
              "title": "Case Ref",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Export History By Ref",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/by-ref/{case_ref}/history/{section}": {
      "get": {
        "operationId": "get_history_page_by_ref_api_v2_cases_by_ref__case_ref__history__section__get",
        "parameters": [
          {
            "in": "path",
            "name": "case_ref",
            "required": true,
            "schema": {
              "title": "Case Ref",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "section",
            "required": true,
            "schema": {
              "enum": [
                "stages",
                "lifecycle",
                "runs",
                "approvals",
                "attachments",
                "evidence_revisions",
                "proof_bindings",
                "proof_context",
                "proof_attempts",
                "proof_consumptions",
                "identity_revisions",
                "policy_revisions",
                "recovery_events",
                "recovery_movements",
                "restarts"
              ],
              "title": "Section",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoryPage"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get History Page By Ref",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/grouped": {
      "get": {
        "description": "Your workspace's cases grouped by where the work stands.\n\nSix groups, in the order a worklist is read: what **needs you** (a\ndecision, an action, or an input only you can supply — a workflow paused\nwaiting for a document you hold lands here), what is **ready to close**\n(the recorded outcomes say the job got done and nothing is running —\nrecord how it turned out), what is **stalled** (open, but nothing is\nrunning and the job is not done), what is **waiting on someone else** (or\non an input that arrives on its own — a workflow paused for a connected\nsystem or a date lands here), what is **in progress** (a run is actually\nexecuting right now), and what is **done**. Each group\ncarries its true count under the current filters plus its first page of\nrows — counting, grouping and paging all happen here, never in the\ncaller, so a workspace with thousands of cases stays fast.\n\nEvery group is returned even when empty: an empty \"needs you\" is good news\nand worth saying, and a hidden group would make its work invisible. The\nsame filters as the flat worklist apply (pack, opened via, free text over\ntitles and case references, date range, overdue), and each row carries its\nsoonest live deadline as ``clock`` and whether its work passed its checks\nas ``governance``. To page deeper into one group, call the flat worklist\nscoped to it: ``GET /api/v2/cases?group=needs_you&offset=10``.",
        "operationId": "list_cases_grouped_api_v2_cases_grouped_get",
        "parameters": [
          {
            "in": "query",
            "name": "primary_pack_slug",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 64,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Primary Pack Slug"
            }
          },
          {
            "in": "query",
            "name": "opened_via",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^(intake|run|api|schedule|email|webhook|manual)$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Opened Via"
            }
          },
          {
            "description": "Free text over case titles; a quoted case_ref (C-000123 / C-123 / 123) additionally matches that exact case.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Free text over case titles; a quoted case_ref (C-000123 / C-123 / 123) additionally matches that exact case.",
              "title": "Q"
            }
          },
          {
            "description": "Only cases created at/after this instant.",
            "in": "query",
            "name": "created_from",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only cases created at/after this instant.",
              "title": "Created From"
            }
          },
          {
            "description": "Only cases created at/before this instant.",
            "in": "query",
            "name": "created_to",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only cases created at/before this instant.",
              "title": "Created To"
            }
          },
          {
            "description": "Only cases with at least one live deadline already past due (the deadline has passed while the case is still open).",
            "in": "query",
            "name": "overdue",
            "required": false,
            "schema": {
              "default": false,
              "description": "Only cases with at least one live deadline already past due (the deadline has passed while the case is still open).",
              "title": "Overdue",
              "type": "boolean"
            }
          },
          {
            "description": "Order within each group by created_at: created_desc (default, newest first) or created_asc (oldest first).",
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "default": "created_desc",
              "description": "Order within each group by created_at: created_desc (default, newest first) or created_asc (oldest first).",
              "pattern": "^(created_asc|created_desc)$",
              "title": "Sort",
              "type": "string"
            }
          },
          {
            "description": "How many rows to return per group (each group's count is complete regardless of this).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "description": "How many rows to return per group (each group's count is complete regardless of this).",
              "maximum": 50,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseGroupedList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "The case worklist grouped by where the work stands, needs-you first.",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/journey-recovery/summary": {
      "get": {
        "description": "Report the active denominator explicitly, including zero.\n\nPaused and previously halted recoverable journeys are counted separately.\nJourneys whose crew is on hold are counted apart from stranded ones, with\nthe open deadlines on those crews' cases. Completed journeys and closed\ncases are excluded. ``crews`` gives the same counts for each crew with an\nunfinished journey, so a reader can judge a subset of crews; the deployed\nAPI still decides which revisions are available.",
        "operationId": "get_recovery_census_api_v2_cases_journey_recovery_summary_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecoveryCensus"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Count stranded journeys against this server's deployed revisions.",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/needs-you-by-pack": {
      "get": {
        "description": "How many cases need you, per pack — the whole workspace in one answer.\n\nThe same needs-you total :func:`list_cases_grouped` reports for a single\npack, for every pack at once. A surface that shows a needs-you badge\nbeside each of a workspace's packs wants exactly this and nothing else:\nasking the grouped worklist once per pack costs one request per pack and\nreturns six groups and a page of rows each time, to read one integer.\n\nOnly packs with at least one case needing you appear. A pack absent from\nthe list has a total of zero — the caller already knows which packs it is\nasking about, and listing a row per catalog pack would make the response\ngrow with the catalog rather than with the work.",
        "operationId": "needs_you_by_pack_api_v2_cases_needs_you_by_pack_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseNeedsYouByPack"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Needs-you totals for every pack at once, in one read.",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}": {
      "get": {
        "description": "Detail for one case + the rollup of everything hanging off its thread:\nthe pack runs attempted against it, the intake conversations that scoped\nit, the approvals its runs raised, and the case file (the input documents\nthose runs consumed). 404 if it does not exist under this tenant.",
        "operationId": "get_case_api_v2_cases__case_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get one case with its runs, intake sessions, approvals, and attachments.",
        "tags": [
          "cases"
        ]
      },
      "patch": {
        "description": "Patch a case: title / primary_pack_slug edits + lifecycle transitions.\n\nThe active states (``open`` / ``waiting_external`` / ``needs_human``) move\nfreely among themselves and into either terminal state. ``resolved``\nrequires ``resolution_outcome`` — closure records what actually happened;\n``abandoned`` takes an optional reason via the resolution fields. Reaching\na terminal state stamps ``resolved_at`` + ``resolved_by_user_id``.\nTerminal cases accept no further transitions (409). Resolution fields\nsupplied without a closing status are a 422 — they are the closure\nattestation, not free edits.\n\nClosing a case also WITHDRAWS its still-open work items in the same\ntransaction: each is recorded ``cancelled`` with the reason it stopped\nasking, and each withdrawal is audited. A closed case asks nobody for\nanything, so nothing it raised is left standing on a worklist or on the\nsign-offs queue.\n\nClosing a case, resolved or abandoned, CANCELS its workflow in the same\ntransaction: no further step runs, and a step still running finishes\nwithout its result being added to the case. A workflow that already\nfinished keeps its record. **409** when the case is changing at that\nmoment, or, on abandon, its workflow; retry.\n\nAttaching (or swapping) the primary pack on a non-terminal case derives\nthe case's data-acquisition statuses in the same transaction: the new\npack's contract entities are seeded ``pending``, and any entity already\nsatisfied by a stored, readable case document flips ``acquired`` — the\nattach-first flow's documents count the moment the pack arrives, not on\nthe next upload or run. An API key's change is refused (**403**\n``exposure_denied_by_policy``, nothing changes) when the workspace's\npolicy keeps the case's crew, its workflow's crew or the new crew inside\nthe app.",
        "operationId": "update_case_api_v2_cases__case_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaseUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Edit a case or transition its lifecycle (close requires ground truth).",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/completion-evidence/enroll": {
      "post": {
        "operationId": "enroll_api_v2_cases__case_id__completion_evidence_enroll_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReasonRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "boolean"
                  },
                  "title": "Response Enroll Api V2 Cases  Case Id  Completion Evidence Enroll Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Enroll",
        "tags": [
          "completion-evidence"
        ]
      }
    },
    "/api/v2/cases/{case_id}/completion-evidence/intents/{intent_id}/retry": {
      "post": {
        "operationId": "retry_continuation_api_v2_cases__case_id__completion_evidence_intents__intent_id__retry_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "intent_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Intent Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReasonRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Retry Continuation Api V2 Cases  Case Id  Completion Evidence Intents  Intent Id  Retry Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Retry Continuation",
        "tags": [
          "completion-evidence"
        ]
      }
    },
    "/api/v2/cases/{case_id}/compute-exports": {
      "get": {
        "description": "Offer only files whose recorded source and release checks succeed now.",
        "operationId": "list_compute_exports_api_v2_cases__case_id__compute_exports_get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComputeExportList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List downloads from this case's completed computation.",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/compute-exports/{compute_run_id}/{kind}": {
      "get": {
        "description": "Recheck source and release conditions before storing and signing a file.",
        "operationId": "download_compute_export_api_v2_cases__case_id__compute_exports__compute_run_id___kind__get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "compute_run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Compute Run Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "title": "Kind",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComputeExportDownload"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download a file from this case's recorded computation.",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/computed-results": {
      "get": {
        "description": "Current computation facts, not historical model inputs or released exports.\n\nValues remain available during a human review or alongside model runs.\nExport release checks are separate and unchanged. Malformed provenance,\nunaccepted attempts and oversized values are explicitly withheld.\n\n``supplied`` (first page only) lists the facts a model step's platform\nreading recorded in code on entry, such as each claim line's route with\nthe rule and codes that decided it, under the same withholding rules.",
        "operationId": "list_computed_results_api_v2_cases__case_id__computed_results_get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 20,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "maximum": 10000,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComputedResultList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read current accepted computation values for case review.",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/data-requirements": {
      "get": {
        "description": "One entry per entity of the case's primary-pack data contract.\n\nEach entry joins the pack's DECLARATION — the datum's name, why it is\nneeded, its named fields, and the ordered sources it can arrive through\n(connector sources carry a code-level ``live`` flag that describes the\nconnector's code, never a connection: every connector is built and\nswitched on with the customer during onboarding) — with this case's\nACQUISITION status: ``pending`` (nothing has supplied it yet),\n``acquiring`` (an in-flight pull — reserved; renders\ngray like pending), ``acquired`` (with what satisfied it, e.g. the\nattached file), or ``failed`` (with a plain-language reason and the\nactionable next step). ``active_source`` is the source the datum pulls\nfrom today; ``fallback_source`` the next one that works.\n\nStatuses derive from runtime signals only — uploads that arrive on the\ncase, runs that start with or without the datum. There is no endpoint\nthat sets one.\n\n``awaiting_record`` rides alongside ``status``, never over it: present\nexactly when a document already stored on the case covers the datum and\nthe record of it has not been written yet. ``status`` still reads\n``pending`` (or ``failed``, when the document answers an earlier failure)\nthere, because that is what has been recorded — the extra field is how\n\"supplied, still being filed\" is told apart from \"never supplied\",\nwithout showing a source nothing can yet be attributed to.\n\nA pack with no declared contract returns ``items: []`` (the panel does\nnot render). 404 if the case is not in your workspace.",
        "operationId": "list_case_data_requirements_api_v2_cases__case_id__data_requirements_get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseDataRequirementList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "The data this case needs, where each datum comes from, and where acquisition stands.",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/evidence-revisions": {
      "get": {
        "operationId": "list_revisions_api_v2_cases__case_id__evidence_revisions_get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/EvidenceRevisionRead"
                  },
                  "title": "Response List Revisions Api V2 Cases  Case Id  Evidence Revisions Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Revisions",
        "tags": [
          "completion-evidence"
        ]
      }
    },
    "/api/v2/cases/{case_id}/evidence-revisions/{attachment_id}/retain": {
      "post": {
        "operationId": "retain_source_api_v2_cases__case_id__evidence_revisions__attachment_id__retain_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "attachment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Attachment Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceRevisionRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Retain Source",
        "tags": [
          "completion-evidence"
        ]
      }
    },
    "/api/v2/cases/{case_id}/evidence-revisions/{revision_id}/{kind}": {
      "get": {
        "operationId": "read_source_api_v2_cases__case_id__evidence_revisions__revision_id___kind__get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "revision_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Revision Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "original",
                "extraction"
              ],
              "title": "Kind",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read Source",
        "tags": [
          "completion-evidence"
        ]
      }
    },
    "/api/v2/cases/{case_id}/history": {
      "get": {
        "operationId": "get_history_api_v2_cases__case_id__history_get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseRecordedHistory"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get History",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/history/export": {
      "get": {
        "operationId": "export_history_api_v2_cases__case_id__history_export_get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Export History",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/history/{section}": {
      "get": {
        "operationId": "get_history_page_api_v2_cases__case_id__history__section__get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "section",
            "required": true,
            "schema": {
              "enum": [
                "stages",
                "lifecycle",
                "runs",
                "approvals",
                "attachments",
                "evidence_revisions",
                "proof_bindings",
                "proof_context",
                "proof_attempts",
                "proof_consumptions",
                "identity_revisions",
                "policy_revisions",
                "recovery_events",
                "recovery_movements",
                "restarts"
              ],
              "title": "Section",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoryPage"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get History Page",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/identity-bases": {
      "get": {
        "operationId": "list_bases_api_v2_cases__case_id__identity_bases_get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityBasesRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Bases",
        "tags": [
          "completion-evidence"
        ]
      },
      "post": {
        "operationId": "select_basis_api_v2_cases__case_id__identity_bases_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/velerian__api__routers__completion_evidence__BasisRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Select Basis Api V2 Cases  Case Id  Identity Bases Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Select Basis",
        "tags": [
          "completion-evidence"
        ]
      }
    },
    "/api/v2/cases/{case_id}/journal": {
      "get": {
        "description": "One case's journal, oldest entry first.\n\nEvery entry says who it was written for. **By default this returns only\nthe customer-visible entries** — the ones written for the customer to\nread. Internal work notes are returned only when you ask for them by name\nwith `audience=all`, so a surface that shows a customer their case cannot\nshow them a work note by omission.\n\n404 if the case does not exist in your workspace.",
        "operationId": "list_case_journal_api_v2_cases__case_id__journal_get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "description": "Which entries to return. 'customer_visible' (the default) returns only what the customer may read; 'all' additionally returns your internal work notes.",
            "in": "query",
            "name": "audience",
            "required": false,
            "schema": {
              "default": "customer_visible",
              "description": "Which entries to return. 'customer_visible' (the default) returns only what the customer may read; 'all' additionally returns your internal work notes.",
              "pattern": "^(customer_visible|all)$",
              "title": "Audience",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 200,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseJournalEntryList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read a case's journal.",
        "tags": [
          "cases"
        ]
      },
      "post": {
        "description": "Record something on the case's journal.\n\nYou must say who the entry is for: `internal` keeps it inside your\nworkspace, `customer_visible` writes it for the customer to read. There is\nno default and the choice cannot be changed afterwards — an entry is\nwritten once, with its audience, and stays that way.\n\nEntries added here are recorded as written by you. 404 if the case does\nnot exist in your workspace.",
        "operationId": "create_case_journal_entry_api_v2_cases__case_id__journal_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaseJournalEntryCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseJournalEntryRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Add an entry to a case's journal.",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/journey": {
      "get": {
        "description": "The case's journey with its stages in declared order.\n\nEach stage carries its state, its explicit entry and completion times, and\nthe artifact that realised it — the governed run it fired, the work item it\nraised, or the deadline it is waiting on. Agent-run stages also carry the\nacting agent from the pack's roster, and the response includes the\njourney's ordered event beats — the work starting, each step being entered\nand closed, and the journey finishing — derived entirely from those\nrecords, naming what is being worked but never an agent's output. When the\npack declares approvals, the response also names the human sign-off seat\n(`principal_seat`): the minimum approver tier the declared gates require —\na tier, never a person, and null when no approval is declared. A step that\nhands typed facts to later steps also carries `facts_check` — why that\nhandoff was not usable, naming the failing locations and the rules they\nbroke but never the values, so a journey that stopped on a step's facts\ncan be diagnosed from this read alone. 404 when the case does not exist\nunder this workspace, or when it is not running a staged pack.",
        "operationId": "get_case_journey_api_v2_cases__case_id__journey_get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JourneyRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get a case's staged journey and every stage's state.",
        "tags": [
          "cases"
        ]
      },
      "post": {
        "operationId": "start_case_journey_api_v2_cases__case_id__journey_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "description": "A client-chosen key (at most 255 characters) that makes this submission safe to resend. A resend with the same key within 24 hours returns the original outcome and starts no second run; the same key with a different request is refused with 422.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 255,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "A client-chosen key (at most 255 characters) that makes this submission safe to resend. A resend with the same key within 24 hours returns the original outcome and starts no second run; the same key with a different request is refused with 422.",
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JourneyStartRequest",
                "default": {
                  "restart_inputs_reviewed": false
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JourneyRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyInUse"
                }
              }
            },
            "description": "The keyed request is still running."
          },
          "422": {
            "description": "Idempotency-Key reused with a different request."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionRefusal"
                }
              }
            },
            "description": "Refused by a workspace capacity limit."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionRefusal"
                }
              }
            },
            "description": "Admission could not decide; retry."
          }
        },
        "summary": "Start a case on its pack's declared stages.",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/journey/next-round": {
      "post": {
        "description": "Start the next round of a case whose crew works in rounds, by hand.\n\nThe new round is a fresh journey on the same case, numbered one above the\ncurrent round, on the stages the case's crew declares now; it enters its\nfirst stage as a start does. The rounds before it stay on the case as they\nended (``GET /cases/{case_id}/journeys``).\n\n- **404** if the case does not exist under this workspace.\n- **409** if the case is closed, its crew does not work in rounds, it has\n  not started its first round, its current round is still running or\n  stopped before it finished, or the crew's own rules refuse a round now;\n  or if the case is changing (refresh and try again); or\n  (``round_held_for_person``) a person must look at the claim first: the\n  crew has opened an item for them on the case.\n- **429** (``Retry-After``) when the workspace already has the most work\n  waiting that it may queue; nothing is written.",
        "operationId": "start_case_next_round_api_v2_cases__case_id__journey_next_round_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "description": "A client-chosen key (at most 255 characters) that makes this submission safe to resend. A resend with the same key within 24 hours returns the original outcome and starts no second run; the same key with a different request is refused with 422.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 255,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "A client-chosen key (at most 255 characters) that makes this submission safe to resend. A resend with the same key within 24 hours returns the original outcome and starts no second run; the same key with a different request is refused with 422.",
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JourneyRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyInUse"
                }
              }
            },
            "description": "The keyed request is still running."
          },
          "422": {
            "description": "Idempotency-Key reused with a different request."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionRefusal"
                }
              }
            },
            "description": "Refused by a workspace capacity limit."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionRefusal"
                }
              }
            },
            "description": "Admission could not decide; retry."
          }
        },
        "summary": "Start a case's next round.",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/journey/position-proof": {
      "get": {
        "description": "Fixed pack reporting positions; future steps remain explicitly unavailable.",
        "operationId": "get_case_position_proof_api_v2_cases__case_id__journey_position_proof_get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JourneyPositionProof"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read authenticated positions accepted by the case workflow.",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/journey/restart": {
      "post": {
        "description": "Preserve the original history and prepare one linked manual replacement.\n\nOffered when the case's ``recovery`` says so: for a workflow pinned to steps\nthis deployment no longer runs, or for one that ended before a readable\ndocument was added to the case. In the second case the replacement already\ncarries a copy of every document on this case, and this case may be closed.\n\nReview original sources and dates on the replacement, then explicitly Start.\nRepeated requests return the same replacement. Running or uncertain execution\nblocks recovery; no execution is cancelled, resumed or replayed on this case.\n\n- **403** when carrying the documents would file patient documents for a\n  workspace with no business associate agreement on record.\n- **409** when the case offers no restart, its documents changed or could\n  not be copied, or it is changing; refresh and try again.",
        "operationId": "restart_case_journey_api_v2_cases__case_id__journey_restart_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestartCaseRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "403": {
            "description": "Refused. Either the caller's role does not allow this action, or the crew works on patient records and the organization has no business associate agreement with Velerian on record (detail.error = patient_data_agreement_required)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Prepare a fresh linked case for a workflow that cannot use this one.",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/journey/resume": {
      "post": {
        "operationId": "resume_case_journey_api_v2_cases__case_id__journey_resume_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JourneyRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Continue a journey that paused for missing inputs.",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/journeys": {
      "get": {
        "description": "Every journey the case has run, one per round, earliest first.\n\nA case whose crew does not work in rounds lists at most one. The current\nround, with its stages, is ``GET /cases/{case_id}/journey``; an earlier\none is ``GET /cases/{case_id}/journeys/{round_number}``. ``next_round``\nsays whether this caller could start the next round now, and why not\nwhen it could not; the start itself still decides. Each round's\n``notes`` are what its steps refused, in the sentences they recorded;\nwhen they cannot be read the rounds are listed without them. The list\nis empty when the case has not started; 404 when the case does not\nexist under this workspace.",
        "operationId": "list_case_rounds_api_v2_cases__case_id__journeys_get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseRoundsRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List a case's rounds, earliest first.",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/journeys/{round_number}": {
      "get": {
        "description": "One round of the case, earlier or current, in the shape of\n``GET /cases/{case_id}/journey``: its journey, every stage's state and\nthe events derived from them. It reads and changes nothing else.\n\n404 when the case does not exist under this workspace, or has no round\nwith that number.",
        "operationId": "get_case_round_api_v2_cases__case_id__journeys__round_number__get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "description": "The round, from 1.",
            "in": "path",
            "name": "round_number",
            "required": true,
            "schema": {
              "description": "The round, from 1.",
              "maximum": 2147483647,
              "minimum": 1,
              "title": "Round Number",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JourneyRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get one round of a case, with its stages.",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/packet-release": {
      "get": {
        "operationId": "read_case_packet_release_api_v2_cases__case_id__packet_release_get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "artifacts_for_packet_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Artifacts For Packet Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Read Case Packet Release Api V2 Cases  Case Id  Packet Release Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read Case Packet Release",
        "tags": [
          "packet-release"
        ]
      }
    },
    "/api/v2/cases/{case_id}/packet-release/amount-basis": {
      "post": {
        "operationId": "confirm_packet_amount_api_v2_cases__case_id__packet_release_amount_basis_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/velerian__api__routers__packet_release__BasisRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Confirm Packet Amount Api V2 Cases  Case Id  Packet Release Amount Basis Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Confirm Packet Amount",
        "tags": [
          "packet-release"
        ]
      }
    },
    "/api/v2/cases/{case_id}/packet-release/amount-basis/withdraw": {
      "post": {
        "description": "Withdraw this case's contribution from a shared dispute scope.\n\nWrites a new scope revision without the case's contribution, recording who,\nwhen and why, and recomputes the scope's total. Any case writer may\nwithdraw the contribution of a resolved or abandoned case; while the case\nis open only an admin or owner may. Packets bound to the scope go stale,\nas they do when an amount is confirmed. ``expected_revision`` is the\nscope's current revision (the case's ``packet-release`` read and a\n``conflicting_episode_source_balances`` refusal both name it).",
        "operationId": "withdraw_packet_amount_contribution_api_v2_cases__case_id__packet_release_amount_basis_withdraw_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WithdrawRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Withdraw Packet Amount Contribution Api V2 Cases  Case Id  Packet Release Amount Basis Withdraw Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Withdraw Packet Amount Contribution",
        "tags": [
          "packet-release"
        ]
      }
    },
    "/api/v2/cases/{case_id}/packet-release/enroll": {
      "post": {
        "operationId": "enroll_packet_release_api_v2_cases__case_id__packet_release_enroll_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "boolean"
                  },
                  "title": "Response Enroll Packet Release Api V2 Cases  Case Id  Packet Release Enroll Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Enroll Packet Release",
        "tags": [
          "packet-release"
        ]
      }
    },
    "/api/v2/cases/{case_id}/packet-release/packets": {
      "post": {
        "operationId": "freeze_case_packet_api_v2_cases__case_id__packet_release_packets_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FreezeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Freeze Case Packet Api V2 Cases  Case Id  Packet Release Packets Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Freeze Case Packet",
        "tags": [
          "packet-release"
        ]
      }
    },
    "/api/v2/cases/{case_id}/packet-release/policy": {
      "put": {
        "operationId": "tighten_packet_policy_api_v2_cases__case_id__packet_release_policy_put",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/velerian__api__routers__packet_release__PolicyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Tighten Packet Policy Api V2 Cases  Case Id  Packet Release Policy Put",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Tighten Packet Policy",
        "tags": [
          "packet-release"
        ]
      }
    },
    "/api/v2/cases/{case_id}/quote-onboarding": {
      "get": {
        "operationId": "list_runs_api_v2_cases__case_id__quote_onboarding_get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/QuoteHandoffRun"
                  },
                  "title": "Response List Runs Api V2 Cases  Case Id  Quote Onboarding Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Runs",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/quote-onboarding/{run_id}": {
      "get": {
        "operationId": "get_handoff_api_v2_cases__case_id__quote_onboarding__run_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "scenario",
            "required": false,
            "schema": {
              "default": "april",
              "enum": [
                "april",
                "july"
              ],
              "title": "Scenario",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteHandoffResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Handoff",
        "tags": [
          "cases"
        ]
      },
      "post": {
        "operationId": "update_handoff_api_v2_cases__case_id__quote_onboarding__run_id__post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteHandoffChange"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteHandoffResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Handoff",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/reopen": {
      "post": {
        "description": "Reopen a claim case that closed as paid, after the payer took money back.\n\nOnly a case whose claim the claim register closed ``paid`` can be reopened,\nand only by a signed-in person (member, admin or owner) with a reason; an\nAPI key or a machine token is refused with 403. The case returns to\n``open`` with its resolution cleared, the claim is open again with a\n``reopened`` history row, and the case holds an item for a person, so it\nreads ``needs_human``. The earlier rounds keep their records. A person\nadds the payer's remittance, completes the item, then starts the case's\nnext round, which reads the take-back. Billing is not touched.\n\n- **404** if the case does not exist, or has no claim.\n- **409** if the case is not resolved, its claim did not close as paid, or\n  the case is being changed right now (try again); nothing is written.\n- **422** for a missing or blank reason, one over 500 characters, or a body\n  it cannot read. Every refusal is a fixed code and sentence; none repeats\n  what the person typed.",
        "operationId": "reopen_case_api_v2_cases__case_id__reopen_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReopenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseReopened"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Reopen Case",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/requirements/{requirement_id}/proof": {
      "get": {
        "operationId": "read_proof_api_v2_cases__case_id__requirements__requirement_id__proof_get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "requirement_id",
            "required": true,
            "schema": {
              "title": "Requirement Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProofDetailRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read Proof",
        "tags": [
          "completion-evidence"
        ]
      }
    },
    "/api/v2/cases/{case_id}/requirements/{requirement_id}/proof/attest": {
      "post": {
        "operationId": "attest_proof_api_v2_cases__case_id__requirements__requirement_id__proof_attest_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "requirement_id",
            "required": true,
            "schema": {
              "title": "Requirement Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttestationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProofDetailRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Attest Proof",
        "tags": [
          "completion-evidence"
        ]
      }
    },
    "/api/v2/cases/{case_id}/requirements/{requirement_id}/proof/candidate": {
      "post": {
        "operationId": "select_candidate_api_v2_cases__case_id__requirements__requirement_id__proof_candidate_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "requirement_id",
            "required": true,
            "schema": {
              "title": "Requirement Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CandidateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProofDetailRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Select Candidate",
        "tags": [
          "completion-evidence"
        ]
      }
    },
    "/api/v2/cases/{case_id}/requirements/{requirement_id}/proof/policy": {
      "post": {
        "operationId": "change_policy_api_v2_cases__case_id__requirements__requirement_id__proof_policy_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "requirement_id",
            "required": true,
            "schema": {
              "title": "Requirement Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/velerian__api__routers__completion_evidence__PolicyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Change Policy Api V2 Cases  Case Id  Requirements  Requirement Id  Proof Policy Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Change Policy",
        "tags": [
          "completion-evidence"
        ]
      }
    },
    "/api/v2/cases/{case_id}/requirements/{requirement_id}/proof/revoke": {
      "post": {
        "operationId": "revoke_proof_api_v2_cases__case_id__requirements__requirement_id__proof_revoke_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "requirement_id",
            "required": true,
            "schema": {
              "title": "Requirement Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RevokeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProofDetailRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke Proof",
        "tags": [
          "completion-evidence"
        ]
      }
    },
    "/api/v2/cases/{case_id}/requirements/{requirement_id}/proof/validate": {
      "post": {
        "operationId": "validate_fields_api_v2_cases__case_id__requirements__requirement_id__proof_validate_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "requirement_id",
            "required": true,
            "schema": {
              "title": "Requirement Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValidationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProofDetailRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Validate Fields",
        "tags": [
          "completion-evidence"
        ]
      }
    },
    "/api/v2/cases/{case_id}/watchers": {
      "get": {
        "description": "Everyone currently watching this case, longest-watching first.\n\nWatching is separate from owning the work — being on this list means\nsomeone wants to see what happens, and nothing more. 404 if the case does\nnot exist in your workspace.",
        "operationId": "list_case_watchers_route_api_v2_cases__case_id__watchers_get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseWatcherList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "See who is watching a case.",
        "tags": [
          "cases"
        ]
      },
      "post": {
        "description": "Watch this case — yourself by default, or a colleague you name.\n\nWatching gives visibility and nothing else: it does not assign the work,\nchange who it belongs to, or make anyone responsible for it. Watching a\ncase you already watch changes nothing. 404 if the case does not exist in\nyour workspace.",
        "operationId": "watch_case_api_v2_cases__case_id__watchers_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/CaseWatchRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseWatcherList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Start watching a case.",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/cases/{case_id}/watchers/{user_id}": {
      "delete": {
        "description": "Stop watching this case.\n\nNothing about the work changes — only who is following it. Stopping a\nwatch that is not running changes nothing. 404 if the case does not exist\nin your workspace.",
        "operationId": "unwatch_case_api_v2_cases__case_id__watchers__user_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "User Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseWatcherList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Stop watching a case.",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/channel-intake": {
      "post": {
        "description": "Open (or add to) a case from a structured message posted by an integration.\n\nThe signed body carries the address the message was posted to, the\nsender's own message id, a subject line, a body, and optionally a sender,\na thread key, a pack and extra metadata. The address decides which\nworkspace the message belongs to; a workspace named in the body is checked\nagainst it and rejected on mismatch.\n\nRe-posting a message id this workspace has already accepted returns the\ncase it already opened rather than opening a second one, so a sender may\nretry freely.",
        "operationId": "receive_channel_message_api_v2_channel_intake_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelIntakeResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Receive Channel Message",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/channel-intake/email": {
      "post": {
        "description": "Open (or add to) a case from an inbound email handed over by a mail relay.\n\nThe signed body carries the message as the relay received it: the\nrecipient address it was delivered to, the message id, the sender, the\nsubject line, the body, and the reply headers. The subject line becomes\nthe case title, the body is kept with the case, and the recipient address\ndecides which workspace the message belongs to.\n\nA reply lands on the case it belongs to: a subject line quoting a case\nreference wins, otherwise the reply headers are matched against messages\nthis workspace has already received. A message matching neither opens a\nnew case.",
        "operationId": "receive_inbound_email_api_v2_channel_intake_email_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelIntakeResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Receive Inbound Email",
        "tags": [
          "cases"
        ]
      }
    },
    "/api/v2/claim-register/{register_id}/write-off": {
      "post": {
        "description": "Write off a claim the claim register still carries.\n\nThe claim stops coming back in later cases. Only a signed-in person may\nwrite a claim off; an API key or a machine token is refused with 403. A\nclaim with an open case of its own has that case resolved in the same\ntransaction, as this person's close with the outcome ``not_achieved``\n(``case_status`` says how the case stands). A claim that is not in this\nworkspace's register is 404; one that has already stopped being carried,\none whose case has a round running (``claim_round_live``), or one whose\ncase is being changed right now (``operation_busy``, try again) is 409,\nwith nothing written. A claim with an open case that this service cannot\nclose (``case_close_unavailable``) is 503, with nothing written.",
        "operationId": "write_off_claim_api_v2_claim_register__register_id__write_off_post",
        "parameters": [
          {
            "in": "path",
            "name": "register_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Register Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WriteOffRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WriteOffResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "The claim has an open case of its own that this service cannot close right now (detail.error = case_close_unavailable); nothing is written."
          }
        },
        "summary": "Write Off Claim",
        "tags": [
          "claim-register"
        ]
      }
    },
    "/api/v2/claim-sweeps": {
      "post": {
        "description": "Read a crew's uploaded batch with code and open one case per claim that needs work.\n\nUpload the batch first through ``/api/v2/run-attachments`` for the crew,\nwith no case. It stays on no case, so no model ever reads it; each claim's\ncase is given only that claim's row, its remittance lines and, for a crew\nthat prices from a fee schedule, that schedule's rows for its payer. A claim\nalready open is ``unchanged`` when its amounts, status and lines are as the\nlast sweep read them. Otherwise each part of its file that differs is filed\non its case from the case's next round (``refreshed``): its remittance\nlines are added to the case's, its aging row and fee schedule slice replace\nthe case's, and a new payer line makes the claim due today. ``changed`` means nothing differed.\nA claim whose case was being changed is ``pending``: kept for the next\nsweep of the crew, which files it first. A line code cannot decide (a\nrepeated line with no payer's reference, a reference with other amounts,\nlines in other columns) holds the claim and raises one item for a person\non its case. A claim whose case was closed and that the batch shows\noutstanding again is reported ``reappeared_after_close`` and not opened.\n\nA batch of more than 500 claims is refused whole with 422; split it and\nsweep each part. A claim that fails is recorded ``failed`` and the sweep\n``partial``; sweeping the same batch again carries it on without opening\nanything twice. A second sweep for the same crew while one runs is 409.\nOnly a signed-in person may sweep (API keys and machine tokens get 403).",
        "operationId": "sweep_claims_api_v2_claim_sweeps_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimSweepRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimSweepResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "403": {
            "description": "Refused. Either the caller's role does not allow this action, or the crew works on patient records and the organization has no business associate agreement with Velerian on record (detail.error = patient_data_agreement_required)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Sweep a claims batch: open one case per claim that needs work.",
        "tags": [
          "claim-sweeps"
        ]
      }
    },
    "/api/v2/clocks": {
      "get": {
        "description": "Every clock on one case, each with its computed reading — the effective\n(pause-shifted) deadline, remaining seconds, and zone — and its firing\nhistory (the automatic run attempt and escalation, when they have fired).\nOpen clocks sort before closed ones, tightest deadline first.",
        "operationId": "list_case_clocks_api_v2_clocks_get",
        "parameters": [
          {
            "description": "The case whose clocks to list.",
            "in": "query",
            "name": "case_id",
            "required": true,
            "schema": {
              "description": "The case whose clocks to list.",
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "description": "Filter by clock state; omit for all.",
            "in": "query",
            "name": "state",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "running",
                    "paused",
                    "met",
                    "breached"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by clock state; omit for all.",
              "title": "State"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseClockList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List a case's clocks with their computed readings.",
        "tags": [
          "clocks"
        ]
      },
      "post": {
        "description": "Materialize a deadline policy as a running clock on a case.\n\nThe deadline is computed once, here, from the policy's duration and\ncalendar (the work-week calendars counting local days in the policy's\ntime zone) — later policy edits never move it. ``started_at`` may be in the\npast when the real-world window opened before the case did (the deadline\nran from the event, not from data entry), but never in the future. A\nsupplied ``started_at`` is recorded as a reported start; omitting it\nrecords the start as an estimate (the platform defaulted to now), and the\nreading says so.\n\n- **404** unknown case or policy (scoped to your workspace).\n- **409** the case is closed, the policy is inactive, or this policy\n  already has an open clock on this case.\n- **422** a future ``started_at``, or a ``started_at`` or deadline outside\n  the years 1000 to 8999 a clock may hold.",
        "operationId": "instantiate_case_clock_api_v2_clocks_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaseClockCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseClockRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Start a clock on a case from a deadline policy.",
        "tags": [
          "clocks"
        ]
      }
    },
    "/api/v2/clocks/definitions": {
      "get": {
        "description": "List deadline policies, newest first, with optional filters.",
        "operationId": "list_clock_definitions_api_v2_clocks_definitions_get",
        "parameters": [
          {
            "in": "query",
            "name": "pack_slug",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 64,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pack Slug"
            }
          },
          {
            "description": "Filter by active flag; omit for all.",
            "in": "query",
            "name": "active",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by active flag; omit for all.",
              "title": "Active"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockDefinitionList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List your workspace's deadline policies.",
        "tags": [
          "clocks"
        ]
      },
      "post": {
        "description": "Create a declarative deadline policy for your workspace.\n\nA policy never ticks by itself — instances materialize against it, either\nautomatically when a case opens for the policy's pack, or explicitly via\nthe instantiation endpoint. A 'normative' policy must carry the citation\nof the law or regulation it derives from (422 otherwise).",
        "operationId": "create_clock_definition_api_v2_clocks_definitions_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClockDefinitionCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockDefinitionRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create a deadline policy (admin).",
        "tags": [
          "clocks"
        ]
      }
    },
    "/api/v2/clocks/definitions/{definition_id}": {
      "get": {
        "description": "One deadline policy's detail. 404 if it doesn't exist in your workspace.",
        "operationId": "get_clock_definition_api_v2_clocks_definitions__definition_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "definition_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Definition Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockDefinitionRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get one deadline policy.",
        "tags": [
          "clocks"
        ]
      },
      "patch": {
        "description": "Edit a deadline policy.\n\nEdits apply to FUTURE instantiations only: a clock already running keeps\nthe deadline it materialized — the instance is the record of the\ncommitment. Deactivate a policy (active=false) to stop new instantiations;\nthere is no delete.",
        "operationId": "update_clock_definition_api_v2_clocks_definitions__definition_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "definition_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Definition Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClockDefinitionUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockDefinitionRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Edit a deadline policy (admin; affects only future clocks).",
        "tags": [
          "clocks"
        ]
      }
    },
    "/api/v2/clocks/sweep": {
      "post": {
        "description": "Evaluate every open clock in your workspace and fire what is due.\n\nA clock entering its warning zone fires ONE governed run that attempts to\nclear the blocker (fully governed and metered, attached to the clock's\ncase; agent action comes first). A clock that breaches — or whose warning\nattempt finished without clearing it — creates ONE typed work item for a\nteammate, carrying what was tried and what is needed (a human is asked\nsecond, and always asked: there is no notification-only path). When the\ncase's crew is on hold, no run is started and the deadline goes to a\nteammate in the same pass. Each action fires at most once per clock, so\nthe sweep is safe to run repeatedly; the platform also runs it on a\nschedule. Governed-run attempts execute within this request.",
        "operationId": "sweep_clocks_api_v2_clocks_sweep_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockSweepResult"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Run the pre-deadline sweep.",
        "tags": [
          "clocks"
        ]
      }
    },
    "/api/v2/clocks/{clock_id}": {
      "get": {
        "description": "One clock's detail: the computed reading plus the firing history (the\nautomatic run attempt and escalation, when they have fired). 404 if it\ndoesn't exist in your workspace.",
        "operationId": "get_case_clock_api_v2_clocks__clock_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "clock_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Clock Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseClockRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get one clock with its computed reading.",
        "tags": [
          "clocks"
        ]
      }
    },
    "/api/v2/connectors": {
      "get": {
        "description": "Return the catalog of systems Velerian builds connectors for, by category.\n\nPublic + read-only. No connector is self-serve: Velerian builds and\nswitches on each one with the customer during onboarding, against the\ncustomer's own systems and credentials. The catalog is derived from the\nplatform's own connector registry on each call.",
        "operationId": "list_connectors_api_v2_connectors_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorCatalog"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Connector catalog",
        "tags": [
          "connectors"
        ]
      }
    },
    "/api/v2/contact/demo-request": {
      "post": {
        "description": "Submit a public contact / demo-request from the pricing page.\n\nPUBLIC (unauthenticated) + rate-limited under the anonymous-IP bucket.\nRecords a job inquiry for partner matching and team follow-up; on success\nreturns the ``ticket`` channel + reference. If JSM is not configured here, or\nthe call fails, returns the ``email`` fallback channel with the sales address\n(HTTP 200 — a normal degraded outcome, never a 500). Best-effort sends an\nauto-acknowledgement email to the prospect (dark until SES goes live).\n``name``/``company``/``use_case`` must be non-empty and ``work_email`` a\nvalid address (all enforced by the schema); a malformed body is rejected 422.",
        "operationId": "submit_demo_request_api_v2_contact_demo_request_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DemoRequestCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DemoRequestResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Submit Demo Request",
        "tags": [
          "contact"
        ]
      }
    },
    "/api/v2/dsar/admin/erase": {
      "post": {
        "description": "Erase (anonymize/tombstone) a subject's PII (GDPR Art. 17). Admin-only.\n\nDestructive, so gated by ``require_network_admin`` and audited: the service\nwrites a ``privacy.subject.erased`` ``audit_log`` entry (the durable\nevidence) and this handler records a completed ``dsar_requests`` row.\n\nIdempotent — re-erasing an already-tombstoned subject returns\n``already_erased=True`` and mutates nothing.\n\nOnly an owner can erase an owner: an admin who names an owner gets 403, and\nnothing is changed, audited or recorded. The workspace's last owner who is\nnot erased cannot be erased: 409, with nothing changed, audited or recorded.\n\nStep-up authentication: additionally gated by ``require_recent_auth`` —\nirreversible PII destruction is exactly the kind of action that should require\na recently re-authenticated human, not just a held admin session. A stale\n``auth_time`` yields 403 ``reauthentication_required``. (Composes with the\n``require_network_admin`` role gate — different axis: role = \"are you allowed\",\nstep-up = \"did you prove presence recently\".)",
        "operationId": "erase_subject_data_api_v2_dsar_admin_erase_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EraseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EraseResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Erase Subject Data",
        "tags": [
          "dsar",
          "compliance"
        ]
      }
    },
    "/api/v2/dsar/me/export": {
      "get": {
        "description": "Export the calling user's own personal data (GDPR Art. 20).\n\nSelf-service: the subject is always ``ctx.user_id`` — a caller can only\never export their own data through this route (no ``subject_user_id``\nparameter). Records a completed ``dsar_requests`` row.",
        "operationId": "export_my_data_api_v2_dsar_me_export_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/velerian__api__routers__dsar__ExportResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Export My Data",
        "tags": [
          "dsar",
          "compliance"
        ]
      }
    },
    "/api/v2/entitlements/me": {
      "get": {
        "description": "Return the calling tenant's ACTIVE per-pack entitlements.\n\nA list of ``{pack_slug, tier, valid_until, is_trial}`` for every pack the\ntenant can invoke right now, plus ``data_region`` — the enforced residency\nregion the tenant's hosted invocations run in (see the module docstring).\nTenant-scoped (RLS); read-only. ``is_trial`` is ``valid_until is not None``\n— a time-boxed grant, which is how the self-serve trial is written. A\ntenant with no active entitlements gets an empty list, not a 403. A grant\nfor a pack this environment no longer offers is kept on record but not\nlisted, because it cannot be invoked.",
        "operationId": "get_my_entitlements_api_v2_entitlements_me_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantEntitlementsResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get My Entitlements",
        "tags": [
          "entitlements"
        ]
      }
    },
    "/api/v2/entitlements/{slug}/select": {
      "post": {
        "description": "Grant the CALLING tenant a time-boxed trial entitlement for ``slug``.\n\nThe self-serve onboarding pack-picker's grant surface: closes the gap where\na self-signup tenant landed on the free tier with ZERO pack entitlements and\nthe only way to add one was the operator-run ``provision_comped_partner.py``.\n\nTenant scoping (security): the tenant is derived from the verified session\n(``ctx.tenant_id``), NEVER from the request body or path — a caller can only\never grant a pack to their OWN workspace. RLS on the write (the caller's\n``platform.tenant_id`` GUC is set by ``get_session``) is defence-in-depth.\n\nEligibility gate (cost safety): ``slug`` must be self-serve-selectable\n(:func:`velerian.core.billing.pack_self_serve.is_self_serve_selectable`) —\na real catalog pack that is cost-safe to hand a self-serve tenant. An\nunknown, held, or cost-unsafe pack (notably ``voicedesk``, whose DID pool\nstays behind an explicit consent gate) returns 403 — the same status a\nrole-denied caller gets, so the endpoint never confirms which packs exist to\nan ineligible caller.\n\nNever a downgrade: the underlying grant is an upsert on\n``(tenant_id, pack_slug)`` that overwrites tier, expiry AND the Stripe\nsubscription link — so before writing, the route compares the starter trial\nit would write against the grant the workspace already holds\n(:func:`velerian.core.billing.entitlements_per_pack.grant_would_downgrade`:\nper-pack tier ladder ``starter < professional < enterprise`` first, then\nexpiry, where no expiry is the top). If the existing grant outranks the\ntrial — a comped enterprise / open-ended grant, or a longer window at the\nsame tier — nothing is written: **200** with ``granted: false``, a\n``reason``, and the existing grant echoed. Otherwise (no active grant, an\nexpired one, or a shorter live starter trial being refreshed) the trial is\nwritten and the response is **201** with ``granted: true``. Re-selecting a\nlive starter trial therefore still refreshes its window rather than erroring.\n\nWhere the environment grants no self-serve trial (production; see\n:func:`velerian.core.tenancy.provisioning.trial_grant_enabled`) every call\nis a **403** and nothing is written: crews reach a workspace only through\nthe Velerian team. ``GET /me`` reports it as ``self_serve_trials: false``.",
        "operationId": "select_pack_api_v2_entitlements__slug__select_post",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackSelectionResponse"
                }
              }
            },
            "description": "No-op: the workspace already holds a grant for this pack that outranks the starter trial (granted=false; the existing grant is echoed untouched)."
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackSelectionResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Self-serve: grant the calling tenant a trial entitlement for an eligible pack",
        "tags": [
          "entitlements"
        ]
      }
    },
    "/api/v2/evidence-records/{record_id}": {
      "get": {
        "description": "A sealed intake turn, voice call, policy reading or custom-agent run record.\n\nFor a workspace owner or administrator; an API key needs ``runs:read`` and\nacts with its creator's role. Anyone else gets the 404 an unknown id gets.\n``download_url`` fetches exactly the record's stored file for an hour. A\nrecord whose file is not stored yet (or not available) has no link, and\n``storage_status`` and ``detail`` say why. Each link given out is recorded\nin the audit log.",
        "operationId": "get_evidence_record_api_v2_evidence_records__record_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "record_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Record Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceRecordLink"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "A download link to one sealed record, by its id.",
        "tags": [
          "evidence"
        ]
      }
    },
    "/api/v2/evidence-records/{record_id}/content": {
      "get": {
        "description": "The sealed record, with its signature attached once it is signed.\n\nVerify it at /trust/verify or with the offline script: the record's hash\nseal, given the record before it its link in the chain, and with\n``--signature`` Velerian's signature. The stored bytes are used only when\ntheir SHA-256 is the one taken when the record was sealed; a signed record\nadds the signature as its ``signature`` member and is served only when the\nresult matches the signed digest recorded at signing (otherwise unsigned).\n``X-Content-SHA256`` is the digest of the bytes returned and\n``X-Velerian-Signature`` says whether they carry a signature (``signed``,\n``pending``, ``unsigned``, ``failed`` or ``unavailable``). Who may read it\nis as for the link: anyone else gets a 404. 409 when the record's file is\nnot stored yet, not available, or larger than 5 MB (fetch that one from its\nlink), with ``storage_status`` and a message. The download is recorded in\nthe audit log.",
        "operationId": "get_evidence_record_content_api_v2_evidence_records__record_id__content_get",
        "parameters": [
          {
            "in": "path",
            "name": "record_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Record Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "The sealed record as stored, with its signature attached once it is signed."
          },
          "409": {
            "description": "The record is sealed but its file is not available."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download one sealed record's exact bytes, by its id.",
        "tags": [
          "evidence"
        ]
      }
    },
    "/api/v2/exports/{export_id}/content": {
      "get": {
        "description": "Return the file of an export this workspace rendered, while its link lasts.\n\nThe download for any export answered with ``delivery: \"stream\"``: a work\nproduct, a structured or case-compute export, or one of the examiner\nexports above, for an hour; and each part of a workspace's document\nexport at termination, for a day. The caller needs what the rendering\nroute needed: an API key must hold the same scope, and a key limited to\none agent may read only that agent's exports. A part of the document\nexport is for a signed-in owner or administrator only: 403 for any other\nseat. 404 when no such export is held for this workspace, and once its\nlink has lapsed. The file is checked against the digest recorded when it\nwas rendered, and the download is recorded in the audit log before it is\nreturned.",
        "operationId": "read_export_content_api_v2_exports__export_id__content_get",
        "parameters": [
          {
            "in": "path",
            "name": "export_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Export Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {}
            },
            "description": "The exported file, exactly as rendered."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download an export held encrypted under the workspace's own key.",
        "tags": [
          "evidence"
        ]
      }
    },
    "/api/v2/feedback": {
      "post": {
        "description": "Submit in-product feedback.\n\nAuthenticated + tenant-scoped: writes one ``feedback`` row bound to the\ncaller's tenant + user and returns its id. Any signed-in user may submit\n(no special role). ``kind`` is validated against the closed set and\n``message`` must be non-empty (both also enforced by DB CHECK constraints);\na malformed body is rejected with 422 before the write.",
        "operationId": "submit_feedback_api_v2_feedback_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedbackCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Submit Feedback",
        "tags": [
          "feedback"
        ]
      }
    },
    "/api/v2/governance/ais-inventory": {
      "get": {
        "description": "NAIC AIS Model Risk Inventory export.\n\nReturns the tenant's full agent list + summary metadata. JSON/CSV/PDF.",
        "operationId": "ais_inventory_api_v2_governance_ais_inventory_get",
        "parameters": [
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "default": "json",
              "pattern": "^(json|csv|pdf)$",
              "title": "Format",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/velerian__api__routers__evidence__ExportResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Ais Inventory",
        "tags": [
          "evidence"
        ]
      }
    },
    "/api/v2/governance/approvals": {
      "get": {
        "description": "Approvals inbox for the caller's tenant. Filter by status; paginate.",
        "operationId": "list_approvals_api_v2_governance_approvals_get",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^(pending|approved|rejected|timed_out)$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/velerian__api__routers__governance__ApprovalList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Approvals",
        "tags": [
          "governance"
        ]
      }
    },
    "/api/v2/governance/approvals/{approval_id}/decide": {
      "post": {
        "description": "Transition a pending approval to approved | rejected | timed_out.\n\nPer migration 010's docstring: the transition is irreversible; reopening\na closed approval requires a new row. Only rows in `status='pending'`\ncan transition — every terminal status returns 409.\n\nThe segregation-of-duties and approver-tier floors gate a SIGN-OFF, and the\nrequested `status` is read before either of them, because one transition is\nnot a sign-off: the person who raised a still-pending request may always\nmove it to `rejected` themselves, withdrawing work they started. That path\nskips both floors, records `self_withdrawn=true`, and writes an\n`approval.withdrawn` audit entry instead of `approval.<status>` — a\nwithdrawal is a different governance event from a review and is never\ncounted as one. `approved` is unaffected: both floors still apply to it —\nexcept that a gate which DECLARES its requester an eligible decider\n(`requester_may_approve`) is not held by segregation of duties at all; the\nrequester's own approval is then accepted and audited as\n`self_approved=true` with `self_approval_basis` naming the declaration.\n\nWrites an audit log entry on every successful transition. The audit\nwrite lands in the same transaction as the UPDATE, so a rollback in\neither drops both atomically.\n\nAn approval resumes the held work in the same transaction, exactly as\n`POST /api/v2/approvals/{approval_id}/decide` does: a blueprint's withheld\ninvocation runs again, and a case workflow step held on a run is resumed\nas a revision of that run. `rejected` and `timed_out` resume nothing; a\nworkflow step held on that run stays open, waiting on a revision.\n\nOnly a signed-in person may decide: a request made with an API key or a\nmachine (M2M) token is refused with 403 `person_required`, whatever its\nscopes and whoever created it, before the approval is read.",
        "operationId": "decide_approval_api_v2_governance_approvals__approval_id__decide_post",
        "parameters": [
          {
            "in": "path",
            "name": "approval_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Approval Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalDecideRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/velerian__api__routers__governance__ApprovalRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Decide Approval",
        "tags": [
          "governance"
        ]
      }
    },
    "/api/v2/governance/estate-summary": {
      "get": {
        "description": "The tenant's estate-level conduct-risk rollup over its run history.\n\nThe portfolio view above the per-run verdict: outcome totals, a per-pack\nbreakdown with pass-rate, the most recent flagged runs, and a daily outcome\ntrend. Every read is RLS-scoped to the calling tenant (the session GUC), so\nthe aggregates cover only this tenant's runs. Any authenticated role may read\nit — reviewing your own estate's governance is a read surface (mirrors the\nrun-history read gate).\n\nFilters — applied CONSISTENTLY across all four aggregates:\n\n- ``start_date`` / ``end_date`` (``YYYY-MM-DD``) bound the whole rollup. When\n  given, they define the trend span too (``trend_window_days`` is null);\n  ``end_date`` is inclusive of its whole calendar day. When BOTH are omitted\n  the trend keeps its trailing ``trend_days`` behaviour.\n- ``pack_slugs`` (repeatable) restricts to the named packs.\n- ``outcomes`` (repeatable: passed|failed|conditional|escalated|unevaluated)\n  restricts to the named conduct outcomes. An unknown value is a 422.\n\nFactual: it counts + groups what the evaluator genuinely recorded. It\nmakes no regulatory-conformance claim.\n\nEach aggregate is a single grouped query (no N+1): the totals + per-pack\nbreakdown + trend each scan the indexed ``pack_runs`` once, and the flagged\nlist is a capped ORDER BY over the same table.",
        "operationId": "get_estate_conduct_summary_api_v2_governance_estate_summary_get",
        "parameters": [
          {
            "in": "query",
            "name": "trend_days",
            "required": false,
            "schema": {
              "default": 30,
              "maximum": 90,
              "minimum": 1,
              "title": "Trend Days",
              "type": "integer"
            }
          },
          {
            "description": "Inclusive lower bound (YYYY-MM-DD). With end_date, bounds the whole rollup.",
            "in": "query",
            "name": "start_date",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive lower bound (YYYY-MM-DD). With end_date, bounds the whole rollup.",
              "title": "Start Date"
            }
          },
          {
            "description": "Inclusive upper bound (YYYY-MM-DD) — the whole end day counts.",
            "in": "query",
            "name": "end_date",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive upper bound (YYYY-MM-DD) — the whole end day counts.",
              "title": "End Date"
            }
          },
          {
            "description": "Repeatable: restrict the rollup to these pack slugs.",
            "in": "query",
            "name": "pack_slugs",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Repeatable: restrict the rollup to these pack slugs.",
              "title": "Pack Slugs"
            }
          },
          {
            "description": "Repeatable: passed | failed | conditional | escalated | unevaluated.",
            "in": "query",
            "name": "outcomes",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Repeatable: passed | failed | conditional | escalated | unevaluated.",
              "title": "Outcomes"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstateConductSummary"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Estate Conduct Summary",
        "tags": [
          "governance"
        ]
      }
    },
    "/api/v2/governance/outcome-baseline": {
      "get": {
        "description": "The per-pack governance-pass vs outcome-met baseline.\n\nNow that outcome contracts are live on every pack, this is the\nhonest measurement split the enforcement-posture decision rests on: per pack\n(and estate-wide) the governance-PASS rate reported SIDE BY SIDE with the\noutcome-MET rate + the full met/partial/incomplete/not_scored distribution —\nthe two verdicts kept SEPARATE, never merged.\n\nRLS-scoped to the calling tenant (the session GUC), so the aggregate covers\nonly this tenant's runs. Any authenticated role may read it — reviewing your\nown estate's outcome baseline is a read surface (mirrors the estate-summary /\nrun-history read gate).\n\nADVISORY + factual: it counts what the advisory scorer genuinely\nrecorded. A ``not_scored`` run (a contract-less/alpha pack, a\ngovernance-withheld output, or a run predating outcome scoring — NULL\n``outcome_verdict``) is reported honestly as not-scored, never folded into\n``met``. Nothing here enforces; this baseline is the INPUT to a later\nenforcement decision, and makes no regulatory-conformance claim.\n\nOne grouped scan for the per-pack rows + one for the estate totals (no N+1):\neach reads the indexed ``pack_runs`` once, the verdict counted via the fixed\n``_OUTCOME_VERDICT_CASE``.",
        "operationId": "get_outcome_baseline_api_v2_governance_outcome_baseline_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutcomeBaselineSummary"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Outcome Baseline",
        "tags": [
          "governance"
        ]
      }
    },
    "/api/v2/governance/policies": {
      "get": {
        "description": "Active policies for the caller's tenant (global + tenant-scoped).",
        "operationId": "list_policies_api_v2_governance_policies_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyList"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Policies",
        "tags": [
          "governance"
        ]
      },
      "post": {
        "description": "Create a tenant-scoped policy + cut its first revision atomically.",
        "operationId": "create_policy_api_v2_governance_policies_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicyCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Policy",
        "tags": [
          "governance"
        ]
      }
    },
    "/api/v2/governance/policies/{policy_id}": {
      "get": {
        "operationId": "get_policy_api_v2_governance_policies__policy_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "policy_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Policy Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Policy",
        "tags": [
          "governance"
        ]
      },
      "patch": {
        "description": "Partial update + cut a new revision when rules change.",
        "operationId": "update_policy_api_v2_governance_policies__policy_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "policy_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Policy Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicyUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Policy",
        "tags": [
          "governance"
        ]
      }
    },
    "/api/v2/governance/scorecard": {
      "get": {
        "description": "Return the calling tenant's governance scorecard for the current month.\n\nTenant-scoped by the verified ``TenantContext.tenant_id`` (the aggregation\nfilters on it explicitly; RLS applies too). Read-only over ``pack_runs`` /\n``evidence_packs`` / ``approvals`` — no new write paths.",
        "operationId": "get_governance_scorecard_api_v2_governance_scorecard_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GovernanceScorecardResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Governance leaderboard — the exec-facing governance-wins scorecard.",
        "tags": [
          "governance"
        ]
      }
    },
    "/api/v2/internal/alerts": {
      "post": {
        "description": "Receive a CloudWatch-alarm / app-error payload and create-or-group an incident.\n\nProtected by the shared-secret header (NOT Cognito JWT) — an SNS topic\nsubscription, not a logged-in user, calls this. The handler:\n\n1. Verifies the shared secret (constant-time; fail-closed on unset).\n2. Parses ``payload`` per ``kind`` into a normalized\n   :class:`~velerian.core.incidents.IncidentIntent` (severity + fingerprint).\n3. Runs the dedup-aware writer: a repeat alarm with the same fingerprint\n   within the dedup window groups onto the open incident (count++), else a\n   new incident opens.\n\nIdempotent-ish by construction: replaying the same alarm does not create\nduplicate incidents; it increments the occurrence count on the open one.\n\n:raises HTTPException 422: ``payload`` is not a valid payload for ``kind``\n    (e.g. a CloudWatch payload with no ``AlarmName``).",
        "operationId": "intake_alert_api_v2_internal_alerts_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Velerian-Internal-Secret",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Velerian-Internal-Secret"
            }
          },
          {
            "in": "header",
            "name": "X-Velerian-Internal-Caller",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Velerian-Internal-Caller"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertIntakeBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertIntakeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Intake Alert",
        "tags": [
          "internal"
        ]
      }
    },
    "/api/v2/internal/audit-login": {
      "post": {
        "description": "Mint the sanctioned audit seat's session + set its cookies.\n\nEnables FULLY UNATTENDED PXA runs: the skill POSTs here with the internal\nshared secret and receives the seat's ``velerian_id_token`` +\n``velerian_access_token`` cookies, so no client-side AWS SSO session is\nneeded to mint the Cognito tokens.\n\nSECURITY MODEL (fail-closed, tightly guarded — mirrors provision-signup):\n\n- **Off unless the environment names an audit seat.** With no seat\n  configured the route answers a plain 404 to every caller, with or without\n  the secret, and mints nothing.\n- **Same shared-secret gate** as every other internal endpoint here:\n  ``X-Velerian-Internal-Secret`` verified constant-time via\n  :func:`_verify_and_rate_limit`; 503 when NO internal secret is configured\n  (fail closed), 401 when the header is missing/wrong, 429 when rate-limited.\n  This IS the gate (the endpoint takes NO body — there is no user role to\n  gate on, exactly like the provision endpoints).\n- **Path is in ``cognito_auth.EXEMPT_PATHS``** — it runs BEFORE any session\n  exists (it is the thing that mints one), so JWT auth can't apply.\n- **Seat-scoped to ONE fixed identity.** The seat username + credentials are\n  ALL config/Secrets-Manager-derived (:func:`_mint_audit_seat_tokens`) and\n  the endpoint accepts NO request body — so it can ONLY ever mint the ONE\n  sanctioned audit seat's session, never an arbitrary user's.\n\n:raises HTTPException 404: the audit seat is not configured in this\n    environment (fail closed).\n:raises HTTPException 503: a seat is configured but no internal secret is\n    (fail closed).\n:raises HTTPException 401: missing/invalid internal secret.\n:raises HTTPException 502: the seat is configured but the Cognito mint failed.",
        "operationId": "audit_login_api_v2_internal_audit_login_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Velerian-Internal-Secret",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Velerian-Internal-Secret"
            }
          },
          {
            "in": "header",
            "name": "X-Velerian-Internal-Caller",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Velerian-Internal-Caller"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditLoginResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Audit Login",
        "tags": [
          "internal"
        ]
      }
    },
    "/api/v2/internal/lifecycle-email-sweep": {
      "post": {
        "description": "Run one idempotent lifecycle-email sweep pass.\n\nProtected by the shared-secret header (NOT Cognito JWT) — a scheduler\n(EventBridge cron, infra follow-on), not a logged-in user, calls this.\nSafe to invoke at any cadence: the lifecycle sent/suppressed ledger in\n``analytics_events`` dedupes per (tenant, template), so a re-run sends\nnothing new. Dark behind ``VELERIAN_SES_LIVE`` — with the flag off every\ndue email is suppressed-and-ledgered, zero SES calls.",
        "operationId": "lifecycle_email_sweep_api_v2_internal_lifecycle_email_sweep_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Velerian-Internal-Secret",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Velerian-Internal-Secret"
            }
          },
          {
            "in": "header",
            "name": "X-Velerian-Internal-Caller",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Velerian-Internal-Caller"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LifecycleSweepResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Lifecycle Email Sweep",
        "tags": [
          "internal"
        ]
      }
    },
    "/api/v2/internal/provision-federated": {
      "post": {
        "description": "Admit, then provision, a federated SSO user (JIT) on a first login.\n\nThe federated-SSO SIBLING of :func:`provision_signup`. Protected by the SAME\nshared-secret header (NOT Cognito JWT) — Cognito Lambdas, not a logged-in\nuser, call this. The workspace IdP is the provider named in\n``provider_user_name``, never a claim the IdP sends. Without\n``cognito_sub`` (the pre-signup call) it only admits or refuses the\nsign-up; with it (the pre-token-gen call at the first token) it runs the\nsame checks and provisions. Idempotent: a repeat call for the same\n``cognito_sub`` returns the existing identifiers with ``created=false`` and\nwrites nothing.\n\n:raises HTTPException 403: the provider is not an enabled workspace IdP, or\n    the workspace removed this identity (``access_removed``).\n:raises HTTPException 422: the body is invalid (e.g. a non-UUID\n    ``cognito_sub`` surfaced as a ValueError).",
        "operationId": "provision_federated_api_v2_internal_provision_federated_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Velerian-Internal-Secret",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Velerian-Internal-Secret"
            }
          },
          {
            "in": "header",
            "name": "X-Velerian-Internal-Caller",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Velerian-Internal-Caller"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProvisionFederatedBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProvisionFederatedResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Provision Federated",
        "tags": [
          "internal"
        ]
      }
    },
    "/api/v2/internal/provision-signup": {
      "post": {
        "description": "Provision a tenant + owner user + free entitlements for a confirmed user.\n\nProtected by the shared-secret header (NOT Cognito JWT). Idempotent — a\nrepeat call for the same ``cognito_sub`` returns the existing identifiers\nwith ``created=false`` and writes nothing.",
        "operationId": "provision_signup_api_v2_internal_provision_signup_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Velerian-Internal-Secret",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Velerian-Internal-Secret"
            }
          },
          {
            "in": "header",
            "name": "X-Velerian-Internal-Caller",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Velerian-Internal-Caller"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProvisionSignupBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProvisionSignupResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Provision Signup",
        "tags": [
          "internal"
        ]
      }
    },
    "/api/v2/internal/user-context-by-sub": {
      "get": {
        "description": "Resolve a provisioned user's tenant_id + network_roles from their Cognito sub.\n\n``custom:tenant_id`` is IMMUTABLE in the Cognito pool schema, so a self-signup\nuser can NEVER carry it as a user attribute — their tokens lack the tenant\nclaim forever, and without it a self-serve signup 404s after its first login.\nThe Cognito pre-token-generation Lambda GETs this endpoint when\n``userAttributes`` lack ``custom:tenant_id`` and injects the resolved\n``tenant_id`` + ``network_roles`` into BOTH the ID and access tokens, so the\nclaim is minted into the token itself (the root fix; the frontend session\ncookie is the interim bridge).\n\nRead-only. Protected by the SAME shared-secret header (NOT Cognito JWT) as\nthe provision-signup SIBLINGS above — the Lambda, not a logged-in user, calls\nthis, and it runs before the user's token carries a tenant claim. Backed by\nthe migration-005 ``user_context_for_cognito_sub`` + migration-028\n``network_roles_for_user`` SECURITY DEFINER functions (the SAME ones\ntenant_scope's per-request DB fallback uses), so it exposes ONLY the one\nsub's own context and no broader read surface.\n\n:raises HTTPException 404: the sub is not provisioned (no ``users`` row). The\n    Lambda treats a 404 as \"no context to inject\" and fails open — the user\n    gets a vanilla token and the tenant_scope DB fallback handles the gap.",
        "operationId": "user_context_by_sub_api_v2_internal_user_context_by_sub_get",
        "parameters": [
          {
            "in": "query",
            "name": "sub",
            "required": true,
            "schema": {
              "title": "Sub",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Velerian-Internal-Secret",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Velerian-Internal-Secret"
            }
          },
          {
            "in": "header",
            "name": "X-Velerian-Internal-Caller",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Velerian-Internal-Caller"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserContextResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "User Context By Sub",
        "tags": [
          "internal"
        ]
      }
    },
    "/api/v2/invite-links/{token}": {
      "get": {
        "description": "Resolve an invite-link token to its invite. NO auth required.\n\n404 for an unknown or malformed token (no failure oracle). A link that is\nexpired, withdrawn (revoked) or already used (accepted) still resolves 200\nwith the matching ``state`` so the sign-up surface can explain it.",
        "operationId": "get_invite_link_api_v2_invite_links__token__get",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "title": "Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteLinkView"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read a team-invite link (no login required).",
        "tags": [
          "team"
        ]
      }
    },
    "/api/v2/knowledge": {
      "get": {
        "description": "The workspace's learned units, newest first.\n\nEvery unit was minted from a case that closed with a recorded outcome, and\ncarries that outcome. Units with an unfavorable outcome are kept and\nlabelled rather than discarded: a record of what did not work is evidence,\nand it is filtered here rather than hidden.\n\nEach unit also carries how often it has informed agent runs that later\nreached a resolution, and how often those resolutions were favorable.\nRead those as correlation only — a unit is one of several things informing\na run, and it was selected because it matched the situation. They do not\nshow that a unit caused an outcome, and the derived share is withheld\nuntil enough runs have accumulated to mean anything.",
        "operationId": "list_knowledge_units_api_v2_knowledge_get",
        "parameters": [
          {
            "description": "Filter by lifecycle status. Defaults to active units only.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "active",
                    "superseded",
                    "retired"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by lifecycle status. Defaults to active units only.",
              "title": "Status"
            }
          },
          {
            "description": "Only units learned from cases worked with this pack.",
            "in": "query",
            "name": "pack_slug",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only units learned from cases worked with this pack.",
              "title": "Pack Slug"
            }
          },
          {
            "description": "Only units with this trust valence — use 'unfavorable' to review what has been recorded as NOT working.",
            "in": "query",
            "name": "outcome_valence",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "favorable",
                    "unfavorable",
                    "unknown"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only units with this trust valence — use 'unfavorable' to review what has been recorded as NOT working.",
              "title": "Outcome Valence"
            }
          },
          {
            "description": "Only units whose source case was linked to this entity.",
            "in": "query",
            "name": "subject_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only units whose source case was linked to this entity.",
              "title": "Subject Id"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeUnitListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List what this workspace has learned from its resolved cases.",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/api/v2/knowledge/{unit_id}": {
      "get": {
        "description": "One unit: the situation, what was done, and what the recorded outcome was.\n\nThe chain pointers say where this unit sits in its situation's history —\nwhich earlier unit it replaced, and which later unit replaced it. Units are\nnever edited, so the chain is the whole history.",
        "operationId": "get_knowledge_unit_api_v2_knowledge__unit_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "unit_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Unit Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeUnitDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read one learned unit in full, with its supersession chain.",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/api/v2/knowledge/{unit_id}/retire": {
      "post": {
        "description": "Stop a unit informing future work, with a reason on the record.\n\nThis is a withdrawal, not an edit: the unit's text is never rewritten, and\nwhat it says about its source case stays readable. An already-retired unit\nreturns unchanged; a superseded unit cannot be retired, because it is\nalready out of use.",
        "operationId": "retire_knowledge_unit_api_v2_knowledge__unit_id__retire_post",
        "parameters": [
          {
            "in": "path",
            "name": "unit_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Unit Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KnowledgeUnitRetireRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeUnitDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Withdraw a learned unit from use.",
        "tags": [
          "knowledge"
        ]
      }
    },
    "/api/v2/me/email-change/confirm": {
      "post": {
        "description": "Set the caller's sign-in and recovery address to the new one, once the\ncode sent to it is given back from the password account's own session.\nFive wrong codes close the change. The old address is told. Audited.",
        "operationId": "confirm_email_change_api_v2_me_email_change_confirm_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailChangeConfirm"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailChangeConfirmed"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Confirm a sign-in and recovery address change with its code.",
        "tags": [
          "me",
          "auth"
        ]
      }
    },
    "/api/v2/me/email-change/start": {
      "post": {
        "description": "Email a one-time code to the new address and a notice to the current\none. Requires a password and MFA sign-in within the last 5 minutes\n(otherwise 403 ``reauthentication_required``) and MFA enabled; at most 3\nstarts per 10 minutes. The code works for 10 minutes. Audited.",
        "operationId": "start_email_change_api_v2_me_email_change_start_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailChangeStart"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailChangeStarted"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Start changing the caller's sign-in and recovery address.",
        "tags": [
          "me",
          "auth"
        ]
      }
    },
    "/api/v2/me/preferences": {
      "get": {
        "description": "Return the calling user's preferences. Auto-creates row on first read.",
        "operationId": "get_preferences_api_v2_me_preferences_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreferencesRead"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Preferences",
        "tags": [
          "me"
        ]
      },
      "patch": {
        "description": "Update one or more preference fields on the calling user's row.",
        "operationId": "update_preferences_api_v2_me_preferences_patch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreferencesUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreferencesRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Preferences",
        "tags": [
          "me"
        ]
      }
    },
    "/api/v2/me/profile": {
      "get": {
        "description": "Return the calling user's joined profile + tenant + MFA signal.",
        "operationId": "get_profile_api_v2_me_profile_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileRead"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Profile",
        "tags": [
          "me"
        ]
      },
      "patch": {
        "description": "Update the calling user's display_name. Email + MFA are read-only here.",
        "operationId": "update_profile_api_v2_me_profile_patch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Profile",
        "tags": [
          "me"
        ]
      }
    },
    "/api/v2/me/sso-links": {
      "get": {
        "description": "List the workspace's enabled single sign-on identity providers, which the\ncaller can link to their password account from Settings.",
        "operationId": "list_sso_link_providers_api_v2_me_sso_links_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoLinkProviderList"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List the workspace identity providers the caller can link.",
        "tags": [
          "me",
          "sso"
        ]
      }
    },
    "/api/v2/me/sso-links/abort": {
      "post": {
        "description": "Close the caller's open link without linking anything: the round trip\nwas cancelled or failed. Audited.",
        "operationId": "abort_sso_link_api_v2_me_sso_links_abort_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SsoLinkAbort"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoLinkAborted"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Close a single sign-on link whose round trip came back without a code.",
        "tags": [
          "me",
          "sso"
        ]
      }
    },
    "/api/v2/me/sso-links/complete": {
      "post": {
        "description": "Link the single sign-on identity named by the ID token Cognito issued for\nthis browser's round trip to the caller's account. Called by the sign-in\ncallback. Every link and every refusal is audited; either closes the link.",
        "operationId": "complete_sso_link_api_v2_me_sso_links_complete_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SsoLinkComplete"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoLinkCompleted"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Complete a single sign-on link with the round trip's ID token.",
        "tags": [
          "me",
          "sso"
        ]
      }
    },
    "/api/v2/me/sso-links/start": {
      "post": {
        "description": "Open a 10-minute link to one of the workspace's identity providers.\nRequires a password and MFA sign-in within the last 5 minutes (otherwise\n403 ``reauthentication_required``), MFA enabled, and no single sign-on\nalready linked; at most 5 starts per 10 minutes. Every start and every\nrefusal is audited.",
        "operationId": "start_sso_link_api_v2_me_sso_links_start_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SsoLinkStart"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoLinkStarted"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Start linking single sign-on to the caller's password account.",
        "tags": [
          "me",
          "sso"
        ]
      }
    },
    "/api/v2/me/widget-config": {
      "get": {
        "description": "Return the calling tenant's client gating config.\n\nCombines a per-tenant fact — ``is_design_partner`` (from the ``tenants``\ndirectory) — with the env-driven feedback-widget window (``enabled`` /\n``expires_at``, flippable without a redeploy). The frontend renders the\ndesign-partner feedback widget only when the tenant is a design partner AND\nthe window is open. Read-only; no role gate.",
        "operationId": "get_widget_config_api_v2_me_widget_config_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetConfigRead"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Widget Config",
        "tags": [
          "me"
        ]
      }
    },
    "/api/v2/networks/{slug}/expose": {
      "delete": {
        "description": "Soft-disable the exposure + revoke its keys. Admin-only, JWT-only.\n\nNever plan-gated (a downgraded tenant must still be able to un-expose).\n404 only when no exposure decision was ever recorded for ``slug`` under\nthe caller's tenant (RLS-filtered). Idempotent on the toggle: a second\nDELETE reports ``already_disabled`` — and STILL runs the key-revoke\nsweep, so a key that somehow escaped the first sweep is cleaned up\n(belt-and-suspenders alongside the invoke path's exposure-enabled\ncheck).",
        "operationId": "unexpose_network_api_v2_networks__slug__expose_delete",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnexposeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Turn off external exposure for this agent — revokes every key restricted to it and blocks external invocation.",
        "tags": [
          "agent-exposure"
        ]
      },
      "post": {
        "description": "Enable external exposure for ``slug`` and mint its scoped credential.\n\nOrder of gates (each fails before any write): catalog 404 → consent 400\n→ entitlement 403 → API-key gate 403 (the workspace has no API access,\nor has reached its active-key limit) → tenant policy 403 (structured\n``exposure_denied_by_policy`` reason + audit row). Then, in one\ntransaction: upsert the exposure row (consent evidence), mint the\nrestricted key, write the ``agent.exposed`` audit row.",
        "operationId": "expose_network_api_v2_networks__slug__expose_post",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExposeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExposeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Expose this agent to external callers — records consent and mints a pack-scoped key (secret shown exactly once).",
        "tags": [
          "agent-exposure"
        ]
      }
    },
    "/api/v2/networks/{slug}/exposure": {
      "get": {
        "description": "Exposure state for ``slug`` under the calling tenant (RLS-scoped).\n\nAny authenticated role (read surface; the response never includes\nsecret material — prefixes and timestamps only). A pack with no\nexposure record reads as ``exposed=false`` with an empty key list so\nthe dashboard renders the toggle's off state uniformly.\n\nCarries the tenant-policy verdict (the additive ``policy`` field)\nso the dashboard can disable the toggle — with the workspace's own reason\n— BEFORE an expose attempt is ever made.",
        "operationId": "get_network_exposure_api_v2_networks__slug__exposure_get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExposureStatus"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Exposure status + minted-key metadata for this agent (never secrets).",
        "tags": [
          "agent-exposure"
        ]
      }
    },
    "/api/v2/networks/{slug}/governance-scorecard": {
      "get": {
        "description": "Return the facts-only governance posture card for one catalog pack.\n\nRead-only, auditor-and-up (an evidence surface); 404 when ``slug`` is not in the catalog\n(mirroring the ``/{slug}/report-card`` precedent). The constraint facts\ndescribe what the invoke route evaluates for this pack; the tenant-overlay\nand outcome-contract sections additionally reflect the CALLING tenant's\nown overlay rows (RLS + explicit tenant filters — never another\ntenant's). No composite score or grade is computed.",
        "operationId": "get_network_governance_scorecard_api_v2_networks__slug__governance_scorecard_get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentGovernanceScorecardResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Per-agent governance scorecard for a catalog pack — facts only.",
        "tags": [
          "governance"
        ]
      }
    },
    "/api/v2/notifications": {
      "get": {
        "description": "List notifications for the current tenant, newest first.\n\nBoth RLS (USING/WITH CHECK against `current_setting('platform.tenant_id')`)\nAND an explicit `tenant_id = :ctx.tenant_id` WHERE clause guard the\nquery — defense in depth, and also keeps the query correct in test\ncontexts where the DB role bypasses RLS. Optional filters narrow\nfurther (AND-composed):\n\n- `type` matches a specific kind (validated against the enum so\n  the response is consistent with what the producer wrote).\n- `read=true` returns only rows with `read_at IS NOT NULL`;\n  `read=false` returns only unread (`read_at IS NULL`).\n\nDefault page size is 25 — matches the registry browser\n(`BLUEPRINT_REGISTRY_PAGE_SIZE`) so the two surfaces feel uniform.",
        "operationId": "list_notifications_api_v2_notifications_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "description": "alert | info | success | system",
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "alert | info | success | system",
              "title": "Type"
            }
          },
          {
            "description": "true → only read notifications; false → only unread; omitted → all",
            "in": "query",
            "name": "read",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "true → only read notifications; false → only unread; omitted → all",
              "title": "Read"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Notifications",
        "tags": [
          "notifications"
        ]
      }
    },
    "/api/v2/notifications/{notification_id}": {
      "patch": {
        "description": "Mark a single notification as read.\n\nIdempotent — if the row is already read, `read_at` stays at its\noriginal value. Both RLS and an explicit `WHERE tenant_id = :ctx`\nclause prevent a cross-tenant PATCH from affecting a row the caller\ndoesn't own (the UPDATE returns zero rows and the handler returns\n404).\n\nReturns the fully-hydrated notification so the client can replace\nits local copy without a follow-up GET.",
        "operationId": "mark_notification_read_api_v2_notifications__notification_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "notification_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Notification Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationSummary"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Mark Notification Read",
        "tags": [
          "notifications"
        ]
      }
    },
    "/api/v2/oauth/token": {
      "post": {
        "description": "Validate client credentials and issue a short-lived, scoped M2M token.\n\n401 on bad/unknown/revoked creds (no oracle). 400 on an unsupported\ngrant_type or a requested scope outside the client's grant. 503 when the\nsigning secret is unconfigured (fail closed — cannot mint).",
        "operationId": "issue_token_api_v2_oauth_token_post",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Body_issue_token_api_v2_oauth_token_post"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "OAuth 2.1 client-credentials grant — exchange creds for an M2M token.",
        "tags": [
          "oauth",
          "m2m"
        ]
      }
    },
    "/api/v2/onboarding/vertical": {
      "post": {
        "description": "Grant the picked vertical's pack-set + set the catalog ranking segment.\n\nOwner/admin-only. Both writes ride the request transaction so they commit\natomically. A ``vertical`` outside the taxonomy is a 422. Idempotent — the\ngrant upserts and the segment write is a straight overwrite.",
        "operationId": "select_vertical_api_v2_onboarding_vertical_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnboardingVerticalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingVerticalResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Apply a first-run vertical pick: grant its pack-set + rank its packs first.",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/api/v2/organizations/{org_id}/blueprints": {
      "get": {
        "description": "List versioned workspace blueprints belonging to ``org_id``.",
        "operationId": "list_organization_blueprints_api_v2_organizations__org_id__blueprints_get",
        "parameters": [
          {
            "in": "path",
            "name": "org_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Org Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "slug",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 64,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Slug"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "draft",
                    "active",
                    "archived"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "latest_only",
            "required": false,
            "schema": {
              "default": false,
              "title": "Latest Only",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueprintListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Organization Blueprints",
        "tags": [
          "blueprints"
        ]
      },
      "post": {
        "description": "Create a new versioned workspace blueprint for ``org_id``.",
        "operationId": "create_organization_blueprint_api_v2_organizations__org_id__blueprints_post",
        "parameters": [
          {
            "in": "path",
            "name": "org_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Org Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBlueprintRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlueprintSummary"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Organization Blueprint",
        "tags": [
          "blueprints"
        ]
      }
    },
    "/api/v2/organizations/{org_id}/workspaces/instantiate": {
      "post": {
        "description": "Atomically instantiate a new RLS-isolated client workspace from a blueprint.",
        "operationId": "instantiate_organization_workspace_api_v2_organizations__org_id__workspaces_instantiate_post",
        "parameters": [
          {
            "in": "path",
            "name": "org_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Org Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstantiateWorkspaceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstantiateWorkspaceResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Instantiate Organization Workspace",
        "tags": [
          "blueprints"
        ]
      }
    },
    "/api/v2/pack-runs": {
      "get": {
        "description": "List the calling tenant's pack runs, newest first (RLS-scoped).",
        "operationId": "list_pack_runs_api_v2_pack_runs_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "pack_slug",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 64,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pack Slug"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackRunList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Pack Runs",
        "tags": [
          "pack-runs"
        ]
      }
    },
    "/api/v2/pack-runs/{run_id}": {
      "get": {
        "description": "Return one run in full + a re-minted presigned evidence download URL.",
        "operationId": "get_pack_run_api_v2_pack_runs__run_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackRunDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Pack Run",
        "tags": [
          "pack-runs"
        ]
      }
    },
    "/api/v2/pack-runs/{run_id}/evidence": {
      "get": {
        "description": "The run's sealed record, the file ``evidence_download_url`` links to, signed once signed.\n\nThe stored file carries no signature (it lives on the record's outbox\nrow), so this route adds it as the record's ``signature`` member and serves\nthe result only when it matches the signed digest recorded at signing;\notherwise, or while signing is under way, the record is served unsigned.\n``X-Content-SHA256`` is the digest of the bytes returned and\n``X-Velerian-Signature`` says whether they carry a signature (``signed``,\n``pending``, ``unsigned``, ``failed`` or ``unavailable``). Verify the file\nat /trust/verify or with the offline script (``--signature`` checks the\nsignature against Velerian's published keys).\n\nWhoever may read the run may read its record. 404 for an unknown run, or a\nrun whose record has no stored-record row (a run that sealed nothing, or\none sealed before records were stored that way: its link still serves it).\n409 when the file is not stored yet, not available, or larger than 5 MB\n(fetch that one from its link). Each download is recorded in the audit log.",
        "operationId": "get_pack_run_evidence_api_v2_pack_runs__run_id__evidence_get",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "The run's sealed record as stored, with its signature attached once it is signed."
          },
          "404": {
            "description": "No such run, or no stored record to serve for it."
          },
          "409": {
            "description": "The record is sealed but its file is not available."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download one run's sealed record, with its signature once it is signed.",
        "tags": [
          "evidence"
        ]
      }
    },
    "/api/v2/pack-runs/{run_id}/evidence-share": {
      "delete": {
        "description": "Stamp ``revoked_at = now()`` on the run's active evidence link. Admin/member only.\n\nAn API key restricted to one agent may revoke an evidence link only for\nthat agent's runs. Idempotent: revoking when no active link exists is a\nno-op that still returns ``exists=false`` (the caller's intent — \"no live\nlink\" — is met).",
        "operationId": "revoke_evidence_share_link_api_v2_pack_runs__run_id__evidence_share_delete",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceShareLinkMetadata"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke the run's active view-only evidence-share link (the public URL stops working).",
        "tags": [
          "pack-runs"
        ]
      },
      "get": {
        "description": "Return whether an active evidence link exists + its prefix/expiry (never the token).\n\nAny authenticated role may read this (it carries no secret material) so the\nrun page can render \"a link exists / expires X / revoke\". Returns\n``exists=false`` when there is no live link. An API key restricted to one\nagent may read link state only for that agent's runs.",
        "operationId": "get_evidence_share_link_api_v2_pack_runs__run_id__evidence_share_get",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceShareLinkMetadata"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "The active view-only evidence-share link's metadata for this run (no full token).",
        "tags": [
          "pack-runs"
        ]
      },
      "post": {
        "description": "Mint (or rotate) the run's shareable view-only evidence link. Admin/member only.\n\nAn API key restricted to one agent may mint an evidence link only for that\nagent's runs; any other run is refused.\n\nSame idempotency choice as run-share (documented there): if an active link\nalready exists we REVOKE it and mint a fresh one, so the caller ALWAYS\nreceives a working full token (the full token is only ever known at mint).",
        "operationId": "create_evidence_share_link_api_v2_pack_runs__run_id__evidence_share_post",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceShareLinkCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Mint a view-only, no-login shareable link to this run's evidence pack (full token shown once).",
        "tags": [
          "pack-runs"
        ]
      }
    },
    "/api/v2/pack-runs/{run_id}/inputs": {
      "get": {
        "description": "Read saved source references and current case metadata without launching work.\n\nPagination applies independently to documents and case facts. Follow each\nnext_offset; truncated means the bounded read ceiling was reached. Missing\nhistorical content stays explicit, and no fact values are returned.",
        "operationId": "get_run_inputs_api_v2_pack_runs__run_id__inputs_get",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "attachment_offset",
            "required": false,
            "schema": {
              "default": 0,
              "maximum": 10000,
              "minimum": 0,
              "title": "Attachment Offset",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "fact_offset",
            "required": false,
            "schema": {
              "default": 0,
              "maximum": 10000,
              "minimum": 0,
              "title": "Fact Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunInputsRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Run Inputs",
        "tags": [
          "pack-runs"
        ]
      }
    },
    "/api/v2/pack-runs/{run_id}/prefill": {
      "get": {
        "description": "Return ``run_id``'s original intake (prompt + model + attachments) to pre-fill a re-run.\n\nThe read behind \"Re-run with changes\": the run form opens pre-filled from the\nreturned prompt / model / attachment list, the user edits it, then submits a\nfresh governed run through the normal invoke path. Reads intake only — nothing\nis launched here. RLS + the pack-restriction guard scope it to the caller.",
        "operationId": "get_pack_run_prefill_api_v2_pack_runs__run_id__prefill_get",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunPrefill"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read a run's original intake to pre-fill a re-run.",
        "tags": [
          "pack-runs"
        ]
      }
    },
    "/api/v2/pack-runs/{run_id}/report.pdf": {
      "get": {
        "description": "Render this run's governed work product to a fileable PDF (or DOCX).\n\nReturns a presigned download URL (NOT the bytes) for a formatted document\ncontaining the run's rendered output, its resolved Sources, and the\ngovernance verdict / per-rule scorecard — the deliverable a claims manager\nor examiner keeps on file. The JSON evidence pack (the tamper-evidence\nartifact) remains a separate download.\n\nOnly terminal `succeeded` runs are reportable: an in-flight or failed run\nhas no finished work product to file.",
        "operationId": "get_pack_run_report_api_v2_pack_runs__run_id__report_pdf_get",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "default": "pdf",
              "pattern": "^(pdf|docx)$",
              "title": "Format",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunReportResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Formatted, examiner-shareable document of this run's governed work product.",
        "tags": [
          "pack-runs"
        ]
      }
    },
    "/api/v2/pack-runs/{run_id}/revise": {
      "post": {
        "description": "Launch a revision of ``run_id`` as a NEW governed run linked to it.\n\nLooks the parent run up under RLS (a cross-tenant / unknown id 404s), then\ndelegates to the standard async governed invoke against the parent's pack —\nthreading the parent id + the named gaps the revision intends to close into\nthe new run's lineage. Returns 202 with the new run's id (poll the run-detail\nendpoint to watch it land), exactly like a hand-typed async invoke. Single-pass\nby construction: this is a fresh submission, not a resume of the parent.\n\nThe revision lands on the PARENT run's case: the whole revision\nchain rolls up to one case, so the case's runs list reads as the story of\nhow the work product was brought to done, and the case file stays visible\nacross every link of the chain. The 202 response carries that case's\n``case_id`` + ``case_ref``.\n\nAttachment carry-over: the parent run's stored\nattachments — collected across its whole revision lineage, so a revision of\na revision still carries the original case file — are ALWAYS re-attached to\nthe revision. The revision's governed model context therefore contains the\nsame document extracts the parent reasoned over; a revision must never\nanswer with the case file gone. Any ``attachment_ids`` in the body (e.g.\nthe newly-arrived document the parent was held for) are merged in after the\ninherited ones, deduplicated. Ids resolve under RLS exactly like the\ninitial-run path: only the calling tenant's own stored attachments load;\nunknown/foreign ids are silently skipped. A merged set larger than the\nparent pack's per-run document limit is a 422 naming that limit — the same\nlimit the pack's initial-run intake enforces, so a case that could be\nsubmitted can always be revised.\n\nEmpty case file: if the run was submitted WITH attached documents but none\nof them can be resolved back to it, the revision is REFUSED with a 409\nnaming that condition, rather than quietly answering as though the documents\nsaid nothing. Supplying the documents explicitly via ``attachment_ids``\nclears the refusal. A run that genuinely carried no documents is unaffected\nand revises normally.\n\nWorkflow step: when the run's case has an open workflow step waiting on a\nrevision of THIS run (its sign-off was returned or expired), the revision\nis queued as that step, in the caller's name, with the step's own model and\nthe case's documents. Its prompt is the step's intake followed by\n``prompt_text``, and its sign-off goes back to the step's approvers; once\napproved, the step resumes. Such a request may name no ``attachment_ids``\nor ``model_id`` (422), and a step whose returned run already has a revision\nanswers 409.",
        "operationId": "revise_pack_run_api_v2_pack_runs__run_id__revise_post",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          },
          {
            "description": "A client-chosen key (at most 255 characters) that makes this submission safe to resend. A resend with the same key within 24 hours returns the original outcome and starts no second run; the same key with a different request is refused with 422.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 255,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "A client-chosen key (at most 255 characters) that makes this submission safe to resend. A resend with the same key within 24 hours returns the original outcome and starts no second run; the same key with a different request is refused with 422.",
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviseRunRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Revise Pack Run Api V2 Pack Runs  Run Id  Revise Post"
                }
              }
            },
            "description": "Successful Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyInUse"
                }
              }
            },
            "description": "The keyed request is still running."
          },
          "422": {
            "description": "Idempotency-Key reused with a different request."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionRefusal"
                }
              }
            },
            "description": "Refused by a workspace capacity limit."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionRefusal"
                }
              }
            },
            "description": "Admission could not decide; retry."
          }
        },
        "summary": "Launch a revision of this run — a new governed run linked to it.",
        "tags": [
          "pack-runs"
        ]
      }
    },
    "/api/v2/pack-runs/{run_id}/share": {
      "delete": {
        "description": "Stamp ``revoked_at = now()`` on the run's active link. Admin/member only.\n\nAn API key restricted to one agent may revoke a link only for that agent's\nruns. Idempotent: revoking when no active link exists is a no-op that\nstill returns ``exists=false`` (the caller's intent — \"no live link\" — is met).",
        "operationId": "revoke_run_share_link_api_v2_pack_runs__run_id__share_delete",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShareLinkMetadata"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke the run's active shareable link (the public URL stops working).",
        "tags": [
          "pack-runs"
        ]
      },
      "get": {
        "description": "Return whether an active link exists + its prefix/expiry (never the token).\n\nAny authenticated role may read this (it carries no secret material) so the\nrun page can render \"a link exists / expires X / revoke\". Returns\n``exists=false`` when there is no live link. An API key restricted to one\nagent may read link state only for that agent's runs.",
        "operationId": "get_run_share_link_api_v2_pack_runs__run_id__share_get",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShareLinkMetadata"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "The active shareable link's metadata for this run (no full token).",
        "tags": [
          "pack-runs"
        ]
      },
      "post": {
        "description": "Mint (or rotate) the run's shareable read-only link. Admin/member only.\n\nAn API key restricted to one agent may mint a link only for that agent's\nruns; any other run is refused.\n\nIdempotency choice (documented): if an active link already exists we REVOKE\nit and mint a fresh one, so the caller ALWAYS receives a working full token.\nThe alternative (returning the existing prefix without a token) would leave\n\"Copy link\" unable to produce a usable URL, since the full token is only\never known at mint. Rotating is the simplest correct behavior and means a\nstale copied link can be supplanted by re-sharing.",
        "operationId": "create_run_share_link_api_v2_pack_runs__run_id__share_post",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShareLinkCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Mint a read-only, no-login shareable link to this run (full token shown once).",
        "tags": [
          "pack-runs"
        ]
      }
    },
    "/api/v2/pack-runs/{run_id}/signoffs/{signoff_id}": {
      "get": {
        "description": "A person's sealed sign-off on a step that follows this run, as the run page lists it.\n\nThe record names the person by their workspace user id, never by name or\nemail. Verify it at /trust/verify or with the offline script, with this\nrun's record as the record before it. Whoever may read the run may read\nits sign-offs. 404 for an unknown run or an id that is not a sign-off on\nit; 409 when the file is not stored yet or not available. Each download is\nrecorded in the audit log.",
        "operationId": "get_pack_run_signoff_api_v2_pack_runs__run_id__signoffs__signoff_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "signoff_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Signoff Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "The sealed sign-off record as stored, with its signature attached once signed."
          },
          "404": {
            "description": "No such run, or no such sign-off on it."
          },
          "409": {
            "description": "The record is sealed but its file is not available."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download one sealed sign-off record listed on a run, signed once it is signed.",
        "tags": [
          "evidence"
        ]
      }
    },
    "/api/v2/pack-runs/{run_id}/structured-exports": {
      "get": {
        "description": "List the structured exports THIS RUN can actually produce.\n\nEvery kind listed here is one this run's finished work product can be\nrendered into — asking for it returns the file. A kind the pack declares\nbut this run cannot serve is not listed, because its output carries none of\nthe machine-readable structure that kind is built from.\n\nAn empty list therefore means one of: the pack declares no structured\nexports; the run has not finished successfully, so there is no work\nproduct yet; or this run's output has nothing the pack's exports are\nbuilt from. In every case there is nothing here to download — and\n``reason`` says which of those cases it is, with ``detail`` carrying the\npack's own explanation where it states one, so \"nothing to download\" is an\nanswer you can check rather than one you have to trust.\n\nA partial list states its basis the same way: ``not_offered`` names each\nexport the pack declares that this run cannot produce, with the pack's own\nexplanation of why and what to do differently.",
        "operationId": "list_structured_exports_api_v2_pack_runs__run_id__structured_exports_get",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StructuredExportList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List the structured exports this run can produce.",
        "tags": [
          "pack-runs"
        ]
      }
    },
    "/api/v2/pack-runs/{run_id}/structured-exports/{kind}": {
      "get": {
        "description": "Render the requested structured export and return a presigned download URL.\n\nThe export is built from this run's finished work product, stored\nencrypted, and served through a short-lived download link (the file bytes\nnever travel through the API response). Only successfully finished runs\ncan be exported, and only of packs that offer structured exports. A run\nwhose output carries no machine-readable structure returns a conflict\nexplaining there is nothing to export.\n\nExports are checked before they are produced. If the file would carry a\ndiagnosis, procedure or modifier code that is malformed or known not to\nexist, the export is blocked with a conflict naming those codes rather than\nhanded over for import into another system. It is blocked the same way if a\ncode the file carries provably contradicts what the submitted record\ndocuments — for example an excision code whose own published description\ncovers a different size range than the excised diameter the operative note\nrecords. Where the record does not document the relevant fact, nothing is\nclaimed either way and the export proceeds.\n\nThe response also carries any warnings that apply to this export: the file\nis sound and downloadable, but something about how this run's result was\nresolved needs to reach whoever loads it. Each warning says whether the\nfile itself contains it — a file shaped for another system's importer often\ncannot hold a notice without breaking that import, and in that case this\nresponse is where the notice lives.\n\nA run of a case under packet release is not exported on its own once its\npackets are being released: the conflict says how many of the case's\nreleasable claims are released. When the last one is, the case's full\nworklist is frozen, and this export of that worklist, for a person who may\nwork the case, serves the frozen copy.",
        "operationId": "get_structured_export_api_v2_pack_runs__run_id__structured_exports__kind__get",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "title": "Kind",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StructuredExportResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download one structured export of this run's work product.",
        "tags": [
          "pack-runs"
        ]
      }
    },
    "/api/v2/pack-runs/{run_id}/work-product-preview": {
      "get": {
        "operationId": "get_work_product_preview_api_v2_pack_runs__run_id__work_product_preview_get",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunWorkProductPreview"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read interpreted rows from this run's work product.",
        "tags": [
          "pack-runs"
        ]
      }
    },
    "/api/v2/packet-revisions/{packet_id}/artifacts/{kind}": {
      "get": {
        "operationId": "read_packet_artifact_api_v2_packet_revisions__packet_id__artifacts__kind__get",
        "parameters": [
          {
            "in": "path",
            "name": "packet_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Packet Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "title": "Kind",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "review",
            "required": false,
            "schema": {
              "default": false,
              "title": "Review",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read Packet Artifact",
        "tags": [
          "packet-release"
        ]
      }
    },
    "/api/v2/packet-revisions/{packet_id}/release": {
      "post": {
        "operationId": "issue_packet_release_api_v2_packet_revisions__packet_id__release_post",
        "parameters": [
          {
            "in": "path",
            "name": "packet_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Packet Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RevisionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Issue Packet Release Api V2 Packet Revisions  Packet Id  Release Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Issue Packet Release",
        "tags": [
          "packet-release"
        ]
      }
    },
    "/api/v2/packet-revisions/{packet_id}/request": {
      "post": {
        "operationId": "request_packet_release_api_v2_packet_revisions__packet_id__request_post",
        "parameters": [
          {
            "in": "path",
            "name": "packet_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Packet Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RevisionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Request Packet Release Api V2 Packet Revisions  Packet Id  Request Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Request Packet Release",
        "tags": [
          "packet-release"
        ]
      }
    },
    "/api/v2/partner-feedback": {
      "post": {
        "description": "Submit design-partner feedback + file it to the JSM feedback queue.\n\nAuthenticated + tenant-scoped: persists one ``design_partner_feedback`` row\nbound to the caller's tenant + user, then best-effort files a JSM ticket into\nthe feedback intake queue (stamping the row's ``jsm_reference`` on success).\n``category`` defaults to 'general'; ``message`` must be non-empty (both also\nenforced by DB CHECK constraints). A malformed body is rejected with 422; a\nJSM failure is NEVER surfaced to the caller (still 201 with the row id).",
        "operationId": "submit_partner_feedback_api_v2_partner_feedback_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerFeedbackCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerFeedbackCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Submit Partner Feedback",
        "tags": [
          "feedback"
        ]
      }
    },
    "/api/v2/plans": {
      "get": {
        "description": "Return purchase guidance and the acceptable-use notice.\n\nProduction use is arranged through a certified partner under an\nagreement. There is no customer plan catalog or self-service annual\npurchase. The empty ``plans`` list and disabled ``annualEnabled`` flag\npreserve the response envelope for existing clients. Stored billing and\nentitlement records are not exposed by this endpoint.",
        "operationId": "get_plans_api_v2_plans_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Plans Api V2 Plans Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Read purchase and acceptable-use guidance",
        "tags": [
          "plans",
          "billing",
          "plans"
        ]
      }
    },
    "/api/v2/policy-library/activate": {
      "post": {
        "description": "Turn approved rule proposals on — they become part of the rules your\nruns are checked against.\n\nOnly proposals a reviewer has APPROVED can be turned on; anything else is\nrefused with the reason. Turning rules on cuts a NEW version of your\nworkspace's policy (existing rules are carried forward, never edited in\nplace), and each turned-on rule permanently records which document and\npassage it came from. Only a signed-in person can turn rules on: API keys\nand machine tokens are refused.",
        "operationId": "activate_candidates_api_v2_policy_library_activate_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivateResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Turn approved rule proposals on for your workspace.",
        "tags": [
          "policy-library"
        ]
      }
    },
    "/api/v2/policy-library/activate/replay": {
      "post": {
        "description": "Before turning proposals on, see what they WOULD have done: your recent\nruns are re-checked against your current rules plus the selected\nproposals, and the preview reports how many would have been held back.\nRead-only — no runs are re-run and nothing is changed.\n\nDelegates to the same replay engine as the required-fields preview, so the\nnumbers here and there can never disagree.",
        "operationId": "replay_activation_api_v2_policy_library_activate_replay_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivateReplayRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Preview what turning these proposals on would have done to recent runs.",
        "tags": [
          "policy-library"
        ]
      }
    },
    "/api/v2/policy-library/candidates": {
      "get": {
        "description": "List your workspace's proposed rules, newest first — optionally only\nthose in one or more review states (comma-separated), or only those\nproposed from one document.\n\nEach entry names the rule (kind + plain-language description), the policy\ndocument it came from (id + file name), the verbatim passage, and — once a\nrule has been turned on — the policy version it landed in. This is the\nread other surfaces (e.g. onboarding) consume for approved/active rules.",
        "operationId": "list_candidates_api_v2_policy_library_candidates_get",
        "parameters": [
          {
            "description": "Only proposals in these review states — one value, or several comma-separated (e.g. 'approved,activated').",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 160,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only proposals in these review states — one value, or several comma-separated (e.g. 'approved,activated').",
              "title": "Status"
            }
          },
          {
            "description": "Only proposals from this policy document.",
            "in": "query",
            "name": "document",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only proposals from this policy document.",
              "title": "Document"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CandidateList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "The proposed-rule review queue (filter by status and/or document).",
        "tags": [
          "policy-library"
        ]
      }
    },
    "/api/v2/policy-library/candidates/{candidate_id}": {
      "patch": {
        "description": "Adjust a proposed rule's wording or details before approving it.\n\nThe rule exactly as it was originally proposed is always kept alongside\nyour edit. The edited rule is checked the same way a hand-authored rule\nis; an edit that would not be enforceable is refused with the reason. Only\nproposals still awaiting review (including ones marked not usable as\nwritten) can be edited.",
        "operationId": "edit_candidate_api_v2_policy_library_candidates__candidate_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "candidate_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Candidate Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CandidateEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CandidateRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Edit a proposed rule before approving it.",
        "tags": [
          "policy-library"
        ]
      }
    },
    "/api/v2/policy-library/candidates/{candidate_id}/approve": {
      "post": {
        "description": "Approve a proposed rule. Approval records your decision; the rule is\nNOT enforced yet — turning approved rules on for your workspace is a\nseparate step, coming next. Only proposals awaiting review can be\napproved. Only a signed-in person can approve: API keys and machine\ntokens are refused.",
        "operationId": "approve_candidate_api_v2_policy_library_candidates__candidate_id__approve_post",
        "parameters": [
          {
            "in": "path",
            "name": "candidate_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Candidate Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CandidateRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Approve a proposed rule (it is not enforced until turned on).",
        "tags": [
          "policy-library"
        ]
      }
    },
    "/api/v2/policy-library/candidates/{candidate_id}/reject": {
      "post": {
        "description": "Reject a proposed rule, optionally recording why. Any proposal that has\nnot yet been approved or rejected can be rejected. Only a signed-in person\ncan reject: API keys and machine tokens are refused.",
        "operationId": "reject_candidate_api_v2_policy_library_candidates__candidate_id__reject_post",
        "parameters": [
          {
            "in": "path",
            "name": "candidate_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Candidate Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CandidateRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Reject a proposed rule.",
        "tags": [
          "policy-library"
        ]
      }
    },
    "/api/v2/policy-library/derivations/{derivation_id}": {
      "get": {
        "description": "Fetch one rule-proposal run — its status, how many proposals it stored,\nand (when it failed) why.",
        "operationId": "get_derivation_api_v2_policy_library_derivations__derivation_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "derivation_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Derivation Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DerivationRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "One rule-proposal run's status record.",
        "tags": [
          "policy-library"
        ]
      }
    },
    "/api/v2/policy-library/documents": {
      "get": {
        "description": "List the policy documents your workspace has uploaded, newest first.\n\nEach entry shows the document's reading status, its integrity fingerprint,\nwhether a newer upload has replaced it, and the latest rule-proposal\nsummary (null if none has run yet). Only your workspace's documents\nare ever returned.",
        "operationId": "list_policy_documents_api_v2_policy_library_documents_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyDocumentList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List the workspace's policy documents (newest first).",
        "tags": [
          "policy-library"
        ]
      }
    },
    "/api/v2/policy-library/documents/{attachment_id}/derive": {
      "post": {
        "description": "Read this policy document and propose rules for your team to review.\n\nThe run happens while you wait and usually takes under a minute. Every\nproposal lands in the review queue — nothing is enforced until someone on\nyour team approves it and turns it on. If the document contains no\noperating rules, the run reports that honestly. One run per document at a\ntime (a second request while one is in progress is refused).",
        "operationId": "derive_rules_from_document_api_v2_policy_library_documents__attachment_id__derive_post",
        "parameters": [
          {
            "in": "path",
            "name": "attachment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Attachment Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DerivationRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read a policy document and propose rules for your team to review.",
        "tags": [
          "policy-library"
        ]
      }
    },
    "/api/v2/policy-library/documents/{attachment_id}/supersede": {
      "post": {
        "description": "Record that a newly uploaded policy document replaces this one.\n\nUpload the new version first (the same upload flow as any policy document),\nthen call this with the new document's id. The old document is kept — runs\nthat referenced it keep their record — but it is marked as replaced and\ndrops out of your current policy set.\n\nBoth documents must be policy documents in your workspace; anything else is\nrejected with a clear reason. A document can only be replaced once.",
        "operationId": "supersede_policy_document_api_v2_policy_library_documents__attachment_id__supersede_post",
        "parameters": [
          {
            "in": "path",
            "name": "attachment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Attachment Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupersedeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyDocument"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Mark a policy document as replaced by a newer upload.",
        "tags": [
          "policy-library"
        ]
      }
    },
    "/api/v2/recovery": {
      "get": {
        "operationId": "results_api_v2_recovery_get",
        "parameters": [
          {
            "in": "query",
            "name": "month",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^\\d{4}-(0[1-9]|1[0-2])$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Month"
            }
          },
          {
            "in": "query",
            "name": "crew",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 64,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Crew"
            }
          },
          {
            "in": "query",
            "name": "payer",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 256,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Payer"
            }
          },
          {
            "in": "query",
            "name": "state",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 64,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "State"
            }
          },
          {
            "in": "query",
            "name": "case_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Case Id"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 1024,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "as_of",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "As Of"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecoveryReading"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Results",
        "tags": [
          "recovery"
        ]
      }
    },
    "/api/v2/recovery/cases/{case_id}": {
      "get": {
        "operationId": "case_recovery_api_v2_recovery_cases__case_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "month",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^\\d{4}-(0[1-9]|1[0-2])$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Month"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 1024,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "as_of",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "As Of"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecoveryReading"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Case Recovery",
        "tags": [
          "recovery"
        ]
      }
    },
    "/api/v2/recovery/cases/{case_id}/attest": {
      "post": {
        "operationId": "attest_posting_api_v2_recovery_cases__case_id__attest_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Attestation"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecoveryReading"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Attest Posting",
        "tags": [
          "recovery"
        ]
      }
    },
    "/api/v2/recovery/cases/{case_id}/refresh": {
      "post": {
        "operationId": "refresh_case_api_v2_recovery_cases__case_id__refresh_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecoveryReading"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Refresh Case",
        "tags": [
          "recovery"
        ]
      }
    },
    "/api/v2/recovery/cases/{case_id}/resolve": {
      "post": {
        "operationId": "resolve_event_api_v2_recovery_cases__case_id__resolve_post",
        "parameters": [
          {
            "in": "path",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Resolution"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecoveryReading"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Resolve Event",
        "tags": [
          "recovery"
        ]
      }
    },
    "/api/v2/recovery/statements": {
      "post": {
        "operationId": "issue_statement_api_v2_recovery_statements_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatementRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatementView"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Issue Statement",
        "tags": [
          "recovery"
        ]
      }
    },
    "/api/v2/recovery/statements/{statement_id}": {
      "get": {
        "operationId": "get_statement_api_v2_recovery_statements__statement_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "statement_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Statement Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatementView"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Statement",
        "tags": [
          "recovery"
        ]
      }
    },
    "/api/v2/recovery/statements/{statement_id}/download": {
      "get": {
        "operationId": "download_statement_api_v2_recovery_statements__statement_id__download_get",
        "parameters": [
          {
            "in": "path",
            "name": "statement_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Statement Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "default": "json",
              "enum": [
                "json",
                "csv"
              ],
              "title": "Format",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download Statement",
        "tags": [
          "recovery"
        ]
      }
    },
    "/api/v2/run-attachments": {
      "get": {
        "description": "List this tenant's attachments (RLS-scoped), optionally filtered to a pack\nand to the documents filed on one case.\n\n``case_id`` lists the documents filed on that case. A document that reached\na case only through one of its runs is not filed on it; the case read\n(``GET /api/v2/cases/{case_id}``) lists the whole case file. An unknown\ncase, or one in another workspace, lists nothing: the answer is the same\nas for a case with no documents, so it says nothing of whether the case\nexists. Each item carries the requirement a person declared it is.",
        "operationId": "list_attachments_api_v2_run_attachments_get",
        "parameters": [
          {
            "in": "query",
            "name": "pack_slug",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 64,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pack Slug"
            }
          },
          {
            "description": "Only the documents filed on this case (their case_id). A document that reached the case only through one of its runs is not listed here; the case read (GET /api/v2/cases/{case_id}) lists the whole case file. An id this workspace holds no document for lists nothing.",
            "in": "query",
            "name": "case_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only the documents filed on this case (their case_id). A document that reached the case only through one of its runs is not listed here; the case read (GET /api/v2/cases/{case_id}) lists the whole case file. An id this workspace holds no document for lists nothing.",
              "title": "Case Id"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachmentList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List the calling tenant's run attachments (newest first).",
        "tags": [
          "run-attachments"
        ]
      },
      "post": {
        "description": "Register an attachment (``pending``) and return its id + deterministic key.\n\nValidates the content type against the accepted set (415 otherwise) and the\nsize against the 25 MiB ceiling (the pydantic bound already 422s an\nover-limit declared size). Writes the tenant-scoped ``run_attachments`` row.\n\nWhen ``case_id`` is supplied the document is CASE-SCOPED: the case must\nexist in the caller's workspace (404 otherwise — the same not-found\ncontract the run submit's case addressing uses), the row records the case\nlink, and the registration audit record carries it — filing a document on\na case and recording that filing are one atomic act.\n\nThe raw bytes are NOT uploaded here: the caller next POSTs them (multipart)\nto ``/{id}/upload``, which stores them SERVER-SIDE. The previous\nclient-direct presigned-PUT step is gone — the audit-evidence bucket's S3\nObject Lock rejects a browser presigned PUT (see the module + ``storage``\ndocstrings).",
        "operationId": "create_attachment_api_v2_run_attachments_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachmentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachmentCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "403": {
            "description": "Refused. Either the caller's role does not allow this action, or the crew works on patient records and the organization has no business associate agreement with Velerian on record (detail.error = patient_data_agreement_required)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Register a run-attachment document (bytes are uploaded via POST /{id}/upload).",
        "tags": [
          "run-attachments"
        ]
      }
    },
    "/api/v2/run-attachments/{attachment_id}/content": {
      "get": {
        "description": "Return one stored document's original bytes, as uploaded.\n\nThe download for a document held encrypted under the workspace's own key\n(``POST {id}/download`` answers ``delivery: \"stream\"`` for those); it\nserves any other stored document the same way. Available to workspace\nadmins and members. The bytes are checked against the digest recorded when\nthe document was finalized, and the download is recorded in the audit log\nbefore they are returned. 404 when the document is not this workspace's,\n409 when it has not finished uploading or changed while it was read.",
        "operationId": "read_attachment_content_api_v2_run_attachments__attachment_id__content_get",
        "parameters": [
          {
            "in": "path",
            "name": "attachment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Attachment Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {}
            },
            "description": "The document's original bytes, as uploaded."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download a stored source document's original bytes through the API.",
        "tags": [
          "run-attachments"
        ]
      }
    },
    "/api/v2/run-attachments/{attachment_id}/download": {
      "post": {
        "description": "Say where to download one stored document's original bytes.\n\nBacks the case file's download affordance. Only documents that have\nfinished uploading are downloadable (409 otherwise). Most documents get a\nURL that expires after about 15 minutes — request a fresh one per download.\nA document held encrypted under the workspace's own key gets\n``delivery: \"stream\"`` and the path of ``GET {id}/content`` instead.\nAvailable to workspace admins and members; every download is recorded in\nthe audit log (who pulled which document, and when).",
        "operationId": "download_attachment_api_v2_run_attachments__attachment_id__download_post",
        "parameters": [
          {
            "in": "path",
            "name": "attachment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Attachment Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachmentDownload"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Mint a short-lived download URL for a stored source document.",
        "tags": [
          "run-attachments"
        ]
      }
    },
    "/api/v2/run-attachments/{attachment_id}/finalize": {
      "post": {
        "description": "Extract text from the uploaded bytes and flip the row to ``stored``.\n\nCalled after the client PUT completes. Downloads the raw bytes from S3,\nextracts text (PDF / DOCX / plaintext; PNG/JPEG via OCR when enabled, else\nstored-not-read), stores the extracted text back to S3, and records the\nsha256 + real size + extraction status. RLS scopes the row to the caller's\ntenant (a foreign id reads as 404). Idempotent-ish: re-finalizing recomputes\nfrom the stored bytes.\n\nExtraction failure is NOT an error response: a corrupt/encrypted document is\nstored with ``extraction_status='failed'`` (its text is absent from any run\ninput) and the row is still marked ``stored`` — the run proceeds without it.\n\n- **403** ``exposure_denied_by_policy`` if an API key finalizes a document\n  a case holds (filed on it, or read by one of its runs) whose crew the\n  workspace's policy keeps inside the app: the document is not finalized\n  again (its uploaded bytes are not read) and nothing is recorded.",
        "operationId": "finalize_attachment_api_v2_run_attachments__attachment_id__finalize_post",
        "parameters": [
          {
            "in": "path",
            "name": "attachment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Attachment Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachmentSummary"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Finalize an uploaded attachment: extract its text and mark it stored.",
        "tags": [
          "run-attachments"
        ]
      }
    },
    "/api/v2/run-attachments/{attachment_id}/intake-validation": {
      "get": {
        "description": "Check a stored extract against the intake contract its pack declares.\n\nReads the text extracted when the document was finalized and reports what\nis wrong with it: which required columns are absent, which rows fail which\nrule, and what was deliberately not checked. Every message names the row\nand the column and never repeats the cell's contents.\n\nNothing here blocks a run — a file with issues can still be used, and the\nreport is what tells the desk which conclusions will be weaker if it is.\n\n409 when the document has not finished uploading, when no text could be\nextracted from it, or when the pack it was uploaded for declares no\nstructured intake contract to check against. 404 if the attachment is not\nthe calling tenant's.",
        "operationId": "validate_attachment_intake_api_v2_run_attachments__attachment_id__intake_validation_get",
        "parameters": [
          {
            "in": "path",
            "name": "attachment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Attachment Id",
              "type": "string"
            }
          },
          {
            "description": "Which intake contract to check against. Omit when the pack declares exactly one, which is the usual case.",
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 128,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Which intake contract to check against. Omit when the pack declares exactly one, which is the usual case.",
              "title": "Kind"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntakeValidationRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Check a stored structured extract against its pack's intake contract.",
        "tags": [
          "run-attachments"
        ]
      }
    },
    "/api/v2/run-attachments/{attachment_id}/preview": {
      "post": {
        "description": "Read a bounded preview of the document's current extracted text.\n\nAccess is authorized and audited before text is returned. The preview may\nbe truncated and does not establish which text a historical run consumed.\nThe stored document and its original download remain unchanged.",
        "operationId": "preview_attachment_api_v2_run_attachments__attachment_id__preview_post",
        "parameters": [
          {
            "in": "path",
            "name": "attachment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Attachment Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachmentTextPreview"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read a bounded preview of a document's current extracted text.",
        "tags": [
          "run-attachments"
        ]
      }
    },
    "/api/v2/run-attachments/{attachment_id}/requirement": {
      "put": {
        "description": "State which of its case's required documents a filed document is.\n\nA file counts for a required document when its name carries that\ndocument's words, unless a person has said what the file is. Once stated,\nthe file counts for that required document and no other, whatever its\nname, and the case's data requirements are re-read at once: a required\ndocument this file supplies reads acquired, and a step waiting for it\nmoves on. Null clears the statement.\n\nThe document must be filed on an open case (409 otherwise), stored (409)\nand not superseded on the case's file by a later document (409, with a\nfixed sentence; nothing changes, a clearing included), and\n``requirement_id`` must name one of that case's required documents that\ncan be uploaded (422). Available to workspace admins and\nmembers; every statement is recorded in the audit log. It takes the\ncase's locks first, as a sweep filing on the case does: while another\nchange holds the case (a sweep, a round's start, a close) it is refused at\nonce with 409 and a fixed sentence, and nothing changes. **403**\n``exposure_denied_by_policy`` if an API key makes the statement on a\ndocument a case holds (filed on it, or read by one of its runs) whose crew\nthe workspace's policy keeps inside the app; nothing changes.",
        "operationId": "declare_attachment_requirement_api_v2_run_attachments__attachment_id__requirement_put",
        "parameters": [
          {
            "in": "path",
            "name": "attachment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Attachment Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachmentRequirementDeclare"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachmentRequirementDeclared"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "State which of the case's required documents this file is.",
        "tags": [
          "run-attachments"
        ]
      }
    },
    "/api/v2/run-attachments/{attachment_id}/upload": {
      "post": {
        "description": "Store an attachment's raw bytes SERVER-SIDE.\n\nThis replaces the old client-direct presigned S3 PUT: the audit-evidence\nbucket has S3 Object Lock (GOVERNANCE) enabled, which mandates a signed\nchecksum on every PutObject — a browser ``fetch`` PUT can't supply one, so\nevery upload failed and the attachment sat ``pending``. Here the API writes\nthe bytes with ``storage.put_bytes`` (which sends ``ChecksumAlgorithm=SHA256``\nto satisfy Object Lock).\n\nOwnership/RLS: the row is looked up under the caller's tenant-scoped session,\nso a foreign attachment id reads as 404 — the caller cannot upload into\nanother tenant's attachment (migration 053 RLS). The stored key is derived\nfrom the row (not the request), so the bytes always land at the attachment's\nown ``s3_key``. Size limit: the actual bytes are checked against the 25 MiB\nceiling here (413), independent of the declared size at register time.\n**403** ``exposure_denied_by_policy`` if an API key uploads bytes for a\ndocument a case holds (filed on it, or read by one of its runs) whose crew\nthe workspace's policy keeps inside the app; the stored bytes are\nunchanged.",
        "operationId": "upload_attachment_api_v2_run_attachments__attachment_id__upload_post",
        "parameters": [
          {
            "in": "path",
            "name": "attachment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Attachment Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_attachment_api_v2_run_attachments__attachment_id__upload_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachmentUploaded"
                }
              }
            },
            "description": "Successful Response"
          },
          "403": {
            "description": "Refused. Either the caller's role does not allow this action, or the crew works on patient records and the organization has no business associate agreement with Velerian on record (detail.error = patient_data_agreement_required)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Upload an attachment's raw bytes (multipart); the API stores them server-side.",
        "tags": [
          "run-attachments"
        ]
      }
    },
    "/api/v2/saved-scenarios": {
      "get": {
        "description": "List the calling user's saved scenarios, newest first.\n\nTenant-isolated by RLS and additionally scoped to ``ctx.user_id`` so a\nscenario is personal to its creator. Optionally filtered to one pack.",
        "operationId": "list_saved_scenarios_api_v2_saved_scenarios_get",
        "parameters": [
          {
            "description": "Optional: only scenarios for this pack.",
            "in": "query",
            "name": "pack_slug",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 64,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional: only scenarios for this pack.",
              "title": "Pack Slug"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedScenarioList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List the calling user's saved intake scenarios (newest first).",
        "tags": [
          "saved-scenarios"
        ]
      },
      "post": {
        "description": "Save a named intake scenario for a pack.\n\nAdmin/member-gated: saving is a tenant write (mirrors the invoke gate — a\nviewer cannot create one). The row is stamped with the caller's tenant + user\nso it lists as their personal scenario.",
        "operationId": "create_saved_scenario_api_v2_saved_scenarios_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavedScenarioCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedScenarioRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Save an intake scenario for a pack.",
        "tags": [
          "saved-scenarios"
        ]
      }
    },
    "/api/v2/saved-scenarios/{scenario_id}": {
      "delete": {
        "description": "Delete one of the calling user's saved scenarios.\n\nAdmin/member-gated + user-scoped: a caller can only delete their OWN saved\nscenario in their OWN tenant. A foreign / unknown id 404s (the DELETE matches\nno row) so the endpoint never confirms another user's / tenant's id exists.",
        "operationId": "delete_saved_scenario_api_v2_saved_scenarios__scenario_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "scenario_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Scenario Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete one saved scenario.",
        "tags": [
          "saved-scenarios"
        ]
      },
      "get": {
        "description": "Read one of the calling user's saved scenarios.\n\nTenant-isolated by RLS and scoped to ``ctx.user_id``; a foreign / unknown id\n(including another user's scenario in the same tenant) reads as 404.",
        "operationId": "get_saved_scenario_api_v2_saved_scenarios__scenario_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "scenario_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Scenario Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedScenarioRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read one saved scenario (the run form pre-fills from it).",
        "tags": [
          "saved-scenarios"
        ]
      }
    },
    "/api/v2/scheduled-runs": {
      "get": {
        "description": "Every schedule for the tenant, newest first. Any authenticated role.",
        "operationId": "list_scheduled_runs_api_v2_scheduled_runs_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleList"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List the workspace's scheduled runs.",
        "tags": [
          "scheduled-runs"
        ]
      },
      "post": {
        "description": "Create a schedule: validate, mint the bound key, persist, audit.\n\nAdmin/member only (viewer excluded, mirrors the invoke gate) and JWT-only\n(a key cannot create a schedule — it would be self-issuing run authority).\nThe bound ``runs:write`` key is minted + its full secret discarded (the\nin-process-principal design); ``next_run_at`` is computed from cron+tz.",
        "operationId": "create_scheduled_run_api_v2_scheduled_runs_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create a recurring scheduled pack run.",
        "tags": [
          "scheduled-runs"
        ]
      }
    },
    "/api/v2/scheduled-runs/{schedule_id}": {
      "delete": {
        "description": "Revoke the bound key + delete the schedule. Admin/member + JWT-only.\n\nThe schedule row is hard-deleted (it has no audit value once gone), but its\nbound key is SOFT-revoked (``revoked_at`` stamp) so the credential audit\ntrail — when it existed, what it could do, when it died — is preserved.",
        "operationId": "delete_scheduled_run_api_v2_scheduled_runs__schedule_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Schedule Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Delete Scheduled Run Api V2 Scheduled Runs  Schedule Id  Delete",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete a scheduled run (revokes its bound key).",
        "tags": [
          "scheduled-runs"
        ]
      },
      "get": {
        "description": "Detail for one schedule. 404 if it does not exist under this tenant.",
        "operationId": "get_scheduled_run_api_v2_scheduled_runs__schedule_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Schedule Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get one scheduled run.",
        "tags": [
          "scheduled-runs"
        ]
      },
      "patch": {
        "description": "Patch a schedule. Admin/member + JWT-only.\n\nLifecycle:\n- ``enabled`` false -> revoke the bound key (the schedule stops authorizing).\n- ``enabled`` true (from disabled) -> mint a FRESH bound key + recompute\n  next_run_at from now (the old key stays revoked as audit trail). The\n  fires missed while the schedule was disabled are skipped: no catch-up\n  run fires.\n- cron/timezone change -> recompute next_run_at from now.\n- name/prompt change, or ``enabled`` true on an enabled schedule ->\n  applied as-is; next_run_at does not move.",
        "operationId": "update_scheduled_run_api_v2_scheduled_runs__schedule_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Schedule Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update a scheduled run (toggle, rename, re-prompt, re-schedule).",
        "tags": [
          "scheduled-runs"
        ]
      }
    },
    "/api/v2/scim/tokens": {
      "get": {
        "description": "List the tenant's SCIM provisioning tokens (metadata only).",
        "operationId": "list_tokens_api_v2_scim_tokens_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScimTokenList"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Tokens",
        "tags": [
          "scim"
        ]
      },
      "post": {
        "description": "Mint a SCIM provisioning token. Owner only. The full token is returned only here.",
        "operationId": "create_token_api_v2_scim_tokens_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScimTokenCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScimTokenCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Token",
        "tags": [
          "scim"
        ]
      }
    },
    "/api/v2/scim/tokens/{token_id}": {
      "delete": {
        "description": "Soft-revoke a SCIM token. Owner only. The next SCIM request presenting it 401s.",
        "operationId": "revoke_token_api_v2_scim_tokens__token_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "token_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Token Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke Token",
        "tags": [
          "scim"
        ]
      }
    },
    "/api/v2/share-links/evidence/{token}": {
      "get": {
        "description": "The same read as the public evidence link, as the signed-in caller.\n\nA member of the organization that owns the run sees its findings and the\nevidence download, even when they are limited to members. Anyone else sees\nwhat the public link shows. An API key restricted to a different agent is\nrefused.\n\n404 for an unknown / malformed token or a hash mismatch; 410 Gone when the\nlink is revoked or expired.",
        "operationId": "get_shared_evidence_signed_in_api_v2_share_links_evidence__token__get",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "title": "Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedEvidenceView"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read a shared evidence pack as the signed-in caller.",
        "tags": [
          "shared-evidence"
        ]
      }
    },
    "/api/v2/share-links/runs/{token}": {
      "get": {
        "description": "The same read as the public link, as the signed-in caller.\n\nA member of the organization that owns the run sees its full result, even\nwhen the result is limited to members. Anyone else sees what the public\nlink shows. An API key restricted to a different agent is refused.\n\n404 for an unknown / malformed token or a hash mismatch; 410 Gone when the\nlink is revoked or expired.",
        "operationId": "get_shared_run_signed_in_api_v2_share_links_runs__token__get",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "title": "Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedRunView"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read a shared governed run as the signed-in caller.",
        "tags": [
          "shared-runs"
        ]
      }
    },
    "/api/v2/shared-evidence/{token}": {
      "get": {
        "description": "Resolve a share token to its run's read-only evidence view. NO auth required.\n\nA run whose evidence is limited to members of the organization that owns it\nreturns the verification view here: the verdict, timestamps and evidence\nseal, without the findings or the evidence download.\n\n404 for an unknown / malformed token or a hash mismatch (no failure oracle);\n410 Gone when the link is revoked or expired.",
        "operationId": "get_shared_evidence_api_v2_shared_evidence__token__get",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "title": "Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedEvidenceView"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read a shared evidence pack (no login required).",
        "tags": [
          "shared-evidence"
        ]
      }
    },
    "/api/v2/shared-evidence/{token}/bundle": {
      "get": {
        "description": "Stream the EXACT evidence-bundle bytes for a shared run. NO auth required.\n\nThe byte-for-byte S3 object — never re-serialized — so an in-browser or\noffline verifier can recompute the hash seal over the same bytes the\nplatform sealed. Same token gauntlet as the view endpoint: 404 for an\nunknown/mismatched token (no oracle) OR when the run has no stored bundle,\nwith a detail that says whether the run's record is sealed and why its\nfile is not served (not stored yet, a different file holds its place, not\nin storage, or not readable just now); 410 Gone when the link is revoked\nor expired; 403 when the run's evidence file is limited to members of the\norganization that owns it.",
        "operationId": "get_shared_evidence_bundle_api_v2_shared_evidence__token__bundle_get",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "title": "Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download the shared run's evidence bundle bytes (no login required).",
        "tags": [
          "shared-evidence"
        ]
      }
    },
    "/api/v2/shared-evidence/{token}/signoffs/{signoff_id}": {
      "get": {
        "description": "Download a person's sealed sign-off on a step that followed the shared run. NO auth.\n\nOnly a sign-off the link's view lists is served: 404 for any other id. It\nnames the person by their workspace user id, never by name or email.\nVerify it at /trust/verify or offline, with the run's record as the\nrecord before it. The same token gauntlet as the bundle: 404 for an\nunknown link, 410 when revoked or expired, 403 when the run's files are\nlimited to members; 409 when the record's file is not stored yet.",
        "operationId": "get_shared_evidence_signoff_api_v2_shared_evidence__token__signoffs__signoff_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "title": "Token",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "signoff_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Signoff Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "The sealed sign-off record, with its signature once it is signed."
          },
          "403": {
            "description": "The run's files are limited to members of its workspace."
          },
          "404": {
            "description": "Unknown link, or no such sign-off on its run."
          },
          "409": {
            "description": "The record is sealed but its file is not available."
          },
          "410": {
            "description": "The link is revoked or expired."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download one sealed sign-off record listed on a shared evidence view.",
        "tags": [
          "shared-evidence"
        ]
      }
    },
    "/api/v2/shared-runs/{token}": {
      "get": {
        "description": "Resolve a share token to its run's read-only result. NO auth required.\n\nA run whose result is limited to members of the organization that owns it\nreturns the verification view here: the verdict, timestamps and evidence\nseal, without the prompt, output, findings or evidence download.\n\n404 for an unknown / malformed token or a hash mismatch (no failure oracle);\n410 Gone when the link is revoked or expired.",
        "operationId": "get_shared_run_api_v2_shared_runs__token__get",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "title": "Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedRunView"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read a shared governed run (no login required).",
        "tags": [
          "shared-runs"
        ]
      }
    },
    "/api/v2/shared-runs/{token}/signoffs/{signoff_id}": {
      "get": {
        "description": "Download a person's sealed sign-off on a step that followed the shared run. NO auth.\n\nOnly a sign-off the link's view lists is served: 404 for any other id. It\nnames the person by their workspace user id, never by name or email.\nVerify it at /trust/verify or offline, with the run's record as the\nrecord before it. 404 for an unknown link, 410 when revoked or expired,\n403 when the run's files are limited to members; 409 when the record's\nfile is not stored yet.",
        "operationId": "get_shared_run_signoff_api_v2_shared_runs__token__signoffs__signoff_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "title": "Token",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "signoff_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Signoff Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "The sealed sign-off record, with its signature once it is signed."
          },
          "403": {
            "description": "The run's files are limited to members of its workspace."
          },
          "404": {
            "description": "Unknown link, or no such sign-off on its run."
          },
          "409": {
            "description": "The record is sealed but its file is not available."
          },
          "410": {
            "description": "The link is revoked or expired."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download one sealed sign-off record listed on a shared run.",
        "tags": [
          "shared-runs"
        ]
      }
    },
    "/api/v2/sso/config": {
      "get": {
        "description": "Every IdP config for the tenant, newest first. Any authenticated role —\nthis is a read surface and the response NEVER includes secret material.",
        "operationId": "list_sso_config_api_v2_sso_config_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoConfigList"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List this tenant's SSO IdP configs (credentials redacted).",
        "tags": [
          "sso"
        ]
      },
      "post": {
        "description": "Create or upsert this tenant's IdP config keyed by ``idp_id``.\n\nAdmin-only (owner passes via the hierarchy). The OIDC client secret, when\nsupplied, is envelope-encrypted before persist — plaintext never lands in\nthe DB. INERT regardless of ``enabled``: this slice changes nothing about\nthe live login path; ``enabled`` is consumed only by the later federation\nslice.\n\n409, before any write, when the ``idp_id`` derives the same Cognito\nprovider name as another of this workspace's IdP configs: registering it\nwould update that IdP's live provider instead of creating its own.",
        "operationId": "upsert_sso_config_api_v2_sso_config_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SsoConfigCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoConfigRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create or update (by idp_id) an SSO IdP config. Admin-only.",
        "tags": [
          "sso"
        ]
      }
    },
    "/api/v2/sso/config/reconcile": {
      "post": {
        "description": "Re-apply every ENABLED IdP config of record to the live Cognito pool.\n\nThe config↔Cognito reconciliation path. The live registration performed on a\ncreate/update is BEST-EFFORT: a transient Cognito failure on the\noriginal create/update leaves the durable config of record intact but the\nlive provider un-registered (the write's ``cognito_sync.ok`` was false). This\nendpoint re-runs the SAME ``register_identity_provider`` upsert for each\nENABLED config so an admin can converge the live pool back onto stored intent\nWITHOUT re-entering any secret (it re-reads the envelope-encrypted secret of\nrecord). Admin-only (owner passes via the hierarchy).\n\nDoes not MUTATE any config of record — it only re-issues the live Cognito\nregistration (and appends an audit row for any config whose\nre-sync still fails, so persistent drift is traceable). Idempotent + safe to\ncall repeatedly: re-registering an\nalready-correct provider is a no-op update. A no-op entirely when no Cognito\npool is configured (local/CI): every item reports ``attempted=false``. INERT\nfor a tenant with no enabled IdP config (``reconciled=0``). The existing login\npath is untouched — this only (re)registers federation that an admin already\nconfigured + enabled.",
        "operationId": "reconcile_sso_config_api_v2_sso_config_reconcile_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoConfigReconcileResult"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Re-apply this tenant's stored IdP config to Cognito (drift re-sync). Admin-only.",
        "tags": [
          "sso"
        ]
      }
    },
    "/api/v2/sso/config/{config_id}": {
      "delete": {
        "description": "Remove an IdP config. Admin-only. 404 when the id does not exist under\nthe caller's tenant (RLS-filtered — no cross-tenant existence oracle).",
        "operationId": "delete_sso_config_api_v2_sso_config__config_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "config_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Config Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoConfigDeleted"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete an SSO IdP config. Admin-only.",
        "tags": [
          "sso"
        ]
      }
    },
    "/api/v2/staff/workspaces": {
      "post": {
        "description": "Onboard a client workspace. Velerian onboarding staff only.\n\nIn one transaction: creates the workspace, sets its seat cap, grants the\nnamed crews with no expiry, and invites the first owner. No subscription is\nwritten, so the workspace has no tier or price. The audit row\n(``staff.workspace_onboarded``) is written in the new workspace's log and\nnames the staff person. The invitation email is sent after the commit; the\nresponse says whether it went out, and carries the link only when it did\nnot. The owner accepts by signing up with the invited address, which\nCognito verifies; the link alone admits no one.\n\n- **403** the owner's address is the caller's own (with or without a ``+``\n  tag) or in the caller's email domain, or the caller's own address is not\n  on record. These are checked before the next one.\n- **409** the owner's address already signs in to a workspace, or the short\n  name is taken.\n- **422** a crew this environment does not list or does not grant.\n- **503** Cognito could not be read, so the owner's address was not checked.",
        "operationId": "onboard_workspace_api_v2_staff_workspaces_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnboardWorkspaceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardedWorkspace"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Onboard Workspace",
        "tags": [
          "staff"
        ]
      }
    },
    "/api/v2/staff/workspaces/{tenant_id}/crews/{pack_slug}": {
      "delete": {
        "description": "Revoke a named workspace's crew now. Velerian onboarding staff only.\n\nThe reason goes in the JSON body. The grant keeps its row with today's end\ndate. Work already running is not stopped; a new run of the crew is\nrefused. The audit row (``staff.crew_revoked``, with the reason) is\nwritten in the workspace's log in the same transaction and names the staff\nperson. Returns the grant as it stood before. A closed workspace may be\nrevoked.\n\n- **403** the workspace is the caller's own.\n- **404** no workspace has this id.\n- **409** the workspace holds no active grant of this crew, or a payment\n  subscription owns it.",
        "operationId": "revoke_workspace_crew_api_v2_staff_workspaces__tenant_id__crews__pack_slug__delete",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pack_slug",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
              "title": "Pack Slug",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrewRevocation"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrewGrant"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke Workspace Crew",
        "tags": [
          "staff"
        ]
      },
      "put": {
        "description": "Grant a crew to a named workspace, with no expiry. Velerian onboarding staff only.\n\nRe-granting a crew the workspace already holds keeps its start date. The\naudit row (``staff.crew_granted``, with the previous grant) is written in\nthe workspace's log in the same transaction and names the staff person.\n\n- **403** the workspace is the caller's own.\n- **404** no workspace has this id.\n- **409** the workspace is closed, or a payment subscription owns the grant.\n- **422** a crew this environment does not list or does not grant.",
        "operationId": "grant_workspace_crew_api_v2_staff_workspaces__tenant_id__crews__pack_slug__put",
        "parameters": [
          {
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Tenant Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pack_slug",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 1,
              "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
              "title": "Pack Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrewGrant"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Grant Workspace Crew",
        "tags": [
          "staff"
        ]
      }
    },
    "/api/v2/status": {
      "get": {
        "description": "Public, unauthenticated machine-readable status snapshot.",
        "operationId": "get_status_json_api_v2_status_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Status Json Api V2 Status Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "System status (JSON)",
        "tags": [
          "status",
          "status"
        ]
      }
    },
    "/api/v2/subjects": {
      "get": {
        "description": "The registry of durable entities your cases attach to — policies,\npatients, providers, accounts, systems.\n\nEntities appear here automatically as your intake conversations,\nattachments, connected systems, and runs observe them; there is no way to\nadd one by hand, so the registry stays trustworthy. Filter by type to\nbrowse, or pass ``case_id`` to see who and what one case is about.",
        "operationId": "list_subjects_api_v2_subjects_get",
        "parameters": [
          {
            "description": "Filter by entity type; omit for all.",
            "in": "query",
            "name": "subject_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "policy",
                    "patient",
                    "provider",
                    "account",
                    "system"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by entity type; omit for all.",
              "title": "Subject Type"
            }
          },
          {
            "description": "List the entities linked to one case (each item then carries its role on that case).",
            "in": "query",
            "name": "case_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "List the entities linked to one case (each item then carries its role on that case).",
              "title": "Case Id"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubjectList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List the entities your cases are about.",
        "tags": [
          "subjects"
        ]
      }
    },
    "/api/v2/subjects/{subject_id}": {
      "get": {
        "description": "One entity's detail plus every case it is linked to, newest first.\n\nThis is the history view: recurring problems on one policy, every case\ntouching one provider or payer account, and what each of those cases\nconcluded. 404 if the entity doesn't exist in your workspace.",
        "operationId": "get_subject_api_v2_subjects__subject_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "subject_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Subject Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubjectDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get one entity with its cross-case history.",
        "tags": [
          "subjects"
        ]
      }
    },
    "/api/v2/subjects/{subject_id}/recurrence": {
      "get": {
        "description": "One entity's recent case history, counted and grouped — recurrence as\na single call.\n\nAnswers questions like \"how many cases has this policy had this quarter,\nand how did they end?\": every case linked to the entity inside the\nlook-back window, grouped by owning pack, by lifecycle status, and by\nrecorded outcome, plus the newest cases themselves. 404 if the entity\ndoesn't exist in your workspace.",
        "operationId": "get_subject_recurrence_api_v2_subjects__subject_id__recurrence_get",
        "parameters": [
          {
            "in": "path",
            "name": "subject_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Subject Id",
              "type": "string"
            }
          },
          {
            "description": "How many days to look back (default 90 — 'this quarter').",
            "in": "query",
            "name": "window_days",
            "required": false,
            "schema": {
              "default": 90,
              "description": "How many days to look back (default 90 — 'this quarter').",
              "maximum": 3650,
              "minimum": 1,
              "title": "Window Days",
              "type": "integer"
            }
          },
          {
            "description": "Most cases to return in the list (counts always cover the whole window).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "description": "Most cases to return in the list (counts always cover the whole window).",
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubjectRecurrence"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "See how often an entity keeps coming back.",
        "tags": [
          "subjects"
        ]
      }
    },
    "/api/v2/supervision/overview": {
      "get": {
        "description": "One supervision snapshot for the workspace: runs, backlog, cases.\n\nAggregates, in a single read: governed runs in flight and the last 24\nhours of outcomes with a short recent-activity strip; open work items\nawaiting human input, bucketed by how long the work has been waiting; and\nper-journey-state case counts. Every figure is a property of the work —\nnothing here measures or ranks people.",
        "operationId": "get_supervision_overview_api_v2_supervision_overview_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisionOverview"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Supervision Overview",
        "tags": [
          "supervision"
        ]
      }
    },
    "/api/v2/support/requests": {
      "post": {
        "description": "Escalate a support request to a human.\n\nAuthenticated + tenant-scoped (any signed-in user). Attempts to file a JSM\nVSUP customer request that names the caller and their workspace as who to\nreply to; on success returns the ``ticket`` channel + the ticket reference. If JSM is not configured here, or the call fails, returns\nthe ``email`` fallback channel with the support address (HTTP 200 — a normal\ndegraded outcome, never a 500). ``subject``/``message`` must be non-empty\n(also enforced by the schema); a malformed body is rejected with 422.",
        "operationId": "submit_support_request_api_v2_support_requests_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupportRequestCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportRequestResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Submit Support Request",
        "tags": [
          "support"
        ]
      }
    },
    "/api/v2/surveys": {
      "post": {
        "description": "Submit an in-product NPS/CSAT survey response.\n\nAuthenticated + tenant-scoped: writes one ``survey_responses`` row bound to\nthe caller's tenant + user, emits a ``user.survey_submitted`` analytics\nevent in the same transaction, and returns the created id. Any signed-in\nuser may submit (no special role). ``survey_type`` is validated against the\nclosed set and ``score`` against the per-type range (both also enforced by\nDB CHECK constraints); a malformed body is rejected with 422 before the\nwrite.",
        "operationId": "submit_survey_api_v2_surveys_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurveyCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Submit Survey",
        "tags": [
          "surveys"
        ]
      }
    },
    "/api/v2/team/invitations": {
      "post": {
        "description": "Invite a teammate by email + role. Owner/admin only; seat-limited.\n\nSeat-limit enforcement is server-side: when the tenant is already at its\n``max_seats`` cap the invite is rejected with 409 whose ``detail`` says how\nmany seats the workspace includes, how to free one, and who to talk to.\nOnly an owner may grant the ``owner`` role (an admin inviting an owner gets\n403). The invite email is best-effort; the invite row is written regardless,\nand the response always carries ``invite_url`` plus an honest\n``email_delivered`` so the inviter can share the link directly when the mail\ndid not go out.\n\nThe response is the same whoever the address belongs to. An address that\nalready signs in to another workspace gets an invite email saying that one\nsign-in belongs to one workspace and asking for an invite to a different\naddress; the invite holds its seat until it expires or is revoked.",
        "operationId": "invite_member_api_v2_team_invitations_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Invite Member",
        "tags": [
          "team"
        ]
      }
    },
    "/api/v2/team/invitations/{invitation_id}": {
      "delete": {
        "description": "Revoke a pending invite (frees its reserved seat). Owner/admin only.\n\nSoft-delete: the row is retained (status='revoked') for the audit trail. An\nalready-accepted / unknown invite returns 404.",
        "operationId": "revoke_pending_invitation_api_v2_team_invitations__invitation_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "invitation_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Invitation Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke Pending Invitation",
        "tags": [
          "team"
        ]
      }
    },
    "/api/v2/team/invitations/{invitation_id}/resend": {
      "post": {
        "description": "Resend a pending invite's email. Owner/admin only.\n\nDoes NOT consume a new seat (the invite already reserved one). Re-sends the\nsame token to the same address. A non-pending / unknown invite returns 404.\nThe email's wording is chosen as at invite time, and the response is the\nsame whoever the address belongs to. Revoking an invite frees its seat.",
        "operationId": "resend_invitation_api_v2_team_invitations__invitation_id__resend_post",
        "parameters": [
          {
            "in": "path",
            "name": "invitation_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Invitation Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Resend Invitation",
        "tags": [
          "team"
        ]
      }
    },
    "/api/v2/team/members": {
      "get": {
        "description": "List the workspace team: active members + pending invites, with seat usage.\n\nAny authenticated member of the tenant may read their own roster. The list is\nthe union of ``users`` rows (active members) and non-revoked\n``tenant_invitations`` (pending / expired), newest activity first. Seat usage\nreflects the same count the invite limit is enforced against.",
        "operationId": "list_members_api_v2_team_members_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamRoster"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Members",
        "tags": [
          "team"
        ]
      }
    },
    "/api/v2/team/members/{user_id}": {
      "delete": {
        "description": "Remove an active member (frees their seat). Owner/admin only.\n\nGuards: a caller cannot remove themselves, the last owner cannot be removed\n(a tenant must always keep an owner), and only an owner can remove an owner:\nan admin removing an owner gets 403. Any other refused removal returns 409\nwith the reason; an unknown member returns 404. The 204 means the member was\nactually removed: if the team changes while the removal is under way (another\nowner is removed at the same moment, or someone else removes this member\nfirst), the removal is refused with the reason instead.",
        "operationId": "remove_team_member_api_v2_team_members__user_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "User Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Remove Team Member",
        "tags": [
          "team"
        ]
      }
    },
    "/api/v2/tenant-data": {
      "get": {
        "description": "Every record in the library, newest first, with its version count.\n\nAny authenticated seat may read — this is the workspace's own reference\ndata, the \"configured once in your data library\" surface the case\ncockpit's Data panel points at. Writes are admin-only.",
        "operationId": "list_tenant_data_records_api_v2_tenant_data_get",
        "parameters": [
          {
            "description": "Filter to one entity kind (e.g. fee_schedule).",
            "in": "query",
            "name": "entity_kind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 32,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to one entity kind (e.g. fee_schedule).",
              "title": "Entity Kind"
            }
          },
          {
            "description": "Include retired records (history view).",
            "in": "query",
            "name": "include_retired",
            "required": false,
            "schema": {
              "default": false,
              "description": "Include retired records (history view).",
              "title": "Include Retired",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantDataRecordList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List the workspace's standing reference data (the data library).",
        "tags": [
          "tenant-data"
        ]
      },
      "post": {
        "description": "Create a record with its first effective-dated version.\n\nConfigured once, consumed everywhere: every open case whose pack declares\nthe entity kind ``tenant_standing`` flips its Data-panel entry to\nacquired in this same request (``cases_updated`` reports how many).\n``reference_table`` / ``other`` records must name the contract\nrequirement they fulfil (``requirement_key``); kinds with intrinsic\nmeaning (fee_schedule, payer_contract, ...) must not. A record keyed to a\ncounterparty (``counterparty_key`` — a payer contract's payer) resolves\nonly for that counterparty's claims. 409 on a duplicate (kind, name) or a\nsecond active record for one counterparty; 422 on a shape violation.\n**403** ``exposure_denied_by_policy`` for an API key when the workspace's\npolicy keeps inside the app a crew whose data contract reads this kind of\nrecord, or the crew of a workflow on an open case whose crew reads it;\nnothing is written.",
        "operationId": "create_record_api_v2_tenant_data_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantDataRecordCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantDataWriteRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Load one piece of standing reference data (admin).",
        "tags": [
          "tenant-data"
        ]
      }
    },
    "/api/v2/tenant-data/{record_id}": {
      "get": {
        "description": "The record plus its versions, latest effective period first.\n\n404 when the record is not in your workspace (RLS-filtered).",
        "operationId": "get_tenant_data_record_api_v2_tenant_data__record_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "record_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Record Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantDataRecordDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "One record with every payload version.",
        "tags": [
          "tenant-data"
        ]
      }
    },
    "/api/v2/tenant-data/{record_id}/retire": {
      "post": {
        "description": "Idempotent. A retired record stops satisfying case syncs, and every\nacquired Data-panel entry it satisfied turns failed (\"record retired\") in\nthe same transaction, because a retired record no longer reaches a run —\nthe entry turns green again when a replacement record or an upload\nsatisfies it. There is deliberately no delete: acquisition history and\nsealed evidence reference these records.\n**403** ``exposure_denied_by_policy`` for an API key when the\nworkspace's policy keeps inside the app a crew whose data contract reads\nthis record, or the crew of a workflow on an open case whose crew reads it:\nretiring it changes what those cases count.",
        "operationId": "retire_record_api_v2_tenant_data__record_id__retire_post",
        "parameters": [
          {
            "in": "path",
            "name": "record_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Record Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantDataRecordRetired"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Retire a record — it stops resolving; its history stays (admin).",
        "tags": [
          "tenant-data"
        ]
      }
    },
    "/api/v2/tenant-data/{record_id}/versions": {
      "post": {
        "description": "Versions are immutable — a correction or a new effective period is the\nnext version, never an edit. Consumers resolve as-of-date, latest\neffective start (then highest version) first. ``counterparty_key``, when\ngiven, must match a keyed record, or keys an unkeyed one once. 404\noutside your workspace; 422 when the record is retired, the range is\ninvalid or the counterparty differs; 409 when another active record\nalready holds the counterparty. **403** ``exposure_denied_by_policy`` for\nan API key when the workspace's policy keeps inside the app a crew whose\ndata contract reads this record, or the crew of a workflow on an open case\nwhose crew reads it; nothing is written.",
        "operationId": "add_record_version_api_v2_tenant_data__record_id__versions_post",
        "parameters": [
          {
            "in": "path",
            "name": "record_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Record Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantDataVersionCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantDataWriteRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Append the next effective-dated version of a record (admin).",
        "tags": [
          "tenant-data"
        ]
      }
    },
    "/api/v2/tenant-policies": {
      "get": {
        "description": "Return the tenant-wide required-fields policy (applies to every pack).",
        "operationId": "get_tenant_wide_api_v2_tenant_policies_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequiredFieldsRead"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Tenant Wide",
        "tags": [
          "tenant-policies"
        ]
      },
      "put": {
        "description": "Replace the tenant-wide required-fields policy (cuts a new saved version).",
        "operationId": "put_tenant_wide_api_v2_tenant_policies_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequiredFieldsWrite"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequiredFieldsRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Put Tenant Wide",
        "tags": [
          "tenant-policies"
        ]
      }
    },
    "/api/v2/tenant-policies/packs/{slug}": {
      "get": {
        "description": "Return the required-fields policy for one pack.",
        "operationId": "get_pack_policy_api_v2_tenant_policies_packs__slug__get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequiredFieldsRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Pack Policy",
        "tags": [
          "tenant-policies"
        ]
      },
      "put": {
        "description": "Replace the required-fields policy for one pack (cuts a new saved version).",
        "operationId": "put_pack_policy_api_v2_tenant_policies_packs__slug__put",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequiredFieldsWrite"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequiredFieldsRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Put Pack Policy",
        "tags": [
          "tenant-policies"
        ]
      }
    },
    "/api/v2/tenant-policies/packs/{slug}/preview": {
      "post": {
        "description": "Dry-run a sample input against a pack's policy.",
        "operationId": "preview_pack_policy_api_v2_tenant_policies_packs__slug__preview_post",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Preview Pack Policy",
        "tags": [
          "tenant-policies"
        ]
      }
    },
    "/api/v2/tenant-policies/packs/{slug}/replay": {
      "post": {
        "description": "Preview a candidate pack policy against recent run history.",
        "operationId": "replay_pack_policy_api_v2_tenant_policies_packs__slug__replay_post",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplayRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Replay Pack Policy",
        "tags": [
          "tenant-policies"
        ]
      }
    },
    "/api/v2/tenant-policies/packs/{slug}/revisions": {
      "get": {
        "description": "Saved-version history for a pack's policy (newest first).",
        "operationId": "get_pack_revisions_api_v2_tenant_policies_packs__slug__revisions_get",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RevisionRead"
                  },
                  "title": "Response Get Pack Revisions Api V2 Tenant Policies Packs  Slug  Revisions Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Pack Revisions",
        "tags": [
          "tenant-policies"
        ]
      }
    },
    "/api/v2/tenant-policies/preview": {
      "post": {
        "description": "Dry-run a sample input against the tenant-wide policy.",
        "operationId": "preview_tenant_wide_api_v2_tenant_policies_preview_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Preview Tenant Wide",
        "tags": [
          "tenant-policies"
        ]
      }
    },
    "/api/v2/tenant-policies/replay": {
      "post": {
        "description": "Preview a candidate tenant-wide policy against recent run history.",
        "operationId": "replay_tenant_wide_api_v2_tenant_policies_replay_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplayRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Replay Tenant Wide",
        "tags": [
          "tenant-policies"
        ]
      }
    },
    "/api/v2/tenant-policies/revisions": {
      "get": {
        "description": "Saved-version history for the tenant-wide policy (newest first).",
        "operationId": "get_tenant_wide_revisions_api_v2_tenant_policies_revisions_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RevisionRead"
                  },
                  "title": "Response Get Tenant Wide Revisions Api V2 Tenant Policies Revisions Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Tenant Wide Revisions",
        "tags": [
          "tenant-policies"
        ]
      }
    },
    "/api/v2/tenants": {
      "get": {
        "description": "Platform-admin only. Lists all tenants.",
        "operationId": "list_tenants_api_v2_tenants_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Tenants",
        "tags": [
          "tenants"
        ]
      },
      "post": {
        "description": "Platform-admin only. Creates a bare tenant row and nothing else.\n\nNo owner is invited, no crew is granted and no subscription is written; the\naudit row (``tenant.created``) lands in the new tenant's log. Velerian staff\nonboard a client workspace through ``POST /api/v2/staff/workspaces``\ninstead, which does all of that in one transaction.",
        "operationId": "create_tenant_api_v2_tenants_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Tenant",
        "tags": [
          "tenants"
        ]
      }
    },
    "/api/v2/tenants/me": {
      "get": {
        "description": "Return the caller's tenant. Available to any authenticated user.",
        "operationId": "get_my_tenant_api_v2_tenants_me_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantRead"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get My Tenant",
        "tags": [
          "tenants"
        ]
      }
    },
    "/api/v2/underpayments-actions": {
      "get": {
        "operationId": "list_payer_actions_api_v2_underpayments_actions_get",
        "parameters": [
          {
            "in": "query",
            "name": "case_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Case Id"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 32,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 50,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "before_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Before Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Payer Actions Api V2 Underpayments Actions Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Payer Actions",
        "tags": [
          "Underpayments actions"
        ]
      },
      "post": {
        "operationId": "prepare_payer_action_api_v2_underpayments_actions_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrepareActionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Prepare Payer Action Api V2 Underpayments Actions Post"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Prepare Payer Action",
        "tags": [
          "Underpayments actions"
        ]
      }
    },
    "/api/v2/underpayments-actions/{action_id}": {
      "get": {
        "operationId": "get_payer_action_api_v2_underpayments_actions__action_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "action_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Action Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "history_limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 20,
              "minimum": 1,
              "title": "History Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Payer Action Api V2 Underpayments Actions  Action Id  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Payer Action",
        "tags": [
          "Underpayments actions"
        ]
      }
    },
    "/api/v2/underpayments-actions/{action_id}/authorize": {
      "post": {
        "operationId": "authorize_payer_action_api_v2_underpayments_actions__action_id__authorize_post",
        "parameters": [
          {
            "in": "path",
            "name": "action_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Action Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthorizeActionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Authorize Payer Action Api V2 Underpayments Actions  Action Id  Authorize Post"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Authorize Payer Action",
        "tags": [
          "Underpayments actions"
        ]
      }
    },
    "/api/v2/underpayments-actions/{action_id}/portal-launch": {
      "post": {
        "operationId": "launch_official_portal_api_v2_underpayments_actions__action_id__portal_launch_post",
        "parameters": [
          {
            "in": "path",
            "name": "action_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Action Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PortalLaunchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Launch Official Portal Api V2 Underpayments Actions  Action Id  Portal Launch Post"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Launch Official Portal",
        "tags": [
          "Underpayments assisted workspace"
        ]
      }
    },
    "/api/v2/underpayments-actions/{action_id}/portal-session-reports": {
      "post": {
        "operationId": "report_portal_session_api_v2_underpayments_actions__action_id__portal_session_reports_post",
        "parameters": [
          {
            "in": "path",
            "name": "action_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Action Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PortalSessionReportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Report Portal Session Api V2 Underpayments Actions  Action Id  Portal Session Reports Post"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Report Portal Session",
        "tags": [
          "Underpayments assisted workspace"
        ]
      }
    },
    "/api/v2/underpayments-actions/{action_id}/receipt-resolutions": {
      "post": {
        "operationId": "resolve_original_receipt_api_v2_underpayments_actions__action_id__receipt_resolutions_post",
        "parameters": [
          {
            "in": "path",
            "name": "action_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Action Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptResolutionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Resolve Original Receipt Api V2 Underpayments Actions  Action Id  Receipt Resolutions Post"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Resolve Original Receipt",
        "tags": [
          "Underpayments assisted workspace"
        ]
      }
    },
    "/api/v2/underpayments-actions/{action_id}/receipt-supersessions": {
      "post": {
        "description": "Record a person's correction superseding one unsafe receipt event.\n\nThe original receipt stays retained; the correction is an appended,\naudited record and the action projection is recomputed from both.",
        "operationId": "supersede_receipt_event_api_v2_underpayments_actions__action_id__receipt_supersessions_post",
        "parameters": [
          {
            "in": "path",
            "name": "action_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Action Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptSupersessionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Supersede Receipt Event Api V2 Underpayments Actions  Action Id  Receipt Supersessions Post"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Supersede Receipt Event",
        "tags": [
          "Underpayments assisted workspace"
        ]
      }
    },
    "/api/v2/underpayments-actions/{action_id}/receipts": {
      "post": {
        "operationId": "import_payer_receipt_api_v2_underpayments_actions__action_id__receipts_post",
        "parameters": [
          {
            "in": "path",
            "name": "action_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Action Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptImportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Import Payer Receipt Api V2 Underpayments Actions  Action Id  Receipts Post"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Import Payer Receipt",
        "tags": [
          "Underpayments actions"
        ]
      }
    },
    "/api/v2/underpayments-actions/{action_id}/replace": {
      "post": {
        "operationId": "replace_payer_action_api_v2_underpayments_actions__action_id__replace_post",
        "parameters": [
          {
            "in": "path",
            "name": "action_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Action Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceActionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Replace Payer Action Api V2 Underpayments Actions  Action Id  Replace Post"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Replace Payer Action",
        "tags": [
          "Underpayments actions"
        ]
      }
    },
    "/api/v2/underpayments-actions/{action_id}/void": {
      "post": {
        "operationId": "void_payer_action_api_v2_underpayments_actions__action_id__void_post",
        "parameters": [
          {
            "in": "path",
            "name": "action_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Action Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoidActionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Void Payer Action Api V2 Underpayments Actions  Action Id  Void Post"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Void Payer Action",
        "tags": [
          "Underpayments actions"
        ]
      }
    },
    "/api/v2/underpayments-actions/{action_id}/workspace": {
      "get": {
        "operationId": "read_assisted_workspace_api_v2_underpayments_actions__action_id__workspace_get",
        "parameters": [
          {
            "in": "path",
            "name": "action_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Action Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceActionView"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read Assisted Workspace",
        "tags": [
          "Underpayments assisted workspace"
        ]
      }
    },
    "/api/v2/underpayments-intake/contracts/preview": {
      "post": {
        "description": "Persist validation and provenance; this preview does not activate terms.",
        "operationId": "receive_contract_api_v2_underpayments_intake_contracts_preview_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeliveryCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Receive Contract Api V2 Underpayments Intake Contracts Preview Post"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Receive Contract",
        "tags": [
          "underpayments-intake"
        ]
      }
    },
    "/api/v2/underpayments-intake/contracts/{delivery_id}/confirm": {
      "post": {
        "description": "An administrator confirms the exact preview into the existing term store.",
        "operationId": "confirm_contract_api_v2_underpayments_intake_contracts__delivery_id__confirm_post",
        "parameters": [
          {
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Delivery Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContractConfirm"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Confirm Contract",
        "tags": [
          "underpayments-intake"
        ]
      }
    },
    "/api/v2/underpayments-intake/deliveries": {
      "get": {
        "operationId": "list_deliveries_api_v2_underpayments_intake_deliveries_get",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 32,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Deliveries Api V2 Underpayments Intake Deliveries Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Deliveries",
        "tags": [
          "underpayments-intake"
        ]
      },
      "post": {
        "description": "Queue finalized placement/835 sources; an exact replay keeps its identity.",
        "operationId": "receive_delivery_api_v2_underpayments_intake_deliveries_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeliveryCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Receive Delivery Api V2 Underpayments Intake Deliveries Post"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Receive Delivery",
        "tags": [
          "underpayments-intake"
        ]
      }
    },
    "/api/v2/underpayments-intake/deliveries/{delivery_id}": {
      "get": {
        "operationId": "read_delivery_api_v2_underpayments_intake_deliveries__delivery_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Delivery Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Read Delivery Api V2 Underpayments Intake Deliveries  Delivery Id  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read Delivery",
        "tags": [
          "underpayments-intake"
        ]
      }
    },
    "/api/v2/underpayments-intake/deliveries/{delivery_id}/children/{child_id}/overrides": {
      "post": {
        "description": "Record a named person's selection against an accepted parent.",
        "operationId": "record_named_override_api_v2_underpayments_intake_deliveries__delivery_id__children__child_id__overrides_post",
        "parameters": [
          {
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Delivery Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "child_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Child Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NamedOverrideCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Record Named Override",
        "tags": [
          "underpayments-intake"
        ]
      }
    },
    "/api/v2/underpayments-intake/deliveries/{delivery_id}/process": {
      "post": {
        "description": "Retry a durable pending delivery through the same scheduled worker.",
        "operationId": "process_delivery_api_v2_underpayments_intake_deliveries__delivery_id__process_post",
        "parameters": [
          {
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Delivery Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Process Delivery Api V2 Underpayments Intake Deliveries  Delivery Id  Process Post"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Process Delivery",
        "tags": [
          "underpayments-intake"
        ]
      }
    },
    "/api/v2/underpayments-intake/export-preflight": {
      "get": {
        "description": "Identify the current intake tenant before sending any source artifact.\n\nThis observation grants no authority to a later upload or delivery. Those\noperations repeat their own current checks.",
        "operationId": "export_preflight_api_v2_underpayments_intake_export_preflight_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportPreflight"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Authentication is required."
          },
          "403": {
            "description": "The current credential, role or intake policy refuses this read."
          },
          "503": {
            "description": "Current authority could not be established."
          }
        },
        "summary": "Export Preflight",
        "tags": [
          "underpayments-intake"
        ]
      }
    },
    "/api/v2/underpayments-intake/sources/{attachment_id}/digest": {
      "get": {
        "description": "Verify this submitter's finalized source bytes without returning content.\n\nCurrent authority and original custody are observations for this response;\nevery later delivery must establish its own authority and source binding.\nNo database owner spans the physical object read.",
        "operationId": "read_source_digest_api_v2_underpayments_intake_sources__attachment_id__digest_get",
        "parameters": [
          {
            "in": "path",
            "name": "attachment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Attachment Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceDigest"
                }
              }
            },
            "description": "Successful Response"
          },
          "401": {
            "description": "Authentication is required."
          },
          "403": {
            "description": "The current credential, role or intake policy refuses this read."
          },
          "404": {
            "description": "The source document was not found in this tenant."
          },
          "409": {
            "description": "The source is not finalized or its custody changed."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "The original source bytes are unavailable."
          }
        },
        "summary": "Read Source Digest",
        "tags": [
          "underpayments-intake"
        ]
      }
    },
    "/api/v2/underpayments-intake/sources/{attachment_id}/remittance-preview": {
      "post": {
        "description": "Preview one saved JSON-derived candidate without import or filing authority.",
        "operationId": "preview_saved_remittance_api_v2_underpayments_intake_sources__attachment_id__remittance_preview_post",
        "parameters": [
          {
            "in": "path",
            "name": "attachment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Attachment Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavedRemittanceCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedRemittancePreview"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "description": "Existing canonical request refusal."
          },
          "401": {
            "description": "Authentication is required."
          },
          "403": {
            "description": "Canonical credential/role/policy refusal, or remittance_principal_unsupported."
          },
          "404": {
            "description": "The selected source was not found in this tenant."
          },
          "409": {
            "description": "Canonical source/custody refusal, or remittance_source_changed for selection pins."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SavedRemittanceInvalid"
                    },
                    {
                      "$ref": "#/components/schemas/SavedRemittanceUnsupported"
                    }
                  ],
                  "title": "Response 422 Preview Saved Remittance Api V2 Underpayments Intake Sources  Attachment Id  Remittance Preview Post"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "description": "Existing admission or throttle refusal."
          },
          "503": {
            "description": "Current source bytes or authority are unavailable."
          }
        },
        "summary": "Preview Saved Remittance",
        "tags": [
          "underpayments-intake"
        ]
      }
    },
    "/api/v2/underpayments-intake/sources/{attachment_id}/remittance-preview/download": {
      "post": {
        "description": "Download a saved JSON-derived candidate without import or filing authority.",
        "operationId": "download_saved_remittance_api_v2_underpayments_intake_sources__attachment_id__remittance_preview_download_post",
        "parameters": [
          {
            "in": "path",
            "name": "attachment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Attachment Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavedRemittanceDownloadCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "description": "Existing canonical request refusal."
          },
          "401": {
            "description": "Authentication is required."
          },
          "403": {
            "description": "Canonical credential/role/policy refusal, or remittance_principal_unsupported."
          },
          "404": {
            "description": "The selected source was not found in this tenant."
          },
          "409": {
            "description": "Canonical source/custody refusal, or selected source/preview pins changed."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SavedRemittanceInvalid"
                    },
                    {
                      "$ref": "#/components/schemas/SavedRemittanceUnsupported"
                    }
                  ],
                  "title": "Response 422 Download Saved Remittance Api V2 Underpayments Intake Sources  Attachment Id  Remittance Preview Download Post"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "description": "Existing admission or throttle refusal."
          },
          "503": {
            "description": "Current source bytes or authority are unavailable."
          }
        },
        "summary": "Download Saved Remittance",
        "tags": [
          "underpayments-intake"
        ]
      }
    },
    "/api/v2/underpayments-workspace/actions": {
      "post": {
        "operationId": "prepare_assisted_action_api_v2_underpayments_workspace_actions_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspacePrepareRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Prepare Assisted Action Api V2 Underpayments Workspace Actions Post"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Prepare Assisted Action",
        "tags": [
          "Underpayments assisted workspace"
        ]
      }
    },
    "/api/v2/underpayments-workspace/routes": {
      "get": {
        "operationId": "maintained_routes_api_v2_underpayments_workspace_routes_get",
        "parameters": [
          {
            "in": "query",
            "name": "case_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Case Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "drafting_run_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Drafting Run Id"
            }
          },
          {
            "in": "query",
            "name": "product",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 128,
                  "minLength": 1,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Product"
            }
          },
          {
            "in": "query",
            "name": "state",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[A-Z]{2}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "State"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceRouteOptions"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Maintained Routes",
        "tags": [
          "Underpayments assisted workspace"
        ]
      }
    },
    "/api/v2/usage": {
      "get": {
        "description": "Return the calling tenant's usage rollup for the current month.\n\nPlatform-sourced re-implementation of the AgenticX ``GET /api/v2/usage``\nhandler, preserving the camelCase wire shape so the dashboard widget needs\nno change. Tenant-scoped by the verified ``TenantContext.tenant_id`` (the\naggregation filters on it explicitly; it does not rely on the RLS GUC).",
        "operationId": "get_usage_api_v2_usage_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageRollupResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Dashboard usage rollup — runs / seats / integrations / quota.",
        "tags": [
          "usage"
        ]
      }
    },
    "/api/v2/usage/summary": {
      "get": {
        "description": "Return the caller's usage summary.\n\nGoverned-run count against the monthly run limit, evidence-pack history (with\nlinks to the export endpoint), and — for admin callers — an\naccount-level adoption block. All tenant-scoped to the caller's own\naccount; computed on read from ``metering_event`` + ``entitlements`` +\n``evidence_packs``.",
        "operationId": "get_usage_summary_api_v2_usage_summary_get",
        "parameters": [
          {
            "description": "Page size for the evidence-pack history (1..100).",
            "in": "query",
            "name": "evidence_limit",
            "required": false,
            "schema": {
              "default": 20,
              "description": "Page size for the evidence-pack history (1..100).",
              "maximum": 100,
              "minimum": 1,
              "title": "Evidence Limit",
              "type": "integer"
            }
          },
          {
            "description": "Page offset for the evidence-pack history.",
            "in": "query",
            "name": "evidence_offset",
            "required": false,
            "schema": {
              "default": 0,
              "description": "Page offset for the evidence-pack history.",
              "minimum": 0,
              "title": "Evidence Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantUsageSummaryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Usage Summary",
        "tags": [
          "usage"
        ]
      }
    },
    "/api/v2/users": {
      "get": {
        "operationId": "list_users_api_v2_users_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Users",
        "tags": [
          "users"
        ]
      },
      "post": {
        "description": "Create a user in the caller's tenant. Requires tenant-admin role.\n\nOnly an owner can create an owner: an admin asking for ``role=owner`` gets\n403. The new user takes a seat, as every way into a workspace does: when the\nworkspace is at its seat limit the request is refused with 409, and the\n``detail`` says how many seats the workspace includes, how to free one, and\nwho to talk to. A pending invite for the same address already holds the\nperson a seat, so they take that one and the invite is marked accepted; the\nuser gets the role asked for here, not the invite's. An address a member\nalready has, in any letter case, is refused with 409.\n\n``cognito_sub`` must be a login whose verified email is ``email`` and\nwhich does not sign in to another workspace: neither a login made for\nanother workspace nor one that already has a seat in one. Any other login\nid is refused with 422 and the same wording whatever the reason; nothing is\nwritten or audited. When the user pool cannot be read, or a deployed\nenvironment has none configured, the request is refused with 503.",
        "operationId": "create_user_api_v2_users_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create User",
        "tags": [
          "users"
        ]
      }
    },
    "/api/v2/users/me": {
      "get": {
        "description": "Return the calling user's own User record.",
        "operationId": "get_me_api_v2_users_me_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRead"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Me",
        "tags": [
          "users"
        ]
      }
    },
    "/api/v2/users/{user_id}": {
      "patch": {
        "description": "Change a user's role or display name. Requires tenant-admin role.\n\nOnly an owner can make someone an owner, and only an owner can change an\nowner's role. An admin asking for ``role=owner``, for anyone including\nthemselves, or asking to change the role of a user who is an owner, gets 403\nand nothing is changed or audited. Admins still change the roles of admins\nand everyone below, and anyone's display name. A change that would leave the\nworkspace without an owner gets 409.",
        "operationId": "update_user_api_v2_users__user_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "User Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update User",
        "tags": [
          "users"
        ]
      }
    },
    "/api/v2/version": {
      "get": {
        "description": "Return the build identity + release visibility + API-versioning contract.\n\nShape::\n\n    {\n      \"service\": \"velerian-platform-api\",\n      \"environment\": \"<dev|staging|prod|unknown>\",\n      \"git_sha\": \"<git SHA|unknown>\",\n      \"release_tag\": \"<release tag|unknown>\",\n      \"build_timestamp\": \"<ISO-8601|unknown>\",\n      \"version\": \"0.1.0\",            # build/package version\n      \"gitSha\": \"<7-char SHA|dev>\",  # deploy correlation id\n      \"buildDate\": \"<ISO-8601|dev>\",\n      \"apiVersion\": \"v2\",            # URL-path major version\n      \"versioningScheme\": \"url-path\",\n      \"deprecationPolicy\": \"docs/api/versioning-and-deprecation.md\",\n      \"deprecationHeaders\": [\"Deprecation\", \"Sunset\"]\n    }\n\n``apiVersion`` is the stable major a client codes against; the build\n``version`` / ``gitSha`` / ``git_sha`` / ``release_tag`` move per deploy\nwithout changing the contract. ``deprecationHeaders`` names the response\nheaders a sunsetting endpoint carries (per the policy doc) so a client can\ndetect deprecation programmatically. Never exposes secrets or internal\nhostnames.",
        "operationId": "get_version_api_v2_version_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Version Api V2 Version Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "API version + deprecation policy",
        "tags": [
          "meta"
        ]
      }
    },
    "/api/v2/voice-lines": {
      "get": {
        "description": "List the calling tenant's provisioned voice lines.\n\nRLS scopes ``voice_numbers`` to the calling tenant automatically — neither\nthis handler nor the caller passes ``tenant_id``. Each row is enriched with\nthe config-derived shop name (falling back to the tenant's most-recent voice\nintake), a status label, and the open items carried on the config.",
        "operationId": "list_voice_lines_api_v2_voice_lines_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceLineList"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Voice Lines",
        "tags": [
          "voice"
        ]
      }
    },
    "/api/v2/voice-lines/{did}/config": {
      "get": {
        "description": "Return the line's current typed config.\n\nRLS-scoped: a DID the caller's tenant does not own is a 404. The config is\nthe typed :class:`VoicedeskConfig` — the latest applied version when the\nline is versioned, else a best-effort rebuild from the live runtime triad.",
        "operationId": "get_voice_line_config_api_v2_voice_lines__did__config_get",
        "parameters": [
          {
            "in": "path",
            "name": "did",
            "required": true,
            "schema": {
              "title": "Did",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceLineConfigRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "The line's current structured config (the shape the editor edits).",
        "tags": [
          "voice"
        ]
      },
      "put": {
        "description": "Apply an edited config to the live line, in place.\n\nThe edit is validated by the SAME contract the intake uses (the\n:class:`VoicedeskConfig` request model — a bad value never reaches this\nbody; FastAPI 422s it with a field location). Applying re-runs the\nidempotent ``provision_voice_line`` UPSERT on the EXISTING DID — the\nwebhook reads ``voice_numbers.config`` at turn time, so the next call\nanswers with the new config (same number, no downtime, no stack redeploy)\n— and appends one ``source='editor'`` version row, atomic with the upsert.\nAudited like the intake's config application (who/when/what-changed).",
        "operationId": "update_voice_line_config_api_v2_voice_lines__did__config_put",
        "parameters": [
          {
            "in": "path",
            "name": "did",
            "required": true,
            "schema": {
              "title": "Did",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceLineConfigUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceLineConfigRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Validate an edited config and redeploy it in place on the same number.",
        "tags": [
          "voice"
        ]
      }
    },
    "/api/v2/voice-lines/{did}/config/rollback/{version}": {
      "post": {
        "description": "Re-apply a prior version's config through the same seam.\n\nRollback is deliberately NOT a special path: the stored dump is re-validated\nthrough the :class:`VoicedeskConfig` contract and applied via the exact\nvalidate → upsert → version seam the editor uses, appending a NEW\n``source='rollback'`` row — history only ever grows, and the restored\nconfig answers on the same number with no downtime.",
        "operationId": "rollback_voice_line_config_api_v2_voice_lines__did__config_rollback__version__post",
        "parameters": [
          {
            "in": "path",
            "name": "did",
            "required": true,
            "schema": {
              "title": "Did",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "version",
            "required": true,
            "schema": {
              "title": "Version",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceLineConfigRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Restore a prior config version to the live line (same number).",
        "tags": [
          "voice"
        ]
      }
    },
    "/api/v2/voice-lines/{did}/config/versions": {
      "get": {
        "description": "List every config version applied to the line, newest first.\n\nAppend-only history: one row per apply (intake confirm, editor apply,\nrollback re-apply). RLS-scoped — another tenant's DID is a 404.",
        "operationId": "list_voice_line_config_versions_api_v2_voice_lines__did__config_versions_get",
        "parameters": [
          {
            "in": "path",
            "name": "did",
            "required": true,
            "schema": {
              "title": "Did",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceLineConfigVersionList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "The line's config history — every applied version, newest first.",
        "tags": [
          "voice"
        ]
      }
    },
    "/api/v2/voice-lines/{did}/suggestions": {
      "get": {
        "description": "'Improve your receptionist' suggestions for the line.\n\nDeterministic server-side aggregation over the line's last\n~50 non-test calls — recurring out-of-scope asks, withheld price\nconfirmations, mid-call hangups, and bookings missing a callback number —\neach with its countable evidence. No LLM is involved; test-console\nconversations are excluded. RLS-scoped: another tenant's DID is a 404.",
        "operationId": "list_voice_line_suggestions_api_v2_voice_lines__did__suggestions_get",
        "parameters": [
          {
            "in": "path",
            "name": "did",
            "required": true,
            "schema": {
              "title": "Did",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceLineSuggestionList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Improvement suggestions for the line, from its own recent calls.",
        "tags": [
          "voice"
        ]
      }
    },
    "/api/v2/voice-lines/{did}/test-turn": {
      "post": {
        "description": "Run one governed test turn through the REAL call path.\n\nDrives :func:`velerian.core.voice.turn_orchestrator.run_turn` over the\nline's live ``voice_numbers.config`` with the SAME governed invoke +\ngovernance-evaluation adapters, history threading, and turn persistence the\ninbound webhook uses — the reply the console shows is the reply a real\ncaller would hear. The conversation is flagged test end-to-end\n(``voice_calls.is_test``): NO booking or lead row is ever written; the\nresponse instead reports what WOULD have persisted, via the very predicates\nthe webhook gates persistence on.\n\nIn a workspace cleared for patient records (a business associate agreement\nis recorded for it), every test turn is refused with a 403\n(``detail.error = patient_data_surface_closed``) before a test conversation\nis opened or the model is called, as the live line declines its calls.",
        "operationId": "run_voice_line_test_turn_api_v2_voice_lines__did__test_turn_post",
        "parameters": [
          {
            "in": "path",
            "name": "did",
            "required": true,
            "schema": {
              "title": "Did",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceTestTurnRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceTestTurnResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "403": {
            "description": "Refused. Either the caller is not allowed this action, or the workspace is cleared for patient records and this feature is closed to it, because its evidence record keeps content word for word (detail.error = patient_data_surface_closed)."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Run one governed test turn against the line's live config — no phone call.",
        "tags": [
          "voice"
        ]
      }
    },
    "/api/v2/voice/bookings": {
      "get": {
        "description": "List the calling tenant's persisted voice bookings, newest first.\n\nRead-only, any authenticated role (``viewer`` and up). Tenant-scoped: RLS +\nthe explicit ``tenant_id`` filter (defense-in-depth) mean a caller sees only\nits own bookings. This is the review list the Voice-lines surface renders.",
        "operationId": "list_voice_bookings_api_v2_voice_bookings_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceBookingList"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List the tenant's voice bookings the shop should review (newest first).",
        "tags": [
          "voice"
        ]
      }
    },
    "/api/v2/voice/leads": {
      "get": {
        "description": "List the calling tenant's captured voice leads, newest first.\n\nRead-only, any authenticated role (``viewer`` and up). Tenant-scoped: RLS +\nthe explicit ``tenant_id`` filter (defense-in-depth) mean a caller sees only\nits own leads. This is the review list the Voice-lines surface renders.",
        "operationId": "list_voice_leads_api_v2_voice_leads_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceLeadList"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List the tenant's captured voice leads to call back (newest first).",
        "tags": [
          "voice"
        ]
      }
    },
    "/api/v2/voice/leads/{lead_id}": {
      "patch": {
        "description": "Set a lead's review state (``reviewed`` when worked; ``new`` to reopen).\n\nA mutating write, so it is role-gated (``admin``/``member``; ``owner`` via\nthe role hierarchy — every state-changing route carries a role gate).\nTenant-scoped: RLS + the explicit ``tenant_id`` filter mean a caller\ncan only ever update its own leads; a cross-tenant id reads as absent (404,\nnever a leak).",
        "operationId": "update_voice_lead_status_api_v2_voice_leads__lead_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "lead_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Lead Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceLeadStatusUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceLeadRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update a lead's review state (mark reviewed / reopen).",
        "tags": [
          "voice"
        ]
      }
    },
    "/api/v2/webhooks": {
      "get": {
        "operationId": "list_webhooks_api_v2_webhooks_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Webhooks",
        "tags": [
          "webhooks"
        ]
      },
      "post": {
        "description": "Create a new webhook subscription. Returns the signing secret ONCE.\n\nPhase 1: secret stored in the row's signing_secret_id field (literal).\nPhase 5: secret stored in Secrets Manager; row carries the ARN.",
        "operationId": "create_webhook_api_v2_webhooks_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCreateResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Webhook",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/api/v2/webhooks/events": {
      "get": {
        "description": "Return the closed set of subscribable webhook event types.\n\nLets a client UI render the choices without hard-coding the taxonomy.\nDeclared BEFORE ``GET /{webhook_id}`` so the literal ``/events`` path\nisn't captured by the UUID path parameter.",
        "operationId": "list_event_types_api_v2_webhooks_events_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEventsList"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Event Types",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/api/v2/webhooks/voice": {
      "post": {
        "description": "Process one inbound caller turn and return the agent's reply.\n\nThe signed request body carries the dialed number, the call reference, the\ncaller's utterance, the turn number, and an end-of-call flag. It may also\ncarry an optional per-call consent signal: ``consent_state`` (the consent\nrule that applies to the call, such as ``two-party``) and\n``consent_recorded`` (whether the caller's consent was recorded). When the\nconsent signal reports that consent was not recorded, actions that make a\ncommitment to the caller — confirming a booking or a price — are held back\nand the call continues as a message-taking conversation; when the signal is\nomitted, the call behaves exactly as it does today.\n\nA line whose workspace is cleared for patient records (a business associate\nagreement is recorded for it) declines every turn: the caller hears the\nline's ordinary decline, no call record is opened, and the refusal is\nwritten to the workspace's audit log.",
        "operationId": "receive_voice_turn_api_v2_webhooks_voice_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceTurnResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Receive Voice Turn",
        "tags": [
          "voice"
        ]
      }
    },
    "/api/v2/webhooks/{webhook_id}": {
      "delete": {
        "description": "Soft-disable a subscription by setting ``status='paused'``.\n\nIdempotent: pausing an already-paused row returns 200 with\n``already_paused: true``. A missing id returns 404 so the caller can tell\n\"wrong id\" from \"now paused\". Hard delete is deliberately not exposed —\nthe ``webhook_deliveries`` log stays useful for support investigations\nafter a customer revokes a subscription. Re-enable via\n``PATCH {status: 'active'}``.",
        "operationId": "delete_webhook_api_v2_webhooks__webhook_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "webhook_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Webhook Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Delete Webhook Api V2 Webhooks  Webhook Id  Delete",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Webhook",
        "tags": [
          "webhooks"
        ]
      },
      "get": {
        "operationId": "get_webhook_api_v2_webhooks__webhook_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "webhook_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Webhook Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Webhook",
        "tags": [
          "webhooks"
        ]
      },
      "patch": {
        "operationId": "update_webhook_api_v2_webhooks__webhook_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "webhook_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Webhook Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Webhook",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/api/v2/webhooks/{webhook_id}/deliveries": {
      "get": {
        "description": "Return the per-attempt delivery log for one subscription.\n\nEach row is one delivery attempt (multiple rows per event on retry),\ncarrying the outcome (``pending`` / ``delivered`` / ``failed`` /\n``dead_letter``), the response status, and timestamps — the support +\nself-service debugging surface for \"did my endpoint receive event X\".\nRLS scopes the rows to the calling tenant; a 404 on the parent\nsubscription keeps the surface honest about ownership.",
        "operationId": "list_deliveries_api_v2_webhooks__webhook_id__deliveries_get",
        "parameters": [
          {
            "in": "path",
            "name": "webhook_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Webhook Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Deliveries",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/api/v2/webhooks/{webhook_id}/test": {
      "post": {
        "description": "Fire a synthetic ``webhook.test`` event at the registered endpoint.\n\nExercises the SAME signing + dispatch path production events use, so a\ncaller can confirm their receiver verifies the HMAC header correctly in\none shot. Returns the HTTP status the endpoint returned + the attempt\ncount. Does NOT persist a ``webhook_deliveries`` row (a test fire is not\na real domain event); it reuses :func:`dispatcher.dispatch` for a single\nattempt so the response reflects the receiver's immediate reply.\n\nRecords an audit-log entry for the test fire. An explicit ``flush`` is\nissued because this is an audit-only-tail handler (no other DB mutation\nprecedes the commit) — without it the audit row is silently dropped.\n\n:raises HTTPException 404: webhook id not visible to this tenant.",
        "operationId": "test_webhook_api_v2_webhooks__webhook_id__test_post",
        "parameters": [
          {
            "in": "path",
            "name": "webhook_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Webhook Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookTestResult"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Test Webhook",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/api/v2/whoami": {
      "get": {
        "operationId": "whoami_api_v2_whoami_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Whoami Api V2 Whoami Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Whoami"
      }
    },
    "/api/v2/work-actions": {
      "get": {
        "description": "Read contributions or cases with full scoped totals and live keyset traversal.\n\nPending gates, open requests and paused asks retain their own source IDs.\nAll mode includes shared requests and system waits; mine is offered/accepted\nresponsibility OR affirmative review eligibility, never creator/watcher.\nWithdrawal is reported separately and does not count as a review.\nsource_id narrows contributions before totals and paging; use kind and\ncase_id as well to recheck an exact request or gate in its original context.\n\nCase groups, opened_via, inclusive created_from/created_to and overdue use\nthe existing case worklist's recorded-state predicates. Case search accepts\na literal title fragment or normalized case reference (C-123 or 123).\nCase-only filters exclude standalone approvals. summary.groups counts the\ncomplete filtered case cohort; a prepared artifact alone is not ready_to_close.\n\nTotals and rows use one SQL statement/snapshot. A cursor retains the last\nsort tuple even if that row is completed or removed; each page re-evaluates\ncurrent access, expiry and state. Deadline values and ordering use priority_as_of,\nfixed when traversal starts so a ticking paused clock cannot repeat a row.\nRefresh starts a new evaluation. This is a live view, not snapshot isolation\nacross requests: new/reprioritized work can require refreshing the view.\nEach row's review_cursor continues after that row, including the final row\nof a page. Retain that cursor when a decision removes the selected row;\nrevalidate the next candidate before presenting its controls. An exact-source\nlookup has different filters and must not replace the traversal cursor.\nNo cursor grants permission and mutations must still recheck authorization.\nA failed read is an error, never a zero summary. Unknown values remain null.",
        "operationId": "list_work_actions_api_v2_work_actions_get",
        "parameters": [
          {
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "default": "actions",
              "enum": [
                "actions",
                "cases"
              ],
              "title": "Mode",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "view",
            "required": false,
            "schema": {
              "default": "all",
              "enum": [
                "all",
                "mine",
                "unassigned"
              ],
              "title": "View",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "default": "all",
              "enum": [
                "all",
                "approval",
                "request",
                "pause"
              ],
              "title": "Kind",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "default": "deadline",
              "enum": [
                "deadline",
                "waiting",
                "created_asc",
                "created_desc"
              ],
              "title": "Sort",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pack_slug",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 100,
                  "minLength": 1,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pack Slug"
            }
          },
          {
            "in": "query",
            "name": "case_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Case Id"
            }
          },
          {
            "description": "Narrow to this contribution's source ID, with kind when known; case_id identifies a case.",
            "in": "query",
            "name": "source_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Narrow to this contribution's source ID, with kind when known; case_id identifies a case.",
              "title": "Source Id"
            }
          },
          {
            "in": "query",
            "name": "case_status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "open",
                    "needs_human",
                    "waiting_external",
                    "resolved",
                    "abandoned"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Case Status"
            }
          },
          {
            "in": "query",
            "name": "opened_via",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "intake",
                    "run",
                    "api",
                    "schedule",
                    "email",
                    "webhook",
                    "manual"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Opened Via"
            }
          },
          {
            "in": "query",
            "name": "created_from",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Created From"
            }
          },
          {
            "in": "query",
            "name": "created_to",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Created To"
            }
          },
          {
            "in": "query",
            "name": "overdue",
            "required": false,
            "schema": {
              "default": false,
              "title": "Overdue",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "group",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "needs_you",
                    "ready_to_close",
                    "stalled",
                    "waiting",
                    "in_progress",
                    "done"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Group"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 200,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4096,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkActionList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Work Actions",
        "tags": [
          "work-actions"
        ]
      }
    },
    "/api/v2/work-items": {
      "get": {
        "description": "The tenant worklist. RLS scopes results to the calling tenant.\n\nServer-side filtered from day one: filter by ``status`` / ``kind`` /\n``case_id``, paginate with ``limit`` / ``offset``.\nDefault ordering is **pending-first** (the actionable queue), then newest\n``created_at`` first — the approvals-inbox convention.",
        "operationId": "list_work_items_api_v2_work_items_get",
        "parameters": [
          {
            "description": "Filter by status; omit for the full worklist.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "pending",
                    "offered",
                    "accepted",
                    "declined",
                    "completed",
                    "cancelled"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by status; omit for the full worklist.",
              "title": "Status"
            }
          },
          {
            "description": "Filter by kind (approval | escalation).",
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "approval",
                    "escalation"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by kind (approval | escalation).",
              "title": "Kind"
            }
          },
          {
            "description": "Filter to one case's items.",
            "in": "query",
            "name": "case_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to one case's items.",
              "title": "Case Id"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemList"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Work Items",
        "tags": [
          "work-items"
        ]
      }
    },
    "/api/v2/work-items/complete-set": {
      "post": {
        "description": "Approve up to 50 journey steps of one crew and step in one act.\n\nOnly a step that opts in may be approved in a set: it declares its\napprover and the computed facts its card shows. Each item names the card\ndigest the person was shown (``card.digest`` on ``GET /api/v2/work-actions``).\nEach item then completes on its own, in its own savepoint. Its case is\nlocked first, in the runner's order, and its card is read again under that\nlock: an item whose card changed after it was shown is refused and stays\npending while the rest complete. Then it runs everything\n``POST /{work_item_id}/complete`` checks and writes, the step's declared\napprover rule included. A case left out of the set is not named and stays\npending.\n\nEach completed item writes its own ``work_item.completed`` audit row with\n``approval_set_id``, ``set_size``, ``shown_digest`` and\n``approval_basis: set``. Every set that reaches its items writes one row\nunder its ``approval_set_id``: ``work_item.set_completed`` when it\ncompleted at least one item, listing each refusal with its reason, or\n``work_item.set_refused`` when it completed none, with each item's refusal\ncode and the count of each code (no note, claim or case text). So sending\nthe same set again completes nothing twice (a closed item is refused as\nnot actionable) and records the attempt as refused.\n\nA lock an item needs that another transaction holds refuses that item as\n``operation_busy``: at the opening lock on the set's work items (taken\nwithout waiting), in its checks, or in its close. Only its own savepoint\nrolls back, with any work its close queued for after the commit.\n\nHow long the set holds its locks is bounded. An item starts, and its close\nstarts, only before ``SET_TIME_BUDGET_SECONDS`` have passed; an item not\nstarted by then is refused as ``approval_set_out_of_time``. Each lock wait\ninside an item lasts at most the smaller of ``SET_LOCK_WAIT_MS`` and the\nbudget left when the item started, set again before every item, so a value\nan item's own code sets does not carry to the next. The worst case is the\nbudget plus the item in progress: its statements, and each of its lock\nwaits up to that cap. A statement itself is not cut short. The set holds\nat most 50 items. For a crew with a packet release contract each item\ntakes the tenant-wide ledger lock, so the set holds that lock from its\nfirst item until it commits, within the same bound.\n\n- **403** ``person_required`` for an API key or a machine token.\n- **404** ``work_item_not_found`` if any named item does not exist (RLS\n  scopes to the calling tenant); nothing completes.\n- **409** ``approval_set_not_declared`` if the step does not opt in to set\n  approval; ``approval_set_mixed`` if an item is no journey's step, the\n  items are not all one crew's same step, or they differ in a fact the\n  step groups its sets by. Nothing completes.\n- **422** for no items, more than 50, an item named twice, or a malformed\n  digest.\n- **500** / **503** ``approval_set_aborted``, naming the item, if an item\n  fails in a way that is not a refusal; nothing completes.",
        "operationId": "complete_work_item_set_api_v2_work_items_complete_set_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteSetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetCompleted"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Complete Work Item Set",
        "tags": [
          "work-items"
        ]
      }
    },
    "/api/v2/work-items/escalations": {
      "post": {
        "description": "Create a TYPED escalation work item — structured human input for a run.\n\nThe typed contract is binding: ``what_was_tried``, ``why_escalated``\n('capability' | 'policy' | 'uncertainty'), ``what_is_needed``, the case,\nand at least one run ref (``pack_run_id`` / ``invocation_id``) are all\nMANDATORY — a naked escalation is rejected with 422 before any write (and\nwould be rejected by the DB CHECK regardless).\n\nCase coupling: creating the pending item flips the case to ``needs_human``,\ncapturing the prior status on the item so completion can restore it.\n\n- **422** on a missing/blank contract field or missing run refs, or a\n  ``context`` that sets a key only the server writes (``resolved_by``).\n- **404** if the case doesn't exist (RLS scopes to the calling tenant).\n- **409** if the case is terminal (resolved/abandoned) — closed cases don't\n  take new human work; open a new case instead.",
        "operationId": "create_escalation_api_v2_work_items_escalations_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EscalationCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemCreated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Escalation",
        "tags": [
          "work-items"
        ]
      }
    },
    "/api/v2/work-items/{work_item_id}": {
      "get": {
        "description": "One work item's detail. 404 if it doesn't exist (RLS scopes to tenant).\n\n``card`` is the approval card the item's request row carries on\n``GET /api/v2/work-actions`` for the same viewer: for a signed-in person\nwho may act on it now and whose role clears the step's declared tier, its\nreview conclusion first, or that the conclusion could not be read. Absent\notherwise.",
        "operationId": "get_work_item_api_v2_work_items__work_item_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "work_item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Work Item Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Work Item",
        "tags": [
          "work-items"
        ]
      }
    },
    "/api/v2/work-items/{work_item_id}/accept-offer": {
      "post": {
        "description": "Accept a standing offer — the offeree takes the work item.\n\nThe item moves to ``accepted`` (still open; the case stays where it is)\nand can then be completed or declined by its acceptee like any actionable\nitem.\n\n- **403** if the caller is not the teammate the item is offered to.\n- **404** if the item doesn't exist (visibility is workspace-scoped).\n- **409** if the item is not currently offered, or the offer has already\n  lapsed (the sweep re-routes lapsed offers).",
        "operationId": "accept_offer_api_v2_work_items__work_item_id__accept_offer_post",
        "parameters": [
          {
            "in": "path",
            "name": "work_item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Work Item Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemDecided"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Accept Offer",
        "tags": [
          "work-items"
        ]
      }
    },
    "/api/v2/work-items/{work_item_id}/complete": {
      "post": {
        "description": "Complete a pending or accepted work item — the human answered the syscall.\n\nStamps ``closed_by_user_id`` / ``closed_at`` (+ the optional ``note`` as\n``closure_reason``) and RESTORES the case from ``needs_human`` to its\nrecorded prior state (or ``open``) — unless another open work item still\nholds the case. A run is never paused or resumed in place: follow-on work\nfires as a FRESH governed run — on the pack path via a revision re-run of\nthe escalating run (``POST /api/v2/pack-runs/{id}/revise``); this endpoint\nnever re-drives a model call.\n\n- **403** ``exposure_denied_by_policy`` if an API key closes a journey's\n  step while the workspace's policy forbids running that crew from outside\n  the app.\n- **403** ``person_required`` if an API key or a machine token completes\n  the item a reopened claim case holds: only a person completes it.\n- **404** if the item doesn't exist (RLS scopes to the calling tenant).\n- **409** if it is closed (terminal transitions are irreversible) or\n  currently offered to a teammate (accept or decline the offer first).\n- **409** ``card_not_shown`` for a step that has an approval card when\n  ``shown_digest`` is missing, and ``card_stale`` when the card no longer\n  matches it: the person approves only the card they were shown, read\n  again under the case's locks. The item stays as it was.",
        "operationId": "complete_work_item_api_v2_work_items__work_item_id__complete_post",
        "parameters": [
          {
            "in": "path",
            "name": "work_item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Work Item Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemDecided"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Complete Work Item",
        "tags": [
          "work-items"
        ]
      }
    },
    "/api/v2/work-items/{work_item_id}/decide": {
      "post": {
        "description": "Close an item the server raised to be closed by a decision, by recording it.\n\nThe item must be one the server raised with the decision it is closed by\n(a per-claim round's person item); every other item is completed or\ndeclined. In one transaction: the decision is recorded where its crew\nkeeps it (for a claim, its register: a later look, its closure, or the\nchoice to file), then the item closes as a completion and its case is\nrestored, then, for ``file``, the case's next round starts (reason\n``person_file``). Only a signed-in person decides: an API key or a machine\ntoken is refused with 403.\n\n- **404** if the item doesn't exist.\n- **409** if it is closed, offered, not closed by a decision, or the\n  decision is refused for the claim's state (closed, another case's, its\n  deadline passed), or the next round cannot start; nothing is written.\n- **422** for a choice missing its date or reason, a date out of bounds, a\n  note over 500 characters, or a body it cannot read. Every refusal is a\n  fixed code and sentence; none repeats what the person typed.\n- **429** (``Retry-After``) when ``file`` would start a round the\n  workspace has no room to queue, and **503** when admission cannot\n  decide; nothing is written.",
        "operationId": "decide_work_item_api_v2_work_items__work_item_id__decide_post",
        "parameters": [
          {
            "in": "path",
            "name": "work_item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Work Item Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/velerian__api__routers__work_items__DecideRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemDecided"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionRefusal"
                }
              }
            },
            "description": "Refused by a workspace capacity limit."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionRefusal"
                }
              }
            },
            "description": "Admission could not decide; retry."
          }
        },
        "summary": "Decide Work Item",
        "tags": [
          "work-items"
        ]
      }
    },
    "/api/v2/work-items/{work_item_id}/decision": {
      "get": {
        "description": "The choices open today on an item closed by a decision: the days a\nperson may look again on (from tomorrow, within the crew's furthest look,\nand no later than the claim's filing deadline while it is ahead), the\nclose reasons that apply (``deadline_passed`` only once the deadline has\npassed), whether the claim can be filed, and the day a later sweep brought\na newer payer's answer after the item was raised. While a submission's\noutcome is not recorded only closing is open, and ``unavailable`` says why\nthe rest are not. Read as the person would\ndecide: the same role, a signed-in person only, and the same refusals as\n``POST /decide``. It writes nothing.",
        "operationId": "read_work_item_decision_api_v2_work_items__work_item_id__decision_get",
        "parameters": [
          {
            "in": "path",
            "name": "work_item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Work Item Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DecisionChoices"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Read Work Item Decision",
        "tags": [
          "work-items"
        ]
      }
    },
    "/api/v2/work-items/{work_item_id}/decline": {
      "post": {
        "description": "Decline a pending or accepted work item — WITH a reason (mandatory).\n\nThe case STAYS in ``needs_human``: declining records why THIS human won't\naction it, but the need for a human hasn't gone away. To pass on a standing\noffer (so the item re-routes to the next candidate), use\n``POST /{work_item_id}/decline-offer`` instead — this verb closes the item.\n\n- **403** ``exposure_denied_by_policy`` if an API key closes a journey's\n  step while the workspace's policy forbids running that crew from outside\n  the app.\n- **403** ``person_required`` if an API key or a machine token declines a\n  journey step that declares its approver, or the item a reopened claim\n  case holds: only a person closes one.\n- **409** ``reopen_item_completes_only`` for the item a reopened claim case\n  holds, which is completed, never declined (close the case instead).\n- **404** if the item doesn't exist (RLS scopes to the calling tenant).\n- **409** if it is closed (terminal transitions are irreversible) or\n  currently offered to a teammate (decline the offer instead).\n- **422** if the reason is blank.",
        "operationId": "decline_work_item_api_v2_work_items__work_item_id__decline_post",
        "parameters": [
          {
            "in": "path",
            "name": "work_item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Work Item Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeclineRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemDecided"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Decline Work Item",
        "tags": [
          "work-items"
        ]
      }
    },
    "/api/v2/work-items/{work_item_id}/decline-offer": {
      "post": {
        "description": "Decline a standing offer WITH a reason — the item re-routes.\n\nThe decline is recorded on the offer trail (the reason is mandatory; the\nrouter learns from it and won't re-offer the item to the decliner), the\nitem returns to ``pending``, and the next candidate — when one exists —\nis offered immediately. Otherwise the routing sweep takes over: skill\nrelaxation on the queue's clock, then the no-candidate fallback. The item\nitself stays open; the case is untouched.\n\n- **403** if the caller is not the teammate the item is offered to.\n- **404** if the item doesn't exist (visibility is workspace-scoped).\n- **409** if the item is not currently offered.\n- **422** if the reason is blank.",
        "operationId": "decline_offer_api_v2_work_items__work_item_id__decline_offer_post",
        "parameters": [
          {
            "in": "path",
            "name": "work_item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Work Item Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeclineRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OfferDeclined"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Decline Offer",
        "tags": [
          "work-items"
        ]
      }
    },
    "/api/v2/work-items/{work_item_id}/route": {
      "post": {
        "description": "Route a pending work item through a queue, with required skill tags.\n\nBinds the item to the queue, starts its relaxation clock, and immediately\noffers it to the best-matching member when one exists (current role\nsatisfying the queue's requirement, skills covering the item's). If no\ncandidate matches yet, the routing sweep keeps trying: the skill\nrequirement relaxes stepwise on the queue's clock, and an item that stays\nunmatched even at full relaxation is flagged with the reason and its case\nparks as waiting on the outside world — never silently dropped.\n\nRe-routing a pending item (e.g. to a different queue) resets its clock.\n\n- **404** unknown item or queue.\n- **409** if the item is not ``pending`` (offered/accepted/closed items\n  don't re-route; declines and expiries re-route automatically).\n- **422** if the skills aren't within the queue's declared skills.",
        "operationId": "route_work_item_api_v2_work_items__work_item_id__route_post",
        "parameters": [
          {
            "in": "path",
            "name": "work_item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Work Item Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RouteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkItemRouted"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Route Work Item",
        "tags": [
          "work-items"
        ]
      }
    },
    "/api/v2/work-items/{work_item_id}/send-outcome": {
      "post": {
        "description": "Record whether a held submission arrived, as the receiver told the person.\n\nThe item must be a round's held item whose step began sending and\nrecorded no outcome (code ``send_outcome_unknown``). Nothing is sent\neither way, and the step does not run again.\n\n- **arrived: true** writes the send's outcome, marked ``person_reported``,\n  with the receiver's reference when given; records the filing it carried\n  where the crew keeps its filings, marked as reported by this person; and\n  closes the item. The claim's next round is the date the filing's rule\n  sets (``next_round_on``), even one already past, when the due-round job\n  takes the claim up at its next pass; no person chose it, so no decision\n  is recorded. The filing is recorded by the\n  round's recording step, run once through the runner's compute path and\n  dated as of when the send was attempted, so its deadline is tested\n  against the send, not the report. When the claim's own state means no\n  filing is recorded (it is paid, no longer carried, another crew's or\n  case's, out of follow-ups, or names no payer), the arrival is saved, no\n  filing is, and ``filing_not_recorded`` says why. When the claim is paid,\n  no longer carried or worked in another case, nothing is left to decide\n  and the arrival closes the item; otherwise the item stays open with its\n  choices (filing again refused). When the claim refuses the filing for\n  its deadline or for leaving nothing due, nothing is saved (409, the\n  reason's code). When the step cannot record it (it fails, the register\n  refuses it, or it records none for a reason the round's decision to\n  file rules out), nothing is saved (500, ``send_outcome_not_saved``).\n- **arrived: false** abandons the send (its key never sends again), with\n  the person's note as the reason. The item stays open with its choices;\n  filing again starts a new round, after its own sign-off. When the claim\n  is paid, no longer carried or another case's, nothing is left to decide:\n  the report closes the item too, and ``item_closed_because`` says why.\n\nWhen either answer closes the item with no filing, code is then asked to\nclose the case: it closes it when the claim was paid by a round of this\ncase with no person named and no round of the case is live, and otherwise\nleaves the case as it stood. A case it cannot lock is ``operation_busy``,\nwith nothing written.\n\nUntil one is recorded, ``/decide`` refuses looking again and filing\n(``send_outcome_required``), since each can lead to a second submission;\nclosing the claim stays open, and records the send as closed without an\noutcome, so its key never sends again.\n\nOnly a signed-in person with the member or admin role records it; an API\nkey or a machine token is refused with 403. One audit row,\n``connector_send.outcome_recorded``, in the same transaction; it never\ncarries the reference or the note.\n\n- **404** if the item doesn't exist.\n- **409** if it is not a held send's item, its outcome is already\n  recorded, it expired unanswered (``wait_expired``), it is closed or\n  offered, the case is held by a policy, or the case is busy\n  (``operation_busy``); nothing is written.\n- **422** when it did not arrive and no note was given, or for a body it\n  cannot read.\n- **409** also when it arrived and the claim refuses its filing for a\n  reason other than its own state ending it (the reason's code, such as\n  ``filing_deadline_not_ahead``); nothing is written.\n- **500** when it arrived and its filing could not be recorded\n  (``send_outcome_not_saved``); nothing is written.\n\nEvery refusal is a fixed code and sentence.",
        "operationId": "record_send_outcome_api_v2_work_items__work_item_id__send_outcome_post",
        "parameters": [
          {
            "in": "path",
            "name": "work_item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Work Item Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendOutcomeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendOutcomeRecorded"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Record Send Outcome",
        "tags": [
          "work-items"
        ]
      }
    },
    "/api/v2/work-queues": {
      "get": {
        "description": "List this workspace's routing queues (name order).",
        "operationId": "list_work_queues_api_v2_work_queues_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueList"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Work Queues",
        "tags": [
          "work-queues"
        ]
      },
      "post": {
        "description": "Create a routing queue — a declarative role/skill destination for work items.\n\nQueues route escalated work items to the right teammates: members must\nhold the queue's minimum workspace role, and offers match members whose\nskill tags cover the item's requirements (relaxing stepwise if the item\nwaits, so nothing starves).\n\n- **409** if a queue with the same name already exists.\n- **422** on blank skill tags.",
        "operationId": "create_work_queue_api_v2_work_queues_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueueCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Work Queue",
        "tags": [
          "work-queues"
        ]
      }
    },
    "/api/v2/work-queues/sweep": {
      "post": {
        "description": "Run the routing sweep for this workspace — deterministic and repeatable.\n\nOne pass: lapsed offers expire and their items re-queue; waiting items'\nskill requirements relax on their configured clocks; matchable items are\noffered to the next candidate; items with no eligible member even after\nfull relaxation are flagged (with the reason recorded on the item) and\ntheir case parks as waiting on the outside world — nothing is ever\nsilently dropped, and every later sweep re-checks them. Running the sweep\ntwice in a row makes no further changes.",
        "operationId": "sweep_work_queues_api_v2_work_queues_sweep_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SweepResult"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Sweep Work Queues",
        "tags": [
          "work-queues"
        ]
      }
    },
    "/api/v2/work-queues/{queue_id}": {
      "delete": {
        "description": "Delete an idle queue (its memberships go with it).\n\n- **404** if the queue doesn't exist.\n- **409** while any open work item is still routed to it — re-route or\n  finish those items first, so none are silently orphaned.",
        "operationId": "delete_work_queue_api_v2_work_queues__queue_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "queue_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Queue Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Work Queue",
        "tags": [
          "work-queues"
        ]
      },
      "get": {
        "description": "One queue's definition plus its member roster. **404** if unknown.",
        "operationId": "get_work_queue_api_v2_work_queues__queue_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "queue_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Queue Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueDetail"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Work Queue",
        "tags": [
          "work-queues"
        ]
      },
      "patch": {
        "description": "Update a queue definition; omitted fields keep their current value.\n\n- **404** if the queue doesn't exist.\n- **409** if renaming collides with another queue.\n- **422** on blank skill tags.",
        "operationId": "update_work_queue_api_v2_work_queues__queue_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "queue_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Queue Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueueUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Work Queue",
        "tags": [
          "work-queues"
        ]
      }
    },
    "/api/v2/work-queues/{queue_id}/members": {
      "post": {
        "description": "Add a workspace user to a queue with their skill tags.\n\nThe user must already exist in this workspace and their current role must\nsatisfy the queue's minimum role; their skills must be within the queue's\ndeclared vocabulary. Role checks are re-applied at every offer, so a later\nrole change takes effect immediately.\n\n- **404** unknown queue or user.\n- **409** already a member.\n- **422** role below the queue's requirement, or undeclared/blank skills.",
        "operationId": "add_queue_member_api_v2_work_queues__queue_id__members_post",
        "parameters": [
          {
            "in": "path",
            "name": "queue_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Queue Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberAdd"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberRead"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Add Queue Member",
        "tags": [
          "work-queues"
        ]
      }
    },
    "/api/v2/work-queues/{queue_id}/members/{user_id}": {
      "delete": {
        "description": "Remove a user from a queue.\n\nStanding offers already made to them are untouched — they run out their\nclock (or are declined) and the sweep re-routes.\n\n- **404** unknown queue or membership.",
        "operationId": "remove_queue_member_api_v2_work_queues__queue_id__members__user_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "queue_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Queue Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "User Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Remove Queue Member",
        "tags": [
          "work-queues"
        ]
      }
    },
    "/api/v2/workspaces": {
      "get": {
        "description": "List all authorized workspaces across the signed-in caller's organization.",
        "operationId": "list_workspaces_api_v2_workspaces_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceListResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Workspaces",
        "tags": [
          "workspaces"
        ]
      }
    },
    "/api/v2/workspaces/{workspace_id}/blueprint": {
      "get": {
        "description": "Return the resolved declarative UI & workflow manifest for ``workspace_id``.",
        "operationId": "get_workspace_blueprint_api_v2_workspaces__workspace_id__blueprint_get",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolvedBlueprintManifest"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Workspace Blueprint",
        "tags": [
          "blueprints"
        ]
      }
    },
    "/api/v2/workspaces/{workspace_id}/branding": {
      "patch": {
        "description": "Persist workspace branding overrides into ``tenants.branding_config`` JSONB.",
        "operationId": "update_workspace_branding_api_v2_workspaces__workspace_id__branding_patch",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceBrandingUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceBrandingResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Workspace Branding",
        "tags": [
          "workspaces"
        ]
      }
    },
    "/api/v2/workspaces/{workspace_id}/crews": {
      "get": {
        "description": "List executable Consultancy Blueprint crews and active pivot-core slugs.",
        "operationId": "list_workspace_crews_api_v2_workspaces__workspace_id__crews_get",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceCrewListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Workspace Crews",
        "tags": [
          "workspaces",
          "blueprints"
        ]
      }
    },
    "/api/v2/workspaces/{workspace_id}/crews/{crew_slug}/ingest": {
      "post": {
        "description": "Parse an uploaded document and execute or stage it for a workspace crew.",
        "operationId": "ingest_workspace_crew_document_api_v2_workspaces__workspace_id__crews__crew_slug__ingest_post",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "crew_slug",
            "required": true,
            "schema": {
              "title": "Crew Slug",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceCrewIngestRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceCrewIngestResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Ingest Workspace Crew Document",
        "tags": [
          "workspaces",
          "blueprints"
        ]
      }
    },
    "/api/v2/workspaces/{workspace_id}/crews/{crew_slug}/run": {
      "post": {
        "description": "Execute a live Consultancy Blueprint crew scoped to ``workspace_id``.",
        "operationId": "run_workspace_crew_api_v2_workspaces__workspace_id__crews__crew_slug__run_post",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "crew_slug",
            "required": true,
            "schema": {
              "title": "Crew Slug",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceCrewRunRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceCrewRunResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Run Workspace Crew",
        "tags": [
          "workspaces",
          "blueprints"
        ]
      }
    },
    "/api/v2/workspaces/{workspace_id}/invites": {
      "post": {
        "description": "Create an audited client seat invite scoped to ``workspace_id``.",
        "operationId": "create_workspace_client_invite_api_v2_workspaces__workspace_id__invites_post",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceClientInviteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceClientInviteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Workspace Client Invite",
        "tags": [
          "workspaces"
        ]
      }
    },
    "/api/v2/workspaces/{workspace_id}/select": {
      "post": {
        "description": "Verify membership for ``workspace_id`` and bind it as the active workspace.",
        "operationId": "select_workspace_api_v2_workspaces__workspace_id__select_post",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceSelectResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Select Workspace",
        "tags": [
          "workspaces"
        ]
      }
    },
    "/health": {
      "get": {
        "description": "Liveness probe. Returns 200 if the app is running.",
        "operationId": "health_health_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Health Health Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Health"
      }
    },
    "/ready": {
      "get": {
        "description": "Readiness probe. 200 only when hard dependencies can actually serve.\n\nRuns a real ``SELECT 1`` against the platform DB (with a short\ntimeout). Returns 200 ``{\"status\": \"ready\", \"checks\": {\"db\": \"ok\"}}``\nwhen the DB is reachable, and 503 ``{\"status\": \"not_ready\", \"checks\":\n{\"db\": \"unreachable\"}}`` when it is not — so ALB/ECS avoid routing\ntraffic to an instance that cannot serve requests.\n\nNon-throwing by design: any connect/query/timeout error maps to 503,\nnever a 500. This is an infra probe — it sets no tenant GUC and\ntouches no RLS table (a plain ``SELECT 1``). Liveness (``/health``)\nstays trivially-200 and does NOT depend on the DB, so a transient DB\nblip degrades readiness without killing the container.",
        "operationId": "ready_ready_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Ready Ready Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Ready"
      }
    },
    "/scim/v2/Users": {
      "get": {
        "description": "List SCIM users (supports ``filter=userName eq \"...\"`` + pagination).",
        "operationId": "list_users_scim_v2_Users_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Users",
        "tags": [
          "scim"
        ]
      },
      "post": {
        "description": "Provision a user (joiner). 201 on create, 409 on conflict / over seat cap.",
        "operationId": "create_user_scim_v2_Users_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Create User",
        "tags": [
          "scim"
        ]
      }
    },
    "/scim/v2/Users/{scim_id}": {
      "delete": {
        "description": "Hard-delete a SCIM user (revokes access, then drops the record). 204.",
        "operationId": "delete_user_scim_v2_Users__scim_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "scim_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Scim Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete User",
        "tags": [
          "scim"
        ]
      },
      "get": {
        "operationId": "get_user_scim_v2_Users__scim_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "scim_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Scim Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get User",
        "tags": [
          "scim"
        ]
      },
      "patch": {
        "description": "SCIM PatchOp. Supports replace/add of active, names, displayName, roles.\n\nThe ``active=false`` replace is the deprovision path IdPs use for leavers.",
        "operationId": "patch_user_scim_v2_Users__scim_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "scim_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Scim Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Patch User",
        "tags": [
          "scim"
        ]
      },
      "put": {
        "description": "Full replace (PUT). Applies userName-less fields + the active flag.",
        "operationId": "replace_user_scim_v2_Users__scim_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "scim_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Scim Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Replace User",
        "tags": [
          "scim"
        ]
      }
    }
  }
}
