{"openapi":"3.1.0","info":{"title":"DefendableCloud API","description":"Hosted Proof of Execution for agentic work. Create a Run, attach evidence, run verification checks, approve, and issue a hash-chained receipt — JSON + PDF, stored and shareable. To the shed.","version":"0.1.0"},"paths":{"/healthz":{"get":{"tags":["health"],"summary":"Healthz","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthOut"}}}}}}},"/auth/request":{"post":{"tags":["auth"],"summary":"Magic Request","operationId":"magic_request_auth_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicRequestIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/verify":{"post":{"tags":["auth"],"summary":"Magic Verify","operationId":"magic_verify_auth_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicVerifyIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"tags":["auth"],"summary":"Me","operationId":"me_auth_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/org":{"get":{"tags":["org"],"summary":"Get Org","description":"Org info + light stats for the client dashboard.","operationId":"get_org_org_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Org"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/org/api-keys":{"get":{"tags":["org"],"summary":"List Api Keys","operationId":"list_api_keys_org_api_keys_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["org"],"summary":"Create Api Key","description":"Mint a new API key. The plaintext `secret` is returned ONCE here and never again.\n\nRefuses to mint when the caller's principal is itself an API key — only a\nsigned-in human (JWT) can issue keys. That's the trust boundary: API keys\ncan do work, they can't issue more keys.","operationId":"create_api_key_org_api_keys_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/org/api-keys/{key_id}":{"delete":{"tags":["org"],"summary":"Revoke Api Key","description":"Revoke (soft delete) an API key. Sets revoked_at; the row stays for audit.","operationId":"revoke_api_key_org_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/org/usage":{"get":{"tags":["org"],"summary":"Get Usage","description":"Org-level usage. Placeholder for metered billing in Phase 5.","operationId":"get_usage_org_usage_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageStats"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/membership":{"get":{"tags":["membership"],"summary":"Get Membership","description":"Current org's membership state. Always returns a Membership — `pending`\nis the default for orgs that have never applied.","operationId":"get_membership_membership_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Membership"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/membership/apply":{"post":{"tags":["membership"],"summary":"Apply For Membership","description":"Submit a membership application.\n\nRefuses to re-apply over an already-decided state (active / waitlisted /\ninactive). If the cap is full when the application lands, the org enters\nthe waitlist rather than the pending queue — surfaced as `waitlisted` so\nthe applicant knows they're behind a line.\n\nSends an email to build@defendableos.com (or settings.membership_review_email)\nfor human review. Approval happens manually until an admin endpoint lands.","operationId":"apply_for_membership_membership_apply_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipApplicationIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Membership"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/membership/approve":{"post":{"tags":["membership"],"summary":"Approve Membership","description":"Admin endpoint · flip a pending application to `approved`.\n\nGated by `INTERNAL_API_KEY` (`X-Internal-Key`) since the operator surface\nis the same one the rails-side stager uses — fail-closed without it.\nOnce approved, the member can hit /membership/checkout to pay the\nannual $100 and land on `active`.\n\nThe in-app Admin Approval UI uses /admin/applications/{slug}/approve\ninstead, which is gated by ADMIN_EMAILS rather than X-Internal-Key.\nBoth paths share the same _approve_org_by_slug helper so the cap-race\nbehavior stays identical.","operationId":"approve_membership_membership_approve_post","parameters":[{"name":"X-Internal-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipApproveIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Membership"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/membership/checkout":{"post":{"tags":["membership"],"summary":"Create Checkout Session","description":"Create a Stripe Checkout Session for the $100/yr one-time payment.\n\nOnly orgs in `approved` state can check out · this matches the doctrine\nlocked 2026-05-28: apply → admin approves → pay → active. Already-active\nmembers get a 409 (no double-purchase). Pending/waitlisted get a 403 with\nthe reason so the UI can route them.\n\nReturns the Stripe-hosted checkout URL; the frontend redirects there.\nSuccess / cancel routes back to /org via STRIPE_SUCCESS_PATH /\nSTRIPE_CANCEL_PATH (defaults in config).","operationId":"create_checkout_session_membership_checkout_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/MembershipCheckoutIn"},{"type":"null"}],"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipCheckoutOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects":{"post":{"tags":["projects"],"summary":"Create Project","operationId":"create_project_projects_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["projects"],"summary":"List Projects","operationId":"list_projects_projects_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent-profiles":{"get":{"tags":["agent-profiles"],"summary":"List Profiles","operationId":"list_profiles_agent_profiles_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["agent-profiles"],"summary":"Create Profile","operationId":"create_profile_agent_profiles_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProfileIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent-profiles/{profile_id}":{"get":{"tags":["agent-profiles"],"summary":"Get Profile","operationId":"get_profile_agent_profiles__profile_id__get","parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/stack-planner/options":{"get":{"tags":["agent-profiles"],"summary":"Stack Options","operationId":"stack_options_stack_planner_options_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/stack-assessment":{"post":{"tags":["agent-profiles"],"summary":"Stack Assessment","operationId":"stack_assessment_stack_assessment_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAssessmentIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/incidents":{"get":{"tags":["incidents"],"summary":"List Incidents","operationId":"list_incidents_incidents_get","parameters":[{"name":"agent_profile_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Profile Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["incidents"],"summary":"Open Incident","operationId":"open_incident_incidents_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/incidents/{incident_id}":{"patch":{"tags":["incidents"],"summary":"Resolve Incident","operationId":"resolve_incident_incidents__incident_id__patch","parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"string","title":"Incident Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"default":{},"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/incidents/{incident_id}/receipt":{"post":{"tags":["incidents"],"summary":"Incident Receipt","operationId":"incident_receipt_incidents__incident_id__receipt_post","parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"string","title":"Incident Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent-profiles/{profile_id}/watchdog":{"post":{"tags":["incidents"],"summary":"Watchdog Scan","description":"Deterministic ops pass: a lane with recurring critical flags (blocked) gets\nlocked and an incident opened — straight from the capability profile, no telemetry.","operationId":"watchdog_scan_agent_profiles__profile_id__watchdog_post","parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs":{"post":{"tags":["runs"],"summary":"Create Run","operationId":"create_run_runs_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["runs"],"summary":"List Runs","operationId":"list_runs_runs_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/{run_id}":{"get":{"tags":["runs"],"summary":"Get Run","operationId":"get_run_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/{run_id}/evidence":{"post":{"tags":["runs"],"summary":"Add Evidence","operationId":"add_evidence_runs__run_id__evidence_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvidenceIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/{run_id}/evidence/upload":{"post":{"tags":["runs"],"summary":"Upload Evidence","operationId":"upload_evidence_runs__run_id__evidence_upload_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_evidence_runs__run_id__evidence_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/{run_id}/submission":{"get":{"tags":["runs"],"summary":"Get Run Submission","description":"The agent's structured output for this Run. 404 if no submission yet.","operationId":"get_run_submission_runs__run_id__submission_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Submission"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["eval"],"summary":"Add Submission","operationId":"add_submission_runs__run_id__submission_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/{run_id}/checks":{"get":{"tags":["runs"],"summary":"Get Run Checks","description":"All applied rules for this Run — each one passes or raises a flag.\n\nThe referee is a rulebook engine. Clients filter by `status` for findings;\nsort by `category` for the three-bucket repair plan (math/schema/structure/\nevidence = work-defect; policy = deal-finding).","operationId":"get_run_checks_runs__run_id__checks_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChecksList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["runs"],"summary":"Run Run Checks","operationId":"run_run_checks_runs__run_id__checks_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/{run_id}/flags":{"get":{"tags":["runs"],"summary":"Get Run Flags","description":"The subset of checks with `status='flag'` — the thrown flags.\n\nEach item is a `Finding` (a located defect). Use `category` to sort into\nthe three-bucket repair plan; use `severity` to rank.","operationId":"get_run_flags_runs__run_id__flags_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagsList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/{run_id}/verdict":{"get":{"tags":["runs"],"summary":"Get Run Verdict","description":"The latest deterministic verdict — score is % of declared rules satisfied, weighted by tier. 404 if not yet computed.","operationId":"get_run_verdict_runs__run_id__verdict_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verdict"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/{run_id}/approve":{"post":{"tags":["runs"],"summary":"Approve Run","operationId":"approve_run_runs__run_id__approve_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Approval"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/{run_id}/receipt":{"post":{"tags":["runs"],"summary":"Generate Receipt","operationId":"generate_receipt_runs__run_id__receipt_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Receipt"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/flight-sheets":{"get":{"tags":["eval"],"summary":"List Flight Sheets","operationId":"list_flight_sheets_flight_sheets_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlightSheetList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/{run_id}/audit":{"post":{"tags":["eval"],"summary":"Run Audit","operationId":"run_audit_runs__run_id__audit_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/{run_id}/checks/{check_id}":{"patch":{"tags":["eval"],"summary":"Grade Check","operationId":"grade_check_runs__run_id__checks__check_id__patch","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"check_id","in":"path","required":true,"schema":{"type":"string","title":"Check Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/{run_id}/findings":{"post":{"tags":["eval"],"summary":"Finalize Findings","operationId":"finalize_findings_runs__run_id__findings_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/datasets":{"get":{"tags":["datasets"],"summary":"List Datasets","operationId":"list_datasets_datasets_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/datasets/catalog":{"get":{"tags":["datasets"],"summary":"Get Catalog","description":"The full members-only catalog — scorecard, vertical roll-up, all packages.\n\nCarries the source `catalog_sha256` and our `packages_sha256` so members\ncan recompute and confirm the mirror matches the NAS books-and-records.","operationId":"get_catalog_datasets_catalog_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetCatalog"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/datasets/catalog/{slug}":{"get":{"tags":["datasets"],"summary":"Get Package","description":"Single package by slug — identity + pair count + deed status.","operationId":"get_package_datasets_catalog__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetPackage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/datasets/catalog/{slug}/download":{"post":{"tags":["datasets"],"summary":"Request Download","description":"Mint a download receipt and return a fresh download URL for a package.\n\nThe receipt rides the per-org hash chain alongside eval/cook/incident\nreceipts (same `Receipt` model, distinct `schema` field). If the file is\nnot yet staged in Tigris, `ready=False` is sealed into the receipt; the\nmember can re-request anytime to get a fresh download URL once the file\nis staged. Re-requests mint NEW receipts — every access leaves a trail.","operationId":"request_download_datasets_catalog__slug__download_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/DatasetDownloadRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetDownloadGrant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/datasets/catalog/{slug}/samples":{"get":{"tags":["datasets"],"summary":"Get Samples","description":"Cheap sample preview from the staged Tigris object · for the public\nshare view's \"crystal clear\" rendering.\n\nReads a small byte range from the dataset's staged Tigris object,\nparses the first N JSONL rows, and returns them with file metadata\n(size, etag, content-length). Capped at 50 rows to keep the payload\ntile-shaped.\n\nBehavior:\n  - object not staged → 425 Too Early with Retry-After hint (member\n    triggers staging via POST /datasets/catalog/{slug}/download)\n  - object staged → 200 with {rows, count, file_bytes, sha256_or_etag}","operationId":"get_samples_datasets_catalog__slug__samples_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/catalog":{"get":{"tags":["models"],"summary":"Get Catalog","description":"The full members-only model card library — scorecard + cards.\n\nCarries `models_sha256` so members can recompute and confirm the API\nmirror matches the books-and-records source.","operationId":"get_catalog_models_catalog_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelCatalog"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/catalog/{slug}":{"get":{"tags":["models"],"summary":"Get Card","description":"Single model card by slug — identity + base + params + card hash.","operationId":"get_card_models_catalog__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelCard"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/catalog/{slug}/pin":{"post":{"tags":["models"],"summary":"Pin Card","description":"Pin a model card on the per-org chain.\n\nSeals the model's slug + name + base + params + card hash at THIS instant.\nThe card body in the catalog can evolve later; the receipt remembers the\nexact card_sha256 the member declared on this date.\n\nThe member's optional declaration + client_ref are stored as-is in the\nreceipt payload — useful for \"agent A on deal X\" annotation. The receipt\nis shareable via /share/{token} like all other receipts.","operationId":"pin_card_models_catalog__slug__pin_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ModelPinRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelPinReceiptOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/{run_id}/cook":{"post":{"tags":["cooks"],"summary":"Request Cook","operationId":"request_cook_runs__run_id__cook_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CookRequestIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/cooks/{cook_id}":{"get":{"tags":["cooks"],"summary":"Get Cook","operationId":"get_cook_cooks__cook_id__get","parameters":[{"name":"cook_id","in":"path","required":true,"schema":{"type":"string","title":"Cook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/cooks":{"get":{"tags":["cooks"],"summary":"List Cooks","operationId":"list_cooks_cooks_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runner/cooks/next":{"post":{"tags":["runner"],"summary":"Claim Next","description":"The rig claims the oldest queued cook. Returns the job + what to train on.","operationId":"claim_next_runner_cooks_next_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunnerClaimIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runner/cooks/{cook_id}/status":{"post":{"tags":["runner"],"summary":"Update Status","operationId":"update_status_runner_cooks__cook_id__status_post","parameters":[{"name":"cook_id","in":"path","required":true,"schema":{"type":"string","title":"Cook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunnerStatusIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runner/cooks/{cook_id}/complete":{"post":{"tags":["runner"],"summary":"Complete","operationId":"complete_runner_cooks__cook_id__complete_post","parameters":[{"name":"cook_id","in":"path","required":true,"schema":{"type":"string","title":"Cook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunnerCompleteIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runner/cooks/{cook_id}/fail":{"post":{"tags":["runner"],"summary":"Fail","operationId":"fail_runner_cooks__cook_id__fail_post","parameters":[{"name":"cook_id","in":"path","required":true,"schema":{"type":"string","title":"Cook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunnerFailIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/share/{token}":{"get":{"tags":["public"],"summary":"Public Receipt","operationId":"public_receipt_share__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicReceipt"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/share/{token}/download":{"get":{"tags":["public"],"summary":"Public Receipt Download","description":"Indirect through a dataset-download receipt to a fresh Tigris signed URL.\n\nWorks only for receipts whose `schema` is `defendablecloud.dataset-download-receipt/v1`.\nFor any other receipt, returns 404 (the share token isn't a download grant).\n\nBehavior:\n  - receipt not found / wrong schema → 404\n  - grant expired → 410 Gone\n  - object not yet staged in Tigris → 425 Too Early (Retry-After hint)\n  - all good → 302 to a fresh signed URL (TTL = 15 min)","operationId":"public_receipt_download_share__token__download_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/share/{token}/pdf":{"get":{"tags":["public"],"summary":"Public Receipt Pdf","operationId":"public_receipt_pdf_share__token__pdf_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ledger":{"get":{"tags":["public"],"summary":"List Ledger","description":"List the per-org hash chain in `org_seq` order — chain coordinates only,\nno payload. The chain bytes for any single entry are at `/share/{token}`.","operationId":"list_ledger_ledger_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ledger/verify":{"get":{"tags":["public"],"summary":"Verify Ledger","operationId":"verify_ledger_ledger_verify_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerVerifyResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/policy/training-data":{"get":{"tags":["policy"],"summary":"Get Training Data Policy","description":"The frozen doctrine — what enters and never enters the training corpus.\n\nNo auth required. The brand promise is readable by anyone.","operationId":"get_training_data_policy_policy_training_data_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingDataPolicy"}}}}}}},"/internal/staging-tasks":{"get":{"tags":["internal"],"summary":"Staging Tasks","description":"Return the unique pending `tigris_key` set across all members.\n\nA key is \"pending\" if at least one receipt with that key was minted with\n`ready_at_grant=false`. The rails worker is the only consumer; it\ndeduplicates across members so we only rsync each file once.","operationId":"staging_tasks_internal_staging_tasks_get","parameters":[{"name":"X-Internal-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StagingTaskList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/stage-complete":{"post":{"tags":["internal"],"summary":"Stage Complete","description":"Confirm a file is staged in Tigris and notify every pending member.\n\nIdempotent. Calling twice for the same key:\n  first call  → emails sent · download_notifications rows inserted\n  second call → already_notified == receipts_matched · notified == 0","operationId":"stage_complete_internal_stage_complete_post","parameters":[{"name":"X-Internal-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StageCompleteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StageCompleteResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/receipts/recent":{"get":{"tags":["receipts"],"summary":"Recent","description":"Return the N most recent receipts on the calling org's chain.\n\n`schema` is an optional exact-match filter. We index `created_at` per\nreceipt so this query is cheap even at the high end of the lane (50).\nEach row is a compact rollup: identity + share URL + schema-aware\nsummary projected from the payload.","operationId":"recent_receipts_recent_get","parameters":[{"name":"schema","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional exact-match schema filter, e.g. defendablecloud.model-pin-receipt/v1.","title":"Schema"},"description":"Optional exact-match schema filter, e.g. defendablecloud.model-pin-receipt/v1."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptRollupList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/stripe/webhook":{"post":{"tags":["stripe"],"summary":"Stripe Webhook","operationId":"stripe_webhook_stripe_webhook_post","parameters":[{"name":"Stripe-Signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/applications":{"get":{"tags":["admin"],"summary":"List Applications","description":"Return all pending + waitlisted applications, oldest-first.\n\nEach row carries enough for the operator to make an approve / hold\ndecision without a second fetch: org identity, applicant email\n(joined via the owner User row), the application body, and the\nwaitlist position when applicable.","operationId":"list_applications_admin_applications_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminApplicationList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/applications/{slug}/approve":{"post":{"tags":["admin"],"summary":"Approve Application","description":"Flip a pending or waitlisted application to `approved`.\n\nShares the cap-race-aware helper with /membership/approve. Caller is the\nin-app Admin UI; the X-Internal-Key path remains for scripts.","operationId":"approve_application_admin_applications__slug__approve_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Membership"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/health":{"get":{"tags":["admin"],"summary":"Admin Health","description":"Quick sanity check for the Admin UI · confirms the JWT is admin-grade.\nReturns the calling email so the operator can verify they're acting as\nthe right account.","operationId":"admin_health_admin_health_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AdminApplicationList":{"properties":{"applications":{"items":{"$ref":"#/components/schemas/AdminApplicationRow"},"type":"array","title":"Applications"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["applications","count"],"title":"AdminApplicationList","description":"`GET /admin/applications` response."},"AdminApplicationRow":{"properties":{"org_id":{"type":"string","title":"Org Id"},"org_slug":{"type":"string","title":"Org Slug"},"org_name":{"type":"string","title":"Org Name"},"applicant_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Applicant Email"},"status":{"type":"string","title":"Status","description":"`pending` or `waitlisted`."},"applied_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Applied At"},"waitlist_position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Waitlist Position"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"intended_use":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intended Use"},"referral_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referral Source"}},"additionalProperties":true,"type":"object","required":["org_id","org_slug","org_name","status"],"title":"AdminApplicationRow","description":"One row in the Admin Approval UI queue."},"AgentProfileIn":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"harness":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Harness"},"harness_version":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Harness Version"},"model":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Model"},"model_provider":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Model Provider"},"served_by":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Served By"},"runtime_host":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Runtime Host"},"runtime_os":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Runtime Os"},"runtime_hardware":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}],"title":"Runtime Hardware"},"tools":{"items":{"type":"string"},"type":"array","title":"Tools"},"context_window":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Context Window"},"capability_tier":{"anyOf":[{"type":"string","enum":["edge","small","mid","frontier"]},{"type":"null"}],"title":"Capability Tier"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"},"governance":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Governance"}},"type":"object","required":["name"],"title":"AgentProfileIn"},"ApiKey":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"key_prefix":{"type":"string","title":"Key Prefix","description":"The first 12 characters of the key — safe to display."},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"},"revoked":{"type":"boolean","title":"Revoked","default":false}},"type":"object","required":["id","name","key_prefix"],"title":"ApiKey","description":"A redacted view of an API key. NO secret — the secret only ships once,\ninside `ApiKeyCreated` on the POST response. After that, only the short\n`key_prefix` is shown for display."},"ApiKeyCreated":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"key_prefix":{"type":"string","title":"Key Prefix"},"secret":{"type":"string","title":"Secret","description":"The full API key in plaintext. Format `dc_<random>`. SAVE IT NOW — this is the only time the secret is returned. Lost keys must be revoked + recreated."},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","name","key_prefix","secret"],"title":"ApiKeyCreated","description":"`POST /org/api-keys` response — returned ONCE on creation. The plaintext\n`secret` is never shown again; subsequent reads return `ApiKey` (no secret)."},"ApiKeyIn":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"ApiKeyIn","description":"`POST /org/api-keys` body — name the key for human discovery."},"ApiKeyList":{"properties":{"api_keys":{"items":{"$ref":"#/components/schemas/ApiKey"},"type":"array","title":"Api Keys"}},"type":"object","required":["api_keys"],"title":"ApiKeyList","description":"`GET /org/api-keys`"},"Approval":{"properties":{"decision":{"type":"string","enum":["approved","rejected","escalated"],"title":"Decision"},"approver_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approver Email"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["decision"],"title":"Approval","description":"The human approval gate for a Run. Receipts only mint on `decision='approved'`."},"ApprovalIn":{"properties":{"decision":{"type":"string","enum":["approved","rejected","escalated"],"title":"Decision"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["decision"],"title":"ApprovalIn"},"Body_upload_evidence_runs__run_id__evidence_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"}},"type":"object","required":["file"],"title":"Body_upload_evidence_runs__run_id__evidence_upload_post"},"Check":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"check_key":{"type":"string","title":"Check Key"},"label":{"type":"string","title":"Label"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"structure | schema | math | evidence | policy (may be empty on legacy rows)."},"status":{"type":"string","enum":["pass","flag","open","skip"],"title":"Status"},"severity":{"anyOf":[{"type":"string","enum":["high","mid","medium","low","critical","noncritical","honey","jelly","propolis","minor"]},{"type":"null"}],"title":"Severity","description":"The *rule's* declared pre-weight. tier_of() normalizes to TierLevel."},"source":{"anyOf":[{"type":"string","enum":["auto","operator"]},{"type":"null"}],"title":"Source"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"}},"additionalProperties":true,"type":"object","required":["check_key","label","status"],"title":"Check","description":"One applied rule from the rulebook engine.\n\nEach rule passes or raises a flag. There is no opinion grade. `status` is\nthe deterministic outcome; `severity` and `category` come from the rule's\ndeclaration on the Flight Sheet.\n\n`severity` here is the *rule's* pre-weight (a `RuleSeverity`), NOT the\nverdict severity (which is honey/jelly/propolis — see `Severity` and\n`Verdict.severity`). The rolled-up verdict severity is computed by\n`compute_verdict()` from all the flag-status checks on the Run."},"ChecksList":{"properties":{"checks":{"items":{"$ref":"#/components/schemas/Check"},"type":"array","title":"Checks"}},"type":"object","required":["checks"],"title":"ChecksList","description":"`GET /runs/{id}/checks` wrapper — all applied rules for a Run, in author order."},"CookRequestIn":{"properties":{"dataset_id":{"type":"string","title":"Dataset Id"},"base_model":{"type":"string","title":"Base Model","default":"swarm/curator-9b"}},"type":"object","required":["dataset_id"],"title":"CookRequestIn"},"DatasetCatalog":{"properties":{"version":{"type":"string","title":"Version","description":"Catalog snapshot version. Updates ship a new deploy."},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"},"filter_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filter Version"},"catalog_sha256":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Catalog Sha256","description":"SHA-256 of the catalog as published on /mnt/swarm/CATALOG.md (source-of-truth header)."},"packages_sha256":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Packages Sha256","description":"SHA-256 over the canonical sorted packages list. Recompute to verify."},"anchor":{"anyOf":[{"$ref":"#/components/schemas/DatasetCatalogAnchor"},{"type":"null"}]},"scorecard":{"$ref":"#/components/schemas/DatasetCatalogScorecard"},"verticals":{"additionalProperties":{"$ref":"#/components/schemas/DatasetCatalogVertical"},"type":"object","title":"Verticals"},"packages":{"items":{"$ref":"#/components/schemas/DatasetPackage"},"type":"array","title":"Packages"}},"additionalProperties":true,"type":"object","required":["version","scorecard","verticals","packages"],"title":"DatasetCatalog","description":"`GET /datasets/catalog` — the members-only library view of the corpus.\n\nCarries the catalog's own SHA-256 (from the NAS source) plus the packages'\ncanonical-list SHA-256 (computed over the sorted package list). A member can\nfetch this, recompute the packages hash from the response, and confirm the\nAPI mirror matches the books-and-records source."},"DatasetCatalogAnchor":{"properties":{"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hash"}},"type":"object","title":"DatasetCatalogAnchor","description":"The catalog's anchor stamp — `grand_root_v2` label + hash from CATALOG.md."},"DatasetCatalogScorecard":{"properties":{"total_packages":{"type":"integer","title":"Total Packages"},"total_pairs":{"type":"integer","title":"Total Pairs"},"priced_packages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priced Packages"},"deed_anchored":{"type":"integer","title":"Deed Anchored"},"total_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Usd","description":"Internal valuation only — surfaced for books-and-records transparency. Datasets are FREE with membership; this isn't a customer-facing price."}},"additionalProperties":true,"type":"object","required":["total_packages","total_pairs","deed_anchored"],"title":"DatasetCatalogScorecard","description":"Top-level totals from the catalog header — Total packages · Total pairs ·\nDeed-anchored count. Mirrors what's in CATALOG.md's `Sale-Ready Scorecard`."},"DatasetCatalogVertical":{"properties":{"packages":{"type":"integer","title":"Packages"},"pairs":{"type":"integer","title":"Pairs"},"usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Usd"}},"additionalProperties":true,"type":"object","required":["packages","pairs"],"title":"DatasetCatalogVertical","description":"Per-vertical roll-up — packages + pairs + (internal) $ rollup."},"DatasetDownloadGrant":{"properties":{"receipt_id":{"type":"string","title":"Receipt Id"},"org_seq":{"type":"integer","title":"Org Seq"},"receipt_sha256":{"type":"string","title":"Receipt Sha256"},"share_url":{"type":"string","title":"Share Url","description":"Public proof page for the grant — the receipt anyone can verify."},"download_url":{"type":"string","title":"Download Url","description":"Operational handle. GET this URL → 302 to a fresh Tigris signed URL when ready, or 425 with Retry-After when still staging."},"ready":{"type":"boolean","title":"Ready","description":"True when the file is staged in Tigris. False = preparing; retry later."},"expires_at":{"type":"string","title":"Expires At","description":"ISO timestamp · the signed-URL TTL end. Receipts themselves never expire."},"package":{"$ref":"#/components/schemas/DatasetDownloadPackage"}},"type":"object","required":["receipt_id","org_seq","receipt_sha256","share_url","download_url","ready","expires_at","package"],"title":"DatasetDownloadGrant","description":"`POST /datasets/catalog/{slug}/download` response.\n\nThe receipt is the books-and-records artifact (per-org hash chain, JSON +\nPDF, shareable). The download_url is operational — it's an indirection\nthrough `GET /share/{token}/download` which 302s to a fresh Tigris signed\nURL each access. When `ready=False` the file isn't yet staged in our\ndownload bucket; the receipt still mints and the member can re-request a\nfresh URL anytime via the same share token."},"DatasetDownloadPackage":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"vertical":{"type":"string","title":"Vertical"},"tier":{"type":"string","title":"Tier"},"pkg_class":{"type":"string","title":"Pkg Class"},"pairs":{"type":"integer","title":"Pairs"},"deed_anchored":{"type":"boolean","title":"Deed Anchored"}},"additionalProperties":true,"type":"object","required":["slug","name","vertical","tier","pkg_class","pairs","deed_anchored"],"title":"DatasetDownloadPackage","description":"The package identity sealed into the download receipt."},"DatasetDownloadRequest":{"properties":{"expires_in_hours":{"type":"integer","maximum":168.0,"minimum":1.0,"title":"Expires In Hours","default":24}},"type":"object","title":"DatasetDownloadRequest","description":"`POST /datasets/catalog/{slug}/download` body — optional TTL override.\n\nDefaults to 24 hours; capped at 7 days to keep signed URLs short-lived.\nThe receipt itself is permanent; only the operational signed URL TTL is\nbounded."},"DatasetPackage":{"properties":{"slug":{"type":"string","title":"Slug","description":"Stable identifier · `<vertical>_<name-slug>` form."},"name":{"type":"string","title":"Name"},"vertical":{"type":"string","title":"Vertical","description":"One of: cre · medical · grants · jelly · signal · capital-markets · bee-hive · legal · finance · aviation · openalex · failure"},"tier":{"type":"string","title":"Tier","description":"Maturity tier · e.g. honey · canonical · master · royal_jelly · train · mixed · propolis · eval"},"pkg_class":{"type":"string","title":"Pkg Class","description":"Package class · e.g. Premium · Expert · Specialist · Taste"},"pairs":{"type":"integer","title":"Pairs","description":"Count of training pairs in the package."},"deed_anchored":{"type":"boolean","title":"Deed Anchored","description":"True when the package has a local Merkle deed-anchor on the NAS."},"deed":{"type":"string","title":"Deed","description":"Raw deed status · `none` or `anchored_local` or other."}},"additionalProperties":true,"type":"object","required":["slug","name","vertical","tier","pkg_class","pairs","deed_anchored","deed"],"title":"DatasetPackage","description":"A single dataset package in the library. Identity + counts + provenance,\nnever the on-disk path or our internal valuation."},"EvidenceIn":{"properties":{"kind":{"type":"string","enum":["file","note","url","observation","tool_output","model_output","log"],"title":"Kind","default":"note"},"label":{"type":"string","maxLength":300,"minLength":1,"title":"Label"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"}},"type":"object","required":["label"],"title":"EvidenceIn"},"Finding":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"check_key":{"type":"string","title":"Check Key"},"label":{"type":"string","title":"Label"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"structure | schema | math | evidence | policy (may be empty on legacy rows)."},"status":{"type":"string","enum":["pass","flag","open","skip"],"title":"Status"},"severity":{"anyOf":[{"type":"string","enum":["high","mid","medium","low","critical","noncritical","honey","jelly","propolis","minor"]},{"type":"null"}],"title":"Severity","description":"The *rule's* declared pre-weight. tier_of() normalizes to TierLevel."},"source":{"anyOf":[{"type":"string","enum":["auto","operator"]},{"type":"null"}],"title":"Source"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"}},"additionalProperties":true,"type":"object","required":["check_key","label","status"],"title":"Finding","description":"A `Check` whose status is `flag`.\n\nDistinct named type so the doctrine surfaces in OpenAPI: a *finding* is a\n*located defect*, sorted into one of three buckets by `category`:\n    work-defect  → math / schema / structure / evidence  (correct & resubmit)\n    deal-finding → policy                                 (the math is right; the rule says no)\n    stack-fit    → attributed by the run's agent_profile capability tier"},"FlagsList":{"properties":{"flags":{"items":{"$ref":"#/components/schemas/Finding"},"type":"array","title":"Flags"}},"type":"object","required":["flags"],"title":"FlagsList","description":"`GET /runs/{id}/flags` wrapper — the subset of checks with status='flag'.\n\nEach item is a `Finding` — a located defect. Clients sort into the three\nbuckets via the `category` field (work-defect: math/schema/structure/evidence;\ndeal-finding: policy; stack-fit: attributed by the Run's agent_profile tier)."},"FlightSheet":{"properties":{"id":{"type":"string","title":"Id"},"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"version":{"type":"string","title":"Version"},"lane":{"type":"string","enum":["agent","dataset","compute","other"],"title":"Lane"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"purpose":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purpose"},"assignment_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment Instructions"},"required_inputs":{"items":{"type":"string"},"type":"array","title":"Required Inputs"},"expected_outputs":{"items":{"type":"string"},"type":"array","title":"Expected Outputs"},"audit_checks":{"items":{"$ref":"#/components/schemas/FlightSheetRule"},"type":"array","title":"Audit Checks"},"pass_threshold":{"type":"integer","title":"Pass Threshold"},"fail_threshold":{"type":"integer","title":"Fail Threshold"}},"additionalProperties":true,"type":"object","required":["id","slug","name","version","lane","pass_threshold","fail_threshold"],"title":"FlightSheet","description":"The declared rulebook for an Eval Run lane. Source of truth = `flight_sheet_out()`."},"FlightSheetList":{"properties":{"flight_sheets":{"items":{"$ref":"#/components/schemas/FlightSheet"},"type":"array","title":"Flight Sheets"}},"type":"object","required":["flight_sheets"],"title":"FlightSheetList","description":"`GET /flight-sheets` wrapper."},"FlightSheetRule":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"kind":{"anyOf":[{"type":"string","enum":["auto","checklist"]},{"type":"null"}],"title":"Kind"},"severity":{"anyOf":[{"type":"string","enum":["high","mid","medium","low","critical","noncritical","honey","jelly","propolis","minor"]},{"type":"null"}],"title":"Severity","description":"The rule's pre-weight. `tier_of()` normalizes any RuleSeverity value to a TierLevel (low/mid/high). Wire-locked to the RuleSeverity literal so a Flight Sheet authoring drift surfaces at the contract boundary."}},"additionalProperties":true,"type":"object","required":["key","label"],"title":"FlightSheetRule","description":"A single rule on a Flight Sheet. The flight sheet's `audit_checks[]`."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthOut":{"properties":{"ok":{"type":"boolean","title":"Ok"},"service":{"type":"string","title":"Service"},"version":{"type":"string","title":"Version"},"db":{"type":"boolean","title":"Db"},"storage":{"type":"boolean","title":"Storage"},"email_configured":{"type":"boolean","title":"Email Configured"},"bucket":{"type":"string","title":"Bucket"}},"type":"object","required":["ok","service","version","db","storage","email_configured","bucket"],"title":"HealthOut"},"IncidentIn":{"properties":{"agent_profile_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Profile Id"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"kind":{"type":"string","enum":["rogue","dark","policy_violation","recurring_flag"],"title":"Kind","default":"policy_violation"},"tier":{"anyOf":[{"type":"string","enum":["low","mid","high"]},{"type":"null"}],"title":"Tier","default":"high"},"title":{"type":"string","maxLength":300,"minLength":1,"title":"Title"},"detail":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Detail"},"lane":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Lane"},"response":{"items":{"type":"string"},"type":"array","title":"Response"}},"type":"object","required":["title"],"title":"IncidentIn","description":"Open an operational-state incident against an agent profile or Run.\n\nSee `IncidentKind` for the closed taxonomy (rogue | dark | policy_violation |\nrecurring_flag) and why a single flag is intentionally not its own member."},"LedgerEntry":{"properties":{"receipt_id":{"type":"string","title":"Receipt Id"},"org_seq":{"type":"integer","title":"Org Seq"},"parent_hash":{"type":"string","title":"Parent Hash"},"receipt_sha256":{"type":"string","title":"Receipt Sha256"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["receipt_id","org_seq","parent_hash","receipt_sha256"],"title":"LedgerEntry","description":"A single row of the per-org hash chain. The chain coordinates without the payload.\n\n`parent_hash` of row N points at `receipt_sha256` of row N-1. Row 0's\nparent_hash is the canonical ZERO_HASH (sixty-four zeros)."},"LedgerError":{"properties":{"org_seq":{"type":"integer","title":"Org Seq"},"error":{"type":"string","title":"Error"}},"type":"object","required":["org_seq","error"],"title":"LedgerError","description":"A single integrity failure surfaced by `GET /ledger/verify`."},"LedgerList":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/LedgerEntry"},"type":"array","title":"Entries"}},"type":"object","required":["entries"],"title":"LedgerList","description":"`GET /ledger` wrapper — the per-org chain in org_seq order."},"LedgerVerifyResult":{"properties":{"ok":{"type":"boolean","title":"Ok"},"receipts_checked":{"type":"integer","title":"Receipts Checked"},"errors":{"items":{"$ref":"#/components/schemas/LedgerError"},"type":"array","title":"Errors"}},"type":"object","required":["ok","receipts_checked","errors"],"title":"LedgerVerifyResult","description":"`GET /ledger/verify` — walks the per-org chain client-side-equivalent."},"MagicRequestIn":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"MagicRequestIn"},"MagicVerifyIn":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"MagicVerifyIn"},"Membership":{"properties":{"status":{"type":"string","enum":["pending","active","waitlisted","inactive"],"title":"Status"},"applied_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Applied At"},"activated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Activated At"},"seat_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seat Number","description":"Filled when status='active'. The seat the org holds (1..cap)."},"cap":{"type":"integer","title":"Cap","description":"Hard cap on active seats. Defaults to 100."},"active_count":{"type":"integer","title":"Active Count","description":"Current active member count across the platform."},"waitlist_position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Waitlist Position","description":"Filled when status='waitlisted'. 1 = next in line."},"application":{"anyOf":[{"$ref":"#/components/schemas/MembershipApplicationView"},{"type":"null"}]}},"type":"object","required":["status","cap","active_count"],"title":"Membership","description":"`GET /membership` — the org's membership state + community capacity.\n\n`cap` is the hard ceiling on active members; `active_count` is the current\nheadcount. When `active_count >= cap`, new applications become\n`waitlisted` and `waitlist_position` is the order they joined the queue."},"MembershipApplicationIn":{"properties":{"company_name":{"type":"string","maxLength":200,"minLength":1,"title":"Company Name"},"intended_use":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Intended Use"},"referral_source":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Referral Source"}},"type":"object","required":["company_name"],"title":"MembershipApplicationIn","description":"`POST /membership/apply` body. All fields optional except company_name —\nintended_use is the one we read most carefully; referral_source helps us\nunderstand how the community is growing."},"MembershipApplicationView":{"properties":{"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"intended_use":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intended Use"},"referral_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referral Source"}},"additionalProperties":true,"type":"object","title":"MembershipApplicationView","description":"What the applicant told us when they applied. Stored as JSONB on the\norganization; surfaced read-only on `GET /membership` so the org can see\nwhat they submitted (and admins can review)."},"MembershipApproveIn":{"properties":{"org_slug":{"type":"string","maxLength":80,"minLength":1,"title":"Org Slug"}},"type":"object","required":["org_slug"],"title":"MembershipApproveIn","description":"`POST /membership/approve` body · admin endpoint, internal-key gated.\n\nIdentifies the org by its slug (same identifier the application email\nsurfaces in the operator inbox)."},"MembershipCheckoutIn":{"properties":{"return_to_origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Return To Origin","description":"Override the success/cancel redirect origin. Defaults to APP_BASE_URL."}},"type":"object","title":"MembershipCheckoutIn","description":"`POST /membership/checkout` body. Optional · the only field is the\nreturn origin (defaults to app_base_url), useful for preview deploys\nthat want Stripe to redirect back to a non-prod URL."},"MembershipCheckoutOut":{"properties":{"url":{"type":"string","title":"Url","description":"Stripe Checkout hosted URL · redirect the browser here."},"session_id":{"type":"string","title":"Session Id","description":"Stripe checkout session id · useful for client-side logging."},"expires_at":{"type":"integer","title":"Expires At","description":"Unix epoch seconds when the Stripe session expires."}},"type":"object","required":["url","session_id","expires_at"],"title":"MembershipCheckoutOut","description":"`POST /membership/checkout` response · the Stripe-hosted URL the\nfrontend redirects the member to. The session expires after ~24h."},"ModelCard":{"properties":{"slug":{"type":"string","title":"Slug","description":"Stable identifier · `<name>-<base>` form."},"name":{"type":"string","title":"Name"},"family":{"type":"string","title":"Family","description":"`in-house` for sovereign cooks; other tags reserved."},"base":{"type":"string","title":"Base","description":"Underlying open base model · e.g. Qwen2-27B, Qwen3.5-9B, Gemma-2-2B."},"base_license":{"type":"string","title":"Base License"},"params_b":{"type":"number","title":"Params B","description":"Approximate parameter count, in billions."},"context_window":{"type":"integer","title":"Context Window"},"purpose":{"type":"string","title":"Purpose","description":"Short statement of what this model is for."},"trained_on":{"items":{"type":"string"},"type":"array","title":"Trained On","description":"Dataset slug references (catalog vocabulary)."},"eval_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eval Notes"},"compute_class":{"type":"string","title":"Compute Class","description":"Hardware tier expected · informs ops planning."},"status":{"type":"string","title":"Status","description":"`active` · `experimental` · `archived`."},"deed":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deed"},"card_sha256":{"type":"string","title":"Card Sha256","description":"SHA-256 of the canonical card body. Verifiable, stable."}},"additionalProperties":true,"type":"object","required":["slug","name","family","base","base_license","params_b","context_window","purpose","trained_on","compute_class","status","card_sha256"],"title":"ModelCard","description":"A public, member-facing model card. Hides operator-only fields\n(weights_location, default_rate_usd_per_hour). Includes `card_sha256`\ncomputed at load time over the canonical card body."},"ModelCatalog":{"properties":{"version":{"type":"string","title":"Version"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"},"doctrine_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doctrine Note"},"models_sha256":{"type":"string","title":"Models Sha256","description":"SHA-256 over the canonical sorted card list. Recompute to verify."},"scorecard":{"$ref":"#/components/schemas/ModelCatalogScorecard"},"models":{"items":{"$ref":"#/components/schemas/ModelCard"},"type":"array","title":"Models"}},"additionalProperties":true,"type":"object","required":["version","models_sha256","scorecard","models"],"title":"ModelCatalog","description":"`GET /models/catalog` — members-only model card library.\n\nCarries `models_sha256` (computed over the sorted card list). A member can\nfetch the catalog, recompute the hash from the response, and confirm the\nAPI mirror matches the books-and-records source."},"ModelCatalogScorecard":{"properties":{"total_models":{"type":"integer","title":"Total Models"},"in_house_models":{"type":"integer","title":"In House Models"},"active_models":{"type":"integer","title":"Active Models"}},"additionalProperties":true,"type":"object","required":["total_models","in_house_models","active_models"],"title":"ModelCatalogScorecard","description":"Top-level totals for the model catalog."},"ModelPinModel":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"base":{"type":"string","title":"Base"},"params_b":{"type":"number","title":"Params B"},"card_sha256":{"type":"string","title":"Card Sha256","description":"The exact card hash at pin time. Stable forever even if the card later changes."}},"additionalProperties":true,"type":"object","required":["slug","name","base","params_b","card_sha256"],"title":"ModelPinModel","description":"The card identity sealed into a pin receipt. Smaller than the full\ncard — just the fields that make the model identifiable to a third party\nreading the receipt later."},"ModelPinReceiptOut":{"properties":{"receipt_id":{"type":"string","title":"Receipt Id"},"org_seq":{"type":"integer","title":"Org Seq"},"receipt_sha256":{"type":"string","title":"Receipt Sha256"},"share_url":{"type":"string","title":"Share Url","description":"Public proof page for the pin — anyone with the URL can verify."},"pinned_at":{"type":"string","title":"Pinned At","description":"ISO timestamp · when the pin was minted."},"model":{"$ref":"#/components/schemas/ModelPinModel"},"declaration":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Declaration"},"client_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Ref"}},"type":"object","required":["receipt_id","org_seq","receipt_sha256","share_url","pinned_at","model"],"title":"ModelPinReceiptOut","description":"`POST /models/catalog/{slug}/pin` response."},"ModelPinRequest":{"properties":{"declaration":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Declaration","description":"Free-text note · what is this model being pinned for?"},"client_ref":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Client Ref","description":"Opaque member-side identifier (deal/agent/project tag)."}},"type":"object","title":"ModelPinRequest","description":"`POST /models/catalog/{slug}/pin` body. Both fields optional.\n\n`declaration` is a short member-supplied note describing what the model\nis being pinned FOR (e.g. \"agent A on deal X\"). Sealed into the receipt\npayload as-is. `client_ref` is an optional opaque tag the member can use\nto link the receipt to their own bookkeeping."},"Org":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"member_count":{"type":"integer","title":"Member Count","default":1},"receipt_count":{"type":"integer","title":"Receipt Count","default":0},"plan":{"type":"string","enum":["free","pro","enterprise"],"title":"Plan","default":"free"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"additionalProperties":true,"type":"object","required":["id","name","slug"],"title":"Org","description":"`GET /org` — the signed-in user's organization, with light stats."},"ProjectIn":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"ProjectIn"},"PublicReceipt":{"properties":{"receipt_id":{"type":"string","title":"Receipt Id"},"org_seq":{"type":"integer","title":"Org Seq"},"parent_hash":{"type":"string","title":"Parent Hash"},"receipt_sha256":{"type":"string","title":"Receipt Sha256"},"verified":{"type":"boolean","title":"Verified"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"}},"additionalProperties":true,"type":"object","required":["receipt_id","org_seq","parent_hash","receipt_sha256","verified","payload"],"title":"PublicReceipt","description":"`GET /share/{token}` — the public-facing view of a receipt. No auth required.\n\n`verified` is computed server-side as the SHA-256 of the canonical payload\ncompared to the stored `receipt_sha256` — anyone can recompute it client-side."},"Receipt":{"properties":{"receipt_id":{"type":"string","title":"Receipt Id"},"org_seq":{"type":"integer","title":"Org Seq"},"parent_hash":{"type":"string","title":"Parent Hash"},"receipt_sha256":{"type":"string","title":"Receipt Sha256"},"share_token":{"type":"string","title":"Share Token"},"share_url":{"type":"string","title":"Share Url"},"pdf_url":{"type":"string","title":"Pdf Url"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["receipt_id","org_seq","parent_hash","receipt_sha256","share_token","share_url","pdf_url"],"title":"Receipt","description":"A minted receipt — the artifact + the hash chain coordinates returned to the operator.\n\n`share_url` and `pdf_url` are operator-facing; the actual chain bytes are\nin the persisted payload. Public consumers (no auth) get `PublicReceipt`."},"ReceiptRollup":{"properties":{"receipt_id":{"type":"string","title":"Receipt Id"},"org_seq":{"type":"integer","title":"Org Seq"},"payload_schema":{"type":"string","title":"Payload Schema","description":"The receipt payload's `schema` field · e.g. defendablecloud.cook-receipt/v1"},"receipt_sha256":{"type":"string","title":"Receipt Sha256"},"share_url":{"type":"string","title":"Share Url","description":"Public proof page · /share/{token} on the API host"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"summary":{"additionalProperties":true,"type":"object","title":"Summary","description":"Schema-aware compact projection from the payload. Carries headline fields for tile rendering (run_title, outcome, lift, model_slug, etc.)."}},"additionalProperties":true,"type":"object","required":["receipt_id","org_seq","payload_schema","receipt_sha256","share_url"],"title":"ReceiptRollup","description":"One row in the per-org recent-receipts rollup.\n\nIdentity + share URL + a compact `summary` projected from the receipt\npayload. The summary fields vary by schema; the OpenAPI surface declares\nit as `Dict[str, Any]` so callers can dispatch on schema and read the\nheadline fields without re-fetching the receipt."},"ReceiptRollupList":{"properties":{"rollups":{"items":{"$ref":"#/components/schemas/ReceiptRollup"},"type":"array","title":"Rollups"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["rollups","count"],"title":"ReceiptRollupList","description":"`GET /receipts/recent` response · sorted desc by created_at."},"RunIn":{"properties":{"project_id":{"type":"string","title":"Project Id"},"flight_sheet_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Flight Sheet Id"},"agent_profile_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Profile Id"},"lane":{"anyOf":[{"type":"string","enum":["agent","dataset","compute","other"]},{"type":"null"}],"title":"Lane"},"title":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Title"},"inputs":{"additionalProperties":true,"type":"object","title":"Inputs"}},"type":"object","required":["project_id"],"title":"RunIn"},"RunnerClaimIn":{"properties":{"runner":{"type":"string","title":"Runner","default":"rig"}},"type":"object","title":"RunnerClaimIn"},"RunnerCompleteIn":{"properties":{"eval_after":{"type":"number","title":"Eval After"},"adapter_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Adapter Ref"},"metrics":{"additionalProperties":true,"type":"object","title":"Metrics"}},"type":"object","required":["eval_after"],"title":"RunnerCompleteIn"},"RunnerFailIn":{"properties":{"error":{"type":"string","title":"Error"}},"type":"object","required":["error"],"title":"RunnerFailIn"},"RunnerStatusIn":{"properties":{"status":{"type":"string","enum":["running","claimed"],"title":"Status","default":"running"},"metrics":{"additionalProperties":true,"type":"object","title":"Metrics"}},"type":"object","title":"RunnerStatusIn"},"StackAssessmentIn":{"properties":{"jobs":{"items":{"type":"string"},"type":"array","title":"Jobs"},"needs_24_7":{"type":"boolean","title":"Needs 24 7","default":false},"client_facing":{"type":"boolean","title":"Client Facing","default":false},"high_stakes":{"type":"boolean","title":"High Stakes","default":false},"data_local_only":{"type":"boolean","title":"Data Local Only","default":false},"deployment_pref":{"anyOf":[{"type":"string","enum":["owner","cloud","hybrid","no_pref"]},{"type":"null"}],"title":"Deployment Pref","default":"no_pref"},"budget":{"anyOf":[{"type":"string","enum":["low","medium","high"]},{"type":"null"}],"title":"Budget"}},"type":"object","title":"StackAssessmentIn"},"StageCompleteRequest":{"properties":{"tigris_key":{"type":"string","title":"Tigris Key"},"bytes_uploaded":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Bytes Uploaded"}},"type":"object","required":["tigris_key"],"title":"StageCompleteRequest"},"StageCompleteResult":{"properties":{"tigris_key":{"type":"string","title":"Tigris Key"},"receipts_matched":{"type":"integer","title":"Receipts Matched"},"notified":{"type":"integer","title":"Notified"},"already_notified":{"type":"integer","title":"Already Notified"},"no_email_available":{"type":"integer","title":"No Email Available"}},"type":"object","required":["tigris_key","receipts_matched","notified","already_notified","no_email_available"],"title":"StageCompleteResult"},"StagingTask":{"properties":{"tigris_key":{"type":"string","title":"Tigris Key","description":"Destination key in the Tigris bucket."},"slug":{"type":"string","title":"Slug","description":"Package slug — used by rails for logging."},"source_path":{"type":"string","title":"Source Path","description":"NAS path the rails worker rsyncs from (e.g. /mnt/swarm/...)."},"pending_receipts":{"type":"integer","title":"Pending Receipts","description":"How many ready-at-grant=false receipts point at this key."}},"type":"object","required":["tigris_key","slug","source_path","pending_receipts"],"title":"StagingTask","description":"One file the rails worker should ensure is in Tigris."},"StagingTaskList":{"properties":{"tasks":{"items":{"$ref":"#/components/schemas/StagingTask"},"type":"array","title":"Tasks"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["tasks","count"],"title":"StagingTaskList"},"Submission":{"properties":{"agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"},"model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Name"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"output_text":{"type":"string","title":"Output Text"},"tool_logs":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Logs"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"sha256":{"type":"string","title":"Sha256"},"submitted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Submitted At","description":"ISO-8601 datetime."}},"additionalProperties":true,"type":"object","required":["output_text","sha256"],"title":"Submission","description":"The agent's structured output for a Run. Sealed at submission time by sha256."},"TrainingDataPolicy":{"properties":{"version":{"type":"string","title":"Version","description":"Policy version. Updates bump this and last_updated."},"statement":{"type":"string","title":"Statement"},"we_learn_from":{"items":{"type":"string"},"type":"array","title":"We Learn From"},"we_dont_learn_from":{"items":{"type":"string"},"type":"array","title":"We Dont Learn From"},"enforcement":{"items":{"type":"string"},"type":"array","title":"Enforcement"},"effective_at":{"type":"string","title":"Effective At"},"last_updated":{"type":"string","title":"Last Updated"},"sha256":{"type":"string","title":"Sha256","description":"SHA-256 over the canonical policy body (excluding this field). Anyone can recompute."}},"type":"object","required":["version","statement","we_learn_from","we_dont_learn_from","enforcement","effective_at","last_updated","sha256"],"title":"TrainingDataPolicy","description":"`GET /policy/training-data` — frozen doctrine on what enters and never\nenters the training corpus. Hash-anchored: the `sha256` field is computed\nover the canonical body and any drift shifts the hash. Public, no auth.\n\n> We learn from how agents fail. We never learn from what your business is doing."},"UsageStats":{"properties":{"receipts_lifetime":{"type":"integer","title":"Receipts Lifetime"},"receipts_this_month":{"type":"integer","title":"Receipts This Month"},"org_seq":{"type":"integer","title":"Org Seq","description":"The next org_seq the chain will assign — equals receipts_lifetime today."},"earned_lanes":{"type":"integer","title":"Earned Lanes","description":"Count of agent profiles with ≥3 honey + 0 propolis on any lane.","default":0}},"additionalProperties":true,"type":"object","required":["receipts_lifetime","receipts_this_month","org_seq"],"title":"UsageStats","description":"`GET /org/usage` — receipt minting + chain position. Placeholder for\nmetered billing in Phase 5; today reports raw counts so the dashboard can\nshow usage even before Stripe lands."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"Verdict":{"properties":{"outcome":{"type":"string","enum":["pass","risk","fail"],"title":"Outcome"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score","description":"0.0 – 1.0"},"score_100":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Score 100","description":"0 – 100, weighted by tier."},"severity":{"anyOf":[{"type":"string","enum":["honey","jelly","propolis"]},{"type":"null"}],"title":"Severity"},"client_ready":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Ready"},"recommended_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recommended Action"},"checks_passed":{"type":"integer","title":"Checks Passed"},"checks_failed":{"type":"integer","title":"Checks Failed"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"risk_breakdown":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Risk Breakdown","description":"{high: [...], mid: [...], low: [...]} — populated by compute_verdict."}},"additionalProperties":true,"type":"object","required":["outcome","checks_passed","checks_failed"],"title":"Verdict","description":"The deterministic verdict produced by the referee from the applied rules.\n\nScore is the **% of declared rules satisfied**, weighted by tier — NOT a\nquality grade. Severity is flag-driven: any high-tier flag → propolis;\nmid-tier flag(s) only → jelly; otherwise → honey."}}}}