--- kind: epic slug: task-as-runnable-unit title: Task as runnable unit — workflow prompts and a runs table plan_slug: agent-coordination status: ready priority: P2 tenant_id: global cursor_epic_id: null updated_at: "2026-06-01" --- # Epic objective Every backlog item can carry a workflow prompt; every agent session against a task gets recorded in a `runs` table. These two changes are the foundation that `claim_task` / `complete_task` build on. ## In scope / out of scope **In scope** - Schema additions for workflow prompts. - New `runs` table + tRPC router. - Minimal UI for editing the prompt and viewing recent runs. **Out of scope** - The actual MCP tools (next epic). - Orchestrator process (deferred epic). ## Related tasks | Task | Link | |------|------| | Add workflow prompt to backlog items | `./Task-add-workflow-prompt-to-backlog-items.md` | | Runs table and tRPC router | `./Task-runs-table-and-trpc-router.md` | ## Dependencies - Depends on: `Plan-daily-driver-finish` (don't extend stubs). - Blocks: `Epic-mcp-claim-complete`. ## Acceptance criteria - [ ] A task row can store an optional workflow prompt that overrides the epic/plan default. - [ ] A `runs` row captures `started_at`, `finished_at`, `actor_user_id`, `outcome`, `tokens_input`, `tokens_output`, and `notes`. - [ ] Minimal UI lets an operator read a task's effective prompt and recent runs. ## Proposed timeline | Phase | Window | Notes | |-------|--------|-------| | Schema + procedures | Day 1 | Columns, table, tRPC router. | | UI surfacing | Day 2 | Inline prompt editor, recent-runs panel. |