Coordinator
Hosted coordinator brain — initiative-wide reasoning over Project Tracker state, with every consult persisted as a coordinator.consults row plus an audit entry.
Ask the hosted coordinator brain an initiative-wide question
Ask the hosted coordinator brain an initiative-wide question. Loads initiative-scoped state (in-progress tasks, recent consults, initiative profile), reasons via Claude, writes one row to `coordinator.consults`, and emits `coordinator.consult.created` via `auditCritical` — all in one transaction. Called by the `consult_coordinator` MCP tool, the `pt consult` CLI, and (Phase 2) the Directory chat UI.
Agent-facing index-first knowledge-base retrieval (PLT-283)
Agent-facing index-first knowledge-base retrieval (PLT-283). Runs the same `queryKnowledgeBase` read the coordinator brain uses, under the calling agent’s own auth, so the wiki RLS + an UNCLASSIFIED classification cap scope every read to what the caller may see. Returns the rendered KB section (index + recent synthesis pages, capped to the coordinator context budget) plus a citations array. Backs the `query_knowledge_base` MCP tool and the `pt query-kb` CLI.
List the coordinator decision log for one initiative the caller belongs to — the persisted `coordinator.consults` rows, paginated and sortable by recency / cost / actor
List the coordinator decision log for one initiative the caller belongs to — the persisted `coordinator.consults` rows, paginated and sortable by recency / cost / actor. Backs the Directory decision-log feed (PLT-208 slice 2). Membership is enforced by RLS + an explicit check: a non-member receives 403, not an empty list. When the initiative classification exceeds the viewer clearance, entries are returned with `masked: true` and `questionExcerpt: null` (PLT-212). SECRET-classified reads are written to the audit log regardless of masking outcome.
Month-to-date coordinator spend for an initiative — per-user and initiative-wide token + USD totals, aggregated from `coordinator.consults` (SUM of `tokens_in` / `tokens_out` / `usd_cents` since the start of the current month, grouped by user)
Month-to-date coordinator spend for an initiative — per-user and initiative-wide token + USD totals, aggregated from `coordinator.consults` (SUM of `tokens_in` / `tokens_out` / `usd_cents` since the start of the current month, grouped by user). Backs the cost tiles in Directory's coordinator chat header. Tenant + initiative isolation is enforced by the `consults_tenant_read` RLS policy, so a non-member reads all-zero totals.
Staging step of the artifact-promotion ladder (PLT-210): writes a `coordinator.pending_actions` row from one of a persisted consult’s `suggestedActions` (referenced by `consultId` + `actionIndex`) and returns the staged id + preview for the confirm modal
Staging step of the artifact-promotion ladder (PLT-210): writes a `coordinator.pending_actions` row from one of a persisted consult’s `suggestedActions` (referenced by `consultId` + `actionIndex`) and returns the staged id + preview for the confirm modal. This is the ONLY route that creates pending actions; it never runs a side effect — execution is the separate `[id]/execute` step.
Human-confirmation step: executes a staged coordinator pending action
Human-confirmation step: executes a staged coordinator pending action. A pending action is created by the coordinator brain when it suggests a write (`create_task`, `link_to_existing`, `draft_spec_pr`). This route is the ONLY write path — there is no direct-mutation bypass. The optional `mutationPolicyOverride` in the request body may tighten (never loosen) the code-declared `confirm-required` ceiling.
Cancels a staged coordinator pending action
Cancels a staged coordinator pending action. Called by the UI confirm-dialog 'Dismiss' / 'Cancel' control, or by the Directory chat zone when the user dismisses the mutation-preview card. The row must be in `status=pending` and not past `expires_at`.