Work Graph — v0.5 (Phase 2)
Make every runtime session attributable to a unit of work — without becoming a Linear/Jira clone or a Multica fork. “Keep your board. Replace the runtime chaos.”
What shipped (the keystone — Milestone A)#
- Native WorkItem model (migration 0015):
work_items(owner-scoped, human-readablekeylikeAUTH-124, status machine), acceptance criteria, and thework_item_sessionslink table withlink_type+confidence. - Core API (
/work-items): list/create/ show/patch, attach & detach a session, and branch/cwd candidate inference — every query owner-scoped, with an owner-isolation test on real Postgres. - CLI:
cu work list | create | show | attach. - Work Queue UI:
/worksectioned by status + a WorkItem detail page (intent, acceptance, linked sessions, attach suggestions). - Provenance-blind mediator seam: a
ProviderAdapterinterface + aMediatorregistry. The core never branches on provider —GET /work-items/providersandPOST /work-items/importresolve an adapter and upsert idempotently by external ref. Only the built-innativeis registered; an unknown provider returns an honest501 no_adapter. Adding GitHub/Linear/… later is a registration, not a core change (migration 0016 opens the provider column so the registry is the gate, not a DB enum).
cu work create --title "Harden OAuth refresh" --prefix AUTH \
--branch feat/auth --accept "single-use tokens" --accept "replay 401"
cu work list --status running
cu work attach AUTH-1 <session-id>Also shipped — the NEXT slice (real-PG tested)#
cu work run <id>—POST /work-items/{id}/run: inserts the session (still the runtime root), links itexplicit, flips the item torunning, and propagates the work-binding into the daemon launch message + prepends the work intent to the first prompt. No daemon rewrite — it rides the existing launch path.- Confidence auto-attach —
POST /work-items/{id}/auto-attach: scores the cwd-vs-branch/repo signal and links anything ≥ threshold, idempotent. - Task-aware approvals —
GET /work-items/{id}/approvals: each linked session's policy checks enriched with the work item context + an advisorytask_hint(never overrides the engine). - Work-aware restore —
GET /work-items/{id}/restore/cu work restore: resolves the newest linked session and returns the exact Phase-3 replay envelope (wrapped, not reimplemented) + the four restore modes.
Adapters are a future plug-in, not a blocker#
Because the core is provenance-blind, GitHub / Linear / Multica are each just a thin ProviderAdapter that registers on the (already built & tested) seam and brings its own credentials when written. None requires a core or schema change. Multica is not a fork and not a license question — the no-fork decision stands and is unrelated to shipping v0.5; it is simply one more possible future adapter. Registering any of them now without its service would be the fake, so they are not.
The one genuinely deferred gate#
Team / multi-tenant work queues — there is no tenant column anywhere; same Phase-2 multi-tenant work the v0.4 dossier flagged. The keystone + seam are deliberately single-tenant so they ship now without it.