{
  "components": {
    "headers": {
      "RetryAfter": {
        "description": "Retry delay in seconds when the caller is rate limited.",
        "schema": {
          "oneOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "string"
            }
          ]
        }
      },
      "XRateLimitRemaining": {
        "description": "Remaining authenticated requests in the current UTC day. Omitted for exempt roles and free-tier requests.",
        "schema": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "XRateLimitReset": {
        "description": "UTC reset timestamp for the authenticated daily quota.",
        "schema": {
          "format": "date-time",
          "type": "string"
        }
      }
    },
    "responses": {
      "ClerkRejection": {
        "content": {
          "application/json": {
            "example": {
              "block_issues": [
                "No explicit decision or alternatives are stated.",
                "Constraints and success criteria are missing."
              ],
              "reason": "invalid_problem_framing",
              "suggestion": "Rewrite the request as a decision with options, constraints, and what would make the choice successful.",
              "verdict": "BLOCKED"
            },
            "schema": {
              "$ref": "#/components/schemas/ClerkResult"
            }
          }
        },
        "description": "The Clerk rejected or blocked the request before deliberation."
      },
      "ForbiddenError": {
        "content": {
          "application/json": {
            "example": {
              "code": "forbidden",
              "error": "invalid API key"
            },
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        },
        "description": "Credential rejected or blocked."
      },
      "InternalError": {
        "content": {
          "application/json": {
            "example": {
              "code": "internal_error",
              "error": "internal error"
            },
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        },
        "description": "Internal server error."
      },
      "NotFoundError": {
        "content": {
          "application/json": {
            "example": {
              "code": "not_found",
              "error": "not found"
            },
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        },
        "description": "Requested resource does not exist."
      },
      "RateLimitedError": {
        "content": {
          "application/json": {
            "example": {
              "code": "rate_limited",
              "error": "daily rate limit exceeded"
            },
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        },
        "description": "Caller exceeded the current rate or daily spend limit, OR the Council queue was saturated and the submission was not accepted (error code \"queue_full\", WO-1077 — not charged; back off for Retry-After seconds, do not auto-resubmit).",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/XRateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/XRateLimitReset"
          }
        }
      },
      "ServiceUnavailable": {
        "content": {
          "application/json": {
            "example": {
              "code": "no_database",
              "error": "database not configured"
            },
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        },
        "description": "Database or dependent service is unavailable."
      },
      "UnauthorizedError": {
        "content": {
          "application/json": {
            "example": {
              "code": "unauthorized",
              "error": "missing X-VC-Key header"
            },
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        },
        "description": "Missing or malformed X-VC-Key header."
      }
    },
    "schemas": {
      "ArtifactEnvelope": {
        "properties": {
          "artifact_id": {
            "type": "string"
          },
          "body": {
            "$ref": "#/components/schemas/VerdictArtifact"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "disclaimer": {
            "type": "string"
          },
          "integrity_hash": {
            "type": "string"
          },
          "schema_version": {
            "type": "string"
          }
        },
        "required": [
          "schema_version",
          "artifact_id",
          "created_at",
          "integrity_hash",
          "disclaimer",
          "body"
        ],
        "type": "object"
      },
      "ArtifactGateMetrics": {
        "properties": {
          "artifact_missing_rate_per_week": {
            "minimum": 0,
            "type": "integer"
          },
          "by_path": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ArtifactGatePathRow"
            },
            "type": "object"
          },
          "estimated_saved_usd_week": {
            "minimum": 0,
            "type": "number"
          }
        },
        "required": [
          "artifact_missing_rate_per_week",
          "estimated_saved_usd_week"
        ],
        "type": "object"
      },
      "ArtifactGatePathRow": {
        "properties": {
          "count": {
            "minimum": 0,
            "type": "integer"
          },
          "estimated_saved_usd_week": {
            "minimum": 0,
            "type": "number"
          }
        },
        "required": [
          "count",
          "estimated_saved_usd_week"
        ],
        "type": "object"
      },
      "CaseFiling": {
        "properties": {
          "alternatives": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "constraints": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "context": {
            "type": "string"
          },
          "decision": {
            "type": "string"
          },
          "evidence": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "governance": {
            "$ref": "#/components/schemas/GovernanceOverlay"
          },
          "governance_overlay": {
            "type": "boolean"
          },
          "known_risks": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "review_artifacts": {
            "$ref": "#/components/schemas/ReviewArtifactManifest"
          },
          "success_criteria": {
            "type": "string"
          }
        },
        "required": [
          "decision"
        ],
        "type": "object"
      },
      "CaseResponse": {
        "properties": {
          "case": {
            "$ref": "#/components/schemas/VerdictArtifact"
          },
          "lineage": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/VerdictLineage"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "case",
          "lineage"
        ],
        "type": "object"
      },
      "ClerkAdversarialPattern": {
        "properties": {
          "class": {
            "type": "string"
          },
          "evidence": {
            "type": "string"
          },
          "handling": {
            "type": "string"
          },
          "pattern": {
            "type": "string"
          }
        },
        "required": [
          "class"
        ],
        "type": "object"
      },
      "ClerkRequiredArtifact": {
        "properties": {
          "description": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "why_required": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "description",
          "why_required"
        ],
        "type": "object"
      },
      "ClerkResult": {
        "properties": {
          "accepted_strength_ceiling": {
            "additionalProperties": true,
            "description": "Pre-Council maximum verdict strength supported by intake.",
            "type": "object"
          },
          "adversarial_pattern_match": {
            "$ref": "#/components/schemas/ClerkAdversarialPattern"
          },
          "adversarial_payload_risks": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "allowed_outputs": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "block_issues": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "blocked_decisions": {
            "items": {
              "additionalProperties": true,
              "description": "Decision type blocked by missing facts.",
              "type": "object"
            },
            "type": "array"
          },
          "decision_type": {
            "type": "string"
          },
          "decision_type_needs_review": {
            "type": "boolean"
          },
          "decision_type_review_reason": {
            "type": "string"
          },
          "decision_type_source": {
            "enum": [
              "llm_enrichment",
              "keyword_fallback"
            ],
            "type": "string"
          },
          "decision_types": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "estimated_cost_saved_usd": {
            "minimum": 0,
            "type": "number"
          },
          "intent_state": {
            "additionalProperties": true,
            "description": "Declared and suspected target state detected by Clerk.",
            "type": "object"
          },
          "missing_facts": {
            "items": {
              "additionalProperties": true,
              "description": "Missing fact required for stronger outputs.",
              "type": "object"
            },
            "type": "array"
          },
          "must_not_do": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "question_type": {
            "type": "string"
          },
          "question_type_needs_review": {
            "type": "boolean"
          },
          "question_type_review_reason": {
            "type": "string"
          },
          "question_type_source": {
            "enum": [
              "llm_enrichment",
              "keyword_fallback",
              "answer_contract"
            ],
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "required_artifacts": {
            "items": {
              "$ref": "#/components/schemas/ClerkRequiredArtifact"
            },
            "type": "array"
          },
          "resubmit_url": {
            "format": "uri-reference",
            "type": "string"
          },
          "status": {
            "enum": [
              "rejected",
              "accepted_analysis",
              "accepted_provisional",
              "accepted_recommendation",
              "artifact_missing"
            ],
            "type": "string"
          },
          "submitted_artifacts": {
            "items": {
              "$ref": "#/components/schemas/ClerkSubmittedArtifact"
            },
            "type": "array"
          },
          "suggestion": {
            "type": "string"
          },
          "suspected_framing_risks": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "tier": {
            "enum": [
              "simple",
              "standard",
              "complex",
              "extended"
            ],
            "type": "string"
          },
          "verdict": {
            "enum": [
              "ACCEPTED",
              "REJECTED",
              "BLOCKED",
              "wrong_question",
              "artifact_missing"
            ],
            "type": "string"
          }
        },
        "required": [
          "verdict"
        ],
        "type": "object"
      },
      "ClerkSubmittedArtifact": {
        "properties": {
          "name": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "ConsultRequest": {
        "properties": {
          "callback_url": {
            "description": "Optional per-case webhook target for authenticated callers. Private and loopback hosts are rejected unless allowlisted. Deliveries are POSTed with X-VectorCourt-Callback-Event, X-VectorCourt-Callback-Timestamp, X-VectorCourt-Callback-Signature, and X-VectorCourt-Callback-Signature-Scheme; the signature scheme is v1=hmac-sha256(timestamp + '.' + body).",
            "format": "uri",
            "type": "string"
          },
          "cf_turnstile_response": {
            "type": "string"
          },
          "extended_deliberation": {
            "type": "boolean"
          },
          "filing": {
            "$ref": "#/components/schemas/CaseFiling"
          },
          "governance": {
            "$ref": "#/components/schemas/GovernanceOverlay"
          },
          "governance_overlay": {
            "type": "boolean"
          },
          "initial_leaning": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "question": {
            "type": "string"
          },
          "reframe_chain_id": {
            "description": "Optional caller-declared opaque lineage for telemetry. It is unverified and never authorizes automatic chain termination.",
            "maxLength": 64,
            "minLength": 8,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$",
            "type": "string"
          },
          "replay": {
            "$ref": "#/components/schemas/ReplayContext"
          },
          "rounds": {
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "question"
        ],
        "type": "object"
      },
      "Decision": {
        "properties": {
          "chosen_path": {
            "type": "string"
          },
          "confidence": {
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "next_action": {
            "type": "string"
          },
          "reversal_conditions": {
            "items": {
              "$ref": "#/components/schemas/ReversalCondition"
            },
            "type": "array"
          },
          "selection_rationale": {
            "type": "string"
          },
          "unresolved_uncertainty": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "chosen_path",
          "confidence",
          "next_action"
        ],
        "type": "object"
      },
      "DomainIntentCandidate": {
        "properties": {
          "confidence": {
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "consequence_class": {
            "type": "string"
          },
          "domain_id": {
            "type": "string"
          },
          "evidence": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "domain_id",
          "label",
          "consequence_class",
          "confidence"
        ],
        "type": "object"
      },
      "DomainIntentClassification": {
        "properties": {
          "ambiguous": {
            "type": "boolean"
          },
          "analysis_locked": {
            "type": "boolean"
          },
          "candidates": {
            "items": {
              "$ref": "#/components/schemas/DomainIntentCandidate"
            },
            "type": "array"
          },
          "confidence": {
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "consequence_class": {
            "type": "string"
          },
          "evidence": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "needs_review": {
            "type": "boolean"
          },
          "primary_domain_id": {
            "type": "string"
          },
          "primary_label": {
            "type": "string"
          },
          "rationale": {
            "type": "string"
          },
          "review_reason": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "primary_domain_id",
          "primary_label",
          "consequence_class",
          "candidates"
        ],
        "type": "object"
      },
      "ErrorResponse": {
        "properties": {
          "code": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "resets_at": {
            "format": "date-time",
            "type": "string"
          },
          "upgrade_url": {
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "ExhibitRequest": {
        "additionalProperties": false,
        "properties": {
          "case": {
            "additionalProperties": true,
            "description": "Evidence Clerk case reference.",
            "type": "object"
          },
          "filing": {
            "$ref": "#/components/schemas/CaseFiling"
          },
          "max_exhibits": {
            "maximum": 5,
            "minimum": 1,
            "type": "integer"
          },
          "output_mode": {
            "const": "exhibits_only"
          },
          "price_usd": {
            "maximum": 0.15,
            "minimum": 0.05,
            "type": "number"
          },
          "question": {
            "type": "string"
          },
          "retrieval_sources": {
            "items": {
              "enum": [
                "workledger",
                "git",
                "file",
                "review"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "risk_classes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "question",
          "output_mode"
        ],
        "type": "object"
      },
      "ExhibitResult": {
        "$id": "https://vectorcourt.com/exhibits-schema.json",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "additionalProperties": false,
        "properties": {
          "case": {
            "additionalProperties": false,
            "properties": {
              "changed_files": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "parent_wo": {
                "type": "string"
              },
              "subject": {
                "type": "string"
              },
              "trigger": {
                "type": "string"
              },
              "wo": {
                "type": "string"
              }
            },
            "required": [
              "wo",
              "trigger",
              "subject",
              "changed_files"
            ],
            "type": "object"
          },
          "court": {
            "const": "vectorcourt"
          },
          "exhibits": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "citations": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "content_hash": {
                        "pattern": "^sha256:[0-9a-f]{64}$",
                        "type": "string"
                      },
                      "provenance_class": {
                        "enum": [
                          "human_verified",
                          "agent_generated",
                          "auto_merged",
                          "unknown"
                        ],
                        "type": "string"
                      },
                      "quote_or_summary": {
                        "type": "string"
                      },
                      "quoted": {
                        "type": "boolean"
                      },
                      "relevance": {
                        "type": "string"
                      },
                      "retrieved_at": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "source": {
                        "type": "string"
                      },
                      "source_mutability": {
                        "enum": [
                          "immutable",
                          "mutable"
                        ],
                        "type": "string"
                      },
                      "source_type": {
                        "enum": [
                          "workledger",
                          "git",
                          "file",
                          "review"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "source",
                      "source_type",
                      "provenance_class",
                      "retrieved_at",
                      "content_hash",
                      "source_mutability",
                      "quote_or_summary",
                      "quoted",
                      "relevance"
                    ],
                    "type": "object"
                  },
                  "minItems": 1,
                  "type": "array"
                },
                "id": {
                  "type": "string"
                },
                "procedural_options": {
                  "items": {
                    "enum": [
                      "ignore",
                      "ask_reviewer_to_recheck",
                      "require_child_wo",
                      "hold_parent_close",
                      "escalate_to_human"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "risk_class": {
                  "enum": [
                    "precedent_conflict",
                    "coupled_file_omission",
                    "boundary_violation",
                    "wo44_authority_leak",
                    "stack_graph_hazard",
                    "review_rubber_stamp",
                    "acceptance_drift",
                    "evidence_gap"
                  ],
                  "type": "string"
                },
                "severity_of_precedent": {
                  "enum": [
                    "blocker_in_history",
                    "high",
                    "medium",
                    "low"
                  ],
                  "type": "string"
                },
                "suggested_child_wo_candidate": {
                  "additionalProperties": false,
                  "properties": {
                    "acceptance": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "rationale_cites": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "scope": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "title",
                    "scope",
                    "acceptance",
                    "rationale_cites"
                  ],
                  "type": "object"
                },
                "title": {
                  "type": "string"
                },
                "what_current_solution_does_not_address": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "risk_class",
                "title",
                "severity_of_precedent",
                "citations",
                "what_current_solution_does_not_address",
                "procedural_options"
              ],
              "type": "object"
            },
            "maxItems": 5,
            "type": "array"
          },
          "retrieval_calls_needed": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "schema_version": {
            "const": "exhibits.v1"
          },
          "status": {
            "enum": [
              "exhibits_found",
              "no_precedent",
              "insufficient_evidence",
              "not_applicable"
            ],
            "type": "string"
          },
          "summary": {
            "maxLength": 200,
            "type": "string"
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "required": [
          "schema_version",
          "court",
          "case",
          "status",
          "summary",
          "exhibits",
          "truncated"
        ],
        "title": "VectorCourt Evidence Clerk ExhibitResult",
        "type": "object"
      },
      "GenesisApproveRequest": {
        "properties": {
          "brief": {
            "description": "Original Genesis brief. The server re-runs deterministic intake before any create.",
            "type": "string"
          },
          "project": {
            "description": "Lowercase shared workledger project slug to receive the approved Genesis work orders.",
            "type": "string"
          },
          "selected_draft_ids": {
            "description": "Subset of reviewable Genesis draft IDs to create.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "project",
          "brief",
          "selected_draft_ids"
        ],
        "type": "object"
      },
      "GenesisApproveResponse": {
        "properties": {
          "batch_id": {
            "type": "string"
          },
          "created_count": {
            "minimum": 0,
            "type": "integer"
          },
          "project": {
            "type": "string"
          },
          "reused_count": {
            "minimum": 0,
            "type": "integer"
          },
          "selected_draft_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "work_orders": {
            "items": {
              "$ref": "#/components/schemas/GenesisApprovedWorkOrder"
            },
            "type": "array"
          }
        },
        "required": [
          "project",
          "batch_id",
          "selected_draft_ids",
          "created_count",
          "reused_count",
          "work_orders"
        ],
        "type": "object"
      },
      "GenesisApprovedWorkOrder": {
        "properties": {
          "created": {
            "type": "boolean"
          },
          "id": {
            "minimum": 1,
            "type": "integer"
          },
          "reused": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "status"
        ],
        "type": "object"
      },
      "GenesisBriefDoctorClaimProfile": {
        "properties": {
          "claimed_signals": {
            "minimum": 0,
            "type": "integer"
          },
          "inference_pressure": {
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string"
          },
          "inferred_signals": {
            "minimum": 0,
            "type": "integer"
          },
          "intent_reality_balance": {
            "enum": [
              "balanced",
              "intent_only",
              "reality_only",
              "unclear"
            ],
            "type": "string"
          },
          "observed_signals": {
            "minimum": 0,
            "type": "integer"
          },
          "unknown_signals": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "observed_signals",
          "claimed_signals",
          "inferred_signals",
          "unknown_signals",
          "intent_reality_balance",
          "inference_pressure"
        ],
        "type": "object"
      },
      "GenesisBriefDoctorLength": {
        "properties": {
          "characters": {
            "minimum": 0,
            "type": "integer"
          },
          "hard_limit": {
            "example": 24000,
            "minimum": 1,
            "type": "integer"
          },
          "soft_limit": {
            "example": 10000,
            "minimum": 1,
            "type": "integer"
          },
          "soft_limit_exceeded": {
            "type": "boolean"
          }
        },
        "required": [
          "characters",
          "soft_limit",
          "hard_limit"
        ],
        "type": "object"
      },
      "GenesisBriefDoctorRequest": {
        "properties": {
          "brief": {
            "description": "Single text brief for Genesis artifact-to-backlog reconstruction.",
            "type": "string"
          },
          "cf_turnstile_response": {
            "description": "Cloudflare Turnstile token for anonymous public Genesis runs.",
            "type": "string"
          },
          "project": {
            "description": "Optional lowercase project slug. When present, Genesis compares this dry-run against the latest approved backlog for that project and requires authenticated context.",
            "type": "string"
          }
        },
        "required": [
          "brief"
        ],
        "type": "object"
      },
      "GenesisBriefDoctorResult": {
        "properties": {
          "budget": {
            "$ref": "#/components/schemas/GenesisBudgetEstimate"
          },
          "claim_profile": {
            "$ref": "#/components/schemas/GenesisBriefDoctorClaimProfile"
          },
          "clarification_questions": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "contradictions": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "facts": {
            "items": {
              "$ref": "#/components/schemas/GenesisTextFact"
            },
            "type": "array"
          },
          "gaps": {
            "items": {
              "$ref": "#/components/schemas/GenesisGap"
            },
            "type": "array"
          },
          "gate": {
            "$ref": "#/components/schemas/GenesisIntakeGate"
          },
          "insufficiency": {
            "$ref": "#/components/schemas/GenesisInsufficiency"
          },
          "length": {
            "$ref": "#/components/schemas/GenesisBriefDoctorLength"
          },
          "missing_sections": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "project_state": {
            "$ref": "#/components/schemas/GenesisProjectState"
          },
          "promoted_facts": {
            "items": {
              "$ref": "#/components/schemas/GenesisPromotedFact"
            },
            "type": "array"
          },
          "public_control": {
            "$ref": "#/components/schemas/GenesisPublicControl"
          },
          "review": {
            "$ref": "#/components/schemas/GenesisReviewSurface"
          },
          "save_policy": {
            "$ref": "#/components/schemas/GenesisSavePolicy"
          },
          "score": {
            "maximum": 100,
            "minimum": 0,
            "type": "integer"
          },
          "sections": {
            "items": {
              "$ref": "#/components/schemas/GenesisBriefDoctorSection"
            },
            "type": "array"
          },
          "sequence": {
            "$ref": "#/components/schemas/GenesisSequencePlan"
          },
          "status": {
            "enum": [
              "ready",
              "clarify",
              "refuse"
            ],
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "synthesis_ready": {
            "type": "boolean"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "wo_drafts": {
            "items": {
              "$ref": "#/components/schemas/GenesisWODraft"
            },
            "type": "array"
          }
        },
        "required": [
          "status",
          "score",
          "synthesis_ready",
          "summary",
          "length",
          "sections",
          "budget",
          "sequence",
          "review",
          "insufficiency",
          "claim_profile",
          "public_control",
          "save_policy"
        ],
        "type": "object"
      },
      "GenesisBriefDoctorSection": {
        "properties": {
          "basis": {
            "enum": [
              "observed",
              "claimed",
              "inferred",
              "unknown"
            ],
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "status": {
            "enum": [
              "provided",
              "weak",
              "missing"
            ],
            "type": "string"
          }
        },
        "required": [
          "key",
          "label",
          "status",
          "basis"
        ],
        "type": "object"
      },
      "GenesisBudgetEstimate": {
        "properties": {
          "artifact_count": {
            "minimum": 0,
            "type": "integer"
          },
          "breadth_risk": {
            "enum": [
              "low",
              "medium",
              "high",
              "explosion"
            ],
            "type": "string"
          },
          "budget_tier": {
            "enum": [
              "low",
              "medium",
              "high",
              "oversized"
            ],
            "type": "string"
          },
          "estimated_input_tokens": {
            "minimum": 1,
            "type": "integer"
          },
          "expected_wo_drafts": {
            "minimum": 0,
            "type": "integer"
          },
          "reasons": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "refused_by_default": {
            "type": "boolean"
          },
          "requires_explicit_approval": {
            "type": "boolean"
          },
          "scan_cost_units": {
            "minimum": 0,
            "type": "integer"
          },
          "source_types": {
            "items": {
              "enum": [
                "repo",
                "dir",
                "text_file",
                "pasted_brief",
                "transcript_bundle"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "spar_cost_units": {
            "minimum": 0,
            "type": "integer"
          },
          "synthesis_cost_units": {
            "minimum": 0,
            "type": "integer"
          },
          "total_cost_units": {
            "minimum": 0,
            "type": "integer"
          },
          "worst_case_wo_drafts": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "artifact_count",
          "source_types",
          "estimated_input_tokens",
          "scan_cost_units",
          "spar_cost_units",
          "synthesis_cost_units",
          "total_cost_units",
          "expected_wo_drafts",
          "worst_case_wo_drafts",
          "budget_tier",
          "breadth_risk"
        ],
        "type": "object"
      },
      "GenesisExecutionAssumptionFailure": {
        "properties": {
          "assumption": {
            "type": "string"
          },
          "draft_id": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "work_order_id": {
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "work_order_id",
          "title",
          "assumption"
        ],
        "type": "object"
      },
      "GenesisExecutionCalibration": {
        "properties": {
          "assumption_failure_count": {
            "minimum": 0,
            "type": "integer"
          },
          "assumption_failures": {
            "items": {
              "$ref": "#/components/schemas/GenesisExecutionAssumptionFailure"
            },
            "type": "array"
          },
          "batch_id": {
            "type": "string"
          },
          "executed_count": {
            "minimum": 0,
            "type": "integer"
          },
          "generated_count": {
            "minimum": 0,
            "type": "integer"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/GenesisExecutionCalibrationItem"
            },
            "type": "array"
          },
          "merged_count": {
            "minimum": 0,
            "type": "integer"
          },
          "saved_at": {
            "format": "date-time",
            "type": "string"
          },
          "skipped_count": {
            "minimum": 0,
            "type": "integer"
          },
          "summary": {
            "type": "string"
          },
          "unknown_count": {
            "minimum": 0,
            "type": "integer"
          },
          "unnecessary_count": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "summary",
          "generated_count",
          "executed_count",
          "merged_count",
          "skipped_count",
          "unnecessary_count",
          "unknown_count",
          "assumption_failure_count"
        ],
        "type": "object"
      },
      "GenesisExecutionCalibrationItem": {
        "properties": {
          "assumption_failures": {
            "minimum": 0,
            "type": "integer"
          },
          "draft_id": {
            "type": "string"
          },
          "evidence_refs": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "outcome": {
            "enum": [
              "executed",
              "merged",
              "skipped",
              "unnecessary",
              "unknown"
            ],
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "work_order_id": {
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "work_order_id",
          "title",
          "outcome"
        ],
        "type": "object"
      },
      "GenesisGap": {
        "properties": {
          "category": {
            "enum": [
              "product",
              "architecture",
              "backend",
              "frontend",
              "infra",
              "auth_billing",
              "ops_observability",
              "docs_legal",
              "ci_release",
              "security_compliance"
            ],
            "type": "string"
          },
          "evidence_refs": {
            "items": {
              "$ref": "#/components/schemas/GenesisTextSourceRef"
            },
            "type": "array"
          },
          "label": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "trust_class": {
            "enum": [
              "observed",
              "claimed",
              "inferred",
              "unknown"
            ],
            "type": "string"
          }
        },
        "required": [
          "category",
          "label",
          "summary",
          "trust_class",
          "evidence_refs"
        ],
        "type": "object"
      },
      "GenesisInsufficiency": {
        "properties": {
          "blocks_synthesis": {
            "type": "boolean"
          },
          "primary_code": {
            "enum": [
              "not_enough_evidence",
              "question_not_backlog_source",
              "requirements_contradictory",
              "roadmap_intent_not_existing_reality",
              "unsupported_breadth"
            ],
            "type": "string"
          },
          "severity": {
            "enum": [
              "none",
              "clarify",
              "refuse"
            ],
            "type": "string"
          },
          "signals": {
            "items": {
              "$ref": "#/components/schemas/GenesisInsufficiencySignal"
            },
            "type": "array"
          },
          "summary": {
            "type": "string"
          }
        },
        "required": [
          "severity",
          "blocks_synthesis"
        ],
        "type": "object"
      },
      "GenesisInsufficiencySignal": {
        "properties": {
          "clarification_question": {
            "type": "string"
          },
          "code": {
            "enum": [
              "not_enough_evidence",
              "question_not_backlog_source",
              "requirements_contradictory",
              "roadmap_intent_not_existing_reality",
              "unsupported_breadth"
            ],
            "type": "string"
          },
          "evidence_refs": {
            "items": {
              "$ref": "#/components/schemas/GenesisTextSourceRef"
            },
            "type": "array"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object"
      },
      "GenesisIntakeGate": {
        "properties": {
          "allows_synthesis": {
            "type": "boolean"
          },
          "blocking_reasons": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "clarification_questions": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "findings": {
            "items": {
              "$ref": "#/components/schemas/GenesisIntakeGateFinding"
            },
            "type": "array"
          },
          "status": {
            "enum": [
              "pass",
              "clarify",
              "block"
            ],
            "type": "string"
          }
        },
        "required": [
          "status",
          "allows_synthesis"
        ],
        "type": "object"
      },
      "GenesisIntakeGateFinding": {
        "properties": {
          "blocking": {
            "type": "boolean"
          },
          "evidence_refs": {
            "items": {
              "$ref": "#/components/schemas/GenesisTextSourceRef"
            },
            "type": "array"
          },
          "key": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "ambiguity",
              "contradiction"
            ],
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "question": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "kind",
          "blocking",
          "message"
        ],
        "type": "object"
      },
      "GenesisProjectState": {
        "properties": {
          "confidence": {
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "evidence_refs": {
            "items": {
              "$ref": "#/components/schemas/GenesisTextSourceRef"
            },
            "type": "array"
          },
          "reasons": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "state": {
            "enum": [
              "idea_only",
              "spec_only",
              "partial_build",
              "existing_repo",
              "contradictory_state"
            ],
            "type": "string"
          }
        },
        "required": [
          "state",
          "confidence",
          "reasons"
        ],
        "type": "object"
      },
      "GenesisPromotedFact": {
        "properties": {
          "eligible_for_observed": {
            "type": "boolean"
          },
          "evidence_refs": {
            "items": {
              "$ref": "#/components/schemas/GenesisTextSourceRef"
            },
            "type": "array"
          },
          "mixed_trust": {
            "type": "boolean"
          },
          "promotion_rule": {
            "type": "string"
          },
          "section_key": {
            "type": "string"
          },
          "section_label": {
            "type": "string"
          },
          "trust_class": {
            "enum": [
              "observed",
              "claimed",
              "inferred",
              "unknown"
            ],
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "section_key",
          "section_label",
          "value",
          "trust_class",
          "eligible_for_observed",
          "promotion_rule",
          "evidence_refs"
        ],
        "type": "object"
      },
      "GenesisPublicControl": {
        "properties": {
          "abuse_strike_threshold": {
            "minimum": 1,
            "type": "integer"
          },
          "abuse_strikes": {
            "minimum": 0,
            "type": "integer"
          },
          "access_tier": {
            "enum": [
              "anonymous",
              "authenticated"
            ],
            "type": "string"
          },
          "blocked": {
            "type": "boolean"
          },
          "budget_refused": {
            "type": "boolean"
          },
          "budget_unit_cap": {
            "minimum": 1,
            "type": "integer"
          },
          "cooldown_seconds": {
            "minimum": 0,
            "type": "integer"
          },
          "daily_limit": {
            "minimum": 0,
            "type": "integer"
          },
          "daily_remaining": {
            "minimum": 0,
            "type": "integer"
          },
          "daily_used": {
            "minimum": 0,
            "type": "integer"
          },
          "role": {
            "type": "string"
          },
          "turnstile_required": {
            "type": "boolean"
          },
          "worst_case_draft_cap": {
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "access_tier",
          "turnstile_required",
          "daily_limit",
          "daily_used",
          "daily_remaining",
          "cooldown_seconds",
          "budget_unit_cap",
          "worst_case_draft_cap",
          "abuse_strike_threshold",
          "abuse_strikes"
        ],
        "type": "object"
      },
      "GenesisReplayAssumptionChange": {
        "properties": {
          "after": {
            "type": "string"
          },
          "before": {
            "type": "string"
          },
          "field": {
            "type": "string"
          }
        },
        "required": [
          "field"
        ],
        "type": "object"
      },
      "GenesisReplayDependencyShift": {
        "properties": {
          "added": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "category": {
            "enum": [
              "product",
              "architecture",
              "backend",
              "frontend",
              "infra",
              "auth_billing",
              "ops_observability",
              "docs_legal",
              "ci_release",
              "security_compliance"
            ],
            "type": "string"
          },
          "draft_id": {
            "type": "string"
          },
          "removed": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "draft_id",
          "title",
          "category"
        ],
        "type": "object"
      },
      "GenesisReplayDiff": {
        "properties": {
          "added": {
            "items": {
              "$ref": "#/components/schemas/GenesisReplayDraftRef"
            },
            "type": "array"
          },
          "assumption_changes": {
            "items": {
              "$ref": "#/components/schemas/GenesisReplayAssumptionChange"
            },
            "type": "array"
          },
          "calibration": {
            "$ref": "#/components/schemas/GenesisExecutionCalibration"
          },
          "changed": {
            "items": {
              "$ref": "#/components/schemas/GenesisReplayDraftChange"
            },
            "type": "array"
          },
          "dependency_shifts": {
            "items": {
              "$ref": "#/components/schemas/GenesisReplayDependencyShift"
            },
            "type": "array"
          },
          "has_prior_run": {
            "type": "boolean"
          },
          "new_contradictions": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "notes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "prior_batch_id": {
            "type": "string"
          },
          "prior_saved_at": {
            "format": "date-time",
            "type": "string"
          },
          "project": {
            "type": "string"
          },
          "removed": {
            "items": {
              "$ref": "#/components/schemas/GenesisReplayDraftRef"
            },
            "type": "array"
          },
          "reprioritized": {
            "items": {
              "$ref": "#/components/schemas/GenesisReplayPriorityShift"
            },
            "type": "array"
          },
          "resolved_contradictions": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "summary": {
            "type": "string"
          }
        },
        "required": [
          "has_prior_run",
          "summary"
        ],
        "type": "object"
      },
      "GenesisReplayDraftChange": {
        "properties": {
          "category": {
            "enum": [
              "product",
              "architecture",
              "backend",
              "frontend",
              "infra",
              "auth_billing",
              "ops_observability",
              "docs_legal",
              "ci_release",
              "security_compliance"
            ],
            "type": "string"
          },
          "draft_id": {
            "type": "string"
          },
          "fields": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "draft_id",
          "title",
          "category",
          "fields"
        ],
        "type": "object"
      },
      "GenesisReplayDraftRef": {
        "properties": {
          "category": {
            "enum": [
              "product",
              "architecture",
              "backend",
              "frontend",
              "infra",
              "auth_billing",
              "ops_observability",
              "docs_legal",
              "ci_release",
              "security_compliance"
            ],
            "type": "string"
          },
          "draft_id": {
            "type": "string"
          },
          "gap_label": {
            "type": "string"
          },
          "priority": {
            "enum": [
              "P1",
              "P2",
              "P3"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "draft_id",
          "title",
          "category"
        ],
        "type": "object"
      },
      "GenesisReplayPriorityShift": {
        "properties": {
          "after": {
            "enum": [
              "P1",
              "P2",
              "P3"
            ],
            "type": "string"
          },
          "before": {
            "enum": [
              "P1",
              "P2",
              "P3"
            ],
            "type": "string"
          },
          "category": {
            "enum": [
              "product",
              "architecture",
              "backend",
              "frontend",
              "infra",
              "auth_billing",
              "ops_observability",
              "docs_legal",
              "ci_release",
              "security_compliance"
            ],
            "type": "string"
          },
          "draft_id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "draft_id",
          "title",
          "category",
          "before",
          "after"
        ],
        "type": "object"
      },
      "GenesisReviewApproval": {
        "properties": {
          "approvable_draft_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "default_selected_draft_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "manual_selection_allowed": {
            "type": "boolean"
          },
          "notes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suggested_slices": {
            "items": {
              "$ref": "#/components/schemas/GenesisReviewSlice"
            },
            "type": "array"
          },
          "write_path_available": {
            "type": "boolean"
          }
        },
        "required": [
          "write_path_available",
          "manual_selection_allowed"
        ],
        "type": "object"
      },
      "GenesisReviewDraft": {
        "properties": {
          "blocked_reasons": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "category": {
            "enum": [
              "product",
              "architecture",
              "backend",
              "frontend",
              "infra",
              "auth_billing",
              "ops_observability",
              "docs_legal",
              "ci_release",
              "security_compliance"
            ],
            "type": "string"
          },
          "draft_id": {
            "type": "string"
          },
          "evidence_refs": {
            "items": {
              "$ref": "#/components/schemas/GenesisTextSourceRef"
            },
            "type": "array"
          },
          "gap_label": {
            "type": "string"
          },
          "priority": {
            "enum": [
              "P1",
              "P2",
              "P3"
            ],
            "type": "string"
          },
          "selectable": {
            "type": "boolean"
          },
          "summary": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "trust_class": {
            "enum": [
              "observed",
              "claimed",
              "inferred",
              "unknown"
            ],
            "type": "string"
          },
          "why_this_exists": {
            "type": "string"
          }
        },
        "required": [
          "draft_id",
          "title",
          "category",
          "gap_label",
          "priority",
          "summary",
          "why_this_exists",
          "trust_class",
          "evidence_refs",
          "selectable"
        ],
        "type": "object"
      },
      "GenesisReviewSlice": {
        "properties": {
          "draft_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "label",
          "draft_ids"
        ],
        "type": "object"
      },
      "GenesisReviewSurface": {
        "properties": {
          "approval": {
            "$ref": "#/components/schemas/GenesisReviewApproval"
          },
          "budget": {
            "$ref": "#/components/schemas/GenesisBudgetEstimate"
          },
          "contradictions": {
            "items": {
              "$ref": "#/components/schemas/GenesisIntakeGateFinding"
            },
            "type": "array"
          },
          "drafts": {
            "items": {
              "$ref": "#/components/schemas/GenesisReviewDraft"
            },
            "type": "array"
          },
          "dry_run_only": {
            "type": "boolean"
          },
          "gaps": {
            "items": {
              "$ref": "#/components/schemas/GenesisGap"
            },
            "type": "array"
          },
          "insufficiency": {
            "$ref": "#/components/schemas/GenesisInsufficiency"
          },
          "open_questions": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "project_state": {
            "$ref": "#/components/schemas/GenesisProjectState"
          },
          "replay": {
            "$ref": "#/components/schemas/GenesisReplayDiff"
          },
          "sequence": {
            "$ref": "#/components/schemas/GenesisSequencePlan"
          },
          "status": {
            "enum": [
              "ready",
              "clarify",
              "refuse"
            ],
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "dry_run_only",
          "status",
          "summary",
          "insufficiency",
          "project_state",
          "sequence",
          "budget",
          "approval",
          "replay"
        ],
        "type": "object"
      },
      "GenesisSavePolicy": {
        "properties": {
          "anonymous_export_only": {
            "type": "boolean"
          },
          "binding_key": {
            "type": "string"
          },
          "brief_hash": {
            "type": "string"
          },
          "notes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "project": {
            "type": "string"
          },
          "requires_project": {
            "type": "boolean"
          },
          "save_available": {
            "type": "boolean"
          }
        },
        "required": [
          "save_available",
          "requires_project",
          "anonymous_export_only"
        ],
        "type": "object"
      },
      "GenesisSaveRequest": {
        "properties": {
          "brief": {
            "description": "Original Genesis brief. The server re-runs deterministic intake before saving project-bound state.",
            "type": "string"
          },
          "project": {
            "description": "Lowercase shared workledger project slug that should own the saved Genesis review.",
            "type": "string"
          }
        },
        "required": [
          "project",
          "brief"
        ],
        "type": "object"
      },
      "GenesisSaveResponse": {
        "properties": {
          "binding_key": {
            "type": "string"
          },
          "brief_hash": {
            "type": "string"
          },
          "project": {
            "type": "string"
          },
          "saved_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "ready",
              "clarify",
              "refuse"
            ],
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "synthesis_ready": {
            "type": "boolean"
          }
        },
        "required": [
          "project",
          "binding_key",
          "brief_hash",
          "saved_at",
          "status",
          "synthesis_ready",
          "summary"
        ],
        "type": "object"
      },
      "GenesisSequenceIssue": {
        "properties": {
          "depends_on": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "missing_dependency",
              "circular_dependency",
              "orphan_work"
            ],
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "title",
          "message"
        ],
        "type": "object"
      },
      "GenesisSequenceNode": {
        "properties": {
          "category": {
            "enum": [
              "product",
              "architecture",
              "backend",
              "frontend",
              "infra",
              "auth_billing",
              "ops_observability",
              "docs_legal",
              "ci_release",
              "security_compliance"
            ],
            "type": "string"
          },
          "dependents": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "depends_on": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "foundation": {
            "type": "boolean"
          },
          "mvp_critical": {
            "type": "boolean"
          },
          "priority": {
            "enum": [
              "P1",
              "P2",
              "P3"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "title",
          "category",
          "priority",
          "depends_on",
          "dependents"
        ],
        "type": "object"
      },
      "GenesisSequencePlan": {
        "properties": {
          "dependency_graph": {
            "items": {
              "$ref": "#/components/schemas/GenesisSequenceNode"
            },
            "type": "array"
          },
          "execution_order": {
            "items": {
              "$ref": "#/components/schemas/GenesisSequenceStep"
            },
            "type": "array"
          },
          "issues": {
            "items": {
              "$ref": "#/components/schemas/GenesisSequenceIssue"
            },
            "type": "array"
          },
          "mvp_path": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "review_ready": {
            "type": "boolean"
          }
        },
        "required": [
          "review_ready"
        ],
        "type": "object"
      },
      "GenesisSequenceStep": {
        "properties": {
          "blocked_reasons": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "category": {
            "enum": [
              "product",
              "architecture",
              "backend",
              "frontend",
              "infra",
              "auth_billing",
              "ops_observability",
              "docs_legal",
              "ci_release",
              "security_compliance"
            ],
            "type": "string"
          },
          "foundation": {
            "type": "boolean"
          },
          "mvp_critical": {
            "type": "boolean"
          },
          "position": {
            "minimum": 1,
            "type": "integer"
          },
          "prerequisites_satisfied": {
            "type": "boolean"
          },
          "priority": {
            "enum": [
              "P1",
              "P2",
              "P3"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "position",
          "title",
          "category",
          "priority",
          "prerequisites_satisfied"
        ],
        "type": "object"
      },
      "GenesisTextFact": {
        "properties": {
          "basis": {
            "enum": [
              "observed",
              "claimed",
              "inferred",
              "unknown"
            ],
            "type": "string"
          },
          "section_key": {
            "type": "string"
          },
          "section_label": {
            "type": "string"
          },
          "source_ref": {
            "$ref": "#/components/schemas/GenesisTextSourceRef"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "section_key",
          "section_label",
          "basis",
          "value",
          "source_ref"
        ],
        "type": "object"
      },
      "GenesisTextSourceRef": {
        "properties": {
          "artifact_id": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "segment"
            ],
            "type": "string"
          },
          "locator": {
            "type": "string"
          },
          "segment_index": {
            "minimum": 1,
            "type": "integer"
          },
          "snippet": {
            "type": "string"
          },
          "source_id": {
            "type": "string"
          },
          "source_type": {
            "enum": [
              "repo",
              "dir",
              "text_file",
              "pasted_brief",
              "transcript_bundle"
            ],
            "type": "string"
          }
        },
        "required": [
          "kind",
          "segment_index",
          "snippet"
        ],
        "type": "object"
      },
      "GenesisWODependency": {
        "properties": {
          "category": {
            "enum": [
              "product",
              "architecture",
              "backend",
              "frontend",
              "infra",
              "auth_billing",
              "ops_observability",
              "docs_legal",
              "ci_release",
              "security_compliance"
            ],
            "type": "string"
          },
          "rationale": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "category",
          "title",
          "rationale"
        ],
        "type": "object"
      },
      "GenesisWODraft": {
        "properties": {
          "acceptance": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "deps": {
            "items": {
              "$ref": "#/components/schemas/GenesisWODependency"
            },
            "type": "array"
          },
          "draft_id": {
            "type": "string"
          },
          "evidence_refs": {
            "items": {
              "$ref": "#/components/schemas/GenesisTextSourceRef"
            },
            "type": "array"
          },
          "gap_category": {
            "enum": [
              "product",
              "architecture",
              "backend",
              "frontend",
              "infra",
              "auth_billing",
              "ops_observability",
              "docs_legal",
              "ci_release",
              "security_compliance"
            ],
            "type": "string"
          },
          "not_in_scope": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "priority": {
            "enum": [
              "P1",
              "P2",
              "P3"
            ],
            "type": "string"
          },
          "scope": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "summary": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "draft_id",
          "gap_category",
          "title",
          "summary",
          "scope",
          "acceptance",
          "deps",
          "priority",
          "not_in_scope",
          "evidence_refs"
        ],
        "type": "object"
      },
      "GovernanceOverlay": {
        "properties": {
          "artifact_target": {
            "additionalProperties": true,
            "description": "ADR repository/output target metadata.",
            "type": "object"
          },
          "decision_authority": {
            "properties": {
              "who_can_close": {
                "type": "string"
              },
              "who_must_be_consulted": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "expected_revalidation_cadence": {
            "type": "string"
          },
          "known_dissent": {
            "items": {
              "additionalProperties": true,
              "description": "Governance dissent entry.",
              "type": "object"
            },
            "type": "array"
          },
          "proposed_escalation_trigger": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "regulatory_relevance": {
            "properties": {
              "applies": {
                "type": "boolean"
              },
              "named_frameworks": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "notes": {
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "HealthResponse": {
        "properties": {
          "artifact_gate": {
            "$ref": "#/components/schemas/ArtifactGateMetrics"
          },
          "startup_self_test": {
            "$ref": "#/components/schemas/StartupSelfTestSummary"
          },
          "status": {
            "enum": [
              "healthy",
              "degraded"
            ],
            "type": "string"
          }
        },
        "required": [
          "status",
          "artifact_gate"
        ],
        "type": "object"
      },
      "PipelineEvent": {
        "properties": {
          "final": {
            "type": "boolean"
          },
          "id": {
            "minimum": 1,
            "type": "integer"
          },
          "message": {
            "type": "string"
          },
          "persona": {
            "type": "string"
          },
          "stage": {
            "type": "string"
          },
          "timestamp": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "stage",
          "timestamp",
          "final"
        ],
        "type": "object"
      },
      "ProtocolResponse": {
        "additionalProperties": false,
        "example": {
          "version": "1.0.0",
          "max_branches_per_round": 6,
          "max_splits_per_branch": 2,
          "max_confidence_gap": 0.4,
          "confidence_high": 0.8,
          "confidence_moderate": 0.55,
          "confidence_cautious": 0.4,
          "confidence_inconclusive": 0.25,
          "confidence_floor": 0.3,
          "entropy_threshold_low": 0.3,
          "entropy_threshold_high": 1.2,
          "budget_phase_05": 0.2,
          "budget_prosecution": 0.5,
          "budget_post_verdict": 0.15,
          "budget_censor": 0.3,
          "budget_reopen": 1,
          "budget_gate": 0.2,
          "budget_insights": 0.15,
          "budget_filing": 0.05,
          "budget_divergence": 0.02,
          "budget_delta": 0.01,
          "budget_counterfactual": 0.03,
          "parallel_councils": 1,
          "council_roles": [
            "Reason from infrastructure constraints first",
            "Reason from reliability and failure modes first",
            "Reason from operational economics first"
          ],
          "herding_diversity_floor": 0.3,
          "herding_convergence_ceiling": 0.7,
          "pdr_floor": 0.15,
          "anchor_similarity_cap": 0.8,
          "confidence_spread_floor": 0.1,
          "max_model_dominance": 0.4,
          "escalation_enabled": true,
          "evidence_strong_threshold": 10,
          "evidence_moderate_threshold": 5,
          "uncertainty_high_threshold": 0.35,
          "uncertainty_mod_threshold": 0.15,
          "promotion_threshold": 10,
          "promotion_confidence": 0.65
        },
        "properties": {
          "anchor_similarity_cap": {
            "type": "number"
          },
          "budget_censor": {
            "type": "number"
          },
          "budget_counterfactual": {
            "type": "number"
          },
          "budget_delta": {
            "type": "number"
          },
          "budget_divergence": {
            "type": "number"
          },
          "budget_filing": {
            "type": "number"
          },
          "budget_gate": {
            "type": "number"
          },
          "budget_insights": {
            "type": "number"
          },
          "budget_phase_05": {
            "type": "number"
          },
          "budget_post_verdict": {
            "type": "number"
          },
          "budget_prosecution": {
            "type": "number"
          },
          "budget_reopen": {
            "type": "number"
          },
          "confidence_cautious": {
            "type": "number"
          },
          "confidence_floor": {
            "type": "number"
          },
          "confidence_high": {
            "type": "number"
          },
          "confidence_inconclusive": {
            "type": "number"
          },
          "confidence_moderate": {
            "type": "number"
          },
          "confidence_spread_floor": {
            "type": "number"
          },
          "council_roles": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "entropy_threshold_high": {
            "type": "number"
          },
          "entropy_threshold_low": {
            "type": "number"
          },
          "escalation_enabled": {
            "type": "boolean"
          },
          "evidence_moderate_threshold": {
            "minimum": 0,
            "type": "integer"
          },
          "evidence_strong_threshold": {
            "minimum": 0,
            "type": "integer"
          },
          "herding_convergence_ceiling": {
            "type": "number"
          },
          "herding_diversity_floor": {
            "type": "number"
          },
          "max_branches_per_round": {
            "minimum": 1,
            "type": "integer"
          },
          "max_confidence_gap": {
            "type": "number"
          },
          "max_model_dominance": {
            "type": "number"
          },
          "max_splits_per_branch": {
            "minimum": 0,
            "type": "integer"
          },
          "parallel_councils": {
            "minimum": 1,
            "type": "integer"
          },
          "pdr_floor": {
            "type": "number"
          },
          "promotion_confidence": {
            "type": "number"
          },
          "promotion_threshold": {
            "minimum": 0,
            "type": "integer"
          },
          "uncertainty_high_threshold": {
            "type": "number"
          },
          "uncertainty_mod_threshold": {
            "type": "number"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "version",
          "max_branches_per_round",
          "max_splits_per_branch",
          "max_confidence_gap",
          "confidence_high",
          "confidence_moderate",
          "confidence_cautious",
          "confidence_inconclusive",
          "confidence_floor",
          "entropy_threshold_low",
          "entropy_threshold_high",
          "budget_phase_05",
          "budget_prosecution",
          "budget_post_verdict",
          "budget_censor",
          "budget_reopen",
          "budget_gate",
          "budget_insights",
          "budget_filing",
          "budget_divergence",
          "budget_delta",
          "budget_counterfactual",
          "parallel_councils",
          "council_roles",
          "herding_diversity_floor",
          "herding_convergence_ceiling",
          "pdr_floor",
          "anchor_similarity_cap",
          "confidence_spread_floor",
          "max_model_dominance",
          "escalation_enabled",
          "evidence_strong_threshold",
          "evidence_moderate_threshold",
          "uncertainty_high_threshold",
          "uncertainty_mod_threshold",
          "promotion_threshold",
          "promotion_confidence"
        ],
        "type": "object"
      },
      "QuestionDecisionAxis": {
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "why": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "label"
        ],
        "type": "object"
      },
      "QuestionKnownFact": {
        "properties": {
          "fact": {
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "fact",
          "source"
        ],
        "type": "object"
      },
      "QuestionReframeAngle": {
        "properties": {
          "basis": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "description"
        ],
        "type": "object"
      },
      "QuestionSearchLanguage": {
        "properties": {
          "code": {
            "type": "string"
          },
          "primary": {
            "type": "boolean"
          },
          "rationale": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      },
      "QuestionUnderstanding": {
        "properties": {
          "answer_intent_groups": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "decision_axes": {
            "items": {
              "$ref": "#/components/schemas/QuestionDecisionAxis"
            },
            "type": "array"
          },
          "decision_types": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "disallowed_evidence_source_classes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "domain_intent": {
            "$ref": "#/components/schemas/DomainIntentClassification"
          },
          "entities": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "expected_answer_shape": {
            "type": "string"
          },
          "gentle_redirect_target": {
            "type": "string"
          },
          "known_facts": {
            "items": {
              "$ref": "#/components/schemas/QuestionKnownFact"
            },
            "type": "array"
          },
          "nature": {
            "type": "string"
          },
          "question_type": {
            "type": "string"
          },
          "reframe_angles": {
            "items": {
              "$ref": "#/components/schemas/QuestionReframeAngle"
            },
            "type": "array"
          },
          "required_evidence_source_classes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "schema_version": {
            "type": "string"
          },
          "seal": {
            "$ref": "#/components/schemas/QuestionUnderstandingSeal"
          },
          "search_intent": {
            "type": "string"
          },
          "search_languages": {
            "items": {
              "$ref": "#/components/schemas/QuestionSearchLanguage"
            },
            "type": "array"
          },
          "topics": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "web_searchability": {
            "type": "string"
          }
        },
        "required": [
          "schema_version",
          "nature",
          "expected_answer_shape",
          "web_searchability",
          "search_intent",
          "seal"
        ],
        "type": "object"
      },
      "QuestionUnderstandingSeal": {
        "properties": {
          "fallbacks": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "notes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "source"
        ],
        "type": "object"
      },
      "ReframeChainRecord": {
        "properties": {
          "authority": {
            "enum": [
              "telemetry_only"
            ],
            "type": "string"
          },
          "chain_id": {
            "type": "string"
          },
          "reframe_observed": {
            "type": "boolean"
          },
          "source": {
            "enum": [
              "caller_declared_unverified"
            ],
            "type": "string"
          },
          "verdict_posture": {
            "type": "string"
          },
          "verdict_status": {
            "type": "string"
          }
        },
        "required": [
          "chain_id",
          "source",
          "authority",
          "verdict_status",
          "reframe_observed"
        ],
        "type": "object"
      },
      "ReplayContext": {
        "properties": {
          "actual_outcome": {
            "type": "string"
          },
          "constraints_at_time": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "decision_taken": {
            "type": "string"
          },
          "incident": {
            "type": "string"
          },
          "incident_date": {
            "format": "date",
            "type": "string"
          }
        },
        "required": [
          "incident",
          "actual_outcome",
          "decision_taken"
        ],
        "type": "object"
      },
      "ReversalCondition": {
        "properties": {
          "condition": {
            "type": "string"
          },
          "flips_to": {
            "type": "string"
          }
        },
        "required": [
          "condition",
          "flips_to"
        ],
        "type": "object"
      },
      "ReviewArtifactManifest": {
        "description": "Minimum artifact bundle required before review-shaped filings can spend Council budget.",
        "properties": {
          "api_spec_or_schema_link": {
            "description": "OpenAPI, schema, protobuf, migration, or data-contract reference.",
            "type": "string"
          },
          "artifact_link": {
            "description": "URL or path for code, config, diagram, or an uploaded artifact bundle.",
            "type": "string"
          },
          "dependency_manifest": {
            "description": "Lockfile/package manifest or external dependency inventory.",
            "type": "string"
          },
          "deployment_config": {
            "description": "Runtime, topology, IaC, rollout, or deployment config reference.",
            "type": "string"
          },
          "operational_context": {
            "description": "Team size, traffic class, external dependencies, SRE/ownership context.",
            "type": "string"
          },
          "system_description": {
            "description": "Inline system description when no artifact bundle exists.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "StartupSelfTestSummary": {
        "properties": {
          "failed": {
            "minimum": 0,
            "type": "integer"
          },
          "ok": {
            "type": "boolean"
          },
          "passed": {
            "minimum": 0,
            "type": "integer"
          },
          "warned": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "passed",
          "warned",
          "failed",
          "ok"
        ],
        "type": "object"
      },
      "SubmissionStatusResponse": {
        "properties": {
          "case_id": {
            "format": "uuid",
            "type": "string"
          },
          "completed_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "estimate": {
            "type": "string"
          },
          "queue_position": {
            "minimum": 0,
            "type": "integer"
          },
          "result": {
            "$ref": "#/components/schemas/ArtifactEnvelope"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "queued",
              "processing",
              "completed",
              "failed"
            ],
            "type": "string"
          },
          "submission_id": {
            "format": "uuid",
            "type": "string"
          },
          "verdict_url": {
            "type": "string"
          },
          "wait_state": {
            "enum": [
              "backend_queued",
              "backend_processing",
              "backend_completed",
              "backend_failed",
              "backend_unknown"
            ],
            "type": "string"
          }
        },
        "required": [
          "submission_id",
          "case_id",
          "status",
          "created_at",
          "verdict_url"
        ],
        "type": "object"
      },
      "SubmitAcceptedResponse": {
        "properties": {
          "case_id": {
            "format": "uuid",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "poll_url": {
            "type": "string"
          },
          "status": {
            "enum": [
              "queued",
              "processing",
              "completed",
              "failed"
            ],
            "type": "string"
          },
          "submission_id": {
            "format": "uuid",
            "type": "string"
          },
          "verdict_url": {
            "type": "string"
          },
          "wait_url": {
            "type": "string"
          }
        },
        "required": [
          "submission_id",
          "case_id",
          "status",
          "poll_url",
          "wait_url",
          "verdict_url",
          "created_at"
        ],
        "type": "object"
      },
      "VerdictArtifact": {
        "additionalProperties": true,
        "description": "Portable verdict body. The schema is intentionally partial; additional fields may appear as the artifact evolves.",
        "properties": {
          "adr_markdown": {
            "type": "string"
          },
          "attack_grid": {
            "additionalProperties": true,
            "description": "Adversarial attack grid keyed by risk dimension.",
            "type": "object"
          },
          "blind_spots": {
            "items": {
              "additionalProperties": true,
              "description": "Blind spot alert entry.",
              "type": "object"
            },
            "type": "array"
          },
          "claims": {
            "items": {
              "additionalProperties": true,
              "description": "Structured claims and evidence extracted during deliberation.",
              "type": "object"
            },
            "type": "array"
          },
          "cost": {
            "minimum": 0,
            "type": "number"
          },
          "decision": {
            "$ref": "#/components/schemas/Decision"
          },
          "decision_type": {
            "type": "string"
          },
          "decision_types": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "dissent_record": {
            "additionalProperties": true,
            "description": "Structured governance dissent record.",
            "type": "object"
          },
          "domain_intent": {
            "$ref": "#/components/schemas/DomainIntentClassification"
          },
          "duration_seconds": {
            "minimum": 0,
            "type": "number"
          },
          "filing": {
            "$ref": "#/components/schemas/CaseFiling"
          },
          "governance": {
            "$ref": "#/components/schemas/GovernanceOverlay"
          },
          "governance_overlay": {
            "type": "boolean"
          },
          "metrics": {
            "additionalProperties": true,
            "description": "Verdict metrics and calibration telemetry.",
            "type": "object"
          },
          "protocol_version": {
            "type": "string"
          },
          "question": {
            "type": "string"
          },
          "question_understanding": {
            "$ref": "#/components/schemas/QuestionUnderstanding"
          },
          "reframe_chain": {
            "$ref": "#/components/schemas/ReframeChainRecord"
          },
          "verdict_dissent_reason": {
            "enum": [
              "no_validated_challenger",
              "reopen_missing_critique",
              "unknown"
            ],
            "type": "string"
          },
          "verdict_markdown": {
            "type": "string"
          },
          "verdict_status": {
            "type": "string"
          }
        },
        "required": [
          "question",
          "verdict_status",
          "decision"
        ],
        "type": "object"
      },
      "VerdictLineage": {
        "properties": {
          "case_id": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "factpack_version": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "model_family": {
            "type": "string"
          },
          "model_id": {
            "type": "string"
          },
          "prior_source": {
            "type": "string"
          },
          "prompt_version": {
            "type": "string"
          },
          "retrieval_config": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "case_id",
          "model_id",
          "model_family",
          "prompt_version",
          "factpack_version",
          "created_at"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "description": "Signed VectorCourt API or license key. Session cookie auth is also supported, but X-VC-Key is the primary agent contract.",
        "in": "header",
        "name": "X-VC-Key",
        "type": "apiKey"
      }
    }
  },
  "externalDocs": {
    "description": "Machine-oriented usage guide",
    "url": "https://vectorcourt.com/openapi.json"
  },
  "info": {
    "contact": {
      "name": "VectorCourt",
      "url": "https://vectorcourt.com"
    },
    "description": "VectorCourt is the commercial surface of Oracul. It exposes synchronous and asynchronous verdict workflows plus public discovery metadata for agent clients.",
    "summary": "Structured adversarial reasoning for ambiguous technical decisions",
    "title": "VectorCourt API",
    "version": "current"
  },
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "openapi": "3.1.0",
  "paths": {
    "/exhibits-schema.json": {
      "get": {
        "operationId": "getExhibitsSchema",
        "responses": {
          "200": {
            "content": {
              "application/schema+json": {
                "example": {
                  "$id": "https://vectorcourt.com/exhibits-schema.json",
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "additionalProperties": false,
                  "properties": {
                    "case": {
                      "additionalProperties": false,
                      "properties": {
                        "changed_files": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "parent_wo": {
                          "type": "string"
                        },
                        "subject": {
                          "type": "string"
                        },
                        "trigger": {
                          "type": "string"
                        },
                        "wo": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "wo",
                        "trigger",
                        "subject",
                        "changed_files"
                      ],
                      "type": "object"
                    },
                    "court": {
                      "const": "vectorcourt"
                    },
                    "exhibits": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "citations": {
                            "items": {
                              "additionalProperties": false,
                              "properties": {
                                "content_hash": {
                                  "pattern": "^sha256:[0-9a-f]{64}$",
                                  "type": "string"
                                },
                                "provenance_class": {
                                  "enum": [
                                    "human_verified",
                                    "agent_generated",
                                    "auto_merged",
                                    "unknown"
                                  ],
                                  "type": "string"
                                },
                                "quote_or_summary": {
                                  "type": "string"
                                },
                                "quoted": {
                                  "type": "boolean"
                                },
                                "relevance": {
                                  "type": "string"
                                },
                                "retrieved_at": {
                                  "format": "date-time",
                                  "type": "string"
                                },
                                "source": {
                                  "type": "string"
                                },
                                "source_mutability": {
                                  "enum": [
                                    "immutable",
                                    "mutable"
                                  ],
                                  "type": "string"
                                },
                                "source_type": {
                                  "enum": [
                                    "workledger",
                                    "git",
                                    "file",
                                    "review"
                                  ],
                                  "type": "string"
                                }
                              },
                              "required": [
                                "source",
                                "source_type",
                                "provenance_class",
                                "retrieved_at",
                                "content_hash",
                                "source_mutability",
                                "quote_or_summary",
                                "quoted",
                                "relevance"
                              ],
                              "type": "object"
                            },
                            "minItems": 1,
                            "type": "array"
                          },
                          "id": {
                            "type": "string"
                          },
                          "procedural_options": {
                            "items": {
                              "enum": [
                                "ignore",
                                "ask_reviewer_to_recheck",
                                "require_child_wo",
                                "hold_parent_close",
                                "escalate_to_human"
                              ],
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "risk_class": {
                            "enum": [
                              "precedent_conflict",
                              "coupled_file_omission",
                              "boundary_violation",
                              "wo44_authority_leak",
                              "stack_graph_hazard",
                              "review_rubber_stamp",
                              "acceptance_drift",
                              "evidence_gap"
                            ],
                            "type": "string"
                          },
                          "severity_of_precedent": {
                            "enum": [
                              "blocker_in_history",
                              "high",
                              "medium",
                              "low"
                            ],
                            "type": "string"
                          },
                          "suggested_child_wo_candidate": {
                            "additionalProperties": false,
                            "properties": {
                              "acceptance": {
                                "items": {
                                  "type": "string"
                                },
                                "type": "array"
                              },
                              "rationale_cites": {
                                "items": {
                                  "type": "string"
                                },
                                "type": "array"
                              },
                              "scope": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "title",
                              "scope",
                              "acceptance",
                              "rationale_cites"
                            ],
                            "type": "object"
                          },
                          "title": {
                            "type": "string"
                          },
                          "what_current_solution_does_not_address": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "risk_class",
                          "title",
                          "severity_of_precedent",
                          "citations",
                          "what_current_solution_does_not_address",
                          "procedural_options"
                        ],
                        "type": "object"
                      },
                      "maxItems": 5,
                      "type": "array"
                    },
                    "retrieval_calls_needed": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "schema_version": {
                      "const": "exhibits.v1"
                    },
                    "status": {
                      "enum": [
                        "exhibits_found",
                        "no_precedent",
                        "insufficient_evidence",
                        "not_applicable"
                      ],
                      "type": "string"
                    },
                    "summary": {
                      "maxLength": 200,
                      "type": "string"
                    },
                    "truncated": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "schema_version",
                    "court",
                    "case",
                    "status",
                    "summary",
                    "exhibits",
                    "truncated"
                  ],
                  "title": "VectorCourt Evidence Clerk ExhibitResult",
                  "type": "object"
                },
                "schema": {
                  "additionalProperties": true,
                  "properties": {
                    "$id": {
                      "format": "uri",
                      "type": "string"
                    },
                    "$schema": {
                      "format": "uri",
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "boolean"
                    },
                    "properties": {
                      "additionalProperties": true,
                      "type": "object"
                    },
                    "required": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "title": {
                      "type": "string"
                    },
                    "type": {
                      "const": "object"
                    }
                  },
                  "required": [
                    "$schema",
                    "$id",
                    "type",
                    "properties",
                    "required"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON Schema document for Evidence Clerk exhibit results."
          }
        },
        "summary": "Fetch the Evidence Clerk exhibit JSON schema",
        "tags": [
          "discovery"
        ]
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenAPI",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "info": {
                    "title": "VectorCourt API"
                  },
                  "openapi": "3.1.0"
                },
                "schema": {
                  "additionalProperties": true,
                  "type": "object"
                }
              }
            },
            "description": "OpenAPI 3.1 document for the public VectorCourt surface."
          }
        },
        "summary": "Fetch the OpenAPI 3.1 document",
        "tags": [
          "discovery"
        ]
      }
    },
    "/v1/admin/filing-diversity": {
      "get": {
        "operationId": "getFilingDiversity",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "alert": {
                    "triggered": false
                  },
                  "current_entropy": 1.2,
                  "thirty_day_trend": []
                },
                "schema": {
                  "additionalProperties": true,
                  "description": "Filing diversity report.",
                  "type": "object"
                }
              }
            },
            "description": "Current filing-shape entropy, weekly trend, histogram, and narrowed dimensions."
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Report filing-shape diversity and monoculture alerts",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/cases/{id}": {
      "get": {
        "operationId": "getCase",
        "parameters": [
          {
            "description": "Case UUID or stored artifact identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "case": {
                    "cost": 12.75,
                    "decision": {
                      "chosen_path": "Keep PostgreSQL as the primary path and add Cassandra only behind an isolated retrieval adapter.",
                      "confidence": 0.78,
                      "next_action": "Ship the adapter behind a feature flag and measure retrieval latency on release-validation traffic.",
                      "reversal_conditions": [
                        {
                          "condition": "PostgreSQL retrieval exceeds the latency budget for three consecutive release bundles.",
                          "flips_to": "Promote Cassandra-backed retrieval to primary."
                        }
                      ],
                      "selection_rationale": "The adapter preserves rollback safety while making the retrieval ceiling measurable before a wholesale migration."
                    },
                    "decision_type": "system_design",
                    "decision_types": [
                      "system_design",
                      "tradeoff"
                    ],
                    "duration_seconds": 148.4,
                    "protocol_version": "1.0.0",
                    "question": "Should we keep PostgreSQL-only search or add Cassandra-backed retrieval for release validation verdicts?",
                    "verdict_status": "finalized"
                  },
                  "lineage": {
                    "case_id": "8c9fef10-9777-4be0-a3e3-d28ba0bc5b99",
                    "created_at": "2026-04-24T05:02:35Z",
                    "factpack_version": "current",
                    "id": "lineage-123",
                    "model_family": "openai",
                    "model_id": "gpt-5.4",
                    "prior_source": "current_defaults",
                    "prompt_version": "wo-599",
                    "retrieval_config": "postgres-primary+cassandra-shadow"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/CaseResponse"
                }
              }
            },
            "description": "Stored verdict body plus prompt/model lineage metadata.",
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "code": "missing_id",
                  "error": "case ID is required"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing case identifier."
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Retrieve a stored verdict and lineage metadata",
        "tags": [
          "cases"
        ]
      }
    },
    "/v1/cases/{id}/stream": {
      "get": {
        "operationId": "streamCaseRedeliberation",
        "parameters": [
          {
            "description": "Case UUID being re-deliberated after clarification.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "example": "data: {\"stage\":\"spar\",\"message\":\"Council is re-deliberating with your answers\",\"timestamp\":\"2026-04-25T13:30:00Z\",\"final\":false}\n\n",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Event stream for follow-up deliberation. Each `data:` frame is a serialized PipelineEvent JSON object."
          },
          "400": {
            "content": {
              "text/plain": {
                "example": "case ID required\n",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Missing case identifier."
          },
          "404": {
            "content": {
              "text/plain": {
                "example": "404 page not found\n",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Case not found."
          },
          "500": {
            "content": {
              "text/plain": {
                "example": "internal error\n",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Streaming failed."
          },
          "503": {
            "content": {
              "text/plain": {
                "example": "service unavailable\n",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Database is not configured."
          }
        },
        "summary": "Stream clarification re-deliberation progress as server-sent events",
        "tags": [
          "cases"
        ]
      }
    },
    "/v1/consult": {
      "post": {
        "description": "Returns simple verdict artifacts directly. Standard, Pro, Enterprise, and extended deliberations are routed to the async submission queue and return a wait URL before client/server timeout boundaries. When callback_url is supplied by an authenticated caller, lifecycle callbacks are delivered as signed POSTs for clarification_pending and finalized.",
        "operationId": "postConsult",
        "parameters": [
          {
            "description": "Optional caller-scoped retry key. Reusing the same key returns the existing async submission instead of queuing duplicate work.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "callback_url": "https://agent.example.com/vectorcourt/callbacks",
                "extended_deliberation": true,
                "filing": {
                  "alternatives": [
                    "PostgreSQL only",
                    "Add Cassandra-backed retrieval"
                  ],
                  "constraints": [
                    "No downtime",
                    "Cloud Run only",
                    "Keep rollback simple"
                  ],
                  "context": "We need production-safe retrieval without breaking the current launch window.",
                  "decision": "Pick the next retrieval architecture for release validation workloads.",
                  "evidence": [
                    "Current pg query plans regress above 1M rows",
                    "Cassandra service already deployed"
                  ],
                  "known_risks": [
                    "Search latency spikes",
                    "Schema drift"
                  ],
                  "success_criteria": "Median retrieval under 300ms with a rollback path inside one deploy."
                },
                "governance": {
                  "decision_authority": {
                    "who_can_close": "Platform maintainer",
                    "who_must_be_consulted": [
                      "Security",
                      "Support"
                    ]
                  },
                  "expected_revalidation_cadence": "90 days",
                  "known_dissent": [
                    {
                      "conditions_under_which_it_would_win": "Measured latency stays below target without Cassandra.",
                      "dissenter": "Operations",
                      "position_summary": "Do not add a second retrieval system before latency is measured.",
                      "why_it_did_not_win": "The filing scopes the rollout behind a reversible launch gate."
                    }
                  ],
                  "proposed_escalation_trigger": [
                    "provider deprecation",
                    "customer audit commitment"
                  ],
                  "regulatory_relevance": {
                    "applies": false,
                    "named_frameworks": [],
                    "notes": "No formal regulated deployment yet; export and audit expectations may apply later."
                  }
                },
                "governance_overlay": true,
                "initial_leaning": "Keep PostgreSQL unless the retrieval ceiling is already visible.",
                "question": "Should we keep PostgreSQL-only search or add Cassandra-backed retrieval for release validation verdicts?"
              },
              "schema": {
                "$ref": "#/components/schemas/ConsultRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "artifact_id": "6d8d7b9d-4b9a-4566-85b4-76a0ef4e0b12",
                  "body": {
                    "cost": 12.75,
                    "decision": {
                      "chosen_path": "Keep PostgreSQL as the primary path and add Cassandra only behind an isolated retrieval adapter.",
                      "confidence": 0.78,
                      "next_action": "Ship the adapter behind a feature flag and measure retrieval latency on release-validation traffic.",
                      "reversal_conditions": [
                        {
                          "condition": "PostgreSQL retrieval exceeds the latency budget for three consecutive release bundles.",
                          "flips_to": "Promote Cassandra-backed retrieval to primary."
                        }
                      ],
                      "selection_rationale": "The adapter preserves rollback safety while making the retrieval ceiling measurable before a wholesale migration."
                    },
                    "decision_type": "system_design",
                    "decision_types": [
                      "system_design",
                      "tradeoff"
                    ],
                    "duration_seconds": 148.4,
                    "protocol_version": "1.0.0",
                    "question": "Should we keep PostgreSQL-only search or add Cassandra-backed retrieval for release validation verdicts?",
                    "verdict_status": "finalized"
                  },
                  "created_at": "2026-04-24T05:00:00Z",
                  "disclaimer": "This verdict is a structured reasoning artifact, not professional advice. VectorCourt does not provide legal, financial, medical, or other professional advice. You are responsible for your own decisions.",
                  "integrity_hash": "7d6dbfbc4d86dc9aa7bf2f046981f0f7a4e326531bd7684b95fbc5f0d5e30d31",
                  "schema_version": "1.0.0"
                },
                "schema": {
                  "$ref": "#/components/schemas/ArtifactEnvelope"
                }
              }
            },
            "description": "Final verdict artifact envelope.",
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "202": {
            "content": {
              "application/json": {
                "example": {
                  "case_id": "8c9fef10-9777-4be0-a3e3-d28ba0bc5b99",
                  "created_at": "2026-04-24T05:00:00Z",
                  "poll_url": "/v1/submissions/e4c0c5f9-9f40-4bc1-b6db-b2bc5cb6c6dd",
                  "status": "queued",
                  "submission_id": "e4c0c5f9-9f40-4bc1-b6db-b2bc5cb6c6dd",
                  "verdict_url": "/v/8c9fef10-9777-4be0-a3e3-d28ba0bc5b99",
                  "wait_url": "/w/e4c0c5f9-9f40-4bc1-b6db-b2bc5cb6c6dd"
                },
                "schema": {
                  "$ref": "#/components/schemas/SubmitAcceptedResponse"
                }
              }
            },
            "description": "Heavy consultation queued for async processing.",
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "code": "callback_url_private",
                  "error": "callback_url resolves to a private address"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Malformed request or invalid callback_url."
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "code": "captcha_failed",
                  "error": "verification failed — please try again"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Verification failed or the supplied credential was rejected."
          },
          "422": {
            "$ref": "#/components/responses/ClerkRejection"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedError"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "security": [
          {},
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Run a synchronous consultation",
        "tags": [
          "consult"
        ]
      }
    },
    "/v1/exhibits": {
      "post": {
        "description": "Runs deterministic Clerk preflight and retrieval-only exhibit formatting. This endpoint never emits a verdict, recommendation, confidence score, branch analysis, or Council reasoning.",
        "operationId": "postExhibits",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "max_exhibits": 5,
                "output_mode": "exhibits_only",
                "question": "Find cited precedent for this close decision.",
                "retrieval_sources": [
                  "workledger",
                  "git"
                ],
                "risk_classes": [
                  "precedent_conflict",
                  "evidence_gap"
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/ExhibitRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "court": "vectorcourt",
                  "exhibits": [],
                  "schema_version": "exhibits.v1",
                  "status": "no_precedent",
                  "summary": "no admissible citations found",
                  "truncated": false
                },
                "schema": {
                  "$ref": "#/components/schemas/ExhibitResult"
                }
              }
            },
            "description": "Evidence Clerk exhibit result."
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedError"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "content": {
              "application/json": {
                "example": {
                  "error": "evidence retrieval unavailable"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Evidence retrieval is unavailable."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Run Evidence Clerk exhibit-only retrieval",
        "tags": [
          "exhibits"
        ]
      }
    },
    "/v1/genesis/approve": {
      "post": {
        "description": "Authenticated write path for Genesis. Re-runs the deterministic brief doctor server-side, validates the selected reviewable draft subset, then creates the approved WOs in the named shared workledger project using duplicate-safe batch identifiers and rollback on partial failure.",
        "operationId": "postGenesisApprove",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "brief": "Current state: rough PRD and no repo yet. We want to build a release validation SaaS for engineering managers. Success means an MVP in 8 weeks. Constraints: two engineers, keep GCP, no mobile app. Runtime: Go API on Cloud Run with Postgres. Out of scope: on-prem. Output depth: sequenced MVP backlog first, then phase 2.",
                "project": "releasecopilot",
                "selected_draft_ids": [
                  "a4a1841d9c53576c8388d8ce",
                  "88d1cb8f843f3a41fd12f5f5"
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/GenesisApproveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "batch_id": "ab12cd34ef56ab78cd90ef12",
                  "created_count": 2,
                  "project": "releasecopilot",
                  "reused_count": 0,
                  "selected_draft_ids": [
                    "a4a1841d9c53576c8388d8ce",
                    "88d1cb8f843f3a41fd12f5f5"
                  ],
                  "work_orders": [
                    {
                      "created": true,
                      "id": 631,
                      "status": "open",
                      "title": "Define system architecture and component boundaries"
                    },
                    {
                      "created": true,
                      "id": 632,
                      "status": "open",
                      "title": "Define backend execution and data contracts"
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/GenesisApproveResponse"
                }
              }
            },
            "description": "Selected Genesis drafts were created or reused successfully."
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "code": "missing_selection",
                  "error": "selected_draft_ids is required"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Malformed request, invalid project slug, or invalid selected_draft_ids."
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "code": "unauthorized",
                  "error": "API key required"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Authenticated Genesis approval requires X-VC-Key or a valid session."
          },
          "409": {
            "content": {
              "application/json": {
                "example": {
                  "code": "duplicate_title",
                  "error": "work order title already exists in target project: Define system architecture and component boundaries"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unrelated work order with the same title already exists in the target project."
          },
          "413": {
            "content": {
              "application/json": {
                "example": {
                  "code": "request_too_large",
                  "error": "Genesis approval body is too large"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Genesis approval request body exceeded the configured limit."
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "code": "genesis_not_ready",
                  "error": "Genesis brief is not ready for shared workledger create"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Brief is not ready for Genesis workledger create."
          },
          "502": {
            "content": {
              "application/json": {
                "example": {
                  "code": "workledger_write_failed",
                  "error": "failed to create Genesis work orders"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Shared workledger create failed or rollback could not restore atomicity."
          },
          "503": {
            "content": {
              "application/json": {
                "example": {
                  "code": "no_workledger",
                  "error": "Genesis shared workledger write path is unavailable"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Shared workledger write path is unavailable in this deployment."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Create approved Genesis drafts in shared workledger",
        "tags": [
          "genesis"
        ]
      }
    },
    "/v1/genesis/brief-doctor": {
      "post": {
        "description": "Deterministic public dry-run for Genesis intake. Anonymous callers must pass Turnstile and stay inside tighter public caps; keyed or session-backed callers get wider public Genesis limits. Scores section coverage, contradiction risk, fiction pressure, scan/SPAR/synthesis budget, and synthesis readiness; when the brief passes the intake gate and stays within public breadth limits, it also returns validated WO drafts plus dependency-ordered review and subset-approval metadata without writing project state. If the caller supplies a project slug, Genesis also loads replay against the latest approved backlog for that project and therefore requires authenticated context.",
        "operationId": "postGenesisBriefDoctor",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "brief": "Current state: rough PRD and no repo yet. We want to build a release validation SaaS for engineering managers. Success means an MVP in 8 weeks. Constraints: two engineers, keep GCP, no mobile app. Runtime: Go API on Cloud Run with Postgres. Out of scope: on-prem. Output depth: sequenced MVP backlog first, then phase 2.",
                "cf_turnstile_response": "token-from-turnstile-for-anonymous-genesis",
                "project": "releasecopilot"
              },
              "schema": {
                "$ref": "#/components/schemas/GenesisBriefDoctorRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "budget": {
                    "artifact_count": 1,
                    "breadth_risk": "medium",
                    "budget_tier": "medium",
                    "estimated_input_tokens": 81,
                    "expected_wo_drafts": 6,
                    "reasons": [
                      "Current evidence would likely expand into 6 work orders, or 8 in the worst case."
                    ],
                    "scan_cost_units": 5,
                    "source_types": [
                      "pasted_brief"
                    ],
                    "spar_cost_units": 16,
                    "synthesis_cost_units": 28,
                    "total_cost_units": 49,
                    "worst_case_wo_drafts": 8
                  },
                  "claim_profile": {
                    "claimed_signals": 4,
                    "inference_pressure": "low",
                    "inferred_signals": 1,
                    "intent_reality_balance": "balanced",
                    "observed_signals": 3,
                    "unknown_signals": 0
                  },
                  "facts": [
                    {
                      "basis": "observed",
                      "section_key": "current_state",
                      "section_label": "what exists today",
                      "source_ref": {
                        "artifact_id": "c24802c7e63f3806d3d5c7b0",
                        "kind": "segment",
                        "locator": "inline:brief",
                        "segment_index": 1,
                        "snippet": "Current state: rough PRD and no repo yet",
                        "source_id": "3ce0c327ce26b4198470ebd2",
                        "source_type": "pasted_brief"
                      },
                      "value": "Current state: rough PRD and no repo yet"
                    },
                    {
                      "basis": "claimed",
                      "section_key": "intended_state",
                      "section_label": "what is only intended",
                      "source_ref": {
                        "artifact_id": "c24802c7e63f3806d3d5c7b0",
                        "kind": "segment",
                        "locator": "inline:brief",
                        "segment_index": 2,
                        "snippet": "We want to build a release validation SaaS for engineering managers",
                        "source_id": "3ce0c327ce26b4198470ebd2",
                        "source_type": "pasted_brief"
                      },
                      "value": "We want to build a release validation SaaS for engineering managers"
                    }
                  ],
                  "gaps": [
                    {
                      "category": "auth_billing",
                      "evidence_refs": [
                        {
                          "artifact_id": "c24802c7e63f3806d3d5c7b0",
                          "kind": "segment",
                          "locator": "inline:brief",
                          "segment_index": 2,
                          "snippet": "We want to build a release validation SaaS for engineering managers",
                          "source_id": "3ce0c327ce26b4198470ebd2",
                          "source_type": "pasted_brief"
                        }
                      ],
                      "label": "auth/billing",
                      "summary": "The brief points at a paid or customer-facing product, but auth or billing work is not explicitly covered yet.",
                      "trust_class": "claimed"
                    },
                    {
                      "category": "architecture",
                      "evidence_refs": [
                        {
                          "artifact_id": "c24802c7e63f3806d3d5c7b0",
                          "kind": "segment",
                          "locator": "inline:brief",
                          "segment_index": 2,
                          "snippet": "We want to build a release validation SaaS for engineering managers",
                          "source_id": "3ce0c327ce26b4198470ebd2",
                          "source_type": "pasted_brief"
                        }
                      ],
                      "label": "architecture",
                      "summary": "The brief implies a multi-part system, but the architecture boundary or interaction model is not yet explicit.",
                      "trust_class": "claimed"
                    }
                  ],
                  "gate": {
                    "allows_synthesis": true,
                    "status": "pass"
                  },
                  "insufficiency": {
                    "blocks_synthesis": false,
                    "severity": "none"
                  },
                  "length": {
                    "characters": 321,
                    "hard_limit": 24000,
                    "soft_limit": 10000
                  },
                  "project_state": {
                    "confidence": 0.8,
                    "evidence_refs": [
                      {
                        "artifact_id": "c24802c7e63f3806d3d5c7b0",
                        "kind": "segment",
                        "locator": "inline:brief",
                        "segment_index": 1,
                        "snippet": "Current state: rough PRD and no repo yet",
                        "source_id": "3ce0c327ce26b4198470ebd2",
                        "source_type": "pasted_brief"
                      }
                    ],
                    "reasons": [
                      "Observed facts show specification artifacts or explicit no-repo current state, but no observed implementation surface."
                    ],
                    "state": "spec_only"
                  },
                  "promoted_facts": [
                    {
                      "eligible_for_observed": true,
                      "evidence_refs": [
                        {
                          "artifact_id": "c24802c7e63f3806d3d5c7b0",
                          "kind": "segment",
                          "locator": "inline:brief",
                          "segment_index": 1,
                          "snippet": "Current state: rough PRD and no repo yet",
                          "source_id": "3ce0c327ce26b4198470ebd2",
                          "source_type": "pasted_brief"
                        }
                      ],
                      "promotion_rule": "may_promote_as_observed",
                      "section_key": "current_state",
                      "section_label": "what exists today",
                      "trust_class": "observed",
                      "value": "Current state: rough PRD and no repo yet"
                    },
                    {
                      "eligible_for_observed": false,
                      "evidence_refs": [
                        {
                          "artifact_id": "c24802c7e63f3806d3d5c7b0",
                          "kind": "segment",
                          "locator": "inline:brief",
                          "segment_index": 3,
                          "snippet": "Target user: engineering managers",
                          "source_id": "3ce0c327ce26b4198470ebd2",
                          "source_type": "pasted_brief"
                        }
                      ],
                      "promotion_rule": "intent_only_not_observed",
                      "section_key": "user_customer",
                      "section_label": "who the user/customer is",
                      "trust_class": "claimed",
                      "value": "Target user: engineering managers"
                    }
                  ],
                  "public_control": {
                    "abuse_strike_threshold": 3,
                    "abuse_strikes": 0,
                    "access_tier": "anonymous",
                    "budget_unit_cap": 50,
                    "cooldown_seconds": 300,
                    "daily_limit": 2,
                    "daily_remaining": 1,
                    "daily_used": 1,
                    "turnstile_required": true,
                    "worst_case_draft_cap": 9
                  },
                  "review": {
                    "approval": {
                      "approvable_draft_ids": [
                        "a4a1841d9c53576c8388d8ce"
                      ],
                      "default_selected_draft_ids": [
                        "a4a1841d9c53576c8388d8ce"
                      ],
                      "manual_selection_allowed": true,
                      "notes": [
                        "Dry-run only. This response does not create WOs or write shared project state."
                      ],
                      "suggested_slices": [
                        {
                          "draft_ids": [
                            "a4a1841d9c53576c8388d8ce"
                          ],
                          "key": "all_ready",
                          "label": "All Ready Drafts"
                        }
                      ],
                      "write_path_available": false
                    },
                    "budget": {
                      "artifact_count": 1,
                      "breadth_risk": "medium",
                      "budget_tier": "medium",
                      "estimated_input_tokens": 81,
                      "expected_wo_drafts": 6,
                      "scan_cost_units": 5,
                      "source_types": [
                        "pasted_brief"
                      ],
                      "spar_cost_units": 16,
                      "synthesis_cost_units": 28,
                      "total_cost_units": 49,
                      "worst_case_wo_drafts": 8
                    },
                    "drafts": [
                      {
                        "category": "architecture",
                        "draft_id": "a4a1841d9c53576c8388d8ce",
                        "evidence_refs": [
                          {
                            "artifact_id": "c24802c7e63f3806d3d5c7b0",
                            "kind": "segment",
                            "locator": "inline:brief",
                            "segment_index": 2,
                            "snippet": "We want to build a release validation SaaS for engineering managers",
                            "source_id": "3ce0c327ce26b4198470ebd2",
                            "source_type": "pasted_brief"
                          }
                        ],
                        "gap_label": "architecture",
                        "priority": "P1",
                        "selectable": true,
                        "summary": "Describe the system boundary, major components, interfaces, and data flow before implementation-specific WOs expand.",
                        "title": "Define system architecture and component boundaries",
                        "trust_class": "claimed",
                        "why_this_exists": "The brief implies a multi-part system, but the architecture boundary or interaction model is not yet explicit."
                      }
                    ],
                    "dry_run_only": true,
                    "gaps": [
                      {
                        "category": "architecture",
                        "evidence_refs": [
                          {
                            "artifact_id": "c24802c7e63f3806d3d5c7b0",
                            "kind": "segment",
                            "locator": "inline:brief",
                            "segment_index": 2,
                            "snippet": "We want to build a release validation SaaS for engineering managers",
                            "source_id": "3ce0c327ce26b4198470ebd2",
                            "source_type": "pasted_brief"
                          }
                        ],
                        "label": "architecture",
                        "summary": "The brief implies a multi-part system, but the architecture boundary or interaction model is not yet explicit.",
                        "trust_class": "claimed"
                      }
                    ],
                    "insufficiency": {
                      "blocks_synthesis": false,
                      "severity": "none"
                    },
                    "open_questions": [],
                    "project_state": {
                      "confidence": 0.8,
                      "reasons": [
                        "Observed facts show specification artifacts or explicit no-repo current state, but no observed implementation surface."
                      ],
                      "state": "spec_only"
                    },
                    "replay": {
                      "added": [
                        {
                          "category": "backend",
                          "draft_id": "88d1cb8f843f3a41fd12f5f5",
                          "gap_label": "backend",
                          "priority": "P1",
                          "title": "Define backend execution and data contracts"
                        }
                      ],
                      "assumption_changes": [
                        {
                          "after": "spec_only",
                          "before": "idea_only",
                          "field": "project_state"
                        }
                      ],
                      "calibration": {
                        "assumption_failure_count": 1,
                        "assumption_failures": [
                          {
                            "assumption": "Assumption failed: backend API was already implemented.",
                            "draft_id": "88d1cb8f843f3a41fd12f5f5",
                            "title": "Define backend execution and data contracts",
                            "work_order_id": 632
                          }
                        ],
                        "batch_id": "ab12cd34ef56ab78cd90ef12",
                        "executed_count": 1,
                        "generated_count": 2,
                        "items": [
                          {
                            "draft_id": "a4a1841d9c53576c8388d8ce",
                            "evidence_refs": [
                              "weo_arch_1"
                            ],
                            "outcome": "executed",
                            "status": "done",
                            "title": "Define system architecture and component boundaries",
                            "work_order_id": 631
                          }
                        ],
                        "merged_count": 0,
                        "saved_at": "2026-04-24T09:00:00Z",
                        "skipped_count": 0,
                        "summary": "Genesis execution calibration: 2 generated WOs; 1 executed, 0 merged, 0 skipped, 1 unnecessary, 0 still unknown; 1 assumption failure recorded.",
                        "unknown_count": 0,
                        "unnecessary_count": 1
                      },
                      "has_prior_run": true,
                      "prior_batch_id": "ab12cd34ef56ab78cd90ef12",
                      "prior_saved_at": "2026-04-24T09:00:00Z",
                      "project": "releasecopilot",
                      "reprioritized": [
                        {
                          "after": "P1",
                          "before": "P2",
                          "category": "architecture",
                          "draft_id": "a4a1841d9c53576c8388d8ce",
                          "title": "Define system architecture and component boundaries"
                        }
                      ],
                      "summary": "Genesis replay found 1 added, 1 reprioritized against the prior approved run."
                    },
                    "sequence": {
                      "dependency_graph": [
                        {
                          "category": "architecture",
                          "dependents": [],
                          "depends_on": [],
                          "foundation": true,
                          "mvp_critical": true,
                          "priority": "P1",
                          "title": "Define system architecture and component boundaries"
                        }
                      ],
                      "execution_order": [
                        {
                          "category": "architecture",
                          "foundation": true,
                          "mvp_critical": true,
                          "position": 1,
                          "prerequisites_satisfied": true,
                          "priority": "P1",
                          "title": "Define system architecture and component boundaries"
                        }
                      ],
                      "mvp_path": [
                        "Define system architecture and component boundaries"
                      ],
                      "review_ready": true
                    },
                    "status": "ready",
                    "summary": "Brief cleanly separates current reality from intended scope and is ready for Genesis backlog synthesis."
                  },
                  "save_policy": {
                    "anonymous_export_only": true,
                    "binding_key": "genesis_binding_3bff1de0d6e4273989128c1a",
                    "brief_hash": "3bff1de0d6e4273989128c1a06a7dd70e50c1d29399ea9ecf5fd1bf1033d6f66",
                    "notes": [
                      "Anonymous Genesis is dry-run/export only and cannot create persistent project state.",
                      "Enter an API key or use a session-backed tier to save this Genesis review to the named project."
                    ],
                    "project": "releasecopilot",
                    "requires_project": true,
                    "save_available": false
                  },
                  "score": 92,
                  "sections": [
                    {
                      "basis": "observed",
                      "key": "current_state",
                      "label": "what exists today",
                      "status": "provided"
                    },
                    {
                      "basis": "claimed",
                      "key": "intended_state",
                      "label": "what is only intended",
                      "status": "provided"
                    },
                    {
                      "basis": "claimed",
                      "key": "user_customer",
                      "label": "who the user/customer is",
                      "status": "provided"
                    },
                    {
                      "basis": "claimed",
                      "key": "success_condition",
                      "label": "success condition",
                      "status": "provided"
                    }
                  ],
                  "sequence": {
                    "dependency_graph": [
                      {
                        "category": "product",
                        "dependents": [
                          "Define system architecture and component boundaries"
                        ],
                        "depends_on": [],
                        "foundation": true,
                        "mvp_critical": true,
                        "priority": "P1",
                        "title": "Define product contract and scope boundary"
                      },
                      {
                        "category": "architecture",
                        "dependents": [
                          "Define backend execution and data contracts"
                        ],
                        "depends_on": [
                          "Define product contract and scope boundary"
                        ],
                        "mvp_critical": true,
                        "priority": "P1",
                        "title": "Define system architecture and component boundaries"
                      }
                    ],
                    "execution_order": [
                      {
                        "category": "product",
                        "foundation": true,
                        "mvp_critical": true,
                        "position": 1,
                        "prerequisites_satisfied": true,
                        "priority": "P1",
                        "title": "Define product contract and scope boundary"
                      },
                      {
                        "category": "architecture",
                        "mvp_critical": true,
                        "position": 2,
                        "prerequisites_satisfied": true,
                        "priority": "P1",
                        "title": "Define system architecture and component boundaries"
                      }
                    ],
                    "mvp_path": [
                      "Define product contract and scope boundary",
                      "Define system architecture and component boundaries"
                    ],
                    "review_ready": true
                  },
                  "status": "ready",
                  "summary": "Brief cleanly separates current reality from intended scope and is ready for Genesis backlog synthesis.",
                  "synthesis_ready": true,
                  "wo_drafts": [
                    {
                      "acceptance": [
                        "Architecture decision names the core components and their interaction boundaries.",
                        "Downstream backend, infra, and security work can point at an explicit system contract."
                      ],
                      "deps": [
                        {
                          "category": "product",
                          "rationale": "Architecture should harden around a real user, success target, and scope boundary rather than inferred product intent.",
                          "title": "Define product contract and scope boundary"
                        }
                      ],
                      "draft_id": "a4a1841d9c53576c8388d8ce",
                      "evidence_refs": [
                        {
                          "artifact_id": "c24802c7e63f3806d3d5c7b0",
                          "kind": "segment",
                          "locator": "inline:brief",
                          "segment_index": 2,
                          "snippet": "We want to build a release validation SaaS for engineering managers",
                          "source_id": "3ce0c327ce26b4198470ebd2",
                          "source_type": "pasted_brief"
                        }
                      ],
                      "gap_category": "architecture",
                      "not_in_scope": [
                        "Concrete service implementation or infrastructure provisioning."
                      ],
                      "priority": "P1",
                      "scope": [
                        "Map the major components, integration boundaries, and system responsibilities.",
                        "Define the key data and control flows the later implementation WOs depend on."
                      ],
                      "summary": "Describe the system boundary, major components, interfaces, and data flow before implementation-specific WOs expand.",
                      "title": "Define system architecture and component boundaries"
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/GenesisBriefDoctorResult"
                }
              }
            },
            "description": "Deterministic Genesis brief score and clarification guidance."
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "code": "missing_brief",
                  "error": "brief is required"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Malformed request, invalid project slug, or missing brief."
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "code": "unauthorized",
                  "error": "API key required"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Genesis replay against a named project requires X-VC-Key or a valid session."
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "code": "captcha_failed",
                  "error": "verification failed — please try again"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Anonymous Genesis challenge failed."
          },
          "413": {
            "content": {
              "application/json": {
                "example": {
                  "code": "brief_too_long",
                  "error": "brief exceeds the public Genesis limit of 24000 characters"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Brief exceeds the public Genesis text limit."
          },
          "429": {
            "content": {
              "application/json": {
                "example": {
                  "code": "genesis_rate_limited",
                  "error": "Genesis daily public limit reached for this caller."
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Public Genesis quota, cooldown, or abuse block triggered."
          },
          "502": {
            "content": {
              "application/json": {
                "example": {
                  "code": "genesis_replay_unavailable",
                  "error": "failed to load Genesis replay"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Genesis could not load replay for the requested project."
          }
        },
        "security": [
          {},
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Score a text-only Genesis brief before backlog synthesis",
        "tags": [
          "genesis"
        ]
      }
    },
    "/v1/genesis/save": {
      "post": {
        "description": "Authenticated Genesis save path. Re-runs the deterministic brief doctor server-side and persists the current Genesis dry-run as project-bound shared state without creating work orders. Anonymous callers remain dry-run/export only.",
        "operationId": "postGenesisSave",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "brief": "Current state: rough PRD and no repo yet. We want to build a release validation SaaS for engineering managers. Success means an MVP in 8 weeks. Constraints: two engineers, keep GCP, no mobile app. Runtime: Go API on Cloud Run with Postgres. Out of scope: on-prem. Output depth: sequenced MVP backlog first, then phase 2.",
                "project": "releasecopilot"
              },
              "schema": {
                "$ref": "#/components/schemas/GenesisSaveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "binding_key": "genesis_binding_3bff1de0d6e4273989128c1a",
                  "brief_hash": "3bff1de0d6e4273989128c1a06a7dd70e50c1d29399ea9ecf5fd1bf1033d6f66",
                  "project": "releasecopilot",
                  "saved_at": "2026-04-25T05:00:00Z",
                  "status": "ready",
                  "summary": "Brief cleanly separates current reality from intended scope and is ready for Genesis backlog synthesis.",
                  "synthesis_ready": true
                },
                "schema": {
                  "$ref": "#/components/schemas/GenesisSaveResponse"
                }
              }
            },
            "description": "Genesis dry-run was saved as project-bound shared state."
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "code": "missing_project",
                  "error": "project is required"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Malformed request, invalid project slug, or missing brief."
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "code": "unauthorized",
                  "error": "API key required"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Authenticated Genesis save requires X-VC-Key or a valid session."
          },
          "413": {
            "content": {
              "application/json": {
                "example": {
                  "code": "request_too_large",
                  "error": "Genesis save body is too large"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Genesis save request body exceeded the configured limit."
          },
          "502": {
            "content": {
              "application/json": {
                "example": {
                  "code": "workledger_save_failed",
                  "error": "failed to save Genesis project binding"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Shared workledger save failed."
          },
          "503": {
            "content": {
              "application/json": {
                "example": {
                  "code": "no_workledger",
                  "error": "Genesis shared workledger save path is unavailable"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Shared workledger save path is unavailable in this deployment."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Save a Genesis dry-run as project-bound state",
        "tags": [
          "genesis"
        ]
      }
    },
    "/v1/health": {
      "get": {
        "operationId": "getHealth",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "artifact_gate": {
                    "artifact_missing_rate_per_week": 0,
                    "estimated_saved_usd_week": 0
                  },
                  "status": "healthy"
                },
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            },
            "description": "Service is healthy."
          },
          "503": {
            "content": {
              "application/json": {
                "example": {
                  "artifact_gate": {
                    "artifact_missing_rate_per_week": 0,
                    "estimated_saved_usd_week": 0
                  },
                  "startup_self_test": {
                    "failed": 0,
                    "ok": false,
                    "passed": 2,
                    "warned": 1
                  },
                  "status": "degraded"
                },
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            },
            "description": "Service is degraded by startup self-test warnings."
          }
        },
        "summary": "Check service liveness",
        "tags": [
          "system"
        ]
      }
    },
    "/v1/protocol": {
      "get": {
        "operationId": "getProtocol",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "version": "1.0.0",
                  "max_branches_per_round": 6,
                  "max_splits_per_branch": 2,
                  "max_confidence_gap": 0.4,
                  "confidence_high": 0.8,
                  "confidence_moderate": 0.55,
                  "confidence_cautious": 0.4,
                  "confidence_inconclusive": 0.25,
                  "confidence_floor": 0.3,
                  "entropy_threshold_low": 0.3,
                  "entropy_threshold_high": 1.2,
                  "budget_phase_05": 0.2,
                  "budget_prosecution": 0.5,
                  "budget_post_verdict": 0.15,
                  "budget_censor": 0.3,
                  "budget_reopen": 1,
                  "budget_gate": 0.2,
                  "budget_insights": 0.15,
                  "budget_filing": 0.05,
                  "budget_divergence": 0.02,
                  "budget_delta": 0.01,
                  "budget_counterfactual": 0.03,
                  "parallel_councils": 1,
                  "council_roles": [
                    "Reason from infrastructure constraints first",
                    "Reason from reliability and failure modes first",
                    "Reason from operational economics first"
                  ],
                  "herding_diversity_floor": 0.3,
                  "herding_convergence_ceiling": 0.7,
                  "pdr_floor": 0.15,
                  "anchor_similarity_cap": 0.8,
                  "confidence_spread_floor": 0.1,
                  "max_model_dominance": 0.4,
                  "escalation_enabled": true,
                  "evidence_strong_threshold": 10,
                  "evidence_moderate_threshold": 5,
                  "uncertainty_high_threshold": 0.35,
                  "uncertainty_mod_threshold": 0.15,
                  "promotion_threshold": 10,
                  "promotion_confidence": 0.65
                },
                "schema": {
                  "$ref": "#/components/schemas/ProtocolResponse"
                }
              }
            },
            "description": "Current governance thresholds and budget rules.",
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Inspect the active deliberation protocol",
        "tags": [
          "system"
        ]
      }
    },
    "/v1/submissions/{id}": {
      "get": {
        "operationId": "getSubmission",
        "parameters": [
          {
            "description": "Submission UUID returned by POST /v1/submit.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "case_id": "8c9fef10-9777-4be0-a3e3-d28ba0bc5b99",
                  "completed_at": "2026-04-24T05:02:35Z",
                  "created_at": "2026-04-24T05:00:00Z",
                  "estimate": "~5-8 minutes",
                  "queue_position": 0,
                  "result": {
                    "artifact_id": "6d8d7b9d-4b9a-4566-85b4-76a0ef4e0b12",
                    "body": {
                      "cost": 12.75,
                      "decision": {
                        "chosen_path": "Keep PostgreSQL as the primary path and add Cassandra only behind an isolated retrieval adapter.",
                        "confidence": 0.78,
                        "next_action": "Ship the adapter behind a feature flag and measure retrieval latency on release-validation traffic.",
                        "reversal_conditions": [
                          {
                            "condition": "PostgreSQL retrieval exceeds the latency budget for three consecutive release bundles.",
                            "flips_to": "Promote Cassandra-backed retrieval to primary."
                          }
                        ],
                        "selection_rationale": "The adapter preserves rollback safety while making the retrieval ceiling measurable before a wholesale migration."
                      },
                      "decision_type": "system_design",
                      "decision_types": [
                        "system_design",
                        "tradeoff"
                      ],
                      "duration_seconds": 148.4,
                      "protocol_version": "1.0.0",
                      "question": "Should we keep PostgreSQL-only search or add Cassandra-backed retrieval for release validation verdicts?",
                      "verdict_status": "finalized"
                    },
                    "created_at": "2026-04-24T05:00:00Z",
                    "disclaimer": "This verdict is a structured reasoning artifact, not professional advice. VectorCourt does not provide legal, financial, medical, or other professional advice. You are responsible for your own decisions.",
                    "integrity_hash": "7d6dbfbc4d86dc9aa7bf2f046981f0f7a4e326531bd7684b95fbc5f0d5e30d31",
                    "schema_version": "1.0.0"
                  },
                  "started_at": "2026-04-24T05:00:07Z",
                  "status": "completed",
                  "submission_id": "e4c0c5f9-9f40-4bc1-b6db-b2bc5cb6c6dd",
                  "verdict_url": "/v/8c9fef10-9777-4be0-a3e3-d28ba0bc5b99"
                },
                "schema": {
                  "$ref": "#/components/schemas/SubmissionStatusResponse"
                }
              }
            },
            "description": "Current submission status, optional queue estimate, and final artifact when complete."
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "code": "missing_id",
                  "error": "submission ID is required"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing submission identifier."
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Poll async submission status",
        "tags": [
          "submissions"
        ]
      }
    },
    "/v1/submissions/{id}/stream": {
      "get": {
        "operationId": "streamSubmission",
        "parameters": [
          {
            "description": "Submission UUID returned by POST /v1/submit.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "example": "data: {\"stage\":\"queued\",\"message\":\"Connected to stream\",\"timestamp\":\"2026-04-24T05:00:00Z\",\"final\":false}\n\n",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Event stream. Each `data:` frame is a serialized PipelineEvent JSON object."
          },
          "400": {
            "content": {
              "text/plain": {
                "example": "submission ID required\n",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Missing submission identifier."
          },
          "404": {
            "content": {
              "text/plain": {
                "example": "404 page not found\n",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Submission not found."
          },
          "500": {
            "content": {
              "text/plain": {
                "example": "internal error\n",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Streaming failed."
          },
          "503": {
            "content": {
              "text/plain": {
                "example": "service unavailable\n",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Database is not configured."
          }
        },
        "summary": "Stream async submission progress as server-sent events",
        "tags": [
          "submissions"
        ]
      }
    },
    "/v1/submit": {
      "post": {
        "description": "Queues a submission for background processing and returns URLs for polling and public verdict retrieval. When callback_url is supplied by an authenticated caller, lifecycle callbacks are delivered as signed POSTs for clarification_pending and finalized.",
        "operationId": "postSubmit",
        "parameters": [
          {
            "description": "Optional caller-scoped retry key. Reusing the same key returns the existing async submission instead of queuing duplicate work.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "callback_url": "https://agent.example.com/vectorcourt/callbacks",
                "extended_deliberation": true,
                "filing": {
                  "alternatives": [
                    "PostgreSQL only",
                    "Add Cassandra-backed retrieval"
                  ],
                  "constraints": [
                    "No downtime",
                    "Cloud Run only",
                    "Keep rollback simple"
                  ],
                  "context": "We need production-safe retrieval without breaking the current launch window.",
                  "decision": "Pick the next retrieval architecture for release validation workloads.",
                  "evidence": [
                    "Current pg query plans regress above 1M rows",
                    "Cassandra service already deployed"
                  ],
                  "known_risks": [
                    "Search latency spikes",
                    "Schema drift"
                  ],
                  "success_criteria": "Median retrieval under 300ms with a rollback path inside one deploy."
                },
                "governance": {
                  "decision_authority": {
                    "who_can_close": "Platform maintainer",
                    "who_must_be_consulted": [
                      "Security",
                      "Support"
                    ]
                  },
                  "expected_revalidation_cadence": "90 days",
                  "known_dissent": [
                    {
                      "conditions_under_which_it_would_win": "Measured latency stays below target without Cassandra.",
                      "dissenter": "Operations",
                      "position_summary": "Do not add a second retrieval system before latency is measured.",
                      "why_it_did_not_win": "The filing scopes the rollout behind a reversible launch gate."
                    }
                  ],
                  "proposed_escalation_trigger": [
                    "provider deprecation",
                    "customer audit commitment"
                  ],
                  "regulatory_relevance": {
                    "applies": false,
                    "named_frameworks": [],
                    "notes": "No formal regulated deployment yet; export and audit expectations may apply later."
                  }
                },
                "governance_overlay": true,
                "initial_leaning": "Keep PostgreSQL unless the retrieval ceiling is already visible.",
                "question": "Should we keep PostgreSQL-only search or add Cassandra-backed retrieval for release validation verdicts?"
              },
              "schema": {
                "$ref": "#/components/schemas/ConsultRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "example": {
                  "case_id": "8c9fef10-9777-4be0-a3e3-d28ba0bc5b99",
                  "created_at": "2026-04-24T05:00:00Z",
                  "poll_url": "/v1/submissions/e4c0c5f9-9f40-4bc1-b6db-b2bc5cb6c6dd",
                  "status": "queued",
                  "submission_id": "e4c0c5f9-9f40-4bc1-b6db-b2bc5cb6c6dd",
                  "verdict_url": "/v/8c9fef10-9777-4be0-a3e3-d28ba0bc5b99",
                  "wait_url": "/w/e4c0c5f9-9f40-4bc1-b6db-b2bc5cb6c6dd"
                },
                "schema": {
                  "$ref": "#/components/schemas/SubmitAcceptedResponse"
                }
              }
            },
            "description": "Submission queued successfully.",
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "code": "callback_url_private",
                  "error": "callback_url resolves to a private address"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Malformed request or invalid callback_url."
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "code": "captcha_failed",
                  "error": "verification failed — please try again"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Verification failed or the supplied credential was rejected."
          },
          "422": {
            "$ref": "#/components/responses/ClerkRejection"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedError"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Queue an asynchronous consultation",
        "tags": [
          "consult"
        ]
      }
    }
  },
  "security": [],
  "servers": [
    {
      "description": "Production",
      "url": "https://vectorcourt.com"
    },
    {
      "description": "Local development",
      "url": "http://localhost:8080"
    }
  ],
  "tags": [
    {
      "description": "Machine-readable discovery metadata",
      "name": "discovery"
    },
    {
      "description": "Synchronous and asynchronous verdict intake",
      "name": "consult"
    },
    {
      "description": "Project-backlog reconstruction dry-runs",
      "name": "genesis"
    },
    {
      "description": "Async submission polling and progress streaming",
      "name": "submissions"
    },
    {
      "description": "Stored verdict retrieval",
      "name": "cases"
    },
    {
      "description": "Health and protocol inspection",
      "name": "system"
    },
    {
      "description": "Operator-only telemetry and diagnostics",
      "name": "admin"
    }
  ]
}
