ubiquitous-invention/plans/Plan-agent-coordination/Epic-task-as-runnable-unit
Randall Stillwell b2aff2045b feat(mcp): claim_task tool + register claim/complete pair
Pairs with the parallel complete_task commit. claim_task opens an
agent_runs row, flips status to in_progress only when it's safe
(ready/draft → in_progress, never overwriting a deliberate
blocked/done/in_progress), and returns the resolved workflow prompt
+ source level. Idempotent re-claim by the same actor returns the
existing run with reused=true and refreshes notes only — started_at
is sacred. Different-actor re-claim errors with ALREADY_CLAIMED
naming the existing actor and run id.

Tenancy fence: if the backlog item exists but in a different workspace
than the resolved handle, we refuse with "doesn't belong to workspace"
rather than 404. Prevents cross-tenant existence fishing.

All three writes (run insert + status flip + audit insert) happen in
one db.transaction() so a partial claim is unreachable.

tools/index.ts now registers both claim_task and complete_task.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 22:23:05 -05:00
..
Epic-task-as-runnable-unit.md feat(mcp): claim_task tool + register claim/complete pair 2026-06-02 22:23:05 -05:00
Task-add-workflow-prompt-to-backlog-items.md feat(backlog): workflow_prompt with task → epic → plan inheritance 2026-06-02 22:18:18 -05:00
Task-runs-table-and-trpc-router.md plans: scaffold daily-driver-finish, saas-hardening, agent-coordination 2026-06-01 23:52:22 -05:00
Task-workflow-prompt-task-detail-ui.md feat(backlog): workflow_prompt with task → epic → plan inheritance 2026-06-02 22:18:18 -05:00