Three new plan trees that fill in the gaps surfaced during repo review. Together they map out what remains between the current scaffold-with-stubs state and a daily-usable, multitenant, agent-coordinated app. * Plan-daily-driver-finish (P0): turn stubs into real data. Five tasks covering the lint/shared-types breakage, hardcoded dashboard mocks, AI-page setTimeout placeholder, post-signin landing decision, and a cross-browser collab smoke test against the deployed Hocuspocus instance. * Plan-multitenant-saas-hardening (P1): everything multitenant needs beyond what Plan-multitenant-cursor-sync already covers. Invites and role management, soft-delete + append-only audit log, rate limits on the auth + mutation hot paths, and a Vitest + GitHub Actions test foundation so PRs can't ship red. * Plan-agent-coordination (P2): the layer that makes a Task-*.md runnable, not just readable. Adds workflow_prompt with task -> epic -> plan inheritance, an agent_runs table for auditable sessions, and two new MCP tools (claim_task / complete_task) that replace the freeform update_object composition agents do today. Includes an intentionally-deferred Epic-optional-orchestrator that captures the Symphony-shaped runner as a decision point rather than an immediate build. Each task is bead-scale (one focused Cursor session) with explicit in-scope, out-of-scope, and anti-goal sections so a future agent can pick up a single Task-*.md and start without scrollback context. Co-authored-by: Cursor <cursoragent@cursor.com>
3.5 KiB
3.5 KiB
| kind | slug | title | plan_slug | epic_slug | status | priority | tenant_id | owner | cursor_todo_id | updated_at |
|---|---|---|---|---|---|---|---|---|---|---|
| task | runs-table-and-trpc-router | Runs table, tRPC router, and minimal recent-runs UI | agent-coordination | task-as-runnable-unit | ready | P2 | global | unassigned | null | 2026-06-01 |
Task summary
Every agent session against a task gets a runs row. Add the table, a tRPC router for reads, and a minimal UI to see recent runs.
Description
Schema
New table agent_runs:
iduuid pkworkspace_iduuid not null (indexed)backlog_item_iduuid not null referencesmarkdown_backlog_items.idon delete cascadeactor_user_iduuid null referencesusers.id(null = anonymous / dev session)started_attimestamptz default now (not null)finished_attimestamptz nulloutcomevarchar null — one ofsucceeded,failed,cancelled,stalled(matches Symphony's normalized vocabulary)errortext nulltokens_inputinteger nulltokens_outputinteger nulltokens_totalinteger nullnotestext null — short string the agent (or operator) can write to summarize the runmetadatajsonb null — extensible; keep small- Indexes:
(workspace_id, started_at desc)for the recent-runs query,(backlog_item_id, started_at desc)for the per-task history.
tRPC router
New apps/web/server/routers/runs.ts:
runs.listRecent({ workspaceSlug, limit?: number })— workspace-scoped, default limit 25.runs.listForTask({ workspaceSlug, backlogItemId })— workspace-scoped + verify the item belongs to the workspace.runs.summary({ workspaceSlug })— counts byoutcomefor the last 7 days, plus aggregatetokens_total. Mirror the shape of Symphony'sGET /api/v1/statesnapshot but adapted to our domain.
UI
- Workspace settings: new route
/[workspaceSlug]/settings/runsshowing the last 25 runs, paginated, with task title, started, finished, outcome, token total. Filter by outcome. - Task detail panel: a "Recent runs" sub-section listing the last 5 runs for the current task.
- Workspace home (after
Task-wire-workspace-home-dashboard): add a small "Agent runs this week" card sourced fromruns.summary.
What this task does NOT do
- It does not implement
claim_task/complete_task(next epic). Those are the write path for these rows. This task is read-side + storage only. - It does not implement an orchestrator. Rows can be inserted manually for testing.
Token accounting note
Mirror Symphony's lesson: prefer absolute thread totals (tokens_total) over per-call deltas, and avoid double-counting. Since this table is written by the MCP tools (next epic), the agent reports a single tokens_total at close-out time, not incremental deltas.
Subtasks
- Schema + migration for
agent_runs. - tRPC router with the 3 procedures.
- Settings runs view with pagination + outcome filter.
- Task detail panel "Recent runs" section.
- Hook the workspace-home "Agent runs this week" card (skip if the home dashboard task hasn't landed yet — file a follow-up).
Owner or assignee
Unassigned
Status
ready
Estimation
M
Acceptance criteria
- Inserting a synthetic
agent_runsrow makes it appear in all three UI surfaces. - All queries filter by
workspace_idand verify membership. - Outcome filter works on the settings view.
- Pagination doesn't show >25 rows per page.
Links to related Epic / Plan
- Epic:
./Epic-task-as-runnable-unit.md - Plan:
../Plan-agent-coordination.md