{"openapi":"3.1.0","info":{"title":"SDLC Bot Dashboard API","version":"0.1.0"},"paths":{"/api/health":{"get":{"summary":"Health Check","operationId":"health_check_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Check Api Health Get"}}}}}}},"/api/projects/{slug}/approval-policies":{"get":{"tags":["approval-policies"],"summary":"Get Approval Policies","description":"Return every configurable gate with effective project settings.","operationId":"get_approval_policies_api_projects__slug__approval_policies_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalPoliciesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["approval-policies"],"summary":"Put Approval Policies","description":"Atomically validate, replace, and audit the configured policy subset.","operationId":"put_approval_policies_api_projects__slug__approval_policies_put","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalPolicyPutEntry"},"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalPoliciesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/{task_id}/archive":{"post":{"tags":["archive"],"summary":"Archive Task","description":"Close a task's issue, archive its board card, and mark it Done.\n\n``task_id`` is the numeric ``tasks.id`` primary key. The path-param name is\nload-bearing: ``core.api.auth.ENTITY_SCOPE_RESOLVERS`` maps ``task_id`` to\n``get_scope_for_task``, so the router-wide gate resolves this request's org\nand project from the task row itself rather than from a re-pointable header.\n\nThe recorded transition keeps the ``system`` actor (policy) but carries the\nacting member's display login/email in ``actor_detail`` when authenticated\n(``None`` under ``AUTH_ENABLED=false``). ``resolution`` records the reason in\nthe same transaction.\n\nReturns 200 once canonical Done and its issue intent commit.\n``issue_close_pending`` reports queued delivery, independently of the\nimmediate ``card_archived`` result. ``None`` means no linked resource.","operationId":"archive_task_api_tasks__task_id__archive_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveTaskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/initiatives/{initiative_id}/archive":{"post":{"tags":["archive"],"summary":"Archive Initiative","description":"Close an initiative with its open plans and not-yet-started child tasks.\n\n``initiative_id`` is the numeric ``initiatives.id``; the path-param name is\nload-bearing for project-scoped auth (see :func:`archive_task`). Under the\nproject lock, the guards are re-decided against freshly read children, then\nevery child task not already Done, every open plan and the initiative move\nto Done in ONE transaction, each with the same audit reason and resolution,\nso a refusal anywhere (a split lineage, a policy rejection) changes\nnothing. Children already Done keep their own resolution. ``force``\noverrides only the dependents guard.\n\nIssue delivery is queued atomically across the tree; ``pending_issue_closes``\ncounts those intents. ``issue_close_pending`` describes the initiative.\n``card_archived`` and ``failed_card_archives`` report immediate card cleanup.\nA retry of an already-Done initiative covers its own issue and card only;\none that reaches Done mid-close also cleans up what the call closed under it.","operationId":"archive_initiative_api_initiatives__initiative_id__archive_post","parameters":[{"name":"initiative_id","in":"path","required":true,"schema":{"type":"integer","title":"Initiative Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveTaskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/board/done/archive":{"post":{"tags":["archive"],"summary":"Archive Done Cards","description":"Bulk-archive the board cards of already-Done tasks (a stale-card sweep).\n\nVisits at most ``limit`` rows, oldest-first, starting strictly past\n``after_id``. Runs no transitions — every row is already Done — and skips\nrows with no board card. Idempotent: ``archive_item`` treats an\nalready-archived card as success.\n\nThe sweep is **resumable**, and must be: nothing here mutates the rows it\nvisits, so an unkeyed page would be identical on every call and rows past\n``limit`` would never be archived. ``next_cursor`` is the id of the last row\nthis call visited; feed it back as ``after_id`` to continue. It is ``None``\nwhen the sweep cannot make further progress — either the Done set is\nexhausted, or the PM provider cannot archive at all. ``remaining`` counts\nthe Done tasks beyond ``next_cursor``, so a truncated sweep never reads as a\ncomplete one.","operationId":"archive_done_cards_api_projects__slug__board_done_archive_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveDoneRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/attachments/storage-health":{"get":{"tags":["attachments"],"summary":"Attachment Storage Health","description":"Report whether this deployment's attachment storage is usable.\n\nAdmin-gated and anchorless: the path carries no task/initiative/slug, so\n``core.api.auth._resolve_scope`` falls through to the ``X-Org-Id`` header\nfor the org claim (see that function's step 4) — callers must send it when\nauth is enabled.\n\nThis is the surface that carries the diagnosis an end user's 503\ndeliberately does not: which of \"credentials unset\" / \"bucket missing\" /\n\"bucket public\" is actually wrong, and what to do about it. It still never\nechoes the provider's response body.","operationId":"attachment_storage_health_api_attachments_storage_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageHealthResponse"}}}}}}},"/api/tasks/{task_id}/attachments":{"post":{"tags":["attachments"],"summary":"Upload Task Attachment","description":"Upload a file attachment to a task.","operationId":"upload_task_attachment_api_tasks__task_id__attachments_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentUploadRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["attachments"],"summary":"List Task Attachments","description":"List a task's attachments.","operationId":"list_task_attachments_api_tasks__task_id__attachments_get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AttachmentResponse"},"title":"Response List Task Attachments Api Tasks  Task Id  Attachments Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/{task_id}/attachments/{attachment_id}/download":{"get":{"tags":["attachments"],"summary":"Download Task Attachment","description":"Return a time-limited signed download URL for a task attachment.","operationId":"download_task_attachment_api_tasks__task_id__attachments__attachment_id__download_get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}},{"name":"attachment_id","in":"path","required":true,"schema":{"type":"integer","title":"Attachment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentDownloadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/{task_id}/attachments/{attachment_id}":{"delete":{"tags":["attachments"],"summary":"Delete Task Attachment","description":"Delete a task attachment (row, then best-effort Storage object).","operationId":"delete_task_attachment_api_tasks__task_id__attachments__attachment_id__delete","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}},{"name":"attachment_id","in":"path","required":true,"schema":{"type":"integer","title":"Attachment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Task Attachment Api Tasks  Task Id  Attachments  Attachment Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/initiatives/{initiative_id}/attachments":{"post":{"tags":["attachments"],"summary":"Upload Initiative Attachment","description":"Upload a file attachment to an initiative.","operationId":"upload_initiative_attachment_api_initiatives__initiative_id__attachments_post","parameters":[{"name":"initiative_id","in":"path","required":true,"schema":{"type":"integer","title":"Initiative Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentUploadRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["attachments"],"summary":"List Initiative Attachments","description":"List an initiative's attachments.","operationId":"list_initiative_attachments_api_initiatives__initiative_id__attachments_get","parameters":[{"name":"initiative_id","in":"path","required":true,"schema":{"type":"integer","title":"Initiative Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AttachmentResponse"},"title":"Response List Initiative Attachments Api Initiatives  Initiative Id  Attachments Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/initiatives/{initiative_id}/attachments/{attachment_id}/download":{"get":{"tags":["attachments"],"summary":"Download Initiative Attachment","description":"Return a time-limited signed download URL for an initiative attachment.","operationId":"download_initiative_attachment_api_initiatives__initiative_id__attachments__attachment_id__download_get","parameters":[{"name":"initiative_id","in":"path","required":true,"schema":{"type":"integer","title":"Initiative Id"}},{"name":"attachment_id","in":"path","required":true,"schema":{"type":"integer","title":"Attachment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentDownloadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/initiatives/{initiative_id}/attachments/{attachment_id}":{"delete":{"tags":["attachments"],"summary":"Delete Initiative Attachment","description":"Delete an initiative attachment (row, then best-effort Storage object).","operationId":"delete_initiative_attachment_api_initiatives__initiative_id__attachments__attachment_id__delete","parameters":[{"name":"initiative_id","in":"path","required":true,"schema":{"type":"integer","title":"Initiative Id"}},{"name":"attachment_id","in":"path","required":true,"schema":{"type":"integer","title":"Attachment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Initiative Attachment Api Initiatives  Initiative Id  Attachments  Attachment Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/audit-log":{"get":{"tags":["audit"],"summary":"Get Audit Log","description":"List audit log entries for a project with optional filters.","operationId":"get_audit_log_api_projects__slug__audit_log_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"decision_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision Type"}},{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"}},{"name":"correlation_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AuditLogResponse"},"title":"Response Get Audit Log Api Projects  Slug  Audit Log Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/{task_id}/baseline-retry":{"post":{"tags":["baseline-incidents"],"summary":"Retry Baseline","description":"Release this task's baseline suppression so its PR is tried again.\n\n``task_id`` is the numeric ``tasks.id`` primary key. Idempotent by\nconstruction: the resolving UPDATE carries ``resolved_at IS NULL``, so a\nsecond press returns ``cleared: 0`` and writes no audit row rather than\nre-stamping a release that already happened.","operationId":"retry_baseline_api_tasks__task_id__baseline_retry_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{org_id}/baseline-repair-policy":{"get":{"tags":["baseline-repairs"],"summary":"Get Org Repair Policy","description":"Read and revalidate the organization root policy.","operationId":"get_org_repair_policy_api_orgs__org_id__baseline_repair_policy_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgPolicyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["baseline-repairs"],"summary":"Put Org Repair Policy","description":"Replace the organization root; each change is audited atomically.","operationId":"put_org_repair_policy_api_orgs__org_id__baseline_repair_policy_put","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyPutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgPolicyReceipt"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/baseline-repair-policy":{"get":{"tags":["baseline-repairs"],"summary":"Get Project Repair Policy","description":"Read root and override from one snapshot, plus their intersection.","operationId":"get_project_repair_policy_api_projects__slug__baseline_repair_policy_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectPolicyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["baseline-repairs"],"summary":"Put Project Repair Policy","description":"Opt a project in only within its organization root.","operationId":"put_project_repair_policy_api_projects__slug__baseline_repair_policy_put","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyPutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectPolicyReceipt"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/baseline-repairs":{"get":{"tags":["baseline-repairs"],"summary":"List Baseline Repairs","description":"Newest-first repairs; filters and the total apply before the page.","operationId":"list_baseline_repairs_api_projects__slug__baseline_repairs_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"stage","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/RepairStage"}},{"type":"null"}],"title":"Stage"}},{"name":"active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"}},{"name":"automation_stopped","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Automation Stopped"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":19},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepairPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/baseline-repairs/{repair_id}":{"get":{"tags":["baseline-repairs"],"summary":"Get Baseline Repair","description":"One repair's cause, identities, policy, budget and bounded history.","operationId":"get_baseline_repair_api_projects__slug__baseline_repairs__repair_id__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"repair_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Repair Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepairDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/baseline-repairs/{repair_id}/actions":{"post":{"tags":["baseline-repairs"],"summary":"Submit Baseline Repair Action","description":"Record one idempotent operator request with its audit row.\n\nAn unknown network outcome must be retried with the same ``request_id``:\nthe replay returns the original receipt and writes nothing.","operationId":"submit_baseline_repair_action_api_projects__slug__baseline_repairs__repair_id__actions_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"repair_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Repair Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepairActionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepairActionReceipt"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/capabilities":{"get":{"tags":["capabilities"],"summary":"Get Capabilities","operationId":"get_capabilities_api_capabilities_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Capabilities Api Capabilities Get"}}}}}}},"/api/projects/{slug}/capability-gaps":{"get":{"tags":["capability-gaps"],"summary":"Get Project Capability Gaps","description":"Return item-backed capability demand lacking fresh poller coverage.","operationId":"get_project_capability_gaps_api_projects__slug__capability_gaps_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectCapabilityGapsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/initiatives/chat":{"post":{"tags":["chat"],"summary":"Chat Stream","description":"Stream AI-assisted initiative ideation via AI CLI subprocess.","operationId":"chat_stream_api_projects__slug__initiatives_chat_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/{task_id}":{"delete":{"tags":["delete_work_item"],"summary":"Delete Task","description":"Permanently delete a standalone task (see module docstring).\n\n``task_id`` is the numeric ``tasks.id`` primary key; the path-param name\nis load-bearing (``core.api.auth.ENTITY_SCOPE_RESOLVERS``) for project-\nscoped auth. ``force=true`` overrides the unresolved-dependents guard\nonly — never the open-session guard.","operationId":"delete_task_api_tasks__task_id__delete","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["tasks"],"summary":"Get Task Detail Endpoint","operationId":"get_task_detail_endpoint_api_tasks__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["tasks"],"summary":"Update Task Content Endpoint","description":"Edit a task's title/body — a thin wrapper over\n``update_work_item_content`` (INI-2291-001); no DB/audit/provider logic\nof its own lives here.\n\n``task_id`` here is the numeric ``tasks.id`` primary key ONLY — unlike\n``GET /tasks/{task_id}`` (``_resolve_task`` above), which also accepts\nthe string ``task_id`` and 409s on cross-project ambiguity. A mutation\nmust never be ambiguous about which row it writes, so PATCH takes only\nthe unambiguous numeric primary key — the same choice\n``POST /api/tasks/{task_id}/pause`` (``core/api/routes/pause.py``) and\nthe attachment routes (``core/api/routes/attachments.py``) already made\non this path prefix. The param name is load-bearing:\n``core.api.auth.ENTITY_SCOPE_RESOLVERS`` anchors org/project\nauthorization to this row.","operationId":"update_task_content_endpoint_api_tasks__task_id__patch","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkItemContentUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkItemContentUpdateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/initiatives/{initiative_id}":{"delete":{"tags":["delete_work_item"],"summary":"Delete Initiative","description":"Permanently delete an initiative, its plan(s), and its child tasks.\n\n``initiative_id`` is the numeric ``initiatives.id`` primary key; the\npath-param name is load-bearing for project-scoped auth (see\n:func:`delete_task`). ``force=true`` overrides the unresolved-dependents\nguard only — never the open-session guard.","operationId":"delete_initiative_api_initiatives__initiative_id__delete","parameters":[{"name":"initiative_id","in":"path","required":true,"schema":{"type":"integer","title":"Initiative Id"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["initiatives"],"summary":"Get Initiative Detail","description":"Return initiative with plans, task counts, and wave progress.","operationId":"get_initiative_detail_api_initiatives__initiative_id__get","parameters":[{"name":"initiative_id","in":"path","required":true,"schema":{"type":"integer","title":"Initiative Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitiativeDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["initiatives"],"summary":"Update Initiative Content Endpoint","description":"Edit an initiative's title/body — a thin wrapper over\n``update_work_item_content`` (INI-2291-001); no DB/audit/provider logic\nof its own lives here.\n\n``initiative_id`` is the numeric ``initiatives.id`` primary key, and the\nparam name is load-bearing: ``core.api.auth.ENTITY_SCOPE_RESOLVERS``\nanchors org/project authorization to this row (mirrors\n``core/api/routes/pause.py``).","operationId":"update_initiative_content_endpoint_api_initiatives__initiative_id__patch","parameters":[{"name":"initiative_id","in":"path","required":true,"schema":{"type":"integer","title":"Initiative Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkItemContentUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkItemContentUpdateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/domain-routing/preview":{"post":{"tags":["domain-routing"],"summary":"Preview Domain Routing","description":"Classify *paths* and report the commands that routing would select.","operationId":"preview_domain_routing_api_projects__slug__domain_routing_preview_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainRoutingPreviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainRoutingPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/domain-routing/coverage":{"get":{"tags":["domain-routing"],"summary":"Get Domain Coverage","description":"Report the counts and the silent defects of the stored domain config.","operationId":"get_domain_coverage_api_projects__slug__domain_routing_coverage_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainCoverageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/events":{"get":{"tags":["events"],"summary":"Event Stream","description":"SSE stream of real-time dashboard events.\n\nDeprecated: replaced by Supabase Realtime under AUTH_ENABLED. HARD-\nDISABLED (403) when ``auth_enabled`` is true — the global event detector\nis org-blind and cannot be safely scoped, so the stream is closed rather\nthan risk a cross-org leak; the web auto-selects Realtime instead. See\nthe module docstring.","operationId":"event_stream_api_events_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/learnings":{"get":{"tags":["files"],"summary":"Get Learnings","operationId":"get_learnings_api_learnings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Learnings Api Learnings Get"}}}}}},"put":{"tags":["files"],"summary":"Update Learnings","operationId":"update_learnings_api_learnings_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Update Learnings Api Learnings Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/context":{"get":{"tags":["files"],"summary":"Get Project Context","description":"Return combined project context: preamble from file + active learnings from DB.","operationId":"get_project_context_api_projects__slug__context_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Project Context Api Projects  Slug  Context Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["files"],"summary":"Update Project Context","description":"Write the static preamble portion of the context file.\n\nLearnings are managed separately via the DB and are not affected by this endpoint.","operationId":"update_project_context_api_projects__slug__context_put","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Project Context Api Projects  Slug  Context Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/prs":{"get":{"tags":["github"],"summary":"List Project Prs","description":"List all PRs associated with this project's initiatives and tasks.","operationId":"list_project_prs_api_projects__slug__prs_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Project Prs Api Projects  Slug  Prs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/prs/ci":{"get":{"tags":["github"],"summary":"Get Project Prs Ci Status","description":"Aggregate CI status for every OPEN item's PR in one call.\n\nServes the board's per-card CI badges: one request (and, on GitHub, one\nbatched GraphQL call) replaces a ``/prs/{n}/ci`` round trip per card.\nDone items are excluded — their PRs are merged/closed and render no badge.\nResponse: ``{\"statuses\": {\"<pr_number>\": \"success|pending|failure|no_checks\"}}``.","operationId":"get_project_prs_ci_status_api_projects__slug__prs_ci_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Project Prs Ci Status Api Projects  Slug  Prs Ci Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/prs/{pr_number}":{"get":{"tags":["github"],"summary":"Get Pr Detail","description":"Get PR details with comment categorization stats.","operationId":"get_pr_detail_api_projects__slug__prs__pr_number__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"pr_number","in":"path","required":true,"schema":{"type":"integer","title":"Pr Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Pr Detail Api Projects  Slug  Prs  Pr Number  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/prs/{pr_number}/ci":{"get":{"tags":["github"],"summary":"Get Pr Ci Status","description":"Return the aggregate CI status for a PR (pending|success|failure|no_checks).","operationId":"get_pr_ci_status_api_projects__slug__prs__pr_number__ci_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"pr_number","in":"path","required":true,"schema":{"type":"integer","title":"Pr Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Pr Ci Status Api Projects  Slug  Prs  Pr Number  Ci Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/sync-status":{"get":{"tags":["github"],"summary":"Get Sync Status","description":"Get last sync timestamp and status for this project.","operationId":"get_sync_status_api_projects__slug__sync_status_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Sync Status Api Projects  Slug  Sync Status Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/github-app/config":{"get":{"tags":["github-app"],"summary":"Get Github App Config","description":"Report whether the GitHub App is configured and its install URL.\n\n``install_url`` is GitHub's public install page for the configured App\nslug (``https://github.com/apps/{slug}/installations/new``), or ``None``\nwhen no slug is configured. ``configured`` additionally requires the App\nid + private key (:func:`github_app_configured`).","operationId":"get_github_app_config_api_github_app_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GithubAppConfigResponse"}}}}}}},"/api/github-app/installations":{"get":{"tags":["github-app"],"summary":"List Github App Installations","description":"List the caller org's connected GitHub-App installations (oldest first).","operationId":"list_github_app_installations_api_github_app_installations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/InstallationResponse"},"type":"array","title":"Response List Github App Installations Api Github App Installations Get"}}}}}},"post":{"tags":["github-app"],"summary":"Connect Github App Installation","description":"Connect (confirm + store) an installation after the GitHub redirect.\n\nConfirms the installation exists via an App JWT (:func:`fetch_installation`);\na missing installation — or an unconfigured App — is a 404. A transient\nupstream failure verifying the installation with GitHub (network error,\ntimeout, or a non-404 error response) is a 502 so a retryable outage is not\nmisreported as a permanent \"installation not found\". If the installation is\nalready mapped to a *different* org it is a 409 (an org cannot silently steal\nan installation another org owns — the owner must disconnect it first). That\nguard is enforced atomically by the WHERE-guarded ``upsert_installation``\n(rowcount 0 ⇒ 409), so two orgs racing the same brand-new installation\nresolve to exactly one winner even though both pass the fast-path pre-check\nbelow. On success the org -> installation mapping is stored (idempotent on\n``installation_id``; a same-org reconnect refreshes the account/suspension\nfields) and the stored row is returned (201).","operationId":"connect_github_app_installation_api_github_app_installations_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectInstallationRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstallationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/github-app/installations/{installation_id}":{"delete":{"tags":["github-app"],"summary":"Disconnect Github App Installation","description":"Disconnect an installation from the caller's org (local mapping only).\n\nRemoves ONLY the org -> installation row; it does NOT uninstall the App\nfrom GitHub. Org-scoped and idempotent — a no-op (still 204) when no such\nmapping exists for the caller's org.","operationId":"disconnect_github_app_installation_api_github_app_installations__installation_id__delete","parameters":[{"name":"installation_id","in":"path","required":true,"schema":{"type":"integer","title":"Installation Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/human-gate-assignees":{"get":{"tags":["human-gate-assignments"],"summary":"Get Human Gate Assignments","description":"Return the project's canonical complete assignment configuration.","operationId":"get_human_gate_assignments_api_projects__slug__human_gate_assignees_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HumanGateAssignmentsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["human-gate-assignments"],"summary":"Put Human Gate Assignments","description":"Atomically compare, replace, and audit all assignment families.","operationId":"put_human_gate_assignments_api_projects__slug__human_gate_assignees_put","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HumanGateAssignmentsPutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HumanGateAssignmentsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/human-gates":{"get":{"tags":["human-gates"],"summary":"Get Human Gate Queue","description":"Return exact action-level routing for the current caller.","operationId":"get_human_gate_queue_api_human_gates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HumanGateQueueResponse"}}}}}}},"/api/human-gates/{work_item_kind}/{work_item_db_id}/ai-context":{"get":{"tags":["human-gates"],"summary":"Human Gate Ai Context","description":"Return current context only while the item remains personal/actionable.\n\nThe lookup is read-only and scope-hiding: missing, deleted, unauthorized,\nstale, already-approved and no-longer-actionable items all return the same\n404.  The caller's grants are resolved before acquiring the route's\nconnection, matching the rest of the org-scoped API.","operationId":"human_gate_ai_context_api_human_gates__work_item_kind___work_item_db_id__ai_context_get","parameters":[{"name":"work_item_kind","in":"path","required":true,"schema":{"enum":["initiative","task"],"type":"string","title":"Work Item Kind"}},{"name":"work_item_db_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Work Item Db Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HumanGateAiContextResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/initiatives/{initiative_id}/replan":{"get":{"tags":["initiatives"],"summary":"Export Replan","description":"Read one consistent replan snapshot; the router's viewer gate applies.","operationId":"export_replan_api_initiatives__initiative_id__replan_get","parameters":[{"name":"initiative_id","in":"path","required":true,"schema":{"type":"integer","title":"Initiative Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Export Replan Api Initiatives  Initiative Id  Replan Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/initiatives/{initiative_id}/replan/preview":{"post":{"tags":["initiatives"],"summary":"Preview Replan","description":"Read-only POST: validates a manifest, and never applies its changes.","operationId":"preview_replan_api_initiatives__initiative_id__replan_preview_post","parameters":[{"name":"initiative_id","in":"path","required":true,"schema":{"type":"integer","title":"Initiative Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplanProposal"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Preview Replan Api Initiatives  Initiative Id  Replan Preview Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/initiatives/{initiative_id}/replan/apply":{"post":{"tags":["initiatives"],"summary":"Apply Initiative Replan","description":"Apply a reviewed manifest under the initiative's member/operations gate.","operationId":"apply_initiative_replan_api_initiatives__initiative_id__replan_apply_post","parameters":[{"name":"initiative_id","in":"path","required":true,"schema":{"type":"integer","title":"Initiative Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplanApplyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Apply Initiative Replan Api Initiatives  Initiative Id  Replan Apply Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/initiatives":{"get":{"tags":["initiatives"],"summary":"Get Project Initiatives","description":"List initiatives for a project with summary stats.","operationId":"get_project_initiatives_api_projects__slug__initiatives_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"approval_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approval Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InitiativeSummary"},"title":"Response Get Project Initiatives Api Projects  Slug  Initiatives Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["initiatives"],"summary":"Create Initiative","description":"Create a GitHub issue, add it to the project board, and set Type=Initiative.\n\nA transient failure after the issue is created (add-to-project/Type/\nStatus) no longer orphans the issue (BUG-2664):\n``create_work_item_with_repair`` attempts an immediate repair and falls\nback to a durable ``board_repair`` retry (supported for ``Initiative``,\nnot just Task/Bug — see ``enqueue_durable_board_repair``'s docstring),\nsurfaced to the caller via the response's ``board_status``.","operationId":"create_initiative_api_projects__slug__initiatives_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInitiativeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInitiativeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/plans/{plan_id}":{"get":{"tags":["initiatives"],"summary":"Get Plan Detail","description":"Return plan detail with linked initiative data.","operationId":"get_plan_detail_api_plans__plan_id__get","parameters":[{"name":"plan_id","in":"path","required":true,"schema":{"type":"integer","title":"Plan Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/judgments/{feature_id}":{"post":{"tags":["judgments"],"summary":"Ask Judgment","description":"Ask one registered feature about the supplied state.","operationId":"ask_judgment_api_projects__slug__judgments__feature_id__post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"feature_id","in":"path","required":true,"schema":{"type":"string","title":"Feature Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JudgmentRequestBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Ask Judgment Api Projects  Slug  Judgments  Feature Id  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/judgments/consent":{"get":{"tags":["judgments"],"summary":"Get Judgment Consent","description":"The caller org's consent flag, today's usage and the feature list.","operationId":"get_judgment_consent_api_judgments_consent_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JudgmentConsentResponse"}}}}}},"put":{"tags":["judgments"],"summary":"Set Judgment Consent","description":"Enable or disable judgments for the caller's org (idempotent).\n\nCompare-and-set against the current flag plus an audit row, committed\ntogether; a repeat of the current value is a no-op that writes nothing.","operationId":"set_judgment_consent_api_judgments_consent_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetJudgmentConsentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JudgmentConsentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/labels":{"get":{"tags":["labels"],"summary":"List Labels","description":"Fetch GitHub repository labels via gh CLI.","operationId":"list_labels_api_projects__slug__labels_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LabelResponse"},"title":"Response List Labels Api Projects  Slug  Labels Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/learnings":{"get":{"tags":["learnings"],"summary":"List Learnings","description":"List a project's active learnings, optionally filtered by domain.","operationId":"list_learnings_api_projects__slug__learnings_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LearningResponse"},"title":"Response List Learnings Api Projects  Slug  Learnings Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/maintenance/db/reset":{"post":{"tags":["maintenance"],"summary":"Reset Database","description":"Delete work-item rows. Preserves `projects` and `project_metadata_cache`.\n\nAuth disabled (single-user local mode): the historical behavior — every\nwork-item row in the database is deleted.\n\nAuth enabled: requires the org ``owner`` role (the org comes from the\n``X-Org-Id`` header — this route has no project anchor) and deletes ONLY\nrows belonging to that org's projects; other orgs' data and active\nsessions are invisible to the request.","operationId":"reset_database_api_maintenance_db_reset_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Reset Database Api Maintenance Db Reset Post"}}}}}}},"/api/notification-preferences":{"get":{"tags":["notification-preferences"],"summary":"Get Notification Preferences","description":"Return the caller's EFFECTIVE setting for every ``(category, channel)``.\n\nThe resolution — and why it is one call per pair rather than a fold here —\nlives in :func:`_effective_preferences`.\n\n``accessible_project_ids`` is resolved BEFORE ``acquire()`` deliberately:\non this org-level route the gate never primes its cache for a restricted\nmember (``_enforce_project_access`` early-returns when\n``request.state.project_ids`` is empty), so the call checks out a pooled\nconnection of its own — and ``core/db.py``'s pool has no acquire timeout,\nso holding two per request can deadlock the worker.","operationId":"get_notification_preferences_api_notification_preferences_get","parameters":[{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":9223372036854775807,"minimum":1},{"type":"null"}],"title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["notification-preferences"],"summary":"Put Notification Preferences","description":"Replace the caller's preference rows for ONE scope, atomically.\n\nA full replace of ``(user, org, project_id)`` — the shape\n``approval_policies.put_approval_policies`` uses — so an omitted\n``(category, channel)`` falls back to the next level down rather than\nsilently keeping a stale setting. ``replace_preferences`` requires the\ncaller to own the transaction for exactly that reason: the DELETE and the\nINSERTs are one atomic replacement, and a crash between them would leave\nthe user with NO preferences instead of their old ones.\n\nSTRICTLY THE CALLER'S OWN ROWS: the user id comes from the authenticated\nrequest, never from the payload, and it is part of the repository's scope\npredicate — so there is no request shape at all that reaches another\nmember's rows. ``project_id`` addresses a SCOPE, not a row set to inherit:\nthe org-wide scope (``project_id`` omitted) and each project scope are\nreplaced independently, and neither disturbs the other.\n\nThe whole payload is validated before the transaction opens, so an invalid\nvalue cannot delete the existing rows and then fail to insert.","operationId":"put_notification_preferences_api_notification_preferences_put","parameters":[{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":9223372036854775807,"minimum":1},{"type":"null"}],"title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplacePreferencesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notification-watches":{"get":{"tags":["notification-preferences"],"summary":"List Notification Watches","description":"List the caller's watches and mutes in this org.\n\n``project_id`` is an optional FILTER, and unlike the preferences scope,\nomitting it means \"every project\" rather than \"the org-wide rows\": a\nwatch's ``project_id`` is provenance (the entity it points at belongs to\nexactly one project), not a scope value where NULL is meaningful.\n\nThe listing itself is not narrowed to the caller's grants. Every row is\none the caller created for themselves, and dropping a watch from the list\nbecause access to its project changed would leave a stance the user can\nsee the effects of but not find or clear. A SUPPLIED ``project_id`` is\nstill validated, because a query parameter anchors nothing.","operationId":"list_notification_watches_api_notification_watches_get","parameters":[{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":9223372036854775807,"minimum":1},{"type":"null"}],"title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["notification-preferences"],"summary":"Set Notification Watch","description":"Set the caller's ``watch``/``mute`` stance on one work item.\n\nIdempotent through ``set_watch``'s upsert on\n``(user_id, org_id, entity_type, entity_db_id)``: repeating a request\nreturns the same row id, and flipping between watching and muting updates\nthat one row rather than accumulating contradictory ones. The response\nechoes the stored stance, so an identical repeat produces an identical\nbody.\n\n``project_id`` is DERIVED from the addressed entity, never taken from the\npayload — the entity already belongs to exactly one project, so accepting\na client-supplied one would only create a way for the two to disagree.\nThat same resolution is the authorization: an entity that does not exist,\nlives in another org, or lives in a project the caller was not granted is\na 404, indistinguishable from each other.\n\n``mode`` is validated against ``WATCH_MODES`` here because ``set_watch``\nraises ``ValueError`` on an unknown one, which would surface as a 500.\nThat frozenset is the repository's own vocabulary (it has no taxonomy\nowner and no SQL CHECK), so it is imported rather than restated.","operationId":"set_notification_watch_api_notification_watches_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetWatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notification-watches/{watch_id}":{"delete":{"tags":["notification-preferences"],"summary":"Clear Notification Watch","description":"Clear one of the CALLER's watches; a repeat is ``changed: false``.\n\n``watch_id`` is the one client-supplied row id on this route, so it is\nnever addressed alone: the authenticated caller's user id and the resolved\n``org_id`` go into ``clear_watch`` beside it, and its rowcount becomes\n``changed``. RLS is NOT the enforcement point — the backend reaches\nPostgres through ``core/db.py``'s pooled OWNING-ROLE connection, which the\ntable's ``user_id = auth.uid()`` policy does not apply to — so the owner\npredicate has to be in the statement.\n\nAnother member's watch id is therefore a zero-row ``{changed: false}``,\ndeliberately indistinguishable from an already-cleared one: a 404 would\ndisclose that the row exists, and idempotency needs the same answer for\n\"already gone\" anyway.\n\nThe :data:`_MAX_BIGINT` bound is the one id that does NOT reach that\nanswer: an out-of-range value never survives the ``bigint`` bind, so it is\na 422 rather than the unmapped ``asyncpg`` encoding error it would\notherwise be. Every id the column can actually hold still behaves exactly\nas described above.","operationId":"clear_notification_watch_api_notification_watches__watch_id__delete","parameters":[{"name":"watch_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Watch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClearWatchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notifications":{"get":{"tags":["notifications"],"summary":"List Notifications","description":"Return one filtered, paginated page of the caller's notification feed.\n\nEvery filter is a SQL predicate applied BEFORE ``LIMIT``/``OFFSET`` (see\n``list_events``), so ``total`` always describes the same row set the page\nwas drawn from and nothing is dropped in Python afterwards.","operationId":"list_notifications_api_notifications_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":0,"default":0,"title":"Offset"}},{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":9223372036854775807,"minimum":1},{"type":"null"}],"title":"Project Id"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},{"name":"severity","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"}},{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"}},{"name":"actor_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Type"}},{"name":"origin","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"}},{"name":"unread","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Unread"}},{"name":"action_required","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Action Required"}},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notifications/summary":{"get":{"tags":["notifications"],"summary":"Notification Summary","description":"The bell's two badge counts for the caller, in ONE statement.\n\nScoped identically to the feed *in project and org scope*: the shared\nmapping's ``project_ids`` half is the only filter\n``count_unread_and_action_required`` takes, so the same three\nproject-access cases apply here.\n\nIt is NOT identical on the unread predicate, and the difference is\ndeliberate on the repository's side rather than introduced here.\n``count_unread_and_action_required`` adds ``nrs.dismissed_at IS NULL`` to\nboth counts — a badge that keeps counting something the user explicitly\ndismissed is a badge people learn to ignore — while ``list_events``'\n``unread_only`` stays literally \"not read\". So a row the caller dismissed\nwithout reading IS returned by ``GET /notifications?unread=true`` and is\nNOT counted here. Clients must not derive one from the other: the bell\nreads this endpoint, the list reads the feed. Pinned by\n``tests/test_route_notifications.py::TestSummary::\ntest_dismissed_but_unread_row_is_listed_but_not_counted``.","operationId":"notification_summary_api_notifications_summary_get","parameters":[{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":9223372036854775807,"minimum":1},{"type":"null"}],"title":"Project Id"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},{"name":"severity","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"}},{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"}},{"name":"actor_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Type"}},{"name":"origin","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"}},{"name":"unread","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Unread"}},{"name":"action_required","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Action Required"}},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notifications/read-all":{"post":{"tags":["notifications"],"summary":"Mark All Read","description":"Mark read exactly the rows ``GET /notifications`` would have returned.\n\nTakes the IDENTICAL filter model as the feed — ``unread`` included — rather\nthan a narrower second schema, so INI-2965-009's client forwards its whole\nfilter object unchanged. ``unread`` is accepted and dropped after\nnormalization because ``bulk_mark_read`` already implies ``unread_only``;\nthat can never widen the row set, since ``true`` narrows to the unread\nsubset (the only rows marking-read can touch at all) and ``false``/omitted\nboth mean *no unread predicate*.","operationId":"mark_all_read_api_notifications_read_all_post","parameters":[{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":9223372036854775807,"minimum":1},{"type":"null"}],"title":"Project Id"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},{"name":"severity","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"}},{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"}},{"name":"actor_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Type"}},{"name":"origin","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"}},{"name":"unread","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Unread"}},{"name":"action_required","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Action Required"}},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkAllReadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notifications/{notification_id}/read":{"post":{"tags":["notifications"],"summary":"Mark Read","description":"Stamp the caller's ``read_at``; a repeat is ``changed: false``.","operationId":"mark_read_api_notifications__notification_id__read_post","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Notification Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notifications/{notification_id}/unread":{"post":{"tags":["notifications"],"summary":"Mark Unread","description":"Clear the caller's ``read_at``; a repeat is ``changed: false``.","operationId":"mark_unread_api_notifications__notification_id__unread_post","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Notification Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notifications/{notification_id}/dismiss":{"post":{"tags":["notifications"],"summary":"Dismiss","description":"Stamp the caller's ``dismissed_at``; a repeat is ``changed: false``.","operationId":"dismiss_api_notifications__notification_id__dismiss_post","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Notification Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notifications/{notification_id}/acknowledge":{"post":{"tags":["notifications"],"summary":"Acknowledge","description":"Stamp the caller's ``acknowledged_at``; a repeat is ``changed: false``.","operationId":"acknowledge_api_notifications__notification_id__acknowledge_post","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Notification Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notifications/{notification_id}/snooze":{"post":{"tags":["notifications"],"summary":"Snooze","description":"Set the caller's ``snoozed_until`` to a future, timezone-aware instant.\n\nA naive or past ``until`` is 422: a snooze into the past is silently no\nsnooze at all, and a naive one would be interpreted as UTC and mean\nsomething different to every client.","operationId":"snooze_api_notifications__notification_id__snooze_post","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Notification Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SnoozeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notifications/{notification_id}/deliveries/claim":{"post":{"tags":["notifications"],"summary":"Claim Delivery","description":"Claim one channel of this notification for one device.\n\nOwnership is SINGLE-HOLDER-AT-A-TIME and transferable, not\nfirst-come-forever. ``claimed: true`` goes to the caller whose request\nsatisfies INI-2965-004's conflict predicate — the first claimant, OR a\nlater caller reclaiming a claim that is already ``failed`` or whose\n``claimed_at`` precedes ``stale_before``. A caller conflicting with a claim\nthat is still live (claimed inside the staleness window) or already\ndelivered gets ``claimed: false`` with both ids ``null``. The bounded\nreclaim exists so a device that crashed after claiming and before alerting\ncannot suppress a notification forever.\n\nThis is one of the two places this route reads a clock:\n``claim_delivery`` takes ``stale_before`` explicitly so the repository\nstays deterministic, so it is computed here as\n``now - DELIVERY_CLAIM_STALE_AFTER`` from that module's named constant.\n\n``claim_generation`` is echoed back because a reclaim REUSES the same\n``delivery_id``: a device whose stale claim was reclaimed still holds that\nid, and the generation is what tells a later acknowledgement apart from the\ncurrent claimant's. The route does not interpret it.\n\n``accessible_project_ids`` is resolved BEFORE ``acquire()`` deliberately —\nsee :func:`_apply_recipient_state` for why it must not move back inside.","operationId":"claim_delivery_api_notifications__notification_id__deliveries_claim_post","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Notification Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryClaimRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notifications/{notification_id}/deliveries/{delivery_id}/delivered":{"post":{"tags":["notifications"],"summary":"Mark Delivered","description":"Record one claim's terminal outcome; ``{changed: <rowcount > 0>}``.\n\nThe client supplies only ``delivery_id``, ``claim_generation`` and the\noutcome. The other two halves of ``mark_delivered``'s predicate are\nAUTHORIZATION inputs and come from the request's own scope — the\nauthenticated caller's user id and the path's ``notification_id`` — never\nfrom the body: RLS cannot enforce this, because the backend reaches\nPostgres through ``core/db.py``'s pooled owning-role connection.\n\nA zero rowcount is ALWAYS ``{changed: false}`` and never a 4xx, whatever\nproduced it — a superseded generation, a repeat acknowledgement at the\ncurrent generation, a ``delivery_id`` belonging to another user, or one\nthat does not belong to this ``notification_id``. A superseded device\nreporting an outcome is an expected race, not a client fault, and the\nmismatched-id cases are deliberately indistinguishable to the caller rather\nthan a probe for whose rows exist.\n\n``accessible_project_ids`` is resolved BEFORE ``acquire()`` deliberately —\nsee :func:`_apply_recipient_state` for why it must not move back inside.","operationId":"mark_delivered_api_notifications__notification_id__deliveries__delivery_id__delivered_post","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Notification Id"}},{"name":"delivery_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Delivery Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveredRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notifications/{notification_id}/ai-context":{"get":{"tags":["notifications"],"summary":"Notification Ai Context","description":"Exchange an opaque notification id for a seed context for an AI CLI.\n\nA pure READ: no provider call, no repository write, no session spawn. It\nfetches the notification, the project's identity and the item's current\nstate, and hands all three to ``core.notifications.ai_context`` — which is\nwhere every string is redacted and bounded.\n\nThe re-authorization is the security property, not a formality.\n``notification_id`` is deliberately NOT one of\n``core.api.auth.ENTITY_SCOPE_RESOLVERS``' entity anchors, so the router\ngate has checked only org membership from ``X-Org-Id``. This handler\nre-resolves the row under that org (inside ``get_event``'s own WHERE\nclause) AND re-checks project access, exactly as the per-recipient writes\ndo through :func:`_load_visible_event`. A notification outside the caller's\nscope is a 404 — not a redacted body, which would confirm the id exists.\n\n``prerequisites`` names the project slug and its repository identity, and\nresolves no local filesystem path: where the operator's checkout lives is\nthe Desktop client's business, and a hosted API has no business learning\nthat operator machines exist.\n\n``accessible_project_ids`` is resolved BEFORE ``acquire()`` deliberately —\nsee :func:`_apply_recipient_state` for why it must not move back inside.","operationId":"notification_ai_context_api_notifications__notification_id__ai_context_get","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Notification Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/operations/health":{"get":{"tags":["operations"],"summary":"Get Org Health","description":"List the caller org's open conditions, fleet-level rows included.\n\n``accessible_project_ids`` is resolved BEFORE the connection this route's\nreads run on is checked out: that helper opens its own pooled connection\nfor a restricted member, and calling it inside an ``acquire()`` block is\nwhat exhausts the pool under concurrency. Its ``None``/empty-list overload\nis passed through verbatim — ``None`` means \"every project in the org\" and\nan empty list must reach the query as a genuine match-nothing project\npredicate, which still leaves the fleet rows visible.","operationId":"get_org_health_api_operations_health_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/operations/health":{"get":{"tags":["operations"],"summary":"Get Project Health","description":"List ONE project's open conditions.\n\n``include_fleet=False`` and ``project_ids=[project.id]``: a fleet-level row\nand another project's row are both outside the query's predicate, so\nneither can reach a project-scoped reader.","operationId":"get_project_health_api_projects__slug__operations_health_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/operations/recovery-records":{"get":{"tags":["operations"],"summary":"List Project Recovery Records","description":"List one project's recovery records, newest-first.\n\nIsolation is the resolved ``project.id`` in the query's ``WHERE`` clause —\nanother project's record is never in the result set. The effective-org\nresolution in :func:`_project_scope` runs first for the same reason project\nHealth needs it: an auth-disabled project outside ``DEFAULT_ORG_ID`` must\nstay readable.","operationId":"list_project_recovery_records_api_projects__slug__operations_recovery_records_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryRecordsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/audit/events":{"get":{"tags":["audit-timeline"],"summary":"Audit Events","description":"Merged, org-scoped audit timeline: grant/deny + status-transition events.","operationId":"audit_events_api_audit_events_get","parameters":[{"name":"member","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Member"}},{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Id"}},{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"}},{"name":"actor_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Type"}},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEventPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/org-pm-integration":{"get":{"tags":["org-pm-integration"],"summary":"Get Org Pm Integration","description":"Return the caller org's server-side board I/O status.\n\nAlways 200 — an org with no integration row is reported as disabled\nrather than 404.","operationId":"get_org_pm_integration_api_org_pm_integration_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgPmIntegrationResponse"}}}}}},"put":{"tags":["org-pm-integration"],"summary":"Connect Org Pm Integration","description":"Enable server-side board I/O for the caller's org.\n\nFails closed (409, ``github_app_not_configured``) when the API host holds\nno App private key to mint tokens from. The supplied ``installation_id``\nmust be one of the org's own connected installations (404 otherwise,\n``list_installations_for_org``) and must not be suspended (409,\n``installation_suspended``). All three checks run before any write.","operationId":"connect_org_pm_integration_api_org_pm_integration_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectPmIntegrationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgPmIntegrationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["org-pm-integration"],"summary":"Disconnect Org Pm Integration","description":"Disable server-side board I/O for the caller's org (idempotent).\n\nA no-op (still 204) when the org has no integration row or it is already\ndisabled.","operationId":"disconnect_org_pm_integration_api_org_pm_integration_delete","responses":{"204":{"description":"Successful Response"}}}},"/api/orgs":{"get":{"tags":["orgs"],"summary":"List Orgs","description":"Orgs the caller belongs to. Disabled mode: every org, as owner.","operationId":"list_orgs_api_orgs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Orgs Api Orgs Get"}}}}}},"post":{"tags":["orgs"],"summary":"Create Org","description":"Create an organization; the authenticated caller becomes its owner.\n\nUnder hosted auth, every allow path requires the caller's verified email.\n``ApiSettings.org_creation_open=True`` is the repository default: open\npolicy permits authenticated, email-verified callers to create an org.\nWith ``ORG_CREATION_OPEN=false``, the caller must also hold an active\nsubscription (``has_active_subscription`` — the Phase-8 seam, currently\n``False``) or appear in ``ORG_CREATION_ALLOWED_EMAILS``. Neither restricted\npath bypasses verified email. Auth-disabled local mode (``user is None``)\nremains unrestricted: the single local caller is the owner of everything.","operationId":"create_org_api_orgs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrgRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Create Org Api Orgs Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{org_id}":{"patch":{"tags":["orgs"],"summary":"Update Org","description":"Rename an organization. The slug is immutable (it anchors links).","operationId":"update_org_api_orgs__org_id__patch","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrgRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Org Api Orgs  Org Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["orgs"],"summary":"Delete Org","description":"Delete an organization (owner only).\n\nRefused while the org still contains projects or registered pollers —\nproject data is never cascade-deleted from here (use the per-project\ndelete endpoint first). The default org is undeletable: auth-disabled\nsingle-user mode and ``projects.org_id``'s permanent DEFAULT depend on\nits existence.","operationId":"delete_org_api_orgs__org_id__delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{org_id}/members":{"get":{"tags":["orgs"],"summary":"List Org Members","description":"List an org's members with their project access and capabilities.\n\nEmails are best-effort (Postgres auth schema); ``project_ids`` carries a\nrestricted member's explicit grants and ``capabilities`` a member's granted\nfamilies (both empty for 'all'/privileged).","operationId":"list_org_members_api_orgs__org_id__members_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Org Members Api Orgs  Org Id  Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{org_id}/members/{user_id}":{"patch":{"tags":["orgs"],"summary":"Update Org Member Role","description":"Change a member's role. Touching admin/owner requires the owner role.\n\nThe change is captured to a ``member_role_changed`` audit row attached to\nthe org's lowest-id project (skipped when the org has no project, or when\nthe requested role equals the member's current role — a no-op writes no\nrow), committed atomically with the role write. ``before`` is the locked\npre-update role, ``after`` the requested role — mirrors the\n``capability_grant_changed`` writer in\n:func:`set_org_member_capabilities` below.","operationId":"update_org_member_role_api_orgs__org_id__members__user_id__patch","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberRoleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Org Member Role Api Orgs  Org Id  Members  User Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["orgs"],"summary":"Remove Org Member","description":"Remove a member. Removing an admin/owner requires the owner role.","operationId":"remove_org_member_api_orgs__org_id__members__user_id__delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Remove Org Member Api Orgs  Org Id  Members  User Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{org_id}/members/{user_id}/project-access":{"put":{"tags":["orgs"],"summary":"Set Org Member Project Access","description":"Set which projects a member/viewer can access.\n\n``project_access='all'`` restores the default full visibility (clearing\ngrants); ``'restricted'`` replaces the member's grant set with\n``project_ids`` (each id must be a project of this org — 400 otherwise).\nowner/admin targets are rejected (400): their access is invariantly\nunrestricted.\n\nThe change is captured to a ``member_project_access_changed`` audit row\nattached to the org's lowest-id project (skipped when the org has no\nproject, or when the canonical before/after state — post-normalization\n``project_access`` plus sorted granted project ids — is unchanged). The\n``before`` value is read INSIDE the transaction after locking the\nmember's ``org_members`` row (mirrors ``set_org_member_capabilities``),\nso two concurrent PUTs to the same member serialize.","operationId":"set_org_member_project_access_api_orgs__org_id__members__user_id__project_access_put","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectAccessRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Org Member Project Access Api Orgs  Org Id  Members  User Id  Project Access Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{org_id}/members/{user_id}/capabilities":{"put":{"tags":["orgs"],"summary":"Set Org Member Capabilities","description":"Set which capability families a member/viewer holds.\n\nCapabilities are SUBTRACTIVE: an explicit grant set narrows the member to\nthat subset of the six families; an empty set restores the unrestricted\ndefault (clearing grants). owner/admin targets are rejected (400 —\n:class:`PrivilegedCapabilityError`): their capabilities are invariantly\nunrestricted. An unknown family is 400 (``ValueError``); a non-member 404.\n\nThe change is captured to a grant-change audit row attached to the org's\nlowest-id project (skipped when the org has no project). The ``before``\nvalue is read INSIDE the transaction after locking the member's\n``org_members`` row, so two concurrent PUTs to the same member serialize —\nthe second's locked read reflects the first's committed write, keeping every\naudit row's ``before`` accurate.","operationId":"set_org_member_capabilities_api_orgs__org_id__members__user_id__capabilities_put","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilitiesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Org Member Capabilities Api Orgs  Org Id  Members  User Id  Capabilities Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{org_id}/my-capabilities":{"get":{"tags":["orgs"],"summary":"Get My Capabilities","description":"Return the caller's own resolved capabilities in the org.\n\n``unrestricted`` is true for owner/admin or an empty grant set (subtractive\ndefault). Auth-disabled single-user mode acts as the unrestricted owner of\nevery org.","operationId":"get_my_capabilities_api_orgs__org_id__my_capabilities_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get My Capabilities Api Orgs  Org Id  My Capabilities Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{org_id}/invitations":{"get":{"tags":["orgs"],"summary":"List Org Invitations","description":"List the org's open (not yet accepted) invitations.","operationId":"list_org_invitations_api_orgs__org_id__invitations_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Org Invitations Api Orgs  Org Id  Invitations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["orgs"],"summary":"Create Org Invitation","description":"Invite an email to the org. The raw token is returned exactly once.\n\nRe-inviting an email refreshes the invitation (role/token/expiry/scope).\nInviting at admin/owner requires the owner role, and those roles must be\ninvited with full project access and no capability restriction (400\notherwise). A 'restricted' invite carries the granted project ids, and any\n``capabilities`` narrow the member's families — both applied on accept.","operationId":"create_org_invitation_api_orgs__org_id__invitations_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvitationRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Org Invitation Api Orgs  Org Id  Invitations Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{org_id}/invitations/{invitation_id}":{"delete":{"tags":["orgs"],"summary":"Revoke Org Invitation","description":"Revoke (delete) an invitation.","operationId":"revoke_org_invitation_api_orgs__org_id__invitations__invitation_id__delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","title":"Invitation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Revoke Org Invitation Api Orgs  Org Id  Invitations  Invitation Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{org_id}/role-templates":{"get":{"tags":["orgs"],"summary":"List Org Role Templates","description":"List the org's role templates, seeding the five built-ins on first read.\n\n``ensure_seeded_templates`` flips ``organizations.role_templates_seeded`` in\nthe same transaction, so re-reads never re-seed and a deliberately-deleted\ndefault template does not resurrect.","operationId":"list_org_role_templates_api_orgs__org_id__role_templates_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Org Role Templates Api Orgs  Org Id  Role Templates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["orgs"],"summary":"Create Org Role Template","description":"Create a role template from a {role, access, capability} bundle.\n\nA privileged (owner/admin) role given a restricted scope or any capabilities\nis 400; an unknown capability family or a foreign project id is 400; a\nduplicate ``(org_id, name)`` is 409.","operationId":"create_org_role_template_api_orgs__org_id__role_templates_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTemplateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Org Role Template Api Orgs  Org Id  Role Templates Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{org_id}/role-templates/{template_id}":{"patch":{"tags":["orgs"],"summary":"Update Org Role Template","description":"Replace a role template's full bundle (404 if not in the org).\n\nSame 400/409 validation as create (the surviving ``IntegrityError`` here is\na rename that collides with a sibling template — see ``create``).","operationId":"update_org_role_template_api_orgs__org_id__role_templates__template_id__patch","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTemplateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Org Role Template Api Orgs  Org Id  Role Templates  Template Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["orgs"],"summary":"Delete Org Role Template","description":"Delete a role template (404 if absent).\n\nTemplates are STAMPED onto members, not linked — previously-stamped members\nkeep their role/access/capability grants intact.","operationId":"delete_org_role_template_api_orgs__org_id__role_templates__template_id__delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Org Role Template Api Orgs  Org Id  Role Templates  Template Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{org_id}/role-templates/{template_id}/apply":{"post":{"tags":["orgs"],"summary":"Apply Org Role Template","description":"Stamp a template's bundle onto one or more members (best-effort).\n\nWhole-request guard: an admin (non-owner) applying an owner/admin-role\ntemplate gets 403 BEFORE any member is touched. Per member the apply runs in\nits own transaction and is best-effort — one un-appliable target (last\nowner, foreign target, stale project id) never blocks the rest — reporting a\nskip reason (``invalid_user_id`` / ``not_a_member`` / ``requires_owner`` /\n``would_demote_last_owner`` / ``unknown_project`` / ``invalid_bundle``). Each\nsuccessful apply commits its audit row atomically and invalidates that\nmember's auth cache (role/access/capabilities all ride the cached tuple).","operationId":"apply_org_role_template_api_orgs__org_id__role_templates__template_id__apply_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyTemplateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Apply Org Role Template Api Orgs  Org Id  Role Templates  Template Id  Apply Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/invitations/accept":{"post":{"tags":["orgs"],"summary":"Accept Invitation","description":"Accept an invitation by its raw token; joins the caller to the org.\n\nRequires an authenticated user even though the module is auth-exempt —\nthe membership row needs the caller's Supabase user id. Possession of the\n(single-use, expiring) token is NOT sufficient on its own: the caller's\nverified JWT email MUST match the invited email (case-insensitive), so a\nforwarded/leaked token can never let a different account join the org. An\nexisting membership is preserved (the invite never demotes/promotes in\nplace).","operationId":"accept_invitation_api_invitations_accept_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInvitationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Accept Invitation Api Invitations Accept Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/{task_id}/pause":{"post":{"tags":["pause"],"summary":"Pause Task","description":"Pause a task — no new bot sessions until unpaused.\n\n``task_id`` is the numeric ``tasks.id`` primary key; the param name is\nload-bearing (see module docstring) so the auth gate project-scopes the\nrequest off the task row itself.","operationId":"pause_task_api_tasks__task_id__pause_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/{task_id}/unpause":{"post":{"tags":["pause"],"summary":"Unpause Task","description":"Restore future eligibility subject to other gates; refuse refinement holds.","operationId":"unpause_task_api_tasks__task_id__unpause_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/initiatives/{initiative_id}/pause":{"post":{"tags":["pause"],"summary":"Pause Initiative","description":"Pause an initiative — covers its child tasks via the dispatch joins.\n\n``initiative_id`` is the numeric ``initiatives.id`` primary key; the param\nname is load-bearing (see module docstring) for project-scoped auth.","operationId":"pause_initiative_api_initiatives__initiative_id__pause_post","parameters":[{"name":"initiative_id","in":"path","required":true,"schema":{"type":"integer","title":"Initiative Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/initiatives/{initiative_id}/unpause":{"post":{"tags":["pause"],"summary":"Unpause Initiative","description":"Restore future eligibility subject to other gates; refuse refinement holds.","operationId":"unpause_initiative_api_initiatives__initiative_id__unpause_post","parameters":[{"name":"initiative_id","in":"path","required":true,"schema":{"type":"integer","title":"Initiative Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/{task_id}/mark-refined":{"post":{"tags":["pause"],"summary":"Mark Task Refined","description":"Release a held task — clears the pause and the ``needs-refinement`` label.\n\n409 ``not_held`` unless the task carries the label; the status is never\nwritten. ``task_id`` is the numeric ``tasks.id`` primary key; the param\nname is load-bearing (see module docstring) for project-scoped auth.","operationId":"mark_task_refined_api_tasks__task_id__mark_refined_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/initiatives/{initiative_id}/mark-refined":{"post":{"tags":["pause"],"summary":"Mark Initiative Refined","description":"Release a held initiative — pause and ``needs-refinement`` cleared together.\n\n409 ``not_held`` unless the initiative carries the label; the status is\nnever written. ``initiative_id`` is the numeric ``initiatives.id`` primary\nkey; the param name is load-bearing (see module docstring) for\nproject-scoped auth.","operationId":"mark_initiative_refined_api_initiatives__initiative_id__mark_refined_post","parameters":[{"name":"initiative_id","in":"path","required":true,"schema":{"type":"integer","title":"Initiative Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/plans":{"get":{"tags":["plans"],"summary":"List Plans","description":"List plan directories from the target repository.","operationId":"list_plans_api_projects__slug__plans_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Plans Api Projects  Slug  Plans Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/specs":{"get":{"tags":["plans"],"summary":"List Specs","description":"List task spec files from initiative plan directories.","operationId":"list_specs_api_projects__slug__specs_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Specs Api Projects  Slug  Specs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/plans/{path}":{"get":{"tags":["plans"],"summary":"Read Plan File","description":"Read a specific plan or spec markdown file from the target repository.","operationId":"read_plan_file_api_projects__slug__plans__path__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Read Plan File Api Projects  Slug  Plans  Path  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/poller/db/exec":{"post":{"tags":["poller-db"],"summary":"Exec Stmt","description":"Run ONE autocommit statement under the caller's RLS identity.","operationId":"exec_stmt_api_poller_db_exec_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Exec Stmt Api Poller Db Exec Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/poller/db/tx":{"post":{"tags":["poller-db"],"summary":"Tx Begin","description":"Open a held identity-scoped transaction and return its ``tx_id``.","operationId":"tx_begin_api_poller_db_tx_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Tx Begin Api Poller Db Tx Post"}}}}}}},"/api/poller/db/tx/{tx_id}/exec":{"post":{"tags":["poller-db"],"summary":"Tx Exec","description":"Run ONE statement on the held transaction ``tx_id``.","operationId":"tx_exec_api_poller_db_tx__tx_id__exec_post","parameters":[{"name":"tx_id","in":"path","required":true,"schema":{"type":"string","title":"Tx Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Tx Exec Api Poller Db Tx  Tx Id  Exec Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/poller/db/tx/{tx_id}/commit":{"post":{"tags":["poller-db"],"summary":"Tx Commit","description":"Commit the held transaction ``tx_id``.","operationId":"tx_commit_api_poller_db_tx__tx_id__commit_post","parameters":[{"name":"tx_id","in":"path","required":true,"schema":{"type":"string","title":"Tx Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Tx Commit Api Poller Db Tx  Tx Id  Commit Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/poller/db/tx/{tx_id}/rollback":{"post":{"tags":["poller-db"],"summary":"Tx Rollback","description":"Roll back the held transaction ``tx_id``.","operationId":"tx_rollback_api_poller_db_tx__tx_id__rollback_post","parameters":[{"name":"tx_id","in":"path","required":true,"schema":{"type":"string","title":"Tx Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Tx Rollback Api Poller Db Tx  Tx Id  Rollback Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/poller/db/subagents/ingest":{"post":{"tags":["poller-db"],"summary":"Ingest Subagent Events","description":"Apply an ordered batch under the caller's RLS identity, all or nothing.\n\nA session this identity cannot see is reported as a 200 carrying the\ntop-level wire-error envelope :func:`_wire_error_response` builds, NOT as a\n404. The client reserves 404 for one meaning — this API build does not\nexpose the route — and answers it by falling back to per-event ingestion\n(``core/poller_transport.RemoteDatabaseConnection.ingest_subagent_events``).\nAnswering an invisible session with the same status would silently send the\npoller back to the N+1 write path BUG-3670 removed, where every per-event\ncall then fails with an unrelated message.\n\nThe whole transaction is bounded by\nthe smaller of :data:`~core.poller_wire.SUBAGENT_INGEST_DEADLINE_S` and\nthe caller's remaining allowance minus a rollback/finalization reserve, because\n``subagents_repo.ingest_event`` holds the parent session row's\n``SELECT ... FOR UPDATE`` for every event in the batch and that lock also\nblocks ``mark_session_completed_if_open``. Nothing else ends this handler\nwhen the poller stops waiting: its own replay allowance expiring, or the\npoller process exiting, closes the connection on the client side only, so\nwithout this deadline a batch wedged on a slow statement would hold the\nlock — and block the parent finalization BUG-3670 exists to unblock — for\nas long as the statement ran. On expiry the ``acquire_as_identity`` scope\nexits FIRST (it is nested inside the timeout), rolling the transaction back\nand returning the connection before the wire error is built, so the lock is\nalready released when the poller reads the response. That\n:class:`~core.db.OperationalError` reaches the client through\n``raise_wire_error``, is not one of the four exceptions\n``core/subagent_ingestion._submit`` retries per-event, and so propagates to\nthe caller's ``final_replay_failure_exhausted`` as one durable attempt.","operationId":"ingest_subagent_events_api_poller_db_subagents_ingest_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubagentIngestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubagentIngestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pollers/{poller_id}/approve":{"post":{"tags":["pollers"],"summary":"Approve Poller","description":"Approve one pending current-org poller and wake after commit.","operationId":"approve_poller_api_pollers__poller_id__approve_post","parameters":[{"name":"poller_id","in":"path","required":true,"schema":{"type":"string","title":"Poller Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollerFleetItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pollers/{poller_id}/scopes":{"put":{"tags":["pollers"],"summary":"Replace Poller Scopes","description":"Serialize, validate, replace, and atomically audit poller scopes.","operationId":"replace_poller_scopes_api_pollers__poller_id__scopes_put","parameters":[{"name":"poller_id","in":"path","required":true,"schema":{"type":"string","title":"Poller Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollerScopesPutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollerFleetItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pollers/{poller_id}/lifecycle":{"post":{"tags":["pollers"],"summary":"Change Poller Lifecycle","description":"Apply one allowed lifecycle transition and wake resumes after commit.","operationId":"change_poller_lifecycle_api_pollers__poller_id__lifecycle_post","parameters":[{"name":"poller_id","in":"path","required":true,"schema":{"type":"string","title":"Poller Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollerLifecycleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollerFleetItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/poller/logs/broadcast":{"post":{"tags":["poller-logs"],"summary":"Broadcast Log","description":"Realtime-broadcast a log batch to ``body.topic`` via the service-role key.","operationId":"broadcast_log_api_poller_logs_broadcast_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Broadcast Log Api Poller Logs Broadcast Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/poller/logs/object":{"post":{"tags":["poller-logs"],"summary":"Upload Log Object","description":"Upsert a log object into Storage via the service-role key.\n\nReturns ``{ok, status, bucket_missing}``. ``status`` carries the upstream\nStorage HTTP status (the poller decides whether to retry) and is ``None``\non a transport error reaching Supabase.\n\n``bucket_missing`` is the tri-state, server-derived answer to \"was that\nfailure caused by an absent bucket?\" — ``True``/``False`` from a\n``bucket_exists`` probe, ``None`` when the probe could not tell. It exists\nbecause an API-transport poller holds no service-role key and so cannot\nprobe Storage itself; without it a missing bucket's **400** (this\ndeployment answers ``NoSuchBucket`` with 400, not 404) would permanently\nblacklist the object path for the rest of that poller's run (BUG-2939).\nOnly this boolean crosses the wire — never the provider body, and never\nany credential. ``body.bucket`` was already validated against\n``_KNOWN_BUCKETS`` above, so the probe reaches Storage with no\ncaller-controlled input.\n\nThe probe runs ONLY on the failure path: a successful upload must not pay\na second Storage round trip.","operationId":"upload_log_object_api_poller_logs_object_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectUploadRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Upload Log Object Api Poller Logs Object Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/poller/wake":{"get":{"tags":["poller-wake"],"summary":"Wait For Dispatch Wake","description":"Block up to ``timeout`` for a dispatch wake; report whether one arrived.","operationId":"wait_for_dispatch_wake_api_poller_wake_get","parameters":[{"name":"timeout","in":"query","required":false,"schema":{"type":"number","maximum":55.0,"minimum":1.0,"description":"Max seconds to block waiting for a dispatch wake.","default":25.0,"title":"Timeout"},"description":"Max seconds to block waiting for a dispatch wake."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Wait For Dispatch Wake Api Poller Wake Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pollers":{"get":{"tags":["pollers"],"summary":"List Poller Fleet","description":"List only the current organization's pollers using the database clock.","operationId":"list_poller_fleet_api_pollers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollerFleetResponse"}}}}}}},"/api/pollers/settings":{"patch":{"tags":["pollers"],"summary":"Update Poller Settings","description":"Serialize, update, and atomically audit the auto-approval setting.","operationId":"update_poller_settings_api_pollers_settings_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollerSettingsPatchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollerSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/pr-review-delivery/health":{"get":{"tags":["pr-review"],"summary":"Get Pr Review Delivery Health","description":"Return per-state artifact counts for a project.","operationId":"get_pr_review_delivery_health_api_projects__slug__pr_review_delivery_health_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryHealthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/pr-review-artifacts":{"get":{"tags":["pr-review"],"summary":"List Pr Review Artifacts","description":"List a project's PR-review artifacts, newest-first, bounded pagination.\n\n``limit`` has no ``le=`` constraint so an oversized request is silently\nclamped to ``_MAX_LIMIT`` here rather than rejected with 422 by FastAPI.\nThe PR filter runs in SQL so PRs outside the first unfiltered page are returned.","operationId":"list_pr_review_artifacts_api_projects__slug__pr_review_artifacts_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":0,"default":0,"title":"Offset"}},{"name":"pr_number","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":2147483647,"minimum":1},{"type":"null"}],"title":"Pr Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ArtifactResponse"},"title":"Response List Pr Review Artifacts Api Projects  Slug  Pr Review Artifacts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sessions/{session_id}/progress":{"get":{"tags":["progress"],"summary":"Get Session Progress","description":"Return progress events for a session, ordered by creation time.","operationId":"get_session_progress_api_sessions__session_id__progress_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProgressEventResponse"},"title":"Response Get Session Progress Api Sessions  Session Id  Progress Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/diary":{"get":{"tags":["project-diary"],"summary":"List Project Diary","description":"List a project's diary entries, newest-first.\n\n``before`` is an optional ``YYYY-MM-DD`` page cursor: only strictly earlier\ndays are returned, so successive pages can neither repeat nor skip a day.","operationId":"list_project_diary_api_projects__slug__diary_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":60,"minimum":1,"default":10,"title":"Limit"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiaryListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/diary/{diary_date}":{"get":{"tags":["project-diary"],"summary":"Get Project Diary Entry","description":"Return one project-day entry, 404 when that day has none.","operationId":"get_project_diary_entry_api_projects__slug__diary__diary_date__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"diary_date","in":"path","required":true,"schema":{"type":"string","title":"Diary Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiaryEntryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/diary/{diary_date}/rebuild":{"post":{"tags":["project-diary"],"summary":"Rebuild Project Diary Entry","description":"Regenerate one closed project-day, replacing a finalized entry.\n\nThe operator repair path. ``finalize=True`` and ``force=True``: a rebuild\nan admin asked for is a deliberate, authoritative regeneration, not a\nprovisional pass, so it stamps ``finalized_at`` and is the one sanctioned\ncaller of the unguarded ``force_upsert_entry``.\n\nA day that is not yet closed is refused with 409 rather than stored: a\nfinalized entry for a still-open day would freeze a partial day that the\nscheduled generation could then never rewrite. \"Today\" comes from the\nDATABASE clock, for the same reason the generator stamps ``finalized_at``\nfrom it — a host clock running ahead near midnight would otherwise let that\nexact partial-day freeze through.","operationId":"rebuild_project_diary_entry_api_projects__slug__diary__diary_date__rebuild_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"diary_date","in":"path","required":true,"schema":{"type":"string","title":"Diary Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/DiaryEntryResponse"},{"$ref":"#/components/schemas/DiaryRebuildSkippedResponse"}],"title":"Response Rebuild Project Diary Entry Api Projects  Slug  Diary  Diary Date  Rebuild Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects":{"get":{"tags":["projects"],"summary":"Get Projects","description":"List projects.\n\nUnder hosted auth this route has no project/slug anchor, so the viewer\ngate resolved the org from the required ``X-Org-Id`` header — the\nlisting is scoped server-side to that org (the API connects as the\ntable owner and bypasses RLS, so the query must filter explicitly) and,\nfor restricted members, to their granted projects. Auth disabled: the\nhistorical cross-project listing.\n\nOne call therefore answers for at most ONE org — a client that needs\nevery org the caller belongs to must fan out over ``GET /api/orgs`` and\nmerge (BUG-2893; the Desktop add-project listing does exactly this).\nEach row carries ``org_id``/``org_name`` so the merged result stays\nattributable.","operationId":"get_projects_api_projects_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProjectSummary"},"type":"array","title":"Response Get Projects Api Projects Get"}}}}}}},"/api/projects/register":{"post":{"tags":["projects"],"summary":"Register Project","description":"Register a project into an org through the credential-less embedded API.\n\nInserts the ``projects`` row with an EXPLICIT ``org_id`` (so the admin-only\nRLS policy is the real authorization gate) and writes the secret-free\ndesktop seed. Idempotent and org-scoped: a slug already registered in the\nrequested org returns 200 with the existing id; a slug taken by a different\norg returns 409 — whether that org is visible under RLS (row org_id differs)\nor invisible (surfaced by the global-unique IntegrityError). Performs NO\nmachine-config write — the desktop owns its own config.yaml.","operationId":"register_project_api_projects_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterProjectRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterProjectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}":{"get":{"tags":["projects"],"summary":"Get Project Detail","operationId":"get_project_detail_api_projects__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["projects"],"summary":"Delete Project","description":"Delete a project and all its data. No active sessions may exist.\n\nOn local deployments the project is also removed from config.yaml (which\nrequires 2+ configured projects). On hosted deployments only the DB rows\nare deleted: the baked config.yaml is not a live machine config and may\nnot even list the project (e.g. one onboarded after the image was built).","operationId":"delete_project_api_projects__slug__delete","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Project Api Projects  Slug  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/desktop-config":{"get":{"tags":["projects"],"summary":"Get Desktop Config","description":"Return the secret-free, PM-agnostic seed the desktop needs to set this\nproject up locally. Org-scoped via the slug path anchor; member-gated.","operationId":"get_desktop_config_api_projects__slug__desktop_config_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DesktopProjectConfig"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["projects"],"summary":"Put Desktop Config","description":"Replace the project's desktop seed — the workspace-owned project defaults.\n\nDB-only, so it works identically on hosted and local deployments; desktops\nPULL the seed when an operator sets the project up locally. Full-replace\nsemantics for the fields ``DesktopSeedUpdate`` models (the settings form\nloads GET /desktop-config, edits, PUTs back); the route MERGES those\nfields onto the stored seed rather than rebuilding it from scratch, so\ncanonical fields the request shape can't represent (``repo.fields``,\n``approval_states``, ``wave_overlap_hot_paths``, ``remote_reviewer``,\n``indexer``, ``verify_commands``, ``deferred_path_rules``,\n``test_quarantine``) survive an unrelated field's save instead of being\nsilently dropped. Tagged ``{cmd, domains, provides}`` command entries are\nrepresentable since INI-2997-002 and are stored verbatim.","operationId":"put_desktop_config_api_projects__slug__desktop_config_put","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DesktopSeedUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DesktopProjectConfig"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/stats":{"get":{"tags":["projects"],"summary":"Get Project Stats Endpoint","operationId":"get_project_stats_endpoint_api_projects__slug__stats_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectStats"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/tasks":{"get":{"tags":["tasks"],"summary":"Get Project Tasks","operationId":"get_project_tasks_api_projects__slug__tasks_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"wave","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Wave"}},{"name":"initiative_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Initiative Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TaskResponse"},"title":"Response Get Project Tasks Api Projects  Slug  Tasks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/pause":{"post":{"tags":["projects"],"summary":"Pause Project","description":"Pause a project. Idempotent — always sets paused=1.","operationId":"pause_project_api_projects__slug__pause_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/unpause":{"post":{"tags":["projects"],"summary":"Unpause Project","description":"Unpause a project. Idempotent — always sets paused=0.","operationId":"unpause_project_api_projects__slug__unpause_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/toggle-pause":{"post":{"tags":["projects"],"summary":"Toggle Pause","description":"Toggle a project's paused state. Backward-compatible endpoint.","operationId":"toggle_pause_api_projects__slug__toggle_pause_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/agents/{role}/enable":{"post":{"tags":["projects"],"summary":"Enable Agent","description":"Enable a schedulable agent (``product_owner``/``scrum_master``) for a project.\n\nADR-016 keeps the ``member`` role floor (parity with the per-item pause) and\nstacks the ``operations`` capability on top, so a restricted member without\nthat family is denied before any flag or audit write. CAS + audit are\natomic; a second identical call is idempotent (``changed: false``, no\nduplicate audit row). Unknown role → 400, unknown slug → 404.","operationId":"enable_agent_api_projects__slug__agents__role__enable_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"role","in":"path","required":true,"schema":{"type":"string","title":"Role"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/agents/{role}/disable":{"post":{"tags":["projects"],"summary":"Disable Agent","description":"Disable a schedulable agent for a project — the inverse of ``enable_agent``.","operationId":"disable_agent_api_projects__slug__agents__role__disable_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"role","in":"path","required":true,"schema":{"type":"string","title":"Role"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/appearance":{"get":{"tags":["projects"],"summary":"Get Appearance","operationId":"get_appearance_api_projects__slug__appearance_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectAppearance"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["projects"],"summary":"Put Appearance","description":"Update project appearance. Admin-gated like every other settings\nmutation (the router-wide viewer baseline is read access only).","operationId":"put_appearance_api_projects__slug__appearance_put","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectAppearanceUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectAppearance"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/sessions":{"delete":{"tags":["projects"],"summary":"Clear Sessions","description":"Clear completed session history for a project. Active sessions block the operation.","operationId":"clear_sessions_api_projects__slug__sessions_delete","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Clear Sessions Api Projects  Slug  Sessions Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["sessions"],"summary":"Get Project Sessions","operationId":"get_project_sessions_api_projects__slug__sessions_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"session_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Type"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SessionWithStatus"},"title":"Response Get Project Sessions Api Projects  Slug  Sessions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/provider-catalog/runtime-policies":{"get":{"tags":["provider-catalog"],"summary":"List Runtime Policies","description":"Read shared runtime approvals even when no model catalog is available.","operationId":"list_runtime_policies_api_provider_catalog_runtime_policies_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Runtime Policies Api Provider Catalog Runtime Policies Get"}}}}}}},"/api/provider-catalog/runtime-policies/{provider}/{adapter_contract}":{"put":{"tags":["provider-catalog"],"summary":"Update Runtime Policy","description":"Publish verified compatibility or revocation without a client release.","operationId":"update_runtime_policy_api_provider_catalog_runtime_policies__provider___adapter_contract__put","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"adapter_contract","in":"path","required":true,"schema":{"type":"string","title":"Adapter Contract"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuntimePolicyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Runtime Policy Api Provider Catalog Runtime Policies  Provider   Adapter Contract  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/provider-catalog":{"get":{"tags":["provider-catalog"],"summary":"List Persisted Provider Catalog","description":"Return the persisted (last-known-good) provider catalog.\n\nReads only the DB `provider_catalog` table — never contacts a vendor —\nand never includes machine-local readiness fields (`cli_found`,\n`env_vars_present`, `config`). `id`-keyed so Desktop's `normalizeProvider`\n(which reads `raw.id`) consumes it unchanged.","operationId":"list_persisted_provider_catalog_api_provider_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Persisted Provider Catalog Api Provider Catalog Get"}}}}}}},"/api/provider-catalog/reference-models":{"get":{"tags":["provider-catalog"],"summary":"List Reference Models","description":"Return reviewed reference-only model metadata with its provenance.\n\nEvery entry has ``availability_scope == \"reference_only\"``: it is operator\nguidance from official public documentation, not account availability.\nThese entries never enter the shared ``models`` above, automatic subagent\nchoices or configured-model validation, and local authenticated discovery\nremains the authority. Staleness comes from each receipt's\n``verified_at``; no discovery outcome renews it.","operationId":"list_reference_models_api_provider_catalog_reference_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Reference Models Api Provider Catalog Reference Models Get"}}}}}}},"/api/provider-catalog/health":{"get":{"tags":["provider-catalog"],"summary":"Get Provider Health","description":"Current coverage, sync freshness and alerts for an org administrator.\n\nGlobal fields carry public metadata only. The three counts describe the\ncomplete authorized inputs at ``checked_at`` and do not change with the\nalert filters or page; ``total`` and ``next_cursor`` describe the\nauthorized alerts that match the filters. A failed read is a 503, never\nan empty healthy answer.","operationId":"get_provider_health_api_provider_catalog_health_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"enum":["sync_disabled","sync_never_successful","sync_stale","missing_credentials","pricing_source_unresolved","missing_rate","coverage_unknown","window_integrity","cli_cost_divergence"],"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"scope","in":"query","required":false,"schema":{"anyOf":[{"enum":["global","organization"],"type":"string"},{"type":"null"}],"title":"Scope"}},{"name":"include_resolved","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Resolved"}},{"name":"after_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":9223372036854775807,"minimum":0},{"type":"null"}],"title":"After Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Provider Health Api Provider Catalog Health Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/provider-catalog/refresh":{"post":{"tags":["provider-catalog"],"summary":"Refresh Provider Catalog","description":"Run one manual catalog and pricing synchronization (no automatic apply).","operationId":"refresh_provider_catalog_api_provider_catalog_refresh_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Refresh Provider Catalog Api Provider Catalog Refresh Post"}}}}}}},"/api/provider-catalog/snapshots/{snapshot_id}/restore":{"post":{"tags":["provider-catalog"],"summary":"Restore Catalog Snapshot","description":"Restore one retained shared graph exactly, through a new audited run.\n\nThe body names the hash of the current graph and a reason; it never\ncarries catalog JSON. Machine-local (Codex) graphs are never restored.","operationId":"restore_catalog_snapshot_api_provider_catalog_snapshots__snapshot_id__restore_post","parameters":[{"name":"snapshot_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Snapshot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogRestoreRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Restore Catalog Snapshot Api Provider Catalog Snapshots  Snapshot Id  Restore Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/provider-catalog/pricing/proposals":{"get":{"tags":["provider-catalog"],"summary":"List Pricing Proposals","description":"Keyset page of full proposals (ascending id) with the same-filter total.","operationId":"list_pricing_proposals_api_provider_catalog_pricing_proposals_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["pending","applied","rejected"],"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"enum":["claude","codex","gemini","grok"],"type":"string"},{"type":"null"}],"title":"Provider"}},{"name":"after_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":9223372036854775807,"minimum":0},{"type":"null"}],"title":"After Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Pricing Proposals Api Provider Catalog Pricing Proposals Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/provider-catalog/pricing/proposals/{proposal_id}":{"get":{"tags":["provider-catalog"],"summary":"Get Pricing Proposal","description":"One proposal with its hash, publication (if applied) and current preview.","operationId":"get_pricing_proposal_api_provider_catalog_pricing_proposals__proposal_id__get","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Proposal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Pricing Proposal Api Provider Catalog Pricing Proposals  Proposal Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/provider-catalog/pricing/proposals/{proposal_id}/revise":{"post":{"tags":["provider-catalog"],"summary":"Revise Pricing Proposal","description":"Replace a pending proposal with reviewed exact rows (new pending proposal).","operationId":"revise_pricing_proposal_api_provider_catalog_pricing_proposals__proposal_id__revise_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Proposal Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Revise Pricing Proposal Api Provider Catalog Pricing Proposals  Proposal Id  Revise Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/provider-catalog/pricing/proposals/{proposal_id}/apply":{"post":{"tags":["provider-catalog"],"summary":"Apply Pricing Proposal","description":"Approve and publish a pending proposal atomically (idempotent on repeat).","operationId":"apply_pricing_proposal_api_provider_catalog_pricing_proposals__proposal_id__apply_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Proposal Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Apply Pricing Proposal Api Provider Catalog Pricing Proposals  Proposal Id  Apply Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/provider-catalog/pricing/proposals/{proposal_id}/reject":{"post":{"tags":["provider-catalog"],"summary":"Reject Pricing Proposal","description":"Record the reviewer's rejection and reason.","operationId":"reject_pricing_proposal_api_provider_catalog_pricing_proposals__proposal_id__reject_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Proposal Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reject Pricing Proposal Api Provider Catalog Pricing Proposals  Proposal Id  Reject Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/provider-catalog/pricing/publications/{publication_id}/recover":{"post":{"tags":["provider-catalog"],"summary":"Recover Pricing Publication","description":"Publish a compensating restoration of selected prior rates.","operationId":"recover_pricing_publication_api_provider_catalog_pricing_publications__publication_id__recover_post","parameters":[{"name":"publication_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":1,"title":"Publication Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoverRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Recover Pricing Publication Api Provider Catalog Pricing Publications  Publication Id  Recover Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reconciliation":{"get":{"tags":["provider-conflicts"],"summary":"Get Reconciliation","operationId":"get_reconciliation_api_reconciliation_get","parameters":[{"name":"slug","in":"query","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"emit_conflicts","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Emit Conflicts"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Reconciliation Api Reconciliation Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/conflicts":{"get":{"tags":["provider-conflicts"],"summary":"Get Conflicts","operationId":"get_conflicts_api_conflicts_get","parameters":[{"name":"slug","in":"query","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Conflicts Api Conflicts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/conflicts/{conflict_id}/resolve":{"post":{"tags":["provider-conflicts"],"summary":"Resolve Work Item Conflict","operationId":"resolve_work_item_conflict_api_conflicts__conflict_id__resolve_post","parameters":[{"name":"conflict_id","in":"path","required":true,"schema":{"type":"integer","title":"Conflict Id"}},{"name":"slug","in":"query","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"resolution_status","in":"query","required":true,"schema":{"type":"string","title":"Resolution Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Resolve Work Item Conflict Api Conflicts  Conflict Id  Resolve Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/provider-sync/health":{"get":{"tags":["provider-sync"],"summary":"Get Provider Sync Health","description":"Return provider-neutral sync and outbound queue health from Postgres.","operationId":"get_provider_sync_health_api_projects__slug__provider_sync_health_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderSyncHealthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/provider-sync/pending":{"get":{"tags":["provider-sync"],"summary":"List Pending Pushes","description":"List queued/failed outbound pushes for a project (newest activity first).\n\nA non-empty ``last_error`` (or ``sync_state='push_failed'``) marks a push the\nUI can surface for retry. Pure read — no provider calls.","operationId":"list_pending_pushes_api_projects__slug__provider_sync_pending_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PendingPushResponse"},"title":"Response List Pending Pushes Api Projects  Slug  Provider Sync Pending Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/backlog":{"get":{"tags":["refinement"],"summary":"List Backlog","description":"Return open initiatives, tasks, and standalone bugs with entity_type tags.\n\nPer-task dollar cost (regular + refinement) is redacted to ``None`` for\ncallers below ``member`` (``viewer``); ``member``+ and auth-off see real\nvalues. Slug-anchored, so ``request.state.org_role`` is already resolved by\nthe router-wide gate — the helper reads it without a DB re-query. Each\nitem's embedded ``allowed_transitions`` is likewise filtered to the gates a\nrestricted member holds (``caller_capabilities``), so the board never\nsurfaces a forbidden gate button (INI-1777-007). The authenticated caller's\nid is additionally threaded through so each configured gate's embedded\n``allowed_transitions`` option carries the caller's approval progress\n(``None`` in local/auth-disabled mode — INI-1784-016).","operationId":"list_backlog_api_projects__slug__backlog_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BacklogItemResponse"},"title":"Response List Backlog Api Projects  Slug  Backlog Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/board/done":{"get":{"tags":["refinement"],"summary":"List Board Done","description":"Return a paginated page of Done board items (initiatives, tasks, bugs).\n\nPages by keyset when ``cursor`` (a ``next_cursor`` from a previous page)\nis supplied, and by ``offset`` otherwise — the offset path is what a client\nthat predates BUG-3228 still gets. A cursor names the last served row by\nits full sort key, so a row leaving the Done set between two requests can\nno longer push an unserved row past the page boundary. When a cursor is\nsupplied, ``offset`` is ignored for row selection but echoed back unchanged\nso the wire shape stays stable.\n\nEach item's per-task dollar cost (regular + refinement) is redacted to\n``None`` for callers below ``member``; ``member``+ and auth-off see real\nvalues. Each item's embedded ``allowed_transitions`` is filtered to the\ngates a restricted member holds (``caller_capabilities``), matching the\nbacklog feed and ``GET /transitions/allowed`` (INI-1777-007). The\nauthenticated caller's id is additionally threaded through for embedded\napproval progress, matching the backlog feed (INI-1784-016).","operationId":"list_board_done_api_projects__slug__board_done_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DoneBoardPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/initiatives/{initiative_id}/refine":{"post":{"tags":["refinement"],"summary":"Trigger Refinement","description":"Validate initiative is in Backlog status and spawn a refinement agent.","operationId":"trigger_refinement_api_projects__slug__initiatives__initiative_id__refine_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"initiative_id","in":"path","required":true,"schema":{"type":"integer","title":"Initiative Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Trigger Refinement Api Projects  Slug  Initiatives  Initiative Id  Refine Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/releases/desktop/latest":{"get":{"tags":["releases"],"summary":"Get Latest Desktop Release","description":"Latest published desktop release, or ``{\"available\": false}``.","operationId":"get_latest_desktop_release_api_releases_desktop_latest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Latest Desktop Release Api Releases Desktop Latest Get"}}}}}}},"/api/releases/desktop/notes":{"get":{"tags":["releases"],"summary":"Get Desktop Release Notes","description":"Full desktop release history with notes bodies, newest first.\n\nNotes live in the GitHub release bodies on the releases repo (updated by\nwhoever cuts a release — docs/desktop-release-runbook.md), so the web\npage reflects edits within the cache TTL with no web redeploy.\n\nSourced from GitHub's GraphQL API when a token is available (GraphQL\nalways requires auth), falling back to the REST releases-list endpoint\notherwise or on any GraphQL failure. See BUG-2651: the REST list\nendpoint intermittently returns 200 with an empty array for this repo\nwhile every other route to the same data is correct, so it is now the\nfallback rather than the sole source, and a well-formed empty result is\nnever cached (treated as transient so the next request retries).","operationId":"get_desktop_release_notes_api_releases_desktop_notes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Desktop Release Notes Api Releases Desktop Notes Get"}}}}}}},"/api/releases/desktop/assets/{asset_id}/download-url":{"get":{"tags":["releases"],"summary":"Get Desktop Asset Download Url","description":"Signed, short-lived download URL for one desktop release asset.","operationId":"get_desktop_asset_download_url_api_releases_desktop_assets__asset_id__download_url_get","parameters":[{"name":"asset_id","in":"path","required":true,"schema":{"type":"integer","title":"Asset Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Get Desktop Asset Download Url Api Releases Desktop Assets  Asset Id  Download Url Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/retros":{"get":{"tags":["retros"],"summary":"List Retros","description":"List retro sync log entries for a project with initiative details.","operationId":"list_retros_api_projects__slug__retros_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RetroWithInitiative"},"title":"Response List Retros Api Projects  Slug  Retros Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sessions/{session_id}/evidence":{"get":{"tags":["sessions"],"summary":"Get Session Evidence","description":"Return one bounded, schema-version-1 evidence page for a session.\n\nPhases, in this order, so no pooled database connection is ever held\nacross HTTP/Storage I/O (AC8): resolve the session and its project facts\n(each under its own short-lived connection), authorize, then read the\nsource — network artifacts with NO connection held, database evidence\nunder a separate one.","operationId":"get_session_evidence_api_sessions__session_id__evidence_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}},{"name":"kind","in":"query","required":true,"schema":{"enum":["progress","log","transcript","toolcalls","events","recovery"],"type":"string","title":"Kind"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"request_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Session Evidence Api Sessions  Session Id  Evidence Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sessions":{"get":{"tags":["sessions"],"summary":"List All Sessions","description":"List sessions across all projects with optional filtering and pagination.\n\nThis route has no project anchor, so under hosted auth the gate only\nproves membership in the ``X-Org-Id`` org — it does not constrain the\nquery. The listing is therefore scoped server-side to the org the auth\ngate resolved (``request.state.org_id``) and, for restricted members, to\ntheir granted projects; every caller-controlled filter (``project``,\n``task``, ``correlation_id``) is ANDed inside that scope. Auth disabled:\n``org_id``/``project_ids`` are ``None`` and behavior is unchanged\n(cross-project listing).","operationId":"list_all_sessions_api_sessions_get","parameters":[{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"project","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project"}},{"name":"task","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task"}},{"name":"correlation_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"}},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"-created_at","title":"Sort"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedSessionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/sessions/search":{"get":{"tags":["sessions"],"summary":"Search Project Sessions","description":"Page sessions belonging to the project identified by ``slug``.","operationId":"search_project_sessions_api_projects__slug__sessions_search_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"correlation_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"}},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"-created_at","title":"Sort"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedSessionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/{task_id}/sessions/search":{"get":{"tags":["sessions"],"summary":"Search Task Sessions","description":"Page sessions directly attached to a numeric task database id.","operationId":"search_task_sessions_api_tasks__task_id__sessions_search_get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"exclusiveMinimum":0,"title":"Task Id"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"correlation_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"}},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"-created_at","title":"Sort"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedSessionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/initiatives/{initiative_id}/sessions/search":{"get":{"tags":["sessions"],"summary":"Search Initiative Sessions","description":"Page direct and child-task sessions for an initiative tree.","operationId":"search_initiative_sessions_api_initiatives__initiative_id__sessions_search_get","parameters":[{"name":"initiative_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"exclusiveMinimum":0,"title":"Initiative Id"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"correlation_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"}},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"-created_at","title":"Sort"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedSessionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sessions/{session_id}":{"get":{"tags":["sessions"],"summary":"Get Session Detail","operationId":"get_session_detail_api_sessions__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionWithStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sessions/{session_id}/subagents":{"get":{"tags":["sessions"],"summary":"List Session Subagents","description":"List child observations without creating independent bot sessions.","operationId":"list_session_subagents_api_sessions__session_id__subagents_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"exclusiveMinimum":0,"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionSubagentListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sessions/{session_id}/subagents/{child_id}":{"get":{"tags":["sessions"],"summary":"Get Session Subagent","operationId":"get_session_subagent_api_sessions__session_id__subagents__child_id__get","parameters":[{"name":"child_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Child Id"}},{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"exclusiveMinimum":0,"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionSubagentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sessions/{session_id}/subagents/{child_id}/events":{"get":{"tags":["sessions"],"summary":"List Session Subagent Events","operationId":"list_session_subagent_events_api_sessions__session_id__subagents__child_id__events_get","parameters":[{"name":"child_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Child Id"}},{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","maximum":9223372036854775807,"exclusiveMinimum":0,"title":"Session Id"}},{"name":"after_sequence","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":9223372036854775807,"minimum":0},{"type":"null"}],"title":"After Sequence"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":500,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionSubagentEventListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sessions/{session_id}/diagnosis":{"post":{"tags":["sessions"],"summary":"Get Session Diagnosis","description":"Enqueue an owner-local diagnosis job for a failed session.\n\nThis mutation creates a durable remote-recovery job and audit trail. The\nowning poller inspects its checkout but does not execute a recovery action.","operationId":"get_session_diagnosis_api_sessions__session_id__diagnosis_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiagnosisResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sessions/{session_id}/retry":{"post":{"tags":["sessions"],"summary":"Retry Session","description":"Reset the entity status so the dispatcher re-dispatches on the next cycle.\n\nOnly works for failed sessions (exit_code > 0).  Resets the associated\ntask or initiative to its pre-dispatch status, pushes the status change\nto GitHub (so sync doesn't overwrite it), clears the ``needs_human`` flag,\nand removes the mirrored 'needs-human' label (BUG-1490).\n\nWith ``smart=true`` on a DEV session, this first attempts a distinct\n``smart_retry`` owner-executed job (commit/push/PR the worktree's pending\nwork) — the API never inspects Git or the filesystem itself. A rescue\nclears ``needs_human`` and returns directly; a fallback (no worktree, no\nchanges, tests failing, ...) falls through to the normal reset below with\nthe fallback reason recorded as ``outcome``; an unreachable/still-running\nowner returns its retryable/accepted contract without consuming this\nsession's single recovery attempt.\n\nThe normal reset transition is attributed to the authenticated member via\n``human_actor`` — the generic ``Actor(\"human\", \"sdlc_ui\")`` when\n``AUTH_ENABLED=false``.","operationId":"retry_session_api_sessions__session_id__retry_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}},{"name":"smart","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Smart"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Retry Session Api Sessions  Session Id  Retry Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sessions/{session_id}/recover":{"post":{"tags":["sessions"],"summary":"Recover Session","description":"Run diagnosis and execute targeted recovery for a failed session.\n\nUnlike retry (which resets status for a full re-run), recover inspects\nthe worktree and takes the cheapest effective action.\n\nEnqueues a durable job for the session's owning poller and waits within a\nbounded deadline. The poller inserts the terminal sentinel only after an\nauthoritative owner-local diagnosis.","operationId":"recover_session_api_sessions__session_id__recover_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Recover Session Api Sessions  Session Id  Recover Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/status-mappings":{"get":{"tags":["status-mappings"],"summary":"Get Status Mappings","operationId":"get_status_mappings_api_projects__slug__status_mappings_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StatusMappingResponse"},"title":"Response Get Status Mappings Api Projects  Slug  Status Mappings Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["status-mappings"],"summary":"Create Status Mapping","operationId":"create_status_mapping_api_projects__slug__status_mappings_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusMappingCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusMappingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/status-mappings/{mapping_id}":{"delete":{"tags":["status-mappings"],"summary":"Delete Status Mapping","operationId":"delete_status_mapping_api_projects__slug__status_mappings__mapping_id__delete","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"mapping_id","in":"path","required":true,"schema":{"type":"integer","title":"Mapping Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Status Mapping Api Projects  Slug  Status Mappings  Mapping Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/status-options":{"get":{"tags":["status-mappings"],"summary":"Get Status Options","description":"List the Status-field options from the project's PM provider.","operationId":"get_status_options_api_projects__slug__status_options_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StatusOptionResponse"},"title":"Response Get Status Options Api Projects  Slug  Status Options Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/github-status-options":{"get":{"tags":["status-mappings"],"summary":"Get Github Status Options","description":"Deprecated alias of ``GET /projects/{slug}/status-options``.\n\nThe implementation was always provider-generic; this GitHub-named path is\nkept only for older web clients and will be removed.","operationId":"get_github_status_options_api_projects__slug__github_status_options_get","deprecated":true,"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StatusOptionResponse"},"title":"Response Get Github Status Options Api Projects  Slug  Github Status Options Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/{task_id}/sessions":{"get":{"tags":["tasks"],"summary":"Get Task Sessions","operationId":"get_task_sessions_api_tasks__task_id__sessions_get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SessionWithStatus"},"title":"Response Get Task Sessions Api Tasks  Task Id  Sessions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/{task_id}/feedback":{"get":{"tags":["tasks"],"summary":"Get Task Feedback","operationId":"get_task_feedback_api_tasks__task_id__feedback_get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FeedbackLogResponse"},"title":"Response Get Task Feedback Api Tasks  Task Id  Feedback Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/{task_id}/comments":{"get":{"tags":["tasks"],"summary":"Get Task Comments","operationId":"get_task_comments_api_tasks__task_id__comments_get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PRCommentResponse"},"title":"Response Get Task Comments Api Tasks  Task Id  Comments Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/transitions":{"post":{"tags":["transitions"],"summary":"Perform Transition","description":"Transition directly or explicitly approve a configured human gate.\n\nResolves ``gh_item_id``/``issue_number``/``is_standalone`` from the DB row\n(mirroring ``sessions.py``), then delegates to the canonical write path.\n``action=\"transition\"`` remains the legacy default; a configured approval\ngate rejects that bypass with 409. ``action=\"approve\"`` records the\nauthenticated member's stable/display identity through ``approve_gate``.\nA qualifying approval below threshold is a successful 200 response with\n``applied=false`` and nested pending progress. Authorization rejections are\n403 and stale/duplicate/policy conflicts are 409; internal failures are not\nrewritten as policy rejections.\n\nIn local mode (``AUTH_ENABLED=false`` ⇒ ``auth_user is None``), both actions\nuse the legacy transition dispatch semantics and generic\n``Actor(\"human\", \"sdlc_ui\")`` attribution used by legacy clients.\n\nAuthorization (auth-enabled mode only): this is a control-plane WRITE whose\nproject anchor lives in the request body, invisible to the router-wide org\ngate (which anchors on path/query/header). The gate proves membership at\n``member`` rank in SOME org the caller picked; before mutating anything we\nre-anchor — ``body.slug``'s project must belong to that same org, else 403.","operationId":"perform_transition_api_transitions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransitionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/transitions/allowed":{"get":{"tags":["transitions"],"summary":"Get Allowed Transitions","description":"Human-allowed target statuses for a work item, derived from policy.\n\nAn empty list means the current status is bot-owned — the UI renders it\nread-only with no controls — **or** that the item has no provider identity\nyet (BUG-3221). The two are deliberately not distinguished on this\nendpoint: it exists to answer \"what may a human do\", and the answer is\n\"nothing\" either way. The distinguishing signal lives on the surfaces that\nhave to explain themselves — the feed's ``awaiting_provisioning`` flag and\nthe card's ``awaiting_provisioning`` dispatch blocker. A caller that\nignores both and posts anyway gets the matching 409 from\n``POST /api/transitions``, never a 500.\n\nIn auth-enabled mode a *restricted* member sees\nonly the gate targets whose *effective* capability they hold: a configured\npolicy override wins over the static gate tag. Configured gates also carry\ncaller-scoped threshold, reason, self/duplicate, role eligibility, and\n``can_approve`` state.\nAlready-approved/requester callers keep the row as read-only progress;\ncallers lacking the effective capability retain the existing filtering.\nAuth-disabled and unconfigured gates skip approval enrichment.","operationId":"get_allowed_transitions_api_transitions_allowed_get","parameters":[{"name":"slug","in":"query","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"work_item_kind","in":"query","required":true,"schema":{"enum":["initiative","plan","task"],"type":"string","title":"Work Item Kind"}},{"name":"work_item_db_id","in":"query","required":true,"schema":{"type":"integer","title":"Work Item Db Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AllowedTransition"},"title":"Response Get Allowed Transitions Api Transitions Allowed Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/transitions/policy":{"get":{"tags":["transitions"],"summary":"Get Transitions Policy","description":"Canonical lane policy for the Board, derived from status_policy.\n\n``gated`` lanes are human-controllable (always visible); ``droppable`` lanes\nare human transition targets. One descriptor per canonical status. No\nproject/DB access — pure policy.","operationId":"get_transitions_policy_api_transitions_policy_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/LanePolicy"},"type":"array","title":"Response Get Transitions Policy Api Transitions Policy Get"}}}}}}},"/api/transitions/history":{"get":{"tags":["transitions"],"summary":"Get Transition History","description":"Recorded transitions for a work item, newest-first (for the audit timeline).","operationId":"get_transition_history_api_transitions_history_get","parameters":[{"name":"slug","in":"query","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"work_item_kind","in":"query","required":true,"schema":{"enum":["initiative","plan","task"],"type":"string","title":"Work Item Kind"}},{"name":"work_item_db_id","in":"query","required":true,"schema":{"type":"integer","title":"Work Item Db Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TransitionHistoryRow"},"title":"Response Get Transition History Api Transitions History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/{task_id}/unstick":{"post":{"tags":["recovery"],"summary":"Unstick Task","description":"Run the self-healing pipeline scoped to a single task.\n\n``task_id`` is the numeric ``tasks.id`` PK; the param name is load-bearing\n(``ENTITY_SCOPE_RESOLVERS``) so the auth gate project-scopes the request\noff the task row itself instead of only checking org membership. ``body``\nis optional — an omitted/empty body clears every provider-scoped backoff\non the task (see :class:`UnstickRequest`).","operationId":"unstick_task_api_tasks__task_id__unstick_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/UnstickRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/initiatives/{initiative_id}/unstick":{"post":{"tags":["recovery"],"summary":"Unstick Initiative","description":"Run the self-healing pipeline scoped to a single initiative.\n\n``initiative_id`` is load-bearing for project-scoped auth (see\n:func:`unstick_task`). ``body`` is optional — see :class:`UnstickRequest`.","operationId":"unstick_initiative_api_initiatives__initiative_id__unstick_post","parameters":[{"name":"initiative_id","in":"path","required":true,"schema":{"type":"integer","title":"Initiative Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/UnstickRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/{task_id}/clear-needs-human":{"post":{"tags":["recovery"],"summary":"Clear Task Needs Human","description":"Clear the ``needs_human`` flag on a task so it resumes dispatch.\n\n``task_id`` is load-bearing for project-scoped auth (see\n:func:`unstick_task`).","operationId":"clear_task_needs_human_api_tasks__task_id__clear_needs_human_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/initiatives/{initiative_id}/clear-needs-human":{"post":{"tags":["recovery"],"summary":"Clear Initiative Needs Human","description":"Clear the ``needs_human`` flag on an initiative so it resumes dispatch.\n\n``initiative_id`` is load-bearing for project-scoped auth (see\n:func:`unstick_task`).","operationId":"clear_initiative_needs_human_api_initiatives__initiative_id__clear_needs_human_post","parameters":[{"name":"initiative_id","in":"path","required":true,"schema":{"type":"integer","title":"Initiative Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/usage/report":{"get":{"tags":["usage"],"summary":"Usage Report","description":"Recorded usage over inclusive whole UTC days for completed sessions.\n\nDates use session creation, not completion or precise invocation timestamps.\nAll selectors constrain the stored session grain before grouping. Initiative\nselection includes direct and child-task accounting already in the rollup.\ncli is provider-reported cost, rate_card is a standard API-equivalent\nestimate (standard paid text rates, not a subscription price), mixed is\ninseparable cost from groups priced from different sources (typically\nCLI-reported plus estimated); null/unknown sources are unattributed and no\nsource proves invoiced payment. ``accounting.notes``\nstates the estimate's rate policy and exclusions.\nMissing-column counters are not capture-state counts and may include\nnot_applicable sessions; legacy fidelity counters may be default zeros.\nMulti-provider sessions do not provide invocation-level attribution. Reads\nnever rebuild historical buckets or add subagent usage again, and make no\nclaim of historical completeness or live quota telemetry.\n\nGrant resolution deliberately precedes report acquisition: resolving grants\nwhile holding a connection could exhaust the pool through nested acquisition.","operationId":"usage_report_api_usage_report_get","parameters":[{"name":"view","in":"query","required":true,"schema":{"enum":["summary","timeseries","breakdown"],"type":"string","title":"View"}},{"name":"after","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"After"}},{"name":"before","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Before"}},{"name":"dimension","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dimension"}},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"enum":["cost","sessions"],"type":"string"},{"type":"null"}],"title":"Sort"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":500,"minimum":1},{"type":"null"}],"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":9223372036854775807,"minimum":0},{"type":"null"}],"title":"Offset"}},{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":9223372036854775807,"exclusiveMinimum":0},{"type":"null"}],"title":"Project Id"}},{"name":"task_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":9223372036854775807,"exclusiveMinimum":0},{"type":"null"}],"title":"Task Id"}},{"name":"initiative_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":9223372036854775807,"exclusiveMinimum":0},{"type":"null"}],"title":"Initiative Id"}},{"name":"agent_role","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Agent Role"}},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Provider"}},{"name":"model","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Model"}},{"name":"host","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Host"}},{"name":"cost_source","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Cost Source"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/usage/summary":{"get":{"tags":["usage"],"summary":"Usage Summary","description":"Aggregate cost/token totals for the org over an optional window.","operationId":"usage_summary_api_usage_summary_get","parameters":[{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}},{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Id"}},{"name":"agent_role","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Role"}},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"}},{"name":"model","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"}},{"name":"operator_user","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operator User"}},{"name":"requester_user","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requester User"}},{"name":"reasoning_effort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning Effort"}},{"name":"host","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Host"}},{"name":"gh_account","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gh Account"}},{"name":"cost_source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost Source"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageSummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/usage/timeseries":{"get":{"tags":["usage"],"summary":"Usage Timeseries","description":"Daily cost/token points for the org over an optional window.","operationId":"usage_timeseries_api_usage_timeseries_get","parameters":[{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}},{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Id"}},{"name":"agent_role","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Role"}},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"}},{"name":"model","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"}},{"name":"operator_user","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operator User"}},{"name":"requester_user","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requester User"}},{"name":"reasoning_effort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning Effort"}},{"name":"host","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Host"}},{"name":"gh_account","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gh Account"}},{"name":"cost_source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost Source"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageTimeseriesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/usage/breakdown":{"get":{"tags":["usage"],"summary":"Usage Breakdown","description":"Cost/token grouped by a whitelisted ``dimension``.\n\nAn unknown ``dimension`` (rejected by the repository) is surfaced as 422\nrather than a 500.","operationId":"usage_breakdown_api_usage_breakdown_get","parameters":[{"name":"dimension","in":"query","required":true,"schema":{"type":"string","title":"Dimension"}},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Id"}},{"name":"agent_role","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Role"}},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"}},{"name":"model","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"}},{"name":"operator_user","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operator User"}},{"name":"requester_user","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requester User"}},{"name":"reasoning_effort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning Effort"}},{"name":"host","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Host"}},{"name":"gh_account","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gh Account"}},{"name":"cost_source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost Source"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageBreakdownResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhooks/github":{"post":{"tags":["webhooks"],"summary":"Receive Github Webhook","operationId":"receive_github_webhook_api_webhooks_github_post","parameters":[{"name":"x-github-event","in":"header","required":false,"schema":{"type":"string","default":"unknown","title":"X-Github-Event"}},{"name":"x-hub-signature-256","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hub-Signature-256"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Receive Github Webhook Api Webhooks Github Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/work-items/search":{"get":{"tags":["work-items"],"summary":"Search Project Work Items","description":"Search one project's initiatives/tasks with filters and match evidence.","operationId":"search_project_work_items_api_projects__slug__work_items_search_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"wave","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":2147483647,"minimum":-2147483648},{"type":"null"}],"title":"Wave"}},{"name":"initiative_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":9223372036854775807,"minimum":-9223372036854775808},{"type":"null"}],"title":"Initiative Id"}},{"name":"needs_human","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Needs Human"}},{"name":"paused","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Paused"}},{"name":"include_done","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Done"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","maximum":9223372036854775807,"minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkItemSearchPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/work-items/similar":{"post":{"tags":["work-items"],"summary":"Similar Project Work Items","description":"Existing work a draft may duplicate, with judged relations when available.","operationId":"similar_project_work_items_api_projects__slug__work_items_similar_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimilarWorkItemsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimilarWorkItemsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/projects/{slug}/work-items":{"post":{"tags":["work-items"],"summary":"Create Project Work Item","description":"Create an Initiative / Bug / Task issue and place it on the board at Backlog.\n\n``req.type`` is a ``Literal`` field, so Pydantic already rejects any other\nvalue with 422 before this handler runs — no manual type check needed.","operationId":"create_project_work_item_api_projects__slug__work_items_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkItemRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkItemResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AcceptInvitationRequest":{"properties":{"token":{"type":"string","maxLength":512,"minLength":16,"title":"Token"}},"type":"object","required":["token"],"title":"AcceptInvitationRequest"},"AffectedTask":{"properties":{"task_db_id":{"type":"integer","title":"Task Db Id"},"task_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Label"},"pr_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pr Number"},"observation_count":{"type":"integer","title":"Observation Count"},"last_observed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Observed At"}},"additionalProperties":false,"type":"object","required":["task_db_id","task_label","pr_number","observation_count","last_observed_at"],"title":"AffectedTask"},"AllowedTransition":{"properties":{"to_status":{"type":"string","title":"To Status"},"requires_reason":{"type":"boolean","title":"Requires Reason"},"capability":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Capability"},"approval":{"anyOf":[{"$ref":"#/components/schemas/TransitionApprovalProgress"},{"type":"null"}]}},"type":"object","required":["to_status","requires_reason"],"title":"AllowedTransition"},"AllowedTransitionOption":{"properties":{"to_status":{"type":"string","title":"To Status"},"requires_reason":{"type":"boolean","title":"Requires Reason"},"capability":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Capability"},"approval":{"anyOf":[{"$ref":"#/components/schemas/TransitionApprovalProgress"},{"type":"null"}]}},"type":"object","required":["to_status","requires_reason"],"title":"AllowedTransitionOption","description":"One human-allowed status move for a work item (mirrors\n``GET /transitions/allowed``'s ``AllowedTransition`` shape so the board\ncan render gate controls without a per-card round trip)."},"ApplyRequest":{"properties":{"effective_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective From"},"review_reason":{"type":"string","title":"Review Reason"},"acknowledged_warnings":{"items":{"type":"string","enum":["unpriced_identity","no_effective_window","rate_change_over_25_percent","zero_nonzero_transition"]},"type":"array","maxItems":4,"title":"Acknowledged Warnings"},"expected_proposal_hash":{"type":"string","title":"Expected Proposal Hash"},"expected_window_fingerprint":{"type":"string","title":"Expected Window Fingerprint"}},"additionalProperties":false,"type":"object","required":["review_reason","expected_proposal_hash","expected_window_fingerprint"],"title":"ApplyRequest","description":"Approve and publish a pending candidate proposal in one action."},"ApplyTemplateRequest":{"properties":{"user_ids":{"items":{"type":"string"},"type":"array","maxItems":500,"title":"User Ids"}},"type":"object","title":"ApplyTemplateRequest"},"ApprovalPoliciesResponse":{"properties":{"project_id":{"type":"integer","title":"Project Id"},"project_slug":{"type":"string","title":"Project Slug"},"policies":{"items":{"$ref":"#/components/schemas/ApprovalPolicyResponseEntry"},"type":"array","title":"Policies"}},"additionalProperties":false,"type":"object","required":["project_id","project_slug","policies"],"title":"ApprovalPoliciesResponse","description":"Canonical complete approval-policy catalog for one project."},"ApprovalPolicyPutEntry":{"properties":{"work_item_kind":{"type":"string","enum":["initiative","task"],"title":"Work Item Kind"},"from_status":{"type":"string","title":"From Status"},"to_status":{"type":"string","title":"To Status"},"required_capability":{"type":"string","enum":["planning","development","pr_review","maintenance","operations","pm_integration"],"title":"Required Capability"},"required_approvals":{"type":"integer","maximum":2147483647.0,"minimum":1.0,"title":"Required Approvals"},"forbid_self_approval":{"type":"boolean","title":"Forbid Self Approval"}},"additionalProperties":false,"type":"object","required":["work_item_kind","from_status","to_status","required_capability","required_approvals","forbid_self_approval"],"title":"ApprovalPolicyPutEntry","description":"Strict effective settings for one configured catalog gate."},"ApprovalPolicyResponseEntry":{"properties":{"work_item_kind":{"type":"string","enum":["initiative","task"],"title":"Work Item Kind"},"from_status":{"type":"string","title":"From Status"},"to_status":{"type":"string","title":"To Status"},"default_capability":{"type":"string","enum":["planning","development","pr_review","maintenance","operations","pm_integration"],"title":"Default Capability"},"requires_reason":{"type":"boolean","title":"Requires Reason"},"configured":{"type":"boolean","title":"Configured"},"required_capability":{"type":"string","enum":["planning","development","pr_review","maintenance","operations","pm_integration"],"title":"Required Capability"},"required_approvals":{"type":"integer","title":"Required Approvals"},"forbid_self_approval":{"type":"boolean","title":"Forbid Self Approval"},"policy_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policy Version"}},"additionalProperties":false,"type":"object","required":["work_item_kind","from_status","to_status","default_capability","requires_reason","configured","required_capability","required_approvals","forbid_self_approval","policy_version"],"title":"ApprovalPolicyResponseEntry","description":"One immutable catalog gate with its effective project configuration."},"ArchiveDoneRequest":{"properties":{"limit":{"type":"integer","maximum":500.0,"minimum":1.0,"title":"Limit","default":100},"after_id":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"After Id"}},"type":"object","title":"ArchiveDoneRequest","description":"Body of ``POST /projects/{slug}/board/done/archive``."},"ArchiveTaskRequest":{"properties":{"reason":{"type":"string","enum":["completed","not planned","duplicate"],"title":"Reason"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"force":{"type":"boolean","title":"Force","default":false}},"type":"object","required":["reason"],"title":"ArchiveTaskRequest","description":"Body of ``POST /tasks/{task_id}/archive`` and its initiative twin."},"ArtifactResponse":{"properties":{"pr_number":{"type":"integer","title":"Pr Number"},"head_sha":{"type":"string","title":"Head Sha"},"reviewer_policy_version":{"type":"string","title":"Reviewer Policy Version"},"review_input_fingerprint":{"type":"string","title":"Review Input Fingerprint"},"state":{"type":"string","title":"State"},"delivery_attempts":{"type":"integer","title":"Delivery Attempts"},"last_delivery_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Delivery Error"},"last_delivery_error_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Delivery Error Category"},"task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At"}},"type":"object","required":["pr_number","head_sha","reviewer_policy_version","review_input_fingerprint","state","delivery_attempts","created_at","updated_at"],"title":"ArtifactResponse","description":"One PR-review artifact's metadata/state (never the review payload body)."},"AttachmentDownloadResponse":{"properties":{"id":{"type":"integer","title":"Id"},"filename":{"type":"string","title":"Filename"},"content_type":{"type":"string","title":"Content Type"},"url":{"type":"string","title":"Url"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["id","filename","content_type","url","expires_in"],"title":"AttachmentDownloadResponse"},"AttachmentResponse":{"properties":{"id":{"type":"integer","title":"Id"},"work_item_kind":{"type":"string","title":"Work Item Kind"},"work_item_db_id":{"type":"integer","title":"Work Item Db Id"},"filename":{"type":"string","title":"Filename"},"content_type":{"type":"string","title":"Content Type"},"size_bytes":{"type":"integer","title":"Size Bytes"},"uploaded_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uploaded By User Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","work_item_kind","work_item_db_id","filename","content_type","size_bytes","created_at"],"title":"AttachmentResponse","description":"One attachment's metadata.\n\nDeliberately omits ``storage_path`` and ``org_id``: the object path is\ninternal addressing (exposing it invites clients to construct their own\nStorage URLs instead of going through the signed-URL endpoint), and\n``org_id`` is internal tenancy plumbing with no business reaching a\nresponse model."},"AttachmentUploadRequest":{"properties":{"filename":{"type":"string","maxLength":255,"minLength":1,"title":"Filename"},"content_type":{"type":"string","maxLength":128,"pattern":"^[\\w.+-]+/[\\w.+-]+$","title":"Content Type"},"content_b64":{"type":"string","maxLength":13981020,"title":"Content B64"}},"type":"object","required":["filename","content_type","content_b64"],"title":"AttachmentUploadRequest","description":"Base64 JSON upload body — see the module docstring for why not multipart."},"AuditEventPage":{"properties":{"events":{"items":{"$ref":"#/components/schemas/AuditEventResponse"},"type":"array","title":"Events"},"total":{"type":"integer","title":"Total","default":0},"limit":{"type":"integer","title":"Limit","default":100},"offset":{"type":"integer","title":"Offset","default":0}},"type":"object","title":"AuditEventPage","description":"Paginated page of the merged, org-scoped audit timeline."},"AuditEventResponse":{"properties":{"source":{"type":"string","title":"Source"},"id":{"type":"string","title":"Id"},"project_id":{"type":"integer","title":"Project Id"},"project_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Slug"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"event_type":{"type":"string","title":"Event Type"},"actor_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Type"},"actor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Id"},"actor_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Label"},"entity_type":{"type":"string","title":"Entity Type"},"entity_id":{"type":"string","title":"Entity Id"},"from_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Status"},"to_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Status"},"outcome":{"type":"string","title":"Outcome"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"correlation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"}},"type":"object","required":["source","id","project_id","created_at","event_type","entity_type","entity_id","outcome"],"title":"AuditEventResponse","description":"One normalized row from the merged audit timeline (INI-1780-002/-004).\n\n``id`` is the stable ``f\"{source}:{row_id}\"`` key — each source table\ncarries its own IDENTITY sequence, so ``row_id`` alone is only unique\nWITHIN a ``source``."},"AuditLogResponse":{"properties":{"id":{"type":"integer","title":"Id"},"project_id":{"type":"integer","title":"Project Id"},"correlation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"},"decision_type":{"type":"string","title":"Decision Type"},"entity_type":{"type":"string","title":"Entity Type"},"entity_id":{"type":"string","title":"Entity Id"},"inputs_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inputs Summary"},"outcome":{"type":"string","title":"Outcome"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","project_id","decision_type","entity_type","entity_id","outcome","created_at"],"title":"AuditLogResponse"},"BacklogItemResponse":{"properties":{"entity_type":{"type":"string","title":"Entity Type"},"id":{"type":"integer","title":"Id"},"project_id":{"type":"integer","title":"Project Id"},"issue_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Issue Number"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"status":{"type":"string","title":"Status"},"task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"},"initiative_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Initiative Id"},"wave":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Wave"},"effort":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Effort"},"pr_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pr Number"},"assigned_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned Agent"},"resolution":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution"},"refinement_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refinement Status"},"refinement_session_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Refinement Session Id"},"refinement_completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Refinement Completed At"},"refinement_cost_usd_microdollars":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Refinement Cost Usd Microdollars"},"repo_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repo Slug"},"labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Labels"},"latest_session_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latest Session Id"},"session_active":{"type":"boolean","title":"Session Active","default":false},"active_session_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Session Role"},"active_session_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Session Model"},"active_session_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Session Effort"},"active_session_host":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Session Host"},"latest_session_failed":{"type":"boolean","title":"Latest Session Failed","default":false},"latest_session_error_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Latest Session Error Category"},"latest_session_retryable":{"type":"boolean","title":"Latest Session Retryable","default":false},"triage_invalid":{"type":"boolean","title":"Triage Invalid","default":false},"triage_invalid_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Triage Invalid Reason"},"awaiting_provisioning":{"type":"boolean","title":"Awaiting Provisioning","default":false},"depends_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Depends On"},"blocked_by":{"type":"integer","title":"Blocked By","default":0},"cost_usd_microdollars":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cost Usd Microdollars"},"board_position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Board Position"},"needs_human":{"type":"boolean","title":"Needs Human","default":false},"needs_human_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Needs Human Reason"},"paused":{"type":"boolean","title":"Paused","default":false},"effective_paused":{"type":"boolean","title":"Effective Paused","default":false},"provider_backoff_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Provider Backoff Until"},"provider_backoff_providers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Provider Backoff Providers"},"dispatch_blocker":{"anyOf":[{"$ref":"#/components/schemas/DispatchBlockerResponse"},{"type":"null"}]},"baseline_repairs":{"anyOf":[{"items":{"$ref":"#/components/schemas/BaselineRepairSummary"},"type":"array"},{"type":"null"}],"title":"Baseline Repairs"},"baseline_repairs_total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Baseline Repairs Total"},"allowed_transitions":{"items":{"$ref":"#/components/schemas/AllowedTransitionOption"},"type":"array","title":"Allowed Transitions"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"planning_started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Planning Started At"},"planning_completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Planning Completed At"},"delivery_started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivery Started At"},"delivery_completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivery Completed At"}},"type":"object","required":["entity_type","id","project_id","status","created_at","updated_at"],"title":"BacklogItemResponse","description":"Unified backlog item covering initiatives, tasks, and standalone bugs."},"BaselineRepairCause":{"properties":{"failed_command":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failed Command"},"failed_phase":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failed Phase"},"exit_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exit Code"},"base_sha":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Sha"}},"type":"object","title":"BaselineRepairCause","description":"The confirmed main failure a repair exists to fix (bounded, redacted)."},"BaselineRepairSummary":{"properties":{"repair_id":{"type":"integer","title":"Repair Id"},"revision":{"type":"integer","title":"Revision"},"role":{"type":"string","enum":["affected","repair"],"title":"Role"},"stage":{"type":"string","title":"Stage"},"cause":{"anyOf":[{"$ref":"#/components/schemas/BaselineRepairCause"},{"type":"null"}]},"waiting_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Waiting Reason"},"repair_task_db_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Repair Task Db Id"},"repair_task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repair Task Id"},"repair_issue_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Repair Issue Number"},"repair_pr_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Repair Pr Number"},"affected_count":{"type":"integer","title":"Affected Count","default":0},"last_validation":{"anyOf":[{"$ref":"#/components/schemas/BaselineRepairValidation"},{"type":"null"}]},"provider_sync_state":{"type":"string","title":"Provider Sync State"},"automation_stopped":{"type":"boolean","title":"Automation Stopped","default":false}},"type":"object","required":["repair_id","revision","role","stage","provider_sync_state"],"title":"BaselineRepairSummary","description":"One unresolved baseline repair an item takes part in (INI-3613-007).\n\nProjected by ``core/repositories/baseline_repair_projection.py``.\n``repair_id`` and ``repair_task_db_id`` are numeric routing identities;\n``repair_task_id`` (``BUG-n``) is a label and dependency id, never an API\nparameter. ``role`` is ``repair`` for the workflow's repair Bug and\n``affected`` for work it observed or holds. ``affected_count`` counts the\nwhole workflow's distinct affected tasks on a task, and the initiative's\nown distinct affected children on an initiative. ``provider_sync_state``\nis the repair Bug's provider identity: ``unlinked``, ``pending``,\n``synced``, ``rejected`` or ``unknown``. The paged incident endpoint\n(``GET /projects/{slug}/baseline-repairs/{repair_id}``) carries history."},"BaselineRepairValidation":{"properties":{"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"base_sha":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Sha"},"checked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Checked At"}},"type":"object","title":"BaselineRepairValidation","description":"The newest validation known for a repair's main.\n\n``state`` is ``passed`` or ``failed``: a confirmed observation is a failed\nvalidation of main at its base SHA, a verification ticket a full\nvalidation of the main it pinned. Unknown values stay ``None``."},"BroadcastRequest":{"properties":{"topic":{"type":"string","maxLength":256,"minLength":1,"title":"Topic"},"event":{"type":"string","maxLength":128,"minLength":1,"title":"Event"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"}},"type":"object","required":["topic","event"],"title":"BroadcastRequest","description":"A single private Realtime Broadcast message."},"CapabilitiesRequest":{"properties":{"capabilities":{"items":{"type":"string"},"type":"array","maxItems":6,"title":"Capabilities"}},"type":"object","title":"CapabilitiesRequest"},"CapabilityGap":{"properties":{"capability":{"type":"string","title":"Capability"},"eligible_items":{"type":"integer","title":"Eligible Items"}},"type":"object","required":["capability","eligible_items"],"title":"CapabilityGap","description":"One uncovered capability family and its aggregate eligible demand."},"CatalogRestoreRequest":{"properties":{"expected_current_hash":{"type":"string","title":"Expected Current Hash"},"reason":{"type":"string","title":"Reason"}},"additionalProperties":false,"type":"object","required":["expected_current_hash","reason"],"title":"CatalogRestoreRequest","description":"Validated before any connection opens; carries no catalog JSON."},"ChatRequest":{"properties":{"messages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Messages"},"available_labels":{"items":{"type":"string"},"type":"array","title":"Available Labels"}},"type":"object","title":"ChatRequest"},"ClearWatchResponse":{"properties":{"changed":{"type":"boolean","title":"Changed"}},"type":"object","required":["changed"],"title":"ClearWatchResponse"},"CommentSummary":{"properties":{"Valid":{"type":"integer","title":"Valid","default":0},"Not_Applicable":{"type":"integer","title":"Not Applicable","default":0},"Needs_Discussion":{"type":"integer","title":"Needs Discussion","default":0},"Defer":{"type":"integer","title":"Defer","default":0}},"type":"object","title":"CommentSummary","description":"PR comment counts grouped by category."},"ConnectInstallationRequest":{"properties":{"installation_id":{"type":"integer","title":"Installation Id"}},"type":"object","required":["installation_id"],"title":"ConnectInstallationRequest"},"ConnectPmIntegrationRequest":{"properties":{"installation_id":{"type":"integer","title":"Installation Id"}},"type":"object","required":["installation_id"],"title":"ConnectPmIntegrationRequest"},"CoverageWarningResponse":{"properties":{"code":{"type":"string","title":"Code"},"detail":{"type":"string","title":"Detail"},"fix":{"type":"string","title":"Fix"}},"type":"object","required":["code","detail","fix"],"title":"CoverageWarningResponse","description":"One silent domain-configuration defect — mirrors ``CoverageWarning``."},"CreateInitiativeRequest":{"properties":{"title":{"type":"string","title":"Title"},"body":{"type":"string","title":"Body"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"},"needs_refinement":{"type":"boolean","title":"Needs Refinement","default":false}},"type":"object","required":["title","body"],"title":"CreateInitiativeRequest"},"CreateInitiativeResponse":{"properties":{"provisioning":{"type":"boolean","title":"Provisioning","default":false},"issue_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Issue Number"},"issue_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issue Url"},"board_status":{"type":"string","enum":["placed","repaired","repair_queued","unrecoverable"],"title":"Board Status","default":"placed"},"id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Id"}},"type":"object","title":"CreateInitiativeResponse"},"CreateInvitationRequest":{"properties":{"email":{"type":"string","maxLength":254,"minLength":3,"title":"Email"},"role":{"type":"string","enum":["viewer","member","admin","owner"],"title":"Role","default":"member"},"project_access":{"type":"string","enum":["all","restricted"],"title":"Project Access","default":"all"},"project_ids":{"items":{"type":"integer"},"type":"array","maxItems":500,"title":"Project Ids"},"capabilities":{"items":{"type":"string"},"type":"array","maxItems":6,"title":"Capabilities"}},"type":"object","required":["email"],"title":"CreateInvitationRequest"},"CreateOrgRequest":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"slug":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Slug"}},"type":"object","required":["name"],"title":"CreateOrgRequest"},"CreateTemplateRequest":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"org_role":{"type":"string","enum":["viewer","member","admin","owner"],"title":"Org Role","default":"member"},"project_access":{"type":"string","enum":["all","restricted"],"title":"Project Access","default":"all"},"project_ids":{"items":{"type":"integer"},"type":"array","maxItems":500,"title":"Project Ids"},"capabilities":{"items":{"type":"string"},"type":"array","maxItems":6,"title":"Capabilities"}},"type":"object","required":["name"],"title":"CreateTemplateRequest"},"CreateWorkItemRequest":{"properties":{"type":{"type":"string","enum":["Initiative","Bug","Task"],"title":"Type"},"title":{"type":"string","title":"Title"},"body":{"type":"string","title":"Body"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"},"needs_refinement":{"type":"boolean","title":"Needs Refinement","default":false}},"type":"object","required":["type","title","body"],"title":"CreateWorkItemRequest"},"CreateWorkItemResponse":{"properties":{"type":{"type":"string","enum":["Initiative","Bug","Task"],"title":"Type"},"provisioning":{"type":"boolean","title":"Provisioning","default":false},"issue_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Issue Number"},"issue_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issue Url"},"board_status":{"type":"string","enum":["placed","repaired","repair_queued","unrecoverable"],"title":"Board Status","default":"placed"},"id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Id"}},"type":"object","required":["type"],"title":"CreateWorkItemResponse"},"DeliveredRequest":{"properties":{"status":{"type":"string","enum":["delivered","failed"],"title":"Status"},"claim_generation":{"type":"integer","maximum":2147483647.0,"minimum":1.0,"title":"Claim Generation"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["status","claim_generation"],"title":"DeliveredRequest"},"DeliveryClaimRequest":{"properties":{"channel":{"type":"string","title":"Channel"},"device_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Id"}},"type":"object","required":["channel"],"title":"DeliveryClaimRequest"},"DeliveryHealthResponse":{"properties":{"generated":{"type":"integer","title":"Generated"},"pending_delivery":{"type":"integer","title":"Pending Delivery"},"delivered":{"type":"integer","title":"Delivered"},"superseded":{"type":"integer","title":"Superseded"},"failed":{"type":"integer","title":"Failed"}},"type":"object","required":["generated","pending_delivery","delivered","superseded","failed"],"title":"DeliveryHealthResponse","description":"DB-derived counts-by-state summary for one project's PR-review artifacts."},"DependencyInfo":{"properties":{"task_id":{"type":"string","title":"Task Id"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","required":["task_id"],"title":"DependencyInfo","description":"A resolved dependency reference with its current status."},"DesktopProjectConfig":{"properties":{"slug":{"type":"string","title":"Slug"},"complete":{"type":"boolean","title":"Complete"},"pm_provider":{"type":"string","title":"Pm Provider"},"git_hosting_provider":{"type":"string","title":"Git Hosting Provider"},"repo":{"additionalProperties":true,"type":"object","title":"Repo"},"pm_config":{"additionalProperties":true,"type":"object","title":"Pm Config"},"git":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Git"},"build_commands":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"}]},"type":"array"},{"type":"null"}],"title":"Build Commands"},"plan_path_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Path Prefix"},"clone_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Clone Url"},"environment":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Environment"},"domains":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Domains"},"validation_prepare_commands":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"}]},"type":"array"},{"type":"null"}],"title":"Validation Prepare Commands"},"context_file_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context File Path"},"max_concurrent_tasks":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Concurrent Tasks"},"remote_reviewer":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Remote Reviewer"},"indexer":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Indexer"},"verify_commands":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Verify Commands"},"approval_states":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Approval States"},"test_quarantine":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Test Quarantine"},"wave_overlap_hot_paths":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Wave Overlap Hot Paths"},"deferred_path_rules":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Deferred Path Rules"},"field_mappings":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Field Mappings"},"release":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Release"}},"type":"object","required":["slug","complete","pm_provider","git_hosting_provider"],"title":"DesktopProjectConfig","description":"PM-provider-agnostic, secret-free project definition for desktop 1-click\nsetup. Echoes the stored ``projects.desktop_seed`` (or a config.yaml/repo_slug\nfallback) plus a derived ``clone_url`` and a ``complete`` flag (false → the\ndesktop must prompt for the provider's missing fields). Never carries\ntokens/secrets or ``target_repo_path``."},"DesktopSeedGit":{"properties":{"default_branch":{"type":"string","minLength":1,"title":"Default Branch","default":"main"},"remote_name":{"type":"string","minLength":1,"title":"Remote Name","default":"origin"}},"additionalProperties":false,"type":"object","title":"DesktopSeedGit"},"DesktopSeedPmConfig":{"properties":{"project_number":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Project Number"}},"additionalProperties":false,"type":"object","title":"DesktopSeedPmConfig","description":"PM-provider-specific seed fields (github_projects: project_number)."},"DesktopSeedRelease":{"properties":{"strategy":{"anyOf":[{"type":"string","enum":["continuous","per_initiative","manual"]},{"type":"null"}],"title":"Strategy"},"mechanism":{"anyOf":[{"type":"string","enum":["tag","workflow_dispatch"]},{"type":"null"}],"title":"Mechanism"},"version_scheme":{"anyOf":[{"type":"string","enum":["semver-patch","date","manual"]},{"type":"null"}],"title":"Version Scheme"},"workflow":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow"},"deploy_trigger":{"anyOf":[{"type":"string","enum":["auto_on_merge","none","unknown"]},{"type":"null"}],"title":"Deploy Trigger"}},"additionalProperties":false,"type":"object","title":"DesktopSeedRelease","description":"Release topology carried by a seed-writing request (INI-2779-006).\n\nDeliberately NOT ``core.project_schema.ReleaseModel``: the write routes\nmerge only the leaves a request actually supplied onto the stored block\nbefore the canonical matrix runs, so this shape must preserve field\nPRESENCE (``model_dump(exclude_unset=True)``) and must not substitute\ndefaults for leaves the caller omitted. An explicitly-supplied ``null``\nleaf is therefore a CLEAR (e.g. dropping ``mechanism`` when moving back\nto the ``continuous`` strategy), while an omitted leaf keeps whatever the\nstored block had.\n\nThe value vocabularies are the canonical ``Literal`` aliases from\n``core/project.py`` — the same ones ``ReleaseModel`` annotates its fields\nwith — so a bad enum is rejected at the request boundary (422) exactly\nlike every other typed leaf in these seed shapes. The cross-field matrix\n(``core.project.release_matrix_errors``, reached through ``ReleaseModel``)\nis applied by the route AFTER the merge, since it is only meaningful on a\nwhole block.\n\n``workflow`` is intentionally a bare ``str``: blank rejection belongs to\nthe canonical ``NonEmptyStr``/matrix gate, and normalizing here (a strip)\nwould make the persisted seed disagree with the value the caller sent."},"DesktopSeedRepo":{"properties":{"owner":{"type":"string","minLength":1,"title":"Owner"},"repo_name":{"type":"string","minLength":1,"title":"Repo Name"},"owner_type":{"type":"string","enum":["user","organization",""],"title":"Owner Type","default":""}},"additionalProperties":false,"type":"object","required":["owner","repo_name"],"title":"DesktopSeedRepo","description":"Repository coordinates inside a desktop-seed update."},"DesktopSeedUpdate":{"properties":{"pm_provider":{"type":"string","title":"Pm Provider","default":"github_projects"},"git_hosting_provider":{"type":"string","title":"Git Hosting Provider","default":"github"},"repo":{"$ref":"#/components/schemas/DesktopSeedRepo"},"pm_config":{"$ref":"#/components/schemas/DesktopSeedPmConfig"},"git":{"$ref":"#/components/schemas/DesktopSeedGit"},"build_commands":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"}]},"type":"array"},{"type":"null"}],"title":"Build Commands"},"plan_path_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Path Prefix"},"environment":{"anyOf":[{"$ref":"#/components/schemas/EnvironmentModel"},{"type":"null"}]},"domains":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Domains"},"validation_prepare_commands":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"}]},"type":"array"},{"type":"null"}],"title":"Validation Prepare Commands"},"context_file_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context File Path"},"max_concurrent_tasks":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Concurrent Tasks"},"release":{"anyOf":[{"$ref":"#/components/schemas/DesktopSeedRelease"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["repo"],"title":"DesktopSeedUpdate","description":"Replacement of a project's desktop seed (workspace-owned project\ndefaults — see docs/settings-architecture.md).\n\n``extra=\"forbid\"`` on this model and its request-specific sub-shapes\n(``DesktopSeedRepo``, ``DesktopSeedGit``, ``DesktopSeedPmConfig``,\n``DesktopSeedRelease``) enforces the seed's secret-free guarantee by\nschema: no free-form keys means no tokens and no machine-specific\n``target_repo_path`` can be smuggled into the DB row that desktops later\napply. ``environment`` reuses the canonical, more tolerant\n``EnvironmentModel`` instead of a parallel shape (see its definition\nabove) — it declares no secret-bearing fields, so the guarantee holds.\n\nFull-replace for the fields this model carries; an omitted optional\nfield (``None``, or a falsy path string) PRESERVES the stored seed's\nexisting value rather than clearing it — the route merges onto the\nstored seed rather than rebuilding it from scratch, so canonical fields\nthis request shape can't represent at all (``repo.fields``,\n``approval_states``, ``wave_overlap_hot_paths``, ...) survive untouched.\nTagged ``{cmd, domains, provides}`` command entries ARE representable\nsince INI-2997-002 — see ``build_commands`` below."},"DiagnosisResponse":{"properties":{"last_completed_phase":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Completed Phase"},"phases_completed":{"items":{"type":"string"},"type":"array","title":"Phases Completed"},"recommended_action":{"type":"string","enum":["rescue","autofix","continue","rescue_plan","resume_plan","reset_to_ready","escalate"],"title":"Recommended Action"},"confidence":{"type":"string","enum":["high","medium","low"],"title":"Confidence"},"worktree_exists":{"type":"boolean","title":"Worktree Exists"},"worktree_state":{"type":"string","enum":["exists","missing","inaccessible","unavailable"],"title":"Worktree State"},"has_changes":{"type":"boolean","title":"Has Changes"},"committed_unpushed":{"type":"boolean","title":"Committed Unpushed","default":false},"builds_pass":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Builds Pass"},"details":{"additionalProperties":true,"type":"object","title":"Details"},"probe_available":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Probe Available"},"head":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Head"},"upstream_head":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upstream Head"},"ahead":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ahead"},"behind":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Behind"},"diverged":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Diverged"},"patch_equivalent":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Patch Equivalent"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"},"project_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Id"},"session_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Session Id"},"target_poller_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Poller Id"},"diagnosed_by_poller_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Diagnosed By Poller Id"},"expected_branch":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Branch"},"actual_branch":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actual Branch"},"worktree_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Worktree Path"},"head_sha":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Head Sha"},"upstream_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upstream Ref"},"retryable":{"type":"boolean","title":"Retryable","default":false}},"type":"object","required":["recommended_action","confidence","worktree_exists","worktree_state","has_changes"],"title":"DiagnosisResponse","description":"Diagnosis result for a failed session — read-only inspection."},"DiaryCompletedItem":{"properties":{"kind":{"type":"string","title":"Kind"},"item_type":{"type":"string","title":"Item Type"},"identifier":{"type":"string","title":"Identifier"},"title":{"type":"string","title":"Title"},"detail_path":{"type":"string","title":"Detail Path"},"completed_at":{"type":"string","title":"Completed At"},"actor_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Kind"},"actor_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Label"},"pr_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pr Number"},"recompletion":{"type":"boolean","title":"Recompletion","default":false}},"type":"object","required":["kind","item_type","identifier","title","detail_path","completed_at"],"title":"DiaryCompletedItem","description":"One work item that reached ``Done`` in the day's window."},"DiaryCompletedWork":{"properties":{"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"},"items":{"items":{"$ref":"#/components/schemas/DiaryCompletedItem"},"type":"array","title":"Items"},"items_truncated":{"type":"boolean","title":"Items Truncated"}},"type":"object","required":["counts","items","items_truncated"],"title":"DiaryCompletedWork","description":"The day's completed work: exact per-type counts and the bounded list.\n\n``counts`` is keyed by ``core.project_diary.facts.ITEM_TYPES`` plus\n``total``, and is computed BEFORE the item list is cut — so it stays exact\non a day whose ``items`` were truncated (``items_truncated``)."},"DiaryEntryResponse":{"properties":{"diary_date":{"type":"string","title":"Diary Date"},"window_started_at":{"type":"string","title":"Window Started At"},"window_ended_at":{"type":"string","title":"Window Ended At"},"timezone":{"type":"string","title":"Timezone","default":"UTC"},"format_version":{"type":"integer","title":"Format Version"},"generated_at":{"type":"string","title":"Generated At"},"finalized_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finalized At"},"markdown":{"type":"string","title":"Markdown"},"facts":{"$ref":"#/components/schemas/DiaryFacts"}},"type":"object","required":["diary_date","window_started_at","window_ended_at","format_version","generated_at","markdown","facts"],"title":"DiaryEntryResponse","description":"One project-day diary entry: its window, its Markdown, its facts."},"DiaryFacts":{"properties":{"completed_work":{"$ref":"#/components/schemas/DiaryCompletedWork"},"usage":{"$ref":"#/components/schemas/DiaryUsage"}},"additionalProperties":true,"type":"object","required":["completed_work","usage"],"title":"DiaryFacts","description":"The stored ``facts_json`` structure, as served.\n\n``extra=\"allow\"`` is deliberate and is the one unusual choice in this\nmodule: a later ``format_version`` that adds a whole section to the facts\n(the optional ``learnings`` / ``friction`` nodes) must round-trip through\nthis route untouched rather than be silently dropped by pydantic's default\n``extra=\"ignore\"``. It also carries the facts' own copies of\n``format_version`` / ``diary_date`` / the window bounds / ``timezone``,\nwhich the response mirrors from the row's columns.\n\nA new section that carries cost must be added to :func:`_redacted`; the\npermissive extras pass values through unredacted by design."},"DiaryListResponse":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/DiaryEntryResponse"},"type":"array","title":"Entries","default":[]}},"type":"object","title":"DiaryListResponse","description":"A page of a project's entries, newest-first."},"DiaryRankingRow":{"properties":{"key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"rank_metric":{"type":"integer","title":"Rank Metric"},"session_count":{"type":"integer","title":"Session Count"},"tokens_total":{"type":"integer","title":"Tokens Total"},"cost_usd_microdollars":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cost Usd Microdollars"}},"type":"object","required":["key","rank_metric","session_count","tokens_total"],"title":"DiaryRankingRow","description":"One row of a day's provider / model / poller usage ranking."},"DiaryRebuildSkippedResponse":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"DiaryRebuildSkippedResponse","description":"200 body when a rebuilt day had no completed work, so stored nothing.\n\n``status`` is ``core.project_diary.generator.SKIPPED_NO_COMPLETED_WORK``.\nA quiet day is not a failure and not a 404: the day is genuinely empty, and\nthe generator deliberately stores no row for it."},"DiaryUsage":{"properties":{"available":{"type":"boolean","title":"Available"},"session_count":{"type":"integer","title":"Session Count","default":0},"input_tokens":{"type":"integer","title":"Input Tokens","default":0},"output_tokens":{"type":"integer","title":"Output Tokens","default":0},"cache_creation_input_tokens":{"type":"integer","title":"Cache Creation Input Tokens","default":0},"cache_read_input_tokens":{"type":"integer","title":"Cache Read Input Tokens","default":0},"tokens_total":{"type":"integer","title":"Tokens Total","default":0},"num_turns":{"type":"integer","title":"Num Turns","default":0},"wall_clock_ms":{"type":"integer","title":"Wall Clock Ms","default":0},"cost_usd_microdollars":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cost Usd Microdollars"},"providers":{"items":{"$ref":"#/components/schemas/DiaryRankingRow"},"type":"array","title":"Providers","default":[]},"models":{"items":{"$ref":"#/components/schemas/DiaryRankingRow"},"type":"array","title":"Models","default":[]},"pollers":{"items":{"$ref":"#/components/schemas/DiaryRankingRow"},"type":"array","title":"Pollers","default":[]}},"type":"object","required":["available"],"title":"DiaryUsage","description":"A day's usage totals plus its three bounded rankings.\n\n``available`` is false when the day's rollup read was unavailable or the\nday recorded no sessions; the stored node is then exactly\n``{\"available\": false}`` and every measure below takes its zero default."},"DispatchBlockerResponse":{"properties":{"kind":{"type":"string","title":"Kind"},"detail":{"type":"string","title":"Detail"},"resolution":{"type":"string","title":"Resolution"},"self_resolving":{"type":"boolean","title":"Self Resolving","default":false},"resumes_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resumes At"}},"type":"object","required":["kind","detail","resolution"],"title":"DispatchBlockerResponse","description":"Why a work item is not dispatching, and which control clears it.\n\nDerived server-side by ``core/dispatch_blockers.py`` from evidence the\nboard query already selects, so the card never has to guess. ``kind`` is\nthat module's closed ``BLOCKER_*`` vocabulary and ``resolution`` its\nmatching operator instruction; the pair exists because before TASK-2845 a\nself-resolving provider window, a permanently-latched item, and a genuine\nreview request all rendered identically and carried the same\n``needs-human`` treatment.\n\n``self_resolving`` is that distinction: ``True`` means the block clears\nitself and no operator action is required (``resumes_at`` says when)."},"DomainCoverageResponse":{"properties":{"slug":{"type":"string","title":"Slug"},"has_domains":{"type":"boolean","title":"Has Domains"},"domain_count":{"type":"integer","title":"Domain Count"},"build_command_count":{"type":"integer","title":"Build Command Count"},"tagged_build_command_count":{"type":"integer","title":"Tagged Build Command Count"},"validation_prepare_command_count":{"type":"integer","title":"Validation Prepare Command Count"},"recent_runs_sampled":{"type":"integer","title":"Recent Runs Sampled"},"recent_unknown_domain_runs":{"type":"integer","title":"Recent Unknown Domain Runs"},"warnings":{"items":{"$ref":"#/components/schemas/CoverageWarningResponse"},"type":"array","title":"Warnings"}},"type":"object","required":["slug","has_domains","domain_count","build_command_count","tagged_build_command_count","validation_prepare_command_count","recent_runs_sampled","recent_unknown_domain_runs","warnings"],"title":"DomainCoverageResponse","description":"A project's domain/command coverage summary."},"DomainRoutingPreviewRequest":{"properties":{"paths":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Paths"},"domains":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Domains"},"build_commands":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"}]},"type":"array"},{"type":"null"}],"title":"Build Commands"},"validation_prepare_commands":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"}]},"type":"array"},{"type":"null"}],"title":"Validation Prepare Commands"}},"type":"object","required":["paths"],"title":"DomainRoutingPreviewRequest","description":"Paths to classify, plus the optional candidate config to classify them against.\n\nEach of the three config blocks is independently optional: an omitted (or\nexplicitly ``null``) block is previewed against the project's **stored**\nseed value, so one request can mix unsaved edits with live configuration.\nAn empty list is a real value meaning \"no commands\", not an omission."},"DomainRoutingPreviewResponse":{"properties":{"slug":{"type":"string","title":"Slug"},"domain":{"type":"string","title":"Domain"},"paths":{"items":{"$ref":"#/components/schemas/PathClassificationResponse"},"type":"array","title":"Paths"},"build_commands":{"items":{"type":"string"},"type":"array","title":"Build Commands"},"validation_prepare_commands":{"items":{"type":"string"},"type":"array","title":"Validation Prepare Commands"},"total_build_commands":{"type":"integer","title":"Total Build Commands"},"total_validation_prepare_commands":{"type":"integer","title":"Total Validation Prepare Commands"}},"type":"object","required":["slug","domain","paths","build_commands","validation_prepare_commands","total_build_commands","total_validation_prepare_commands"],"title":"DomainRoutingPreviewResponse","description":"What the validation gate would resolve for the supplied paths."},"DoneBoardPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BacklogItemResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More","default":false}},"type":"object","required":["items","total","limit","offset"],"title":"DoneBoardPage","description":"Paginated page of Done board items.\n\n``next_cursor`` / ``has_more`` are the keyset half of the contract\n(BUG-3228): pass ``next_cursor`` back as ``?cursor=`` to get the rows\nstrictly after this page in feed order, and trust ``has_more`` rather than\ncomparing served rows against ``total`` (a separate count query that can\ndisagree under concurrency). ``limit`` / ``offset`` are echoed unchanged so\na client that pages by offset keeps working; when a cursor was supplied,\n``offset`` is echoed but not used to select rows. Both new fields carry\ndefaults so every existing construction site stays valid."},"EffectivePolicy":{"properties":{"state":{"type":"string","enum":["enabled","disabled","unknown"],"title":"State"},"coordination_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Coordination Enabled"},"automation_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Automation Enabled"},"stage_permissions":{"$ref":"#/components/schemas/EffectiveStagePermissions"},"max_repair_rounds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Repair Rounds"},"max_sessions":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Sessions"},"max_verifications":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Verifications"},"max_concurrent_repairs":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Concurrent Repairs"},"spend_limit_usd_microdollars":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Spend Limit Usd Microdollars"},"reasons":{"items":{"type":"string"},"type":"array","title":"Reasons"}},"additionalProperties":false,"type":"object","required":["state","coordination_enabled","automation_enabled","stage_permissions","max_repair_rounds","max_sessions","max_verifications","max_concurrent_repairs","spend_limit_usd_microdollars","reasons"],"title":"EffectivePolicy","description":"The org/project intersection; ``None`` values are unknown, not false."},"EffectiveStagePermissions":{"properties":{"admission":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Admission"},"enrichment":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enrichment"},"development":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Development"},"review":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Review"},"integration":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Integration"}},"additionalProperties":false,"type":"object","required":["admission","enrichment","development","review","integration"],"title":"EffectiveStagePermissions","description":"Per-stage effective permission; ``None`` means unknown."},"EnvironmentCheckModel":{"properties":{"type":{"type":"string","enum":["tcp","cmd"],"title":"Type"},"host":{"type":"string","title":"Host","default":"127.0.0.1"},"port":{"anyOf":[{"type":"integer","maximum":65535.0,"minimum":1.0},{"type":"null"}],"title":"Port"},"run":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run"},"timeout_seconds":{"type":"number","exclusiveMinimum":0.0,"title":"Timeout Seconds","default":5.0}},"type":"object","required":["type"],"title":"EnvironmentCheckModel"},"EnvironmentModel":{"properties":{"tools":{"items":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/ToolModel"}]},"type":"array","title":"Tools"},"services":{"items":{"$ref":"#/components/schemas/EnvironmentServiceModel"},"type":"array","title":"Services"},"freshness":{"items":{"$ref":"#/components/schemas/FreshnessModel"},"type":"array","title":"Freshness"}},"type":"object","title":"EnvironmentModel","description":"Machine-environment requirements (tools + services + freshness).\n\nThe complete mirror of ``core/project.py::_parse_environment_config`` —\n``core/api/models.py::DesktopSeedEnvironment`` is an alias for this model\n(INI-2437-008), so the desktop-seed API surfaces share one environment\nshape instead of a partial parallel one."},"EnvironmentServiceModel":{"properties":{"name":{"type":"string","title":"Name"},"check":{"$ref":"#/components/schemas/EnvironmentCheckModel"},"hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hint"},"exclusive":{"type":"boolean","title":"Exclusive","default":false}},"type":"object","required":["name","check"],"title":"EnvironmentServiceModel"},"ExecRequest":{"properties":{"op":{"type":"string","enum":["fetch_one","fetch_all","fetch_val","execute"],"title":"Op"},"sql":{"type":"string","title":"Sql"},"params":{"items":{},"type":"array","title":"Params"}},"type":"object","required":["op","sql"],"title":"ExecRequest","description":"Body for ``POST`` exec / tx-exec: a facade op, SQL, and encoded params.\n\nFor tx-exec the ``tx_id`` travels in the URL path, so the body shape is\nidentical — :data:`TxExecRequest` aliases this model."},"FeedbackLogResponse":{"properties":{"id":{"type":"integer","title":"Id"},"project_id":{"type":"integer","title":"Project Id"},"task_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Task Id"},"initiative_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Initiative Id"},"feedback_type":{"type":"string","title":"Feedback Type"},"feedback_content":{"type":"string","title":"Feedback Content"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","project_id","feedback_type","feedback_content","created_at"],"title":"FeedbackLogResponse"},"FileUpdateRequest":{"properties":{"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"FileUpdateRequest"},"FreshnessModel":{"properties":{"name":{"type":"string","title":"Name"},"check":{"type":"string","title":"Check"},"remediate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remediate"},"timeout_seconds":{"type":"number","exclusiveMinimum":0.0,"title":"Timeout Seconds","default":30.0}},"type":"object","required":["name","check"],"title":"FreshnessModel"},"GithubAppConfigResponse":{"properties":{"configured":{"type":"boolean","title":"Configured"},"app_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"},"install_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Install Url"}},"type":"object","required":["configured","app_slug","install_url"],"title":"GithubAppConfigResponse","description":"Whether the App is configured plus the install URL for the UI."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthCondition":{"properties":{"episode_id":{"type":"integer","title":"Episode Id"},"event_type":{"type":"string","title":"Event Type"},"severity":{"type":"string","title":"Severity"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"title":{"type":"string","title":"Title"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"project_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Id"},"project_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Slug"},"scope_label":{"type":"string","title":"Scope Label"},"first_seen_at":{"type":"string","title":"First Seen At"},"last_seen_at":{"type":"string","title":"Last Seen At"},"occurrence_count":{"type":"integer","title":"Occurrence Count"},"escalation_level":{"type":"integer","title":"Escalation Level"},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"},"entity_db_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Entity Db Id"},"entity_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Ref"}},"type":"object","required":["episode_id","event_type","severity","title","scope_label","first_seen_at","last_seen_at","occurrence_count","escalation_level"],"title":"HealthCondition","description":"One open operational condition, from an active episode."},"HealthCounts":{"properties":{"critical":{"type":"integer","title":"Critical","default":0},"action_required":{"type":"integer","title":"Action Required","default":0},"warning":{"type":"integer","title":"Warning","default":0},"total":{"type":"integer","title":"Total","default":0}},"type":"object","title":"HealthCounts","description":"Severity counts over the WHOLE filtered set, not the returned page."},"HealthResponse":{"properties":{"scope":{"type":"string","title":"Scope"},"org_id":{"type":"string","title":"Org Id"},"project_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Slug"},"server_now":{"type":"string","title":"Server Now"},"counts":{"$ref":"#/components/schemas/HealthCounts"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"conditions":{"items":{"$ref":"#/components/schemas/HealthCondition"},"type":"array","title":"Conditions"}},"type":"object","required":["scope","org_id","server_now","counts","total","limit","offset","conditions"],"title":"HealthResponse","description":"The shared org/project Health payload.\n\n``org_id`` is the effective organization the query behind this response\nran under, which is not always the caller's header org — see the module\ndocstring. ``total`` equals ``counts.total`` and sits beside\n``limit``/``offset`` as the paging contract."},"HumanGateAiContextResponse":{"properties":{"context_version":{"type":"integer","title":"Context Version"},"work_item_kind":{"type":"string","enum":["initiative","task"],"title":"Work Item Kind"},"work_item_db_id":{"type":"integer","title":"Work Item Db Id"},"entity_type":{"type":"string","enum":["initiative","task","bug"],"title":"Entity Type"},"issue_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Issue Number"},"task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"},"title":{"type":"string","title":"Title"},"status":{"type":"string","title":"Status"},"project_slug":{"type":"string","title":"Project Slug"},"needs_human_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Needs Human Reason"},"stable_reference":{"additionalProperties":true,"type":"object","title":"Stable Reference"},"failure_provenance":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Failure Provenance"},"truncated":{"type":"boolean","title":"Truncated"}},"type":"object","required":["context_version","work_item_kind","work_item_db_id","entity_type","issue_number","task_id","title","status","project_slug","needs_human_reason","stable_reference","failure_provenance","truncated"],"title":"HumanGateAiContextResponse","description":"Versioned, prompt-safe context for a personal queue action."},"HumanGateAllowedTransition":{"properties":{"to_status":{"type":"string","title":"To Status"},"requires_reason":{"type":"boolean","title":"Requires Reason"},"capability":{"type":"string","enum":["planning","development","pr_review","maintenance","operations","pm_integration"],"title":"Capability"},"approval_progress":{"anyOf":[{"$ref":"#/components/schemas/HumanGateApprovalProgress"},{"type":"null"}]}},"type":"object","required":["to_status","requires_reason","capability"],"title":"HumanGateAllowedTransition"},"HumanGateApprovalProgress":{"properties":{"required_approvals":{"type":"integer","title":"Required Approvals"},"current_approvals":{"type":"integer","title":"Current Approvals"},"forbid_self_approval":{"type":"boolean","title":"Forbid Self Approval"},"caller_approved":{"type":"boolean","title":"Caller Approved"},"has_canonical_reason":{"type":"boolean","title":"Has Canonical Reason"},"canonical_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Reason"},"caller_can_approve":{"type":"boolean","title":"Caller Can Approve"}},"type":"object","required":["required_approvals","current_approvals","forbid_self_approval","caller_approved","has_canonical_reason","caller_can_approve"],"title":"HumanGateApprovalProgress","description":"Non-caller-specific progress plus this caller's own approval state.\n\nPresent only on a transition backed by a project-configured approval\npolicy; an unconfigured (default) gate keeps this ``None``."},"HumanGateAssignmentRequestFamilies":{"properties":{"planning":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Planning"},"development":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Development"},"operations":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Operations"}},"additionalProperties":false,"type":"object","required":["planning","development","operations"],"title":"HumanGateAssignmentRequestFamilies","description":"Complete assignment replacement requested by an administrator."},"HumanGateAssignmentResponseFamilies":{"properties":{"planning":{"items":{"type":"string"},"type":"array","title":"Planning"},"development":{"items":{"type":"string"},"type":"array","title":"Development"},"operations":{"items":{"type":"string"},"type":"array","title":"Operations"}},"additionalProperties":false,"type":"object","required":["planning","development","operations"],"title":"HumanGateAssignmentResponseFamilies","description":"Canonical assignment lists for all routed gate families."},"HumanGateAssignmentsPutRequest":{"properties":{"assignments":{"$ref":"#/components/schemas/HumanGateAssignmentRequestFamilies"}},"additionalProperties":false,"type":"object","required":["assignments"],"title":"HumanGateAssignmentsPutRequest","description":"Strict full-replacement request body."},"HumanGateAssignmentsResponse":{"properties":{"project_id":{"type":"integer","title":"Project Id"},"project_slug":{"type":"string","title":"Project Slug"},"assignments":{"$ref":"#/components/schemas/HumanGateAssignmentResponseFamilies"}},"additionalProperties":false,"type":"object","required":["project_id","project_slug","assignments"],"title":"HumanGateAssignmentsResponse","description":"Complete assignment configuration for one project."},"HumanGateQueueItem":{"properties":{"work_item_kind":{"type":"string","enum":["initiative","task"],"title":"Work Item Kind"},"entity_type":{"type":"string","enum":["initiative","task","bug"],"title":"Entity Type"},"work_item_db_id":{"type":"integer","title":"Work Item Db Id"},"project_id":{"type":"integer","title":"Project Id"},"project_slug":{"type":"string","title":"Project Slug"},"issue_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Issue Number"},"task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"status":{"type":"string","title":"Status"},"needs_human":{"type":"boolean","title":"Needs Human"},"needs_human_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Needs Human Reason"},"allowed_transitions":{"items":{"$ref":"#/components/schemas/HumanGateAllowedTransition"},"type":"array","title":"Allowed Transitions"},"can_clear_needs_human":{"type":"boolean","title":"Can Clear Needs Human"},"triage_invalid":{"type":"boolean","title":"Triage Invalid","default":false},"triage_invalid_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Triage Invalid Reason"},"awaiting_provisioning":{"type":"boolean","title":"Awaiting Provisioning","default":false}},"type":"object","required":["work_item_kind","entity_type","work_item_db_id","project_id","project_slug","issue_number","task_id","title","status","needs_human","needs_human_reason","allowed_transitions","can_clear_needs_human"],"title":"HumanGateQueueItem"},"HumanGateQueueResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/HumanGateQueueItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"can_view_unassigned":{"type":"boolean","title":"Can View Unassigned"},"unassigned_items":{"items":{"$ref":"#/components/schemas/UnassignedHumanGateItem"},"type":"array","title":"Unassigned Items"},"unassigned_total":{"type":"integer","title":"Unassigned Total"}},"type":"object","required":["items","total","can_view_unassigned","unassigned_items","unassigned_total"],"title":"HumanGateQueueResponse"},"InitiativeDetailResponse":{"properties":{"id":{"type":"integer","title":"Id"},"project_id":{"type":"integer","title":"Project Id"},"gh_item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gh Item Id"},"issue_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Issue Number"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Labels"},"paused":{"type":"boolean","title":"Paused","default":false},"status":{"type":"string","title":"Status"},"approval_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approval Status"},"plan_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Path"},"pr_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pr Number"},"project_slug":{"type":"string","title":"Project Slug","default":""},"repo_slug":{"type":"string","title":"Repo Slug","default":""},"plans":{"items":{"$ref":"#/components/schemas/PlanResponse"},"type":"array","title":"Plans","default":[]},"tasks":{"items":{"$ref":"#/components/schemas/TaskResponse"},"type":"array","title":"Tasks"},"task_status_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Task Status Counts","default":{}},"wave_progress":{"items":{"$ref":"#/components/schemas/WaveProgressResponse"},"type":"array","title":"Wave Progress","default":[]},"active_sessions":{"items":{"$ref":"#/components/schemas/SessionWithStatus"},"type":"array","title":"Active Sessions"},"baseline_repairs":{"anyOf":[{"items":{"$ref":"#/components/schemas/BaselineRepairSummary"},"type":"array"},{"type":"null"}],"title":"Baseline Repairs"},"baseline_repairs_total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Baseline Repairs Total"}},"type":"object","required":["id","project_id","status"],"title":"InitiativeDetailResponse"},"InitiativeProposal":{"properties":{"title":{"type":"string","maxLength":256,"minLength":1,"title":"Title"},"body":{"type":"string","maxLength":60000,"minLength":1,"title":"Body"}},"additionalProperties":false,"type":"object","required":["title","body"],"title":"InitiativeProposal"},"InitiativeResponse":{"properties":{"id":{"type":"integer","title":"Id"},"project_id":{"type":"integer","title":"Project Id"},"gh_item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gh Item Id"},"issue_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Issue Number"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Labels"},"status":{"type":"string","title":"Status"},"approval_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approval Status"},"plan_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Path"},"pr_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pr Number"},"needs_human":{"type":"boolean","title":"Needs Human","default":false},"needs_human_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Needs Human Reason"},"needs_human_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Needs Human At"},"paused":{"type":"boolean","title":"Paused","default":false},"paused_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paused At"},"paused_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paused By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","project_id","status","created_at","updated_at"],"title":"InitiativeResponse"},"InitiativeSummary":{"properties":{"id":{"type":"integer","title":"Id"},"project_id":{"type":"integer","title":"Project Id"},"issue_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Issue Number"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"status":{"type":"string","title":"Status"},"approval_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approval Status"},"plan_count":{"type":"integer","title":"Plan Count","default":0},"task_count":{"type":"integer","title":"Task Count","default":0},"done_tasks":{"type":"integer","title":"Done Tasks","default":0},"wave_count":{"type":"integer","title":"Wave Count","default":0}},"type":"object","required":["id","project_id","status"],"title":"InitiativeSummary","description":"Initiative overview with child-entity counts."},"InstallationResponse":{"properties":{"installation_id":{"type":"integer","title":"Installation Id"},"account_login":{"type":"string","title":"Account Login"},"account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Type"},"repository_selection":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repository Selection"},"suspended":{"type":"boolean","title":"Suspended"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["installation_id","account_login","account_type","repository_selection","suspended","created_at"],"title":"InstallationResponse","description":"A stored org -> GitHub-App installation mapping (no token/credential).\n\n``DELETE`` on the collection removes only this mapping; it does not\nuninstall the App from GitHub."},"JudgmentConsentResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"changed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Changed At"},"changed_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Changed By"},"configured":{"type":"boolean","title":"Configured"},"model":{"type":"string","title":"Model"},"daily_token_budget":{"type":"integer","title":"Daily Token Budget"},"tokens_used_today":{"type":"integer","title":"Tokens Used Today"},"consent_text":{"type":"string","title":"Consent Text"},"features":{"items":{"$ref":"#/components/schemas/JudgmentFeatureInfo"},"type":"array","title":"Features"}},"type":"object","required":["enabled","changed_at","changed_by","configured","model","daily_token_budget","tokens_used_today","consent_text","features"],"title":"JudgmentConsentResponse"},"JudgmentFeatureInfo":{"properties":{"feature_id":{"type":"string","title":"Feature Id"},"description":{"type":"string","title":"Description"}},"type":"object","required":["feature_id","description"],"title":"JudgmentFeatureInfo"},"JudgmentRequestBody":{"properties":{"state":{"additionalProperties":true,"type":"object","title":"State"},"policy_version":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Policy Version"}},"type":"object","title":"JudgmentRequestBody"},"LabelResponse":{"properties":{"name":{"type":"string","title":"Name"},"color":{"type":"string","title":"Color"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["name","color"],"title":"LabelResponse"},"LanePolicy":{"properties":{"status":{"type":"string","title":"Status"},"owner":{"type":"string","title":"Owner"},"gated":{"type":"boolean","title":"Gated"},"droppable":{"type":"boolean","title":"Droppable"}},"type":"object","required":["status","owner","gated","droppable"],"title":"LanePolicy"},"LearningResponse":{"properties":{"id":{"type":"integer","title":"Id"},"domain":{"type":"string","title":"Domain"},"content":{"type":"string","title":"Content"},"source_type":{"type":"string","title":"Source Type"},"source_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Ref"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","domain","content","source_type","created_at"],"title":"LearningResponse"},"MarkAllReadResponse":{"properties":{"marked":{"type":"integer","title":"Marked"}},"type":"object","required":["marked"],"title":"MarkAllReadResponse"},"NotificationActor":{"properties":{"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"}},"type":"object","title":"NotificationActor","description":"Who or what caused the event (``actor_type``/``actor_id``/``actor_detail``)."},"NotificationItem":{"properties":{"id":{"type":"integer","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"event_type":{"type":"string","title":"Event Type"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"severity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"},"origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"},"is_machine_local":{"type":"boolean","title":"Is Machine Local"},"project_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Id"},"project_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Slug"},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"},"entity_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Ref"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"detail":{"anyOf":[{},{"type":"null"}],"title":"Detail"},"targets":{"anyOf":[{},{"type":"null"}],"title":"Targets"},"correlation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"},"episode_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Episode Id"},"actor":{"$ref":"#/components/schemas/NotificationActor"},"state":{"$ref":"#/components/schemas/NotificationState"}},"type":"object","required":["id","created_at","event_type","is_machine_local","actor","state"],"title":"NotificationItem"},"NotificationPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/NotificationItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"NotificationPage"},"NotificationState":{"properties":{"read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Read At"},"dismissed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Dismissed At"},"acknowledged_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Acknowledged At"},"snoozed_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Snoozed Until"}},"type":"object","title":"NotificationState","description":"The CALLER's own per-notification state; every field NULL when untouched."},"NotificationSummary":{"properties":{"unread":{"type":"integer","title":"Unread"},"action_required":{"type":"integer","title":"Action Required"}},"type":"object","required":["unread","action_required"],"title":"NotificationSummary"},"ObjectUploadRequest":{"properties":{"bucket":{"type":"string","maxLength":64,"minLength":1,"title":"Bucket"},"object_path":{"type":"string","maxLength":512,"minLength":1,"title":"Object Path"},"content":{"type":"string","title":"Content"},"content_type":{"type":"string","maxLength":128,"pattern":"^[\\w.+-]+/[\\w.+-]+$","title":"Content Type","default":"text/plain"}},"type":"object","required":["bucket","object_path","content"],"title":"ObjectUploadRequest","description":"A Storage object upsert (text content; logs are UTF-8 text)."},"OrgPmIntegrationResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"provider":{"type":"string","title":"Provider"},"installation_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Installation Id"},"installation_account_login":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Installation Account Login"},"connected_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connected At"},"app_configured":{"type":"boolean","title":"App Configured"},"deployment_mode":{"type":"string","title":"Deployment Mode"}},"type":"object","required":["enabled","provider","installation_id","installation_account_login","connected_at","app_configured","deployment_mode"],"title":"OrgPmIntegrationResponse","description":"The caller org's server-side board I/O status (no credential material)."},"OrgPolicyReceipt":{"properties":{"org_id":{"type":"string","title":"Org Id"},"cost_visible":{"type":"boolean","title":"Cost Visible"},"root":{"$ref":"#/components/schemas/StoredPolicyView"},"changed":{"type":"boolean","title":"Changed"}},"additionalProperties":false,"type":"object","required":["org_id","cost_visible","root","changed"],"title":"OrgPolicyReceipt"},"OrgPolicyResponse":{"properties":{"org_id":{"type":"string","title":"Org Id"},"cost_visible":{"type":"boolean","title":"Cost Visible"},"root":{"$ref":"#/components/schemas/StoredPolicyView"}},"additionalProperties":false,"type":"object","required":["org_id","cost_visible","root"],"title":"OrgPolicyResponse"},"PRCommentResponse":{"properties":{"id":{"type":"integer","title":"Id"},"project_id":{"type":"integer","title":"Project Id"},"task_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Task Id"},"initiative_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Initiative Id"},"gh_comment_id":{"type":"string","title":"Gh Comment Id"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"resolution_details":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution Details"},"reconciliation_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reconciliation Reason"},"reconciliation_batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reconciliation Batch Id"},"reconciled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reconciled At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","project_id","gh_comment_id","created_at","updated_at"],"title":"PRCommentResponse","description":"One ``pr_comments`` row as the task-comments endpoint returns it.\n\nThe reconciliation fields (INI-3016-003) are additive and nullable: a row\nwritten before lifecycle reconciliation existed, or one reconciliation has\nnever touched, serializes all three as ``null``. They explain why a row\nbecame lifecycle-terminal — the controlled reason, the batch the decision\nbelongs to, and when it was taken.\n\n``pr_comments`` also carries ``reconciled_from_status``,\n``reconciled_from_updated_at`` and ``last_reconciliation_checked_at``.\nThose are rollback state and pass scheduling, not operator-facing\nprovenance, and are deliberately absent here — the query builds this model\nfrom a ``SELECT *`` row, so Pydantic's default ``extra=\"ignore\"`` is what\nkeeps them off the wire."},"PaginatedSessionsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SessionWithProject"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total","default":0},"offset":{"type":"integer","title":"Offset","default":0},"limit":{"type":"integer","title":"Limit","default":50}},"type":"object","title":"PaginatedSessionsResponse","description":"Paginated sessions with total count."},"PathClassificationResponse":{"properties":{"path":{"type":"string","title":"Path"},"domain":{"type":"string","title":"Domain"},"matched_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matched Prefix"}},"type":"object","required":["path","domain","matched_prefix"],"title":"PathClassificationResponse","description":"One path's routing decision — mirrors ``domain_routing.PathClassification``."},"PendingPushResponse":{"properties":{"id":{"type":"integer","title":"Id"},"entity_type":{"type":"string","title":"Entity Type"},"entity_id":{"type":"string","title":"Entity Id"},"gh_item_id":{"type":"string","title":"Gh Item Id"},"op_type":{"type":"string","title":"Op Type"},"issue_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Issue Number"},"field_name":{"type":"string","title":"Field Name"},"target_value":{"type":"string","title":"Target Value"},"attempts":{"type":"integer","title":"Attempts"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"sync_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sync State"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","entity_type","entity_id","gh_item_id","op_type","field_name","target_value","attempts","created_at","updated_at"],"title":"PendingPushResponse","description":"One queued outbound provider push, enriched with the owning link's\n``sync_state`` when a link row exists (``None`` when the queue alone governs\nretry for this item)."},"PlanDetailResponse":{"properties":{"id":{"type":"integer","title":"Id"},"project_id":{"type":"integer","title":"Project Id"},"initiative_id":{"type":"integer","title":"Initiative Id"},"gh_item_id":{"type":"string","title":"Gh Item Id"},"issue_number":{"type":"integer","title":"Issue Number"},"status":{"type":"string","title":"Status"},"initiative":{"anyOf":[{"$ref":"#/components/schemas/InitiativeResponse"},{"type":"null"}]}},"type":"object","required":["id","project_id","initiative_id","gh_item_id","issue_number","status"],"title":"PlanDetailResponse"},"PlanResponse":{"properties":{"id":{"type":"integer","title":"Id"},"project_id":{"type":"integer","title":"Project Id"},"initiative_id":{"type":"integer","title":"Initiative Id"},"gh_item_id":{"type":"string","title":"Gh Item Id"},"issue_number":{"type":"integer","title":"Issue Number"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","project_id","initiative_id","gh_item_id","issue_number","status","created_at","updated_at"],"title":"PlanResponse"},"PolicyPutRequest":{"properties":{"expected_revision":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Expected Revision"},"policy":{"$ref":"#/components/schemas/RepairPolicy"}},"additionalProperties":false,"type":"object","required":["expected_revision","policy"],"title":"PolicyPutRequest","description":"A complete canonical policy and the revision the caller last read."},"PollerFleetItem":{"properties":{"poller_id":{"type":"string","title":"Poller Id"},"process_status":{"type":"string","title":"Process Status"},"lifecycle_status":{"type":"string","title":"Lifecycle Status"},"hostname":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hostname"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"last_seen_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Seen At"},"active_sessions":{"type":"integer","title":"Active Sessions"},"project_slugs":{"items":{"type":"string"},"type":"array","title":"Project Slugs"},"approved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved At"},"approved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By"},"allowed_project_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Allowed Project Ids"},"capability_ceiling":{"anyOf":[{"items":{"type":"string","enum":["planning","development","pr_review","maintenance","operations","pm_integration"]},"type":"array"},{"type":"null"}],"title":"Capability Ceiling"},"max_concurrent_sessions":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Concurrent Sessions"}},"additionalProperties":false,"type":"object","required":["poller_id","process_status","lifecycle_status","hostname","version","started_at","last_seen_at","active_sessions","project_slugs","approved_at","approved_by","allowed_project_ids","capability_ceiling","max_concurrent_sessions"],"title":"PollerFleetItem","description":"One poller's process telemetry and administrator-owned governance state."},"PollerFleetResponse":{"properties":{"auto_approve_pollers":{"type":"boolean","title":"Auto Approve Pollers"},"server_now":{"type":"string","title":"Server Now"},"pollers":{"items":{"$ref":"#/components/schemas/PollerFleetItem"},"type":"array","title":"Pollers"}},"additionalProperties":false,"type":"object","required":["auto_approve_pollers","server_now","pollers"],"title":"PollerFleetResponse","description":"Current-organization poller fleet plus its database-clock timestamp."},"PollerLifecycleRequest":{"properties":{"target_status":{"type":"string","enum":["online","draining","stopped"],"title":"Target Status"}},"additionalProperties":false,"type":"object","required":["target_status"],"title":"PollerLifecycleRequest","description":"One requested administrator lifecycle target."},"PollerScopesPutRequest":{"properties":{"allowed_project_ids":{"anyOf":[{"items":{"type":"integer","maximum":9.223372036854776e+18,"exclusiveMinimum":0.0},"type":"array"},{"type":"null"}],"title":"Allowed Project Ids"},"capability_ceiling":{"anyOf":[{"items":{"type":"string","enum":["planning","development","pr_review","maintenance","operations","pm_integration"]},"type":"array"},{"type":"null"}],"title":"Capability Ceiling"},"max_concurrent_sessions":{"anyOf":[{"type":"integer","maximum":2147483647.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Concurrent Sessions"}},"additionalProperties":false,"type":"object","required":["allowed_project_ids","capability_ceiling","max_concurrent_sessions"],"title":"PollerScopesPutRequest","description":"Strict replacement for all administrator-owned execution scopes."},"PollerSettingsPatchRequest":{"properties":{"auto_approve_pollers":{"type":"boolean","title":"Auto Approve Pollers"}},"additionalProperties":false,"type":"object","required":["auto_approve_pollers"],"title":"PollerSettingsPatchRequest","description":"Strict poller auto-approval replacement."},"PollerSettingsResponse":{"properties":{"auto_approve_pollers":{"type":"boolean","title":"Auto Approve Pollers"}},"additionalProperties":false,"type":"object","required":["auto_approve_pollers"],"title":"PollerSettingsResponse","description":"The authoritative poller auto-approval value after a mutation."},"PreferenceEntry":{"properties":{"category":{"type":"string","title":"Category"},"channel":{"type":"string","title":"Channel"},"enabled":{"type":"boolean","title":"Enabled","default":true},"min_severity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Min Severity"},"quiet_hours":{"anyOf":[{"$ref":"#/components/schemas/QuietHoursModel"},{"type":"null"}]},"reminder_minutes":{"anyOf":[{"type":"integer","maximum":2147483647.0,"minimum":1.0},{"type":"null"}],"title":"Reminder Minutes"},"digest":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Digest"}},"type":"object","required":["category","channel"],"title":"PreferenceEntry","description":"One row of a ``PUT`` payload, before vocabulary validation.\n\nEvery closed-vocabulary field is typed ``str`` rather than a ``Literal``\non purpose: the members live in ``core/notifications/taxonomy.py`` and are\nchecked in :func:`_validated_entries` against the imported frozensets, so\na new channel needs no edit here. Restating them as a ``Literal`` would be\nthe second definition this module exists to avoid."},"PricingCandidate":{"properties":{"provider":{"type":"string","enum":["claude","codex","gemini","grok"],"title":"Provider"},"model":{"type":"string","title":"Model"},"input_microdollars_per_mtok":{"type":"integer","maximum":1000000000000.0,"minimum":0.0,"title":"Input Microdollars Per Mtok"},"output_microdollars_per_mtok":{"type":"integer","maximum":1000000000000.0,"minimum":0.0,"title":"Output Microdollars Per Mtok"},"cache_write_microdollars_per_mtok":{"type":"integer","maximum":1000000000000.0,"minimum":0.0,"title":"Cache Write Microdollars Per Mtok"},"cache_read_microdollars_per_mtok":{"type":"integer","maximum":1000000000000.0,"minimum":0.0,"title":"Cache Read Microdollars Per Mtok"},"source_unit":{"type":"string","enum":["usd_per_mtok","usd_per_ktok","usd_cents_per_100mtok"],"title":"Source Unit"},"standard_policy_id":{"type":"string","title":"Standard Policy Id"},"alias_target":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alias Target"},"alias_evidence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alias Evidence"}},"additionalProperties":false,"type":"object","required":["provider","model","input_microdollars_per_mtok","output_microdollars_per_mtok","cache_write_microdollars_per_mtok","cache_read_microdollars_per_mtok","source_unit","standard_policy_id"],"title":"PricingCandidate","description":"One exact provider/model rate candidate in integer microdollars/MTok."},"ProgressEventResponse":{"properties":{"id":{"type":"integer","title":"Id"},"session_id":{"type":"integer","title":"Session Id"},"phase":{"type":"string","title":"Phase"},"status":{"type":"string","title":"Status"},"details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Details"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","session_id","phase","status","created_at"],"title":"ProgressEventResponse"},"ProjectAccessRequest":{"properties":{"project_access":{"type":"string","enum":["all","restricted"],"title":"Project Access"},"project_ids":{"items":{"type":"integer"},"type":"array","maxItems":500,"title":"Project Ids"}},"type":"object","required":["project_access"],"title":"ProjectAccessRequest"},"ProjectAppearance":{"properties":{"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"accent_hue":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Accent Hue"},"glyph_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Glyph Color"}},"type":"object","title":"ProjectAppearance"},"ProjectAppearanceUpdate":{"properties":{"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"accent_hue":{"anyOf":[{"type":"integer","maximum":360.0,"minimum":0.0},{"type":"null"}],"title":"Accent Hue"},"glyph_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Glyph Color"}},"type":"object","title":"ProjectAppearanceUpdate"},"ProjectCapabilityGapsResponse":{"properties":{"project_slug":{"type":"string","title":"Project Slug"},"gaps":{"items":{"$ref":"#/components/schemas/CapabilityGap"},"type":"array","title":"Gaps"}},"type":"object","required":["project_slug","gaps"],"title":"ProjectCapabilityGapsResponse","description":"Privacy-safe capability coverage gaps for one accessible project."},"ProjectPolicyReceipt":{"properties":{"org_id":{"type":"string","title":"Org Id"},"project_id":{"type":"integer","title":"Project Id"},"project_slug":{"type":"string","title":"Project Slug"},"cost_visible":{"type":"boolean","title":"Cost Visible"},"root":{"$ref":"#/components/schemas/StoredPolicyView"},"project":{"$ref":"#/components/schemas/StoredPolicyView"},"effective":{"$ref":"#/components/schemas/EffectivePolicy"},"readiness":{"$ref":"#/components/schemas/RepairReadinessView"},"changed":{"type":"boolean","title":"Changed"}},"additionalProperties":false,"type":"object","required":["org_id","project_id","project_slug","cost_visible","root","project","effective","readiness","changed"],"title":"ProjectPolicyReceipt"},"ProjectPolicyResponse":{"properties":{"org_id":{"type":"string","title":"Org Id"},"project_id":{"type":"integer","title":"Project Id"},"project_slug":{"type":"string","title":"Project Slug"},"cost_visible":{"type":"boolean","title":"Cost Visible"},"root":{"$ref":"#/components/schemas/StoredPolicyView"},"project":{"$ref":"#/components/schemas/StoredPolicyView"},"effective":{"$ref":"#/components/schemas/EffectivePolicy"},"readiness":{"$ref":"#/components/schemas/RepairReadinessView"}},"additionalProperties":false,"type":"object","required":["org_id","project_id","project_slug","cost_visible","root","project","effective","readiness"],"title":"ProjectPolicyResponse"},"ProjectResponse":{"properties":{"id":{"type":"integer","title":"Id"},"slug":{"type":"string","title":"Slug"},"repo_slug":{"type":"string","title":"Repo Slug"},"target_repo_path":{"type":"string","title":"Target Repo Path"},"org_id":{"type":"string","title":"Org Id"},"org_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org Name"},"paused":{"type":"boolean","title":"Paused","default":false},"po_agent_enabled":{"type":"boolean","title":"Po Agent Enabled","default":false},"sm_agent_enabled":{"type":"boolean","title":"Sm Agent Enabled","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","slug","repo_slug","target_repo_path","org_id","created_at"],"title":"ProjectResponse"},"ProjectStats":{"properties":{"total_tasks":{"type":"integer","title":"Total Tasks","default":0},"done_tasks":{"type":"integer","title":"Done Tasks","default":0},"active_sessions":{"type":"integer","title":"Active Sessions","default":0},"error_sessions":{"type":"integer","title":"Error Sessions","default":0},"completion_rate":{"type":"number","title":"Completion Rate","default":0.0}},"type":"object","title":"ProjectStats","description":"Aggregate stats for a single project."},"ProjectSummary":{"properties":{"id":{"type":"integer","title":"Id"},"slug":{"type":"string","title":"Slug"},"repo_slug":{"type":"string","title":"Repo Slug"},"target_repo_path":{"type":"string","title":"Target Repo Path"},"org_id":{"type":"string","title":"Org Id"},"org_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org Name"},"paused":{"type":"boolean","title":"Paused","default":false},"po_agent_enabled":{"type":"boolean","title":"Po Agent Enabled","default":false},"sm_agent_enabled":{"type":"boolean","title":"Sm Agent Enabled","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"initiative_count":{"type":"integer","title":"Initiative Count","default":0},"task_count":{"type":"integer","title":"Task Count","default":0},"active_sessions":{"type":"integer","title":"Active Sessions","default":0},"done_tasks":{"type":"integer","title":"Done Tasks","default":0},"total_tasks":{"type":"integer","title":"Total Tasks","default":0}},"type":"object","required":["id","slug","repo_slug","target_repo_path","org_id","created_at"],"title":"ProjectSummary","description":"Project with aggregate counts.\n\nThe response model for ``GET /projects`` (``core/api/routes/projects.py``).\nIts aggregate counts feed the web project-list consumers — the context\nswitcher's per-project ``active_sessions`` and paused pill — and the\nOperations Health roll-up, which sums them across the org."},"ProviderSyncHealthResponse":{"properties":{"project_slug":{"type":"string","title":"Project Slug"},"status":{"type":"string","enum":["healthy","stale"],"title":"Status"},"last_successful_sync_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Successful Sync At"},"sync_freshness_age_seconds":{"type":"integer","title":"Sync Freshness Age Seconds"},"sync_stale_after_seconds":{"type":"integer","title":"Sync Stale After Seconds"},"sync_stale":{"type":"boolean","title":"Sync Stale"},"pending_push_count":{"type":"integer","title":"Pending Push Count"},"oldest_pending_push_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Oldest Pending Push At"},"oldest_pending_push_age_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Oldest Pending Push Age Seconds"},"outbox_stale_after_seconds":{"type":"integer","title":"Outbox Stale After Seconds"},"outbox_stale":{"type":"boolean","title":"Outbox Stale"},"board_io_owner":{"type":"string","title":"Board Io Owner","default":"poller"}},"type":"object","required":["project_slug","status","last_successful_sync_at","sync_freshness_age_seconds","sync_stale_after_seconds","sync_stale","pending_push_count","oldest_pending_push_at","oldest_pending_push_age_seconds","outbox_stale_after_seconds","outbox_stale"],"title":"ProviderSyncHealthResponse","description":"DB-derived freshness and complete outbox health for one project."},"QuietHoursModel":{"properties":{"start":{"type":"string","title":"Start"},"end":{"type":"string","title":"End"},"tz":{"type":"string","title":"Tz"}},"type":"object","required":["start","end","tz"],"title":"QuietHoursModel","description":"A stored quiet-hours window: two ``HH:MM[:SS]`` strings and an IANA zone.\n\nAll three parts or none — INI-2965-004's reader reports a half-open window\n(or one with no zone) as \"no quiet hours\", because it cannot be compared\nagainst any clock, so accepting one here would silently discard it."},"RecoverRequest":{"properties":{"effective_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective From"},"review_reason":{"type":"string","title":"Review Reason"},"acknowledged_warnings":{"items":{"type":"string","enum":["unpriced_identity","no_effective_window","rate_change_over_25_percent","zero_nonzero_transition"]},"type":"array","maxItems":4,"title":"Acknowledged Warnings"},"models":{"items":{"type":"string"},"type":"array","maxItems":500,"minItems":1,"title":"Models"}},"additionalProperties":false,"type":"object","required":["review_reason","models"],"title":"RecoverRequest","description":"Restore the selected models' prior rates from a publication."},"RecoveryRecordItem":{"properties":{"session_id":{"type":"integer","title":"Session Id"},"session_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Type"},"task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"},"action_taken":{"type":"string","title":"Action Taken"},"outcome":{"type":"string","title":"Outcome"},"confidence":{"type":"string","title":"Confidence"},"error_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Category"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["session_id","action_taken","outcome","confidence"],"title":"RecoveryRecordItem","description":"One ``recovery_records`` row joined to its session and task."},"RecoveryRecordsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RecoveryRecordItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"RecoveryRecordsResponse","description":"One newest-first page of a project's recovery records."},"RegisterProjectRequest":{"properties":{"slug":{"type":"string","minLength":1,"title":"Slug"},"repo_slug":{"type":"string","minLength":1,"title":"Repo Slug"},"org_id":{"type":"string","title":"Org Id"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"target_repo_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Repo Path"},"repo":{"anyOf":[{"$ref":"#/components/schemas/DesktopSeedRepo"},{"type":"null"}]},"pm_config":{"$ref":"#/components/schemas/DesktopSeedPmConfig"},"git":{"$ref":"#/components/schemas/DesktopSeedGit"},"build_commands":{"items":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"}]},"type":"array","title":"Build Commands"},"plan_path_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Path Prefix"},"domains":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Domains"},"validation_prepare_commands":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"}]},"type":"array"},{"type":"null"}],"title":"Validation Prepare Commands"},"context_file_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context File Path"},"max_concurrent_tasks":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Concurrent Tasks"},"environment":{"anyOf":[{"$ref":"#/components/schemas/EnvironmentModel"},{"type":"null"}]},"release":{"anyOf":[{"$ref":"#/components/schemas/DesktopSeedRelease"},{"type":"null"}]}},"type":"object","required":["slug","repo_slug","org_id"],"title":"RegisterProjectRequest","description":"Body for ``POST /projects/register`` — org-anchored project registration.\n\nThe seed sub-fields reuse the same secret-free shapes as\n``PUT /desktop-config`` so a registered project's seed matches what the\ndesktop later pulls. ``target_repo_path`` is machine-specific and is NOT\nstored authoritatively in the shared DB (the seed deliberately omits it)."},"RegisterProjectResponse":{"properties":{"project_id":{"type":"integer","title":"Project Id"},"slug":{"type":"string","title":"Slug"},"org_id":{"type":"string","title":"Org Id"},"created":{"type":"boolean","title":"Created"},"restart_needed":{"type":"boolean","title":"Restart Needed","default":true}},"type":"object","required":["project_id","slug","org_id","created"],"title":"RegisterProjectResponse"},"RejectRequest":{"properties":{"expected_proposal_hash":{"type":"string","title":"Expected Proposal Hash"},"review_reason":{"type":"string","title":"Review Reason"}},"additionalProperties":false,"type":"object","required":["expected_proposal_hash","review_reason"],"title":"RejectRequest"},"RepairActionReceipt":{"properties":{"repair_id":{"type":"integer","title":"Repair Id"},"request_id":{"type":"string","title":"Request Id"},"revision":{"type":"integer","title":"Revision"},"outcome":{"type":"string","enum":["applied","requested"],"title":"Outcome"},"verification_pending":{"type":"boolean","title":"Verification Pending"}},"additionalProperties":false,"type":"object","required":["repair_id","request_id","revision","outcome","verification_pending"],"title":"RepairActionReceipt","description":"What an accepted request did; never a claim of recovery.\n\n``verification_pending`` is true for every accepted request because a\nresolved repair refuses actions: recovery is only ever confirmed by a\nverifier ticket, not by an operator request."},"RepairActionRequest":{"properties":{"action":{"type":"string","enum":["stop","retry","link","resolve"],"title":"Action"},"request_id":{"type":"string","maxLength":36,"minLength":36,"title":"Request Id"},"expected_revision":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Expected Revision"},"reason":{"type":"string","maxLength":2000,"minLength":1,"title":"Reason"},"repair_task_db_id":{"anyOf":[{"type":"integer","maximum":9.223372036854776e+18,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Repair Task Db Id"}},"additionalProperties":false,"type":"object","required":["action","request_id","expected_revision","reason"],"title":"RepairActionRequest","description":"An idempotent operator request against one repair workflow."},"RepairAttempt":{"properties":{"attempt_id":{"type":"integer","title":"Attempt Id"},"retry_generation":{"type":"integer","title":"Retry Generation"},"stage":{"type":"string","title":"Stage"},"ordinal":{"type":"integer","title":"Ordinal"},"state":{"type":"string","title":"State"},"session_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Session Id"},"cost_usd_microdollars":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cost Usd Microdollars"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"additionalProperties":false,"type":"object","required":["attempt_id","retry_generation","stage","ordinal","state","session_id","cost_usd_microdollars","created_at","updated_at"],"title":"RepairAttempt"},"RepairBudget":{"properties":{"state":{"type":"string","enum":["available","exhausted","not_configured","unknown"],"title":"State"},"spent_usd_microdollars":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Spent Usd Microdollars"},"limit_usd_microdollars":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit Usd Microdollars"},"attempt_count":{"type":"integer","title":"Attempt Count"},"active_attempt_count":{"type":"integer","title":"Active Attempt Count"},"session_count":{"type":"integer","title":"Session Count"},"max_sessions":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Sessions"},"verification_count":{"type":"integer","title":"Verification Count"},"max_verifications":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Verifications"},"retry_generation":{"type":"integer","title":"Retry Generation"},"max_repair_rounds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Repair Rounds"}},"additionalProperties":false,"type":"object","required":["state","spent_usd_microdollars","limit_usd_microdollars","attempt_count","active_attempt_count","session_count","max_sessions","verification_count","max_verifications","retry_generation","max_repair_rounds"],"title":"RepairBudget","description":"Consumption against the effective limits; amounts hidden below member."},"RepairCause":{"properties":{"observation_id":{"type":"integer","title":"Observation Id"},"task_db_id":{"type":"integer","title":"Task Db Id"},"source_incident_id":{"type":"integer","title":"Source Incident Id"},"notification_generation":{"type":"integer","title":"Notification Generation"},"observed_count":{"type":"integer","title":"Observed Count"},"recorded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Recorded At"},"has_validation_contract":{"type":"boolean","title":"Has Validation Contract"},"source":{"anyOf":[{"$ref":"#/components/schemas/RepairCauseSource"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["observation_id","task_db_id","source_incident_id","notification_generation","observed_count","recorded_at","has_validation_contract","source"],"title":"RepairCause"},"RepairCauseSource":{"properties":{"pr_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pr Number"},"base_sha":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Sha"},"source_head":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Head"},"candidate_head":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Candidate Head"},"failed_phase":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failed Phase"},"failed_command":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failed Command"},"exit_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exit Code"},"detected_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detected At"},"last_observed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Observed At"},"evidence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evidence"}},"additionalProperties":false,"type":"object","required":["pr_number","base_sha","source_head","candidate_head","failed_phase","failed_command","exit_code","detected_at","last_observed_at","evidence"],"title":"RepairCauseSource"},"RepairDetail":{"properties":{"repair_id":{"type":"integer","title":"Repair Id"},"project_id":{"type":"integer","title":"Project Id"},"project_slug":{"type":"string","title":"Project Slug"},"incident_key":{"type":"string","title":"Incident Key"},"stage":{"$ref":"#/components/schemas/RepairStage"},"revision":{"type":"integer","title":"Revision"},"observation_revision":{"type":"integer","title":"Observation Revision"},"retry_generation":{"type":"integer","title":"Retry Generation"},"automation_stopped":{"type":"boolean","title":"Automation Stopped"},"repair_pr_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Repair Pr Number"},"validation_complete":{"type":"boolean","title":"Validation Complete"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"},"cost_visible":{"type":"boolean","title":"Cost Visible"},"cause":{"anyOf":[{"$ref":"#/components/schemas/RepairCause"},{"type":"null"}]},"affected_tasks":{"items":{"$ref":"#/components/schemas/AffectedTask"},"type":"array","title":"Affected Tasks"},"holds":{"items":{"$ref":"#/components/schemas/RepairHold"},"type":"array","title":"Holds"},"repair_tasks":{"items":{"$ref":"#/components/schemas/RepairTaskLink"},"type":"array","title":"Repair Tasks"},"policy":{"$ref":"#/components/schemas/EffectivePolicy"},"waiting_reasons":{"items":{"type":"string"},"type":"array","title":"Waiting Reasons"},"budget":{"$ref":"#/components/schemas/RepairBudget"},"attempts":{"items":{"$ref":"#/components/schemas/RepairAttempt"},"type":"array","title":"Attempts"},"last_verification":{"anyOf":[{"$ref":"#/components/schemas/RepairVerification"},{"type":"null"}]},"events":{"items":{"$ref":"#/components/schemas/RepairEvent"},"type":"array","title":"Events"},"event_total":{"type":"integer","title":"Event Total"}},"additionalProperties":false,"type":"object","required":["repair_id","project_id","project_slug","incident_key","stage","revision","observation_revision","retry_generation","automation_stopped","repair_pr_number","validation_complete","reason","created_at","updated_at","resolved_at","cost_visible","cause","affected_tasks","holds","repair_tasks","policy","waiting_reasons","budget","attempts","last_verification","events","event_total"],"title":"RepairDetail","description":"Exact numeric identities, with public labels as separate strings."},"RepairEvent":{"properties":{"event_id":{"type":"integer","title":"Event Id"},"kind":{"type":"string","title":"Kind"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"additionalProperties":false,"type":"object","required":["event_id","kind","request_id","payload","created_at"],"title":"RepairEvent"},"RepairHold":{"properties":{"task_db_id":{"type":"integer","title":"Task Db Id"},"task_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Label"},"acquired_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Acquired At"},"released_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Released At"}},"additionalProperties":false,"type":"object","required":["task_db_id","task_label","acquired_at","released_at"],"title":"RepairHold"},"RepairPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RepairSummary"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"total":{"type":"integer","title":"Total"}},"additionalProperties":false,"type":"object","required":["items","next_cursor","total"],"title":"RepairPage"},"RepairPolicy":{"properties":{"coordination_enabled":{"type":"boolean","title":"Coordination Enabled","default":false},"automation_enabled":{"type":"boolean","title":"Automation Enabled","default":false},"stage_permissions":{"$ref":"#/components/schemas/StagePermissions","default":{"admission":false,"enrichment":false,"development":false,"review":false,"integration":false}},"max_repair_rounds":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Max Repair Rounds","default":2},"max_sessions":{"type":"integer","maximum":20.0,"minimum":1.0,"title":"Max Sessions","default":8},"max_verifications":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Max Verifications","default":3},"spend_limit_usd_microdollars":{"anyOf":[{"type":"integer","maximum":9.223372036854776e+18,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Spend Limit Usd Microdollars"},"max_concurrent_repairs":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Max Concurrent Repairs","default":1}},"additionalProperties":false,"type":"object","title":"RepairPolicy","description":"One organization root or project override, in canonical form."},"RepairPolicyView":{"properties":{"coordination_enabled":{"type":"boolean","title":"Coordination Enabled"},"automation_enabled":{"type":"boolean","title":"Automation Enabled"},"stage_permissions":{"$ref":"#/components/schemas/StagePermissions"},"max_repair_rounds":{"type":"integer","title":"Max Repair Rounds"},"max_sessions":{"type":"integer","title":"Max Sessions"},"max_verifications":{"type":"integer","title":"Max Verifications"},"spend_limit_usd_microdollars":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Spend Limit Usd Microdollars"},"max_concurrent_repairs":{"type":"integer","title":"Max Concurrent Repairs"}},"additionalProperties":false,"type":"object","required":["coordination_enabled","automation_enabled","stage_permissions","max_repair_rounds","max_sessions","max_verifications","spend_limit_usd_microdollars","max_concurrent_repairs"],"title":"RepairPolicyView","description":"Stored canonical values; the spend limit is hidden below member."},"RepairReadinessView":{"properties":{"state":{"type":"string","enum":["ready","not_ready","not_evaluated"],"title":"State"},"protocol":{"type":"integer","title":"Protocol"},"reasons":{"items":{"type":"string"},"type":"array","title":"Reasons"},"changed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Changed At"}},"additionalProperties":false,"type":"object","required":["state","protocol","reasons","changed_at"],"title":"RepairReadinessView","description":"Runtime readiness; reasons say what coordination is missing.\n\n``state``, ``protocol`` and ``reasons`` are the live evaluation, or the\nlatest persisted one when the live read is unreadable. ``changed_at`` is\nwhen a runtime last persisted a changed evaluation (``None`` before any)."},"RepairStage":{"type":"string","enum":["observed","provisioning","waiting_policy","enriching","waiting_approval","developing","reviewing","verifying","needs_human","resolved"],"title":"RepairStage"},"RepairSummary":{"properties":{"repair_id":{"type":"integer","title":"Repair Id"},"incident_key":{"type":"string","title":"Incident Key"},"stage":{"$ref":"#/components/schemas/RepairStage"},"revision":{"type":"integer","title":"Revision"},"observation_revision":{"type":"integer","title":"Observation Revision"},"automation_stopped":{"type":"boolean","title":"Automation Stopped"},"retry_generation":{"type":"integer","title":"Retry Generation"},"repair_pr_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Repair Pr Number"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"active_hold_count":{"type":"integer","title":"Active Hold Count"},"affected_task_count":{"type":"integer","title":"Affected Task Count"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"}},"additionalProperties":false,"type":"object","required":["repair_id","incident_key","stage","revision","observation_revision","automation_stopped","retry_generation","repair_pr_number","reason","active_hold_count","affected_task_count","created_at","updated_at","resolved_at"],"title":"RepairSummary"},"RepairTaskLink":{"properties":{"task_db_id":{"type":"integer","title":"Task Db Id"},"task_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Label"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"linked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Linked At"}},"additionalProperties":false,"type":"object","required":["task_db_id","task_label","status","linked_at"],"title":"RepairTaskLink"},"RepairVerification":{"properties":{"ticket_id":{"type":"integer","title":"Ticket Id"},"revision":{"type":"integer","title":"Revision"},"observation_revision":{"type":"integer","title":"Observation Revision"},"successful":{"type":"boolean","title":"Successful"},"recorded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Recorded At"}},"additionalProperties":false,"type":"object","required":["ticket_id","revision","observation_revision","successful","recorded_at"],"title":"RepairVerification"},"ReplacePreferencesRequest":{"properties":{"preferences":{"items":{"$ref":"#/components/schemas/PreferenceEntry"},"type":"array","title":"Preferences"}},"type":"object","required":["preferences"],"title":"ReplacePreferencesRequest"},"ReplanApplyRequest":{"properties":{"schema_version":{"type":"integer","const":1,"title":"Schema Version"},"request_id":{"type":"string","format":"uuid","title":"Request Id"},"proposal":{"$ref":"#/components/schemas/ReplanProposal"},"acknowledged_started_tasks":{"items":{"type":"string"},"type":"array","maxItems":500,"title":"Acknowledged Started Tasks"}},"additionalProperties":false,"type":"object","required":["schema_version","request_id","proposal"],"title":"ReplanApplyRequest"},"ReplanProposal":{"properties":{"schema_version":{"type":"integer","const":1,"title":"Schema Version"},"initiative_id":{"type":"integer","minimum":1.0,"title":"Initiative Id"},"expected_snapshot":{"type":"string","pattern":"^[a-f0-9]{64}$","title":"Expected Snapshot"},"initiative":{"anyOf":[{"$ref":"#/components/schemas/InitiativeProposal"},{"type":"null"}]},"tasks":{"items":{"$ref":"#/components/schemas/TaskProposal"},"type":"array","maxItems":500,"title":"Tasks"}},"additionalProperties":false,"type":"object","required":["schema_version","initiative_id","expected_snapshot"],"title":"ReplanProposal"},"RetroWithInitiative":{"properties":{"id":{"type":"integer","title":"Id"},"project_id":{"type":"integer","title":"Project Id"},"initiative_id":{"type":"integer","title":"Initiative Id"},"created_at":{"type":"string","title":"Created At"},"issue_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Issue Number"},"initiative_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Initiative Status"}},"type":"object","required":["id","project_id","initiative_id","created_at"],"title":"RetroWithInitiative","description":"Retro sync log entry enriched with initiative metadata."},"ReviseRequest":{"properties":{"expected_proposal_hash":{"type":"string","title":"Expected Proposal Hash"},"candidate_rows":{"items":{"$ref":"#/components/schemas/PricingCandidate"},"type":"array","maxItems":500,"minItems":1,"title":"Candidate Rows"},"evidence_urls":{"items":{"type":"string"},"type":"array","maxItems":4,"minItems":1,"title":"Evidence Urls"},"review_reason":{"type":"string","title":"Review Reason"}},"additionalProperties":false,"type":"object","required":["expected_proposal_hash","candidate_rows","evidence_urls","review_reason"],"title":"ReviseRequest","description":"Replace a pending proposal with reviewed exact rows."},"RuntimePolicy":{"properties":{"schema_version":{"type":"integer","maximum":1.0,"minimum":1.0,"title":"Schema Version","default":1},"enabled":{"type":"boolean","title":"Enabled"},"cli_versions":{"items":{"$ref":"#/components/schemas/VersionRange"},"type":"array","maxItems":64,"title":"Cli Versions","default":[]},"sdk_versions":{"items":{"$ref":"#/components/schemas/VersionRange"},"type":"array","maxItems":64,"title":"Sdk Versions","default":[]},"max_concurrent":{"type":"integer","maximum":16.0,"minimum":1.0,"title":"Max Concurrent","default":3},"reason":{"type":"string","maxLength":2000,"title":"Reason","default":""},"evidence":{"items":{"type":"string","maxLength":2000,"minLength":1},"type":"array","maxItems":32,"title":"Evidence","default":[]}},"additionalProperties":false,"type":"object","required":["enabled"],"title":"RuntimePolicy","description":"Small, versioned policy document maintained by platform administrators."},"RuntimePolicyUpdate":{"properties":{"expected_revision":{"type":"integer","minimum":0.0,"title":"Expected Revision"},"policy":{"$ref":"#/components/schemas/RuntimePolicy"}},"additionalProperties":false,"type":"object","required":["expected_revision","policy"],"title":"RuntimePolicyUpdate","description":"Revision-bound platform update, never a machine-local opt-in."},"SessionSubagentEventListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SessionSubagentEventResponse"},"type":"array","title":"Items"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["items","count"],"title":"SessionSubagentEventListResponse"},"SessionSubagentEventResponse":{"properties":{"event_id":{"type":"string","title":"Event Id"},"subagent_id":{"type":"string","title":"Subagent Id"},"generation":{"type":"integer","title":"Generation"},"sequence":{"type":"integer","title":"Sequence"},"event_type":{"type":"string","enum":["started","resumed","progress","completed","failed","cancelled","interrupted"],"title":"Event Type"},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"ingested_at":{"type":"string","format":"date-time","title":"Ingested At"}},"type":"object","required":["event_id","subagent_id","generation","sequence","event_type","occurred_at","payload","ingested_at"],"title":"SessionSubagentEventResponse"},"SessionSubagentListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SessionSubagentResponse"},"type":"array","title":"Items"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["items","count"],"title":"SessionSubagentListResponse"},"SessionSubagentResponse":{"properties":{"id":{"type":"string","title":"Id"},"session_id":{"type":"integer","title":"Session Id"},"project_id":{"type":"integer","title":"Project Id"},"invocation_key":{"type":"string","title":"Invocation Key"},"native_child_id":{"type":"string","title":"Native Child Id"},"generation":{"type":"integer","title":"Generation"},"last_sequence":{"type":"integer","title":"Last Sequence"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"route_tier":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Route Tier"},"assignment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"default_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Model"},"default_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Effort"},"selection_mode":{"type":"string","enum":["manual","auto"],"title":"Selection Mode"},"requested_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested Model"},"requested_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested Effort"},"requested_model_provided":{"type":"boolean","title":"Requested Model Provided","default":false},"requested_effort_provided":{"type":"boolean","title":"Requested Effort Provided","default":false},"actual_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actual Model"},"actual_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actual Effort"},"effective_permissions":{"type":"string","const":"read_only","title":"Effective Permissions"},"state":{"type":"string","enum":["running","completed","failed","cancelled","interrupted"],"title":"State"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"last_progress_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Progress At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"result":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Result"},"failure_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Category"},"failure_details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Failure Details"},"log_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Log Ref"},"usage":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Usage"},"usage_scope":{"anyOf":[{"type":"string","enum":["inclusive","exclusive","unknown"]},{"type":"null"}],"title":"Usage Scope"},"usage_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Source"},"parent_closed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Parent Closed At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","session_id","project_id","invocation_key","native_child_id","generation","last_sequence","selection_mode","effective_permissions","state","created_at","updated_at"],"title":"SessionSubagentResponse","description":"Durable lifecycle snapshot for one provider-native child."},"SessionWithProject":{"properties":{"id":{"type":"integer","title":"Id"},"project_id":{"type":"integer","title":"Project Id"},"initiative_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Initiative Id"},"task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"},"session_type":{"type":"string","title":"Session Type"},"tmux_pane_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tmux Pane Id"},"log_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Log Path"},"exit_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exit Code"},"iteration_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Iteration Count"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"requested_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested Model"},"resolved_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Model"},"input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Input Tokens"},"output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Output Tokens"},"cost_usd_microdollars":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cost Usd Microdollars"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"cache_creation_input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cache Creation Input Tokens"},"cache_read_input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cache Read Input Tokens"},"num_turns":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Num Turns"},"cli_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cli Session Id"},"wall_clock_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Wall Clock Ms"},"cost_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost Source","description":"Where cost_usd_microdollars came from: cli (reported by the CLI), rate_card (a standard API-equivalent estimate), mixed (one workflow whose provider/model groups were priced from different sources that cannot be split, typically CLI-reported plus estimated), or null (source not recorded: no cost, a legacy row, or a cost whose attribution failed). A rate_card cost is a standard API-equivalent estimate: tokens priced at the provider's standard paid text API rates (the shorter-context band where pricing is conditional), published cached-input rates, and 5-minute cache-write rates where available, otherwise the provider's documented standard cache-write policy. It excludes subscription prices, discounts, batch/flex/priority/fast tiers, regional uplifts, tool calls and cache storage. A CLI-reported cost is authoritative. Neither is a subscription charge or an invoice."},"model_pricing_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Model Pricing Id","description":"The effective-dated model_pricing row used to estimate this cost, so a rate_card figure can be recomputed. A cli cost keeps it when a rate card also existed; null when no single rate card applies."},"input_tokens_uncached":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Input Tokens Uncached"},"reasoning_output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reasoning Output Tokens"},"peak_context_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Peak Context Tokens"},"usage_capture_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Capture State"},"usage_capture_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Capture Detail"},"failure_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Detail"},"error_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Category"},"correlation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"},"gh_account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gh Account"},"retried_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Retried At"},"poller_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Poller Id"},"agent_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Role"},"reasoning_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning Effort"},"operator_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operator User Id"},"operator_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operator Label"},"requested_by_login":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested By Login"},"requested_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested By User Id"},"requester_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requester Label"},"poller_hostname":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Poller Hostname"},"derived_status":{"type":"string","title":"Derived Status","default":"running"},"project_slug":{"type":"string","title":"Project Slug","default":""}},"type":"object","required":["id","project_id","session_type","created_at"],"title":"SessionWithProject","description":"Session with project slug for cross-project listing."},"SessionWithStatus":{"properties":{"id":{"type":"integer","title":"Id"},"project_id":{"type":"integer","title":"Project Id"},"initiative_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Initiative Id"},"task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"},"session_type":{"type":"string","title":"Session Type"},"tmux_pane_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tmux Pane Id"},"log_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Log Path"},"exit_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exit Code"},"iteration_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Iteration Count"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"requested_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested Model"},"resolved_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Model"},"input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Input Tokens"},"output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Output Tokens"},"cost_usd_microdollars":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cost Usd Microdollars"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"cache_creation_input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cache Creation Input Tokens"},"cache_read_input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cache Read Input Tokens"},"num_turns":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Num Turns"},"cli_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cli Session Id"},"wall_clock_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Wall Clock Ms"},"cost_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost Source","description":"Where cost_usd_microdollars came from: cli (reported by the CLI), rate_card (a standard API-equivalent estimate), mixed (one workflow whose provider/model groups were priced from different sources that cannot be split, typically CLI-reported plus estimated), or null (source not recorded: no cost, a legacy row, or a cost whose attribution failed). A rate_card cost is a standard API-equivalent estimate: tokens priced at the provider's standard paid text API rates (the shorter-context band where pricing is conditional), published cached-input rates, and 5-minute cache-write rates where available, otherwise the provider's documented standard cache-write policy. It excludes subscription prices, discounts, batch/flex/priority/fast tiers, regional uplifts, tool calls and cache storage. A CLI-reported cost is authoritative. Neither is a subscription charge or an invoice."},"model_pricing_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Model Pricing Id","description":"The effective-dated model_pricing row used to estimate this cost, so a rate_card figure can be recomputed. A cli cost keeps it when a rate card also existed; null when no single rate card applies."},"input_tokens_uncached":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Input Tokens Uncached"},"reasoning_output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reasoning Output Tokens"},"peak_context_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Peak Context Tokens"},"usage_capture_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Capture State"},"usage_capture_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Capture Detail"},"failure_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Detail"},"error_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Category"},"correlation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"},"gh_account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gh Account"},"retried_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Retried At"},"poller_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Poller Id"},"agent_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Role"},"reasoning_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning Effort"},"operator_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operator User Id"},"operator_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operator Label"},"requested_by_login":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested By Login"},"requested_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested By User Id"},"requester_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requester Label"},"poller_hostname":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Poller Hostname"},"derived_status":{"type":"string","title":"Derived Status","default":"running"}},"type":"object","required":["id","project_id","session_type","created_at"],"title":"SessionWithStatus","description":"Session with a derived status field."},"SetJudgmentConsentRequest":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"SetJudgmentConsentRequest"},"SetWatchRequest":{"properties":{"entity_type":{"type":"string","enum":["task","initiative"],"title":"Entity Type"},"entity_db_id":{"type":"integer","maximum":9.223372036854776e+18,"minimum":1.0,"title":"Entity Db Id"},"mode":{"type":"string","title":"Mode"}},"type":"object","required":["entity_type","entity_db_id","mode"],"title":"SetWatchRequest"},"SimilarWorkItem":{"properties":{"kind":{"type":"string","enum":["initiative","task"],"title":"Kind"},"id":{"type":"integer","title":"Id"},"project_id":{"type":"integer","title":"Project Id"},"issue_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Issue Number"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"status":{"type":"string","title":"Status"},"initiative_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Initiative Id"},"task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"},"item_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Type"},"wave":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Wave"},"pr_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pr Number"},"needs_human":{"type":"boolean","title":"Needs Human"},"paused":{"type":"boolean","title":"Paused"},"status_changed_at":{"type":"string","format":"date-time","title":"Status Changed At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"match_fields":{"items":{"type":"string","enum":["title","body"]},"type":"array","title":"Match Fields"},"snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Snippet"},"exact_title_match":{"type":"boolean","title":"Exact Title Match"},"relation":{"anyOf":[{"type":"string","enum":["same","related","different"]},{"type":"null"}],"title":"Relation"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"}},"type":"object","required":["kind","id","project_id","status","needs_human","paused","status_changed_at","updated_at","match_fields","exact_title_match"],"title":"SimilarWorkItem"},"SimilarWorkItemsRequest":{"properties":{"kind":{"type":"string","enum":["bug","task","initiative"],"title":"Kind"},"title":{"type":"string","title":"Title"},"body":{"type":"string","title":"Body","default":""}},"type":"object","required":["kind","title"],"title":"SimilarWorkItemsRequest","description":"The draft about to be created; only its first characters are read."},"SimilarWorkItemsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SimilarWorkItem"},"type":"array","title":"Items"},"judged":{"type":"boolean","title":"Judged"},"unavailable":{"anyOf":[{"type":"string","enum":["not_configured","org_disabled","budget_exhausted","upstream_unavailable","breaker_open","invalid_request"]},{"type":"null"}],"title":"Unavailable"}},"type":"object","required":["items","judged"],"title":"SimilarWorkItemsResponse"},"SnoozeRequest":{"properties":{"until":{"type":"string","format":"date-time","title":"Until"}},"type":"object","required":["until"],"title":"SnoozeRequest"},"StagePermissions":{"properties":{"admission":{"type":"boolean","title":"Admission","default":false},"enrichment":{"type":"boolean","title":"Enrichment","default":false},"development":{"type":"boolean","title":"Development","default":false},"review":{"type":"boolean","title":"Review","default":false},"integration":{"type":"boolean","title":"Integration","default":false}},"additionalProperties":false,"type":"object","title":"StagePermissions","description":"Which coordinator stages may run without a person; all default off."},"StatusMappingCreate":{"properties":{"external_status":{"type":"string","title":"External Status"},"internal_status":{"type":"string","title":"Internal Status"}},"type":"object","required":["external_status","internal_status"],"title":"StatusMappingCreate"},"StatusMappingResponse":{"properties":{"id":{"type":"integer","title":"Id"},"external_status":{"type":"string","title":"External Status"},"internal_status":{"type":"string","title":"Internal Status"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","external_status","internal_status"],"title":"StatusMappingResponse"},"StatusOptionResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"StatusOptionResponse"},"StorageHealthResponse":{"properties":{"configured":{"type":"boolean","title":"Configured"},"bucket_present":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Bucket Present"},"bucket_public":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Bucket Public"},"detail":{"type":"string","title":"Detail"},"fix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fix"}},"type":"object","required":["configured","bucket_present","bucket_public","detail"],"title":"StorageHealthResponse","description":"Operator-facing attachment-storage readiness verdict (admin only).\n\n``bucket_present`` / ``bucket_public`` are tri-state: ``None`` means the\nprobe could not tell (credentials unset, or the probe call itself failed)\n— never conflate that with a confirmed ``False``, which is the actionable\n\"run the provisioning migration\" case. ``detail`` is the same sentence an\nend user would see; ``fix`` is the operator remediation and is omitted\nwhen there is nothing to fix. The provider's own response body is NEVER\nechoed here."},"StoredPolicyView":{"properties":{"state":{"type":"string","enum":["configured","absent","malformed","unreadable"],"title":"State"},"revision":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Revision"},"policy":{"anyOf":[{"$ref":"#/components/schemas/RepairPolicyView"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"additionalProperties":false,"type":"object","required":["state","revision","policy","updated_at"],"title":"StoredPolicyView","description":"One policy row; ``policy`` is null unless ``state`` is configured."},"SubagentEventModel":{"properties":{"event_id":{"type":"string","title":"Event Id"},"invocation_key":{"type":"string","title":"Invocation Key"},"native_child_id":{"type":"string","title":"Native Child Id"},"generation":{"type":"integer","title":"Generation"},"sequence":{"type":"integer","title":"Sequence"},"event_type":{"type":"string","title":"Event Type"},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"route_tier":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Route Tier"},"assignment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"default_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Model"},"default_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Effort"},"selection_mode":{"type":"string","title":"Selection Mode","default":"manual"},"requested_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested Model"},"requested_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested Effort"},"requested_model_provided":{"type":"boolean","title":"Requested Model Provided","default":false},"requested_effort_provided":{"type":"boolean","title":"Requested Effort Provided","default":false},"actual_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actual Model"},"actual_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actual Effort"},"result":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Result"},"failure_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Category"},"failure_details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Failure Details"},"log_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Log Ref"},"usage":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Usage"},"usage_scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Scope"},"usage_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Source"}},"additionalProperties":false,"type":"object","required":["event_id","invocation_key","native_child_id","generation","sequence","event_type","occurred_at","payload"],"title":"SubagentEventModel","description":"Normalized child event; fields mirror ChildEventWrite."},"SubagentIngestRequest":{"properties":{"remaining_seconds":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Remaining Seconds"},"session_id":{"type":"integer","title":"Session Id"},"events":{"items":{"$ref":"#/components/schemas/SubagentEventModel"},"type":"array","maxItems":100,"minItems":1,"title":"Events"}},"type":"object","required":["session_id","events"],"title":"SubagentIngestRequest"},"SubagentIngestResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/SubagentIngestResult"},"type":"array","title":"Results"},"conflict":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conflict"},"invalid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invalid"},"error":{"anyOf":[{"$ref":"#/components/schemas/WireError"},{"type":"null"}]}},"type":"object","title":"SubagentIngestResponse"},"SubagentIngestResult":{"properties":{"child_id":{"type":"string","title":"Child Id"},"inserted_event":{"type":"boolean","title":"Inserted Event"},"state_changed":{"type":"boolean","title":"State Changed"},"lifecycle_applied":{"type":"boolean","title":"Lifecycle Applied"},"parent_authoritative":{"type":"boolean","title":"Parent Authoritative"}},"type":"object","required":["child_id","inserted_event","state_changed","lifecycle_applied","parent_authoritative"],"title":"SubagentIngestResult"},"TaskDetailResponse":{"properties":{"id":{"type":"integer","title":"Id"},"project_id":{"type":"integer","title":"Project Id"},"initiative_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Initiative Id"},"plan_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Plan Id"},"task_id":{"type":"string","title":"Task Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"item_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Type"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Labels"},"gh_item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gh Item Id"},"issue_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Issue Number"},"resolution":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution"},"status":{"type":"string","title":"Status"},"branch_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Name"},"wave":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Wave"},"effort":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Effort"},"pr_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pr Number"},"assigned_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned Agent"},"depends_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Depends On"},"needs_human":{"type":"boolean","title":"Needs Human","default":false},"needs_human_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Needs Human Reason"},"needs_human_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Needs Human At"},"paused":{"type":"boolean","title":"Paused","default":false},"paused_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paused At"},"paused_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paused By"},"effective_paused":{"type":"boolean","title":"Effective Paused","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"project_slug":{"type":"string","title":"Project Slug","default":""},"repo_slug":{"type":"string","title":"Repo Slug","default":""},"dependencies":{"items":{"$ref":"#/components/schemas/DependencyInfo"},"type":"array","title":"Dependencies"},"recent_sessions":{"items":{"$ref":"#/components/schemas/SessionWithStatus"},"type":"array","title":"Recent Sessions"},"feedback_count":{"type":"integer","title":"Feedback Count","default":0},"comment_summary":{"$ref":"#/components/schemas/CommentSummary"},"baseline_repairs":{"anyOf":[{"items":{"$ref":"#/components/schemas/BaselineRepairSummary"},"type":"array"},{"type":"null"}],"title":"Baseline Repairs"},"baseline_repairs_total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Baseline Repairs Total"}},"type":"object","required":["id","project_id","task_id","status","created_at","updated_at"],"title":"TaskDetailResponse","description":"Enriched task detail with dependencies, sessions, feedback, and comments."},"TaskProposal":{"properties":{"task_id":{"type":"string","maxLength":100,"minLength":1,"title":"Task Id"},"title":{"type":"string","maxLength":256,"minLength":1,"title":"Title"},"body":{"type":"string","maxLength":60000,"minLength":1,"title":"Body"},"plan_id":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Plan Id"},"wave":{"type":"integer","minimum":1.0,"title":"Wave"},"effort":{"type":"integer","enum":[1,2,3,5,8],"title":"Effort"},"dependencies":{"items":{"type":"string"},"type":"array","maxItems":500,"title":"Dependencies"},"affected_files":{"items":{"type":"string"},"type":"array","maxItems":500,"minItems":1,"title":"Affected Files"}},"additionalProperties":false,"type":"object","required":["task_id","title","body","plan_id","wave","effort","dependencies","affected_files"],"title":"TaskProposal","description":"Complete proposed content/scheduling fields; identity is immutable."},"TaskResponse":{"properties":{"id":{"type":"integer","title":"Id"},"project_id":{"type":"integer","title":"Project Id"},"initiative_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Initiative Id"},"plan_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Plan Id"},"task_id":{"type":"string","title":"Task Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"item_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Type"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Labels"},"gh_item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gh Item Id"},"issue_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Issue Number"},"resolution":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution"},"status":{"type":"string","title":"Status"},"branch_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Name"},"wave":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Wave"},"effort":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Effort"},"pr_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pr Number"},"assigned_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned Agent"},"depends_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Depends On"},"needs_human":{"type":"boolean","title":"Needs Human","default":false},"needs_human_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Needs Human Reason"},"needs_human_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Needs Human At"},"paused":{"type":"boolean","title":"Paused","default":false},"paused_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paused At"},"paused_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paused By"},"effective_paused":{"type":"boolean","title":"Effective Paused","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","project_id","task_id","status","created_at","updated_at"],"title":"TaskResponse"},"ToolModel":{"properties":{"name":{"type":"string","title":"Name"},"min_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Min Version"}},"type":"object","required":["name"],"title":"ToolModel"},"TransitionApprovalProgress":{"properties":{"effective_capability":{"type":"string","title":"Effective Capability"},"required_approvals":{"type":"integer","title":"Required Approvals"},"current_approvals":{"type":"integer","title":"Current Approvals"},"forbid_self_approval":{"type":"boolean","title":"Forbid Self Approval"},"caller_is_requester":{"type":"boolean","title":"Caller Is Requester"},"caller_has_approved":{"type":"boolean","title":"Caller Has Approved"},"canonical_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Reason"},"pending":{"type":"boolean","title":"Pending"},"policy_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policy Version"},"can_approve":{"type":"boolean","title":"Can Approve"}},"type":"object","required":["effective_capability","required_approvals","current_approvals","forbid_self_approval","caller_is_requester","caller_has_approved","canonical_reason","pending","policy_version","can_approve"],"title":"TransitionApprovalProgress","description":"Caller-scoped approval-gate progress nested on a board transition option.\n\nA public projection of ``core.repositories.approvals.ApprovalProgress``\noverlaid with the gate's effective ``ApprovalPolicyCatalogEntry`` settings\n(INI-1784-002/003/009) — never the raw requester identity or\n``status_transition_revision`` those repositories key gates by; only\npre-derived, caller-facing state."},"TransitionHistoryRow":{"properties":{"id":{"type":"integer","title":"Id"},"work_item_kind":{"type":"string","title":"Work Item Kind"},"work_item_db_id":{"type":"integer","title":"Work Item Db Id"},"from_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Status"},"to_status":{"type":"string","title":"To Status"},"actor_type":{"type":"string","title":"Actor Type"},"actor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Id"},"source":{"type":"string","title":"Source"},"result":{"type":"string","title":"Result"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","work_item_kind","work_item_db_id","from_status","to_status","actor_type","actor_id","source","result","reason","created_at"],"title":"TransitionHistoryRow","description":"One ``work_item_transitions`` row. ``created_at`` is normalized to UTC-aware\nso the browser parses it correctly."},"TransitionRequest":{"properties":{"slug":{"type":"string","title":"Slug"},"work_item_kind":{"type":"string","enum":["initiative","plan","task"],"title":"Work Item Kind"},"work_item_db_id":{"type":"integer","title":"Work Item Db Id"},"target_status":{"type":"string","title":"Target Status"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"action":{"type":"string","enum":["transition","approve"],"title":"Action","default":"transition"}},"type":"object","required":["slug","work_item_kind","work_item_db_id","target_status"],"title":"TransitionRequest"},"UnassignedClearNeedsHumanAction":{"properties":{"action_type":{"type":"string","const":"clear_needs_human","title":"Action Type"},"gate_family":{"type":"string","const":"operations","title":"Gate Family"},"target_status":{"type":"null","title":"Target Status"}},"type":"object","required":["action_type","gate_family","target_status"],"title":"UnassignedClearNeedsHumanAction"},"UnassignedHumanGateItem":{"properties":{"work_item_kind":{"type":"string","enum":["initiative","task"],"title":"Work Item Kind"},"entity_type":{"type":"string","enum":["initiative","task","bug"],"title":"Entity Type"},"work_item_db_id":{"type":"integer","title":"Work Item Db Id"},"project_id":{"type":"integer","title":"Project Id"},"project_slug":{"type":"string","title":"Project Slug"},"issue_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Issue Number"},"task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"status":{"type":"string","title":"Status"},"needs_human":{"type":"boolean","title":"Needs Human"},"needs_human_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Needs Human Reason"},"unassigned_actions":{"items":{"oneOf":[{"$ref":"#/components/schemas/UnassignedTransitionAction"},{"$ref":"#/components/schemas/UnassignedClearNeedsHumanAction"}],"discriminator":{"propertyName":"action_type","mapping":{"clear_needs_human":"#/components/schemas/UnassignedClearNeedsHumanAction","transition":"#/components/schemas/UnassignedTransitionAction"}}},"type":"array","title":"Unassigned Actions"}},"type":"object","required":["work_item_kind","entity_type","work_item_db_id","project_id","project_slug","issue_number","task_id","title","status","needs_human","needs_human_reason","unassigned_actions"],"title":"UnassignedHumanGateItem"},"UnassignedTransitionAction":{"properties":{"action_type":{"type":"string","const":"transition","title":"Action Type"},"gate_family":{"type":"string","enum":["planning","development","operations"],"title":"Gate Family"},"target_status":{"type":"string","title":"Target Status"},"required_approvals":{"type":"integer","title":"Required Approvals"},"current_approvals":{"type":"integer","title":"Current Approvals"}},"type":"object","required":["action_type","gate_family","target_status","required_approvals","current_approvals"],"title":"UnassignedTransitionAction"},"UnstickRequest":{"properties":{"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"}},"type":"object","title":"UnstickRequest","description":"Optional body of ``POST /{tasks|initiatives}/{id}/unstick``.\n\n``provider`` selects the provider-scoped backoff release selector\n(INI-2653-013), applied alongside the self-healing pipeline run: given, it\nclears exactly that ``(item, provider)`` ``provider_backoffs`` row — a\nsingle-provider release (e.g. Grok-only) that leaves sibling-provider rows\nuntouched. Omitted (the default), it clears every provider row for the\nitem — a whole-item release, which also clears the legacy item-wide\n``provider_limit_until`` column so a residual future value cannot still\nblock dispatch after the operator asked to release everything (a\nsingle-provider release deliberately leaves that whole-item column alone,\nsince it protects sibling providers this call does not intend to touch)."},"UpdateMemberRoleRequest":{"properties":{"role":{"type":"string","enum":["viewer","member","admin","owner"],"title":"Role"}},"type":"object","required":["role"],"title":"UpdateMemberRoleRequest"},"UpdateOrgRequest":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"UpdateOrgRequest"},"UpdateTemplateRequest":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"org_role":{"type":"string","enum":["viewer","member","admin","owner"],"title":"Org Role","default":"member"},"project_access":{"type":"string","enum":["all","restricted"],"title":"Project Access","default":"all"},"project_ids":{"items":{"type":"integer"},"type":"array","maxItems":500,"title":"Project Ids"},"capabilities":{"items":{"type":"string"},"type":"array","maxItems":6,"title":"Capabilities"}},"type":"object","required":["name"],"title":"UpdateTemplateRequest"},"UsageBreakdownResponse":{"properties":{"dimension":{"type":"string","title":"Dimension"},"rows":{"items":{"$ref":"#/components/schemas/UsageBreakdownRow"},"type":"array","title":"Rows"}},"type":"object","required":["dimension"],"title":"UsageBreakdownResponse","description":"Usage measures broken down by a single dimension."},"UsageBreakdownRow":{"properties":{"session_count":{"type":"integer","title":"Session Count","default":0},"cost_usd_microdollars":{"type":"integer","title":"Cost Usd Microdollars","default":0},"input_tokens":{"type":"integer","title":"Input Tokens","default":0},"output_tokens":{"type":"integer","title":"Output Tokens","default":0},"cache_creation_input_tokens":{"type":"integer","title":"Cache Creation Input Tokens","default":0},"cache_read_input_tokens":{"type":"integer","title":"Cache Read Input Tokens","default":0},"num_turns":{"type":"integer","title":"Num Turns","default":0},"iteration_count":{"type":"integer","title":"Iteration Count","default":0},"wall_clock_ms":{"type":"integer","title":"Wall Clock Ms","default":0},"input_tokens_uncached":{"type":"integer","title":"Input Tokens Uncached","default":0},"reasoning_output_tokens":{"type":"integer","title":"Reasoning Output Tokens","default":0},"sessions_missing_usage":{"type":"integer","title":"Sessions Missing Usage","default":0},"sessions_missing_cost":{"type":"integer","title":"Sessions Missing Cost","default":0},"key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"}},"type":"object","title":"UsageBreakdownRow","description":"Usage measures grouped under one dimension value.\n\n``key`` is the dimension value (``None`` ⇒ unattributed); ints\n(project/initiative/task ids) are coerced to ``str`` in the query layer.\n\n``label`` is the resolved display name for the identity-shaped dimensions\nonly, and ``None`` for every other dimension (and whenever ``key`` itself\nis ``None``). What \"unresolved\" yields differs per dimension:\n\n- ``operator_user`` / ``requester_user`` — the ``auth.users`` email, or\n  ``None`` when the uuid is unmapped (or the ``auth`` schema is absent).\n- ``host`` — the ``pollers.hostname``, falling back to the raw\n  ``poller_id`` (i.e. ``key``) when the poller row is missing or its\n  hostname is ``NULL``; **never** ``None`` for a non-``None`` ``key``. A\n  poller id defaults to the machine's hostname, so it is already the\n  friendliest label available.\n- ``gh_account`` — the login itself (``key``); it is already a label.\n\n``key`` remains the grouping value and the fallback a consumer renders when\n``label`` is ``None``."},"UsageCostSource":{"properties":{"key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key"},"session_count":{"type":"integer","title":"Session Count"},"cost_usd_microdollars":{"type":"integer","title":"Cost Usd Microdollars"}},"type":"object","required":["key","session_count","cost_usd_microdollars"],"title":"UsageCostSource"},"UsageReportAccounting":{"properties":{"source":{"type":"string","const":"usage_rollup_daily","title":"Source","default":"usage_rollup_daily"},"retrieved_at":{"type":"string","format":"date-time","title":"Retrieved At"},"rollup_updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Rollup Updated At"},"timezone":{"type":"string","const":"UTC","title":"Timezone","default":"UTC"},"session_population":{"type":"string","const":"completed","title":"Session Population","default":"completed"},"date_basis":{"type":"string","const":"session_created_at","title":"Date Basis","default":"session_created_at"},"quota_telemetry":{"type":"boolean","const":false,"title":"Quota Telemetry","default":false},"capture_state_counts_available":{"type":"boolean","const":false,"title":"Capture State Counts Available","default":false},"cost_sources":{"items":{"$ref":"#/components/schemas/UsageCostSource"},"type":"array","title":"Cost Sources"},"notes":{"items":{"type":"string"},"type":"array","title":"Notes","default":["Dates are inclusive whole UTC days for completed sessions, based on session_created_at.","cli means provider-reported cost; rate_card means a standard API-equivalent estimate; mixed means inseparable groups priced from different sources, typically CLI-reported plus estimated. Null and unknown cost sources remain unattributed. A total across sources may combine reported costs with estimates. None of these sources proves an invoiced payment.","A rate_card cost is a standard API-equivalent estimate: tokens priced at the provider's standard paid text API rates (the shorter-context band where pricing is conditional), published cached-input rates, and 5-minute cache-write rates where available, otherwise the provider's documented standard cache-write policy. It excludes subscription prices, discounts, batch/flex/priority/fast tiers, regional uplifts, tool calls and cache storage. A CLI-reported cost is authoritative. Neither is a subscription charge or an invoice.","Usage is attributed to the stored session role/provider/model. A multi-provider session is not an invocation-level breakdown. Subagent usage is not summed again.","Missing-column counters are not capture-state counts. Missing costs may include not_applicable sessions. Legacy buckets may contain default zero fidelity counters.","Historical completeness is not guaranteed. No live quota information is included.","rollup_updated_at is the maximum selected bucket update timestamp, not proof that every bucket was refreshed."]}},"type":"object","required":["retrieved_at","rollup_updated_at","cost_sources"],"title":"UsageReportAccounting"},"UsageReportBreakdown":{"properties":{"dimension":{"type":"string","title":"Dimension"},"rows":{"items":{"$ref":"#/components/schemas/UsageBreakdownRow"},"type":"array","title":"Rows"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"sort":{"type":"string","enum":["cost","sessions"],"title":"Sort"}},"type":"object","required":["dimension","rows","total","limit","offset","sort"],"title":"UsageReportBreakdown"},"UsageReportResponse":{"properties":{"schema_version":{"type":"integer","const":1,"title":"Schema Version","default":1},"view":{"type":"string","enum":["summary","timeseries","breakdown"],"title":"View"},"scope":{"$ref":"#/components/schemas/UsageReportScope"},"accounting":{"$ref":"#/components/schemas/UsageReportAccounting"},"result":{"anyOf":[{"$ref":"#/components/schemas/UsageSummaryResponse"},{"$ref":"#/components/schemas/UsageTimeseriesResponse"},{"$ref":"#/components/schemas/UsageReportBreakdown"}],"title":"Result"}},"type":"object","required":["view","scope","accounting","result"],"title":"UsageReportResponse"},"UsageReportScope":{"properties":{"org_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org Id"},"project_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Id"},"task_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Task Id"},"initiative_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Initiative Id"},"agent_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Role"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"host":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Host"},"cost_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost Source"},"after_date":{"type":"string","format":"date","title":"After Date"},"before_date":{"type":"string","format":"date","title":"Before Date"}},"type":"object","required":["org_id","after_date","before_date"],"title":"UsageReportScope"},"UsageSummaryResponse":{"properties":{"session_count":{"type":"integer","title":"Session Count","default":0},"cost_usd_microdollars":{"type":"integer","title":"Cost Usd Microdollars","default":0},"input_tokens":{"type":"integer","title":"Input Tokens","default":0},"output_tokens":{"type":"integer","title":"Output Tokens","default":0},"cache_creation_input_tokens":{"type":"integer","title":"Cache Creation Input Tokens","default":0},"cache_read_input_tokens":{"type":"integer","title":"Cache Read Input Tokens","default":0},"num_turns":{"type":"integer","title":"Num Turns","default":0},"iteration_count":{"type":"integer","title":"Iteration Count","default":0},"wall_clock_ms":{"type":"integer","title":"Wall Clock Ms","default":0},"input_tokens_uncached":{"type":"integer","title":"Input Tokens Uncached","default":0},"reasoning_output_tokens":{"type":"integer","title":"Reasoning Output Tokens","default":0},"sessions_missing_usage":{"type":"integer","title":"Sessions Missing Usage","default":0},"sessions_missing_cost":{"type":"integer","title":"Sessions Missing Cost","default":0}},"type":"object","title":"UsageSummaryResponse","description":"Aggregate usage/cost measures over a window (from ``usage_rollup_daily``).\n\nMeasures are integers: ``cost_usd_microdollars`` in microdollars, tokens as\nraw counts, ``wall_clock_ms`` in milliseconds.\n\n* ``input_tokens_uncached`` — normalized fresh input, additive across\n  providers (falls back to ``input_tokens`` for rows with no normalized\n  count); ``input_tokens`` stays the providers' verbatim figures.\n* ``reasoning_output_tokens`` — the reasoning share of output, where the\n  provider reports it.\n* ``sessions_missing_usage`` — sessions with neither token count captured.\n* ``sessions_missing_cost`` — sessions with no cost.\n\nThe two ``sessions_missing_*`` counts are **independent**: a session can\nhave complete token capture and no cost (a pricing gap), and legacy rows\ncarry no capture state at all, so neither count is derivable from the\nother or from the grain. Both subclasses below inherit every measure."},"UsageTimeseriesPoint":{"properties":{"session_count":{"type":"integer","title":"Session Count","default":0},"cost_usd_microdollars":{"type":"integer","title":"Cost Usd Microdollars","default":0},"input_tokens":{"type":"integer","title":"Input Tokens","default":0},"output_tokens":{"type":"integer","title":"Output Tokens","default":0},"cache_creation_input_tokens":{"type":"integer","title":"Cache Creation Input Tokens","default":0},"cache_read_input_tokens":{"type":"integer","title":"Cache Read Input Tokens","default":0},"num_turns":{"type":"integer","title":"Num Turns","default":0},"iteration_count":{"type":"integer","title":"Iteration Count","default":0},"wall_clock_ms":{"type":"integer","title":"Wall Clock Ms","default":0},"input_tokens_uncached":{"type":"integer","title":"Input Tokens Uncached","default":0},"reasoning_output_tokens":{"type":"integer","title":"Reasoning Output Tokens","default":0},"sessions_missing_usage":{"type":"integer","title":"Sessions Missing Usage","default":0},"sessions_missing_cost":{"type":"integer","title":"Sessions Missing Cost","default":0},"bucket_date":{"type":"string","format":"date","title":"Bucket Date"}},"type":"object","required":["bucket_date"],"title":"UsageTimeseriesPoint","description":"One daily bucket of usage measures."},"UsageTimeseriesResponse":{"properties":{"points":{"items":{"$ref":"#/components/schemas/UsageTimeseriesPoint"},"type":"array","title":"Points"}},"type":"object","title":"UsageTimeseriesResponse","description":"Daily usage time series over a window."},"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"},"VersionRange":{"properties":{"min":{"type":"string","pattern":"^(0|[1-9][0-9]{0,5})\\.(0|[1-9][0-9]{0,5})\\.(0|[1-9][0-9]{0,5})$","title":"Min"},"max_exclusive":{"type":"string","pattern":"^(0|[1-9][0-9]{0,5})\\.(0|[1-9][0-9]{0,5})\\.(0|[1-9][0-9]{0,5})$","title":"Max Exclusive"}},"additionalProperties":false,"type":"object","required":["min","max_exclusive"],"title":"VersionRange","description":"An explicit approved interval, including min and excluding max."},"WaveProgressResponse":{"properties":{"wave":{"type":"integer","title":"Wave"},"total":{"type":"integer","title":"Total","default":0},"done":{"type":"integer","title":"Done","default":0},"in_progress":{"type":"integer","title":"In Progress","default":0},"percent":{"type":"integer","title":"Percent","default":0}},"type":"object","required":["wave"],"title":"WaveProgressResponse"},"WireError":{"properties":{"type":{"type":"string","enum":["IntegrityError","OperationalError","DatabaseError"],"title":"Type"},"message":{"type":"string","title":"Message"}},"type":"object","required":["type","message"],"title":"WireError","description":"Serialized facade exception carried on a failed exec response."},"WorkItemContentUpdateRequest":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":256,"minLength":1},{"type":"null"}],"title":"Title"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"}},"type":"object","title":"WorkItemContentUpdateRequest","description":"A UI-originated edit — at least one of ``title``/``body`` must be set."},"WorkItemContentUpdateResponse":{"properties":{"work_item_kind":{"type":"string","title":"Work Item Kind"},"work_item_db_id":{"type":"integer","title":"Work Item Db Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"changed":{"type":"boolean","title":"Changed"},"provider_synced":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Provider Synced"},"provider_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Error"}},"type":"object","required":["work_item_kind","work_item_db_id","changed"],"title":"WorkItemContentUpdateResponse","description":"Result of a content edit, including the outbox-mirror enqueue outcome."},"WorkItemSearchPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/WorkItemSearchResult"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"WorkItemSearchPage"},"WorkItemSearchResult":{"properties":{"kind":{"type":"string","enum":["initiative","task"],"title":"Kind"},"id":{"type":"integer","title":"Id"},"project_id":{"type":"integer","title":"Project Id"},"issue_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Issue Number"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"status":{"type":"string","title":"Status"},"initiative_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Initiative Id"},"task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"},"item_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Type"},"wave":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Wave"},"pr_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pr Number"},"needs_human":{"type":"boolean","title":"Needs Human"},"paused":{"type":"boolean","title":"Paused"},"status_changed_at":{"type":"string","format":"date-time","title":"Status Changed At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"match_fields":{"items":{"type":"string","enum":["title","body"]},"type":"array","title":"Match Fields"},"snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Snippet"}},"type":"object","required":["kind","id","project_id","status","needs_human","paused","status_changed_at","updated_at","match_fields"],"title":"WorkItemSearchResult"}}}}