diff --git a/workplans/CUST-WP-0061-work-record-stage3-intake-promotion-index.md b/workplans/CUST-WP-0061-work-record-stage3-intake-promotion-index.md new file mode 100644 index 0000000..ce15151 --- /dev/null +++ b/workplans/CUST-WP-0061-work-record-stage3-intake-promotion-index.md @@ -0,0 +1,139 @@ +--- +id: CUST-WP-0061 +type: workplan +title: "Work-record stage 3 — intake entity, promotion transition, generated index" +domain: infotech +status: active +owner: codex +topic_slug: custodian +planning_priority: high +planning_order: 61 +created: "2026-07-21" +updated: "2026-07-21" +state_hub_workstream_id: "81632950-7948-4a8f-b526-911683713e72" +--- + +# Work-record stage 3 — intake entity, promotion transition, generated index + +Execute stage 3 of `research/WorkOrchestrationArchitectureDraft.md` v0.2 +per the successor seed in `CUST-WP-0060`'s closure review. Stages 1–2 +(canon ratified, schemas + CI validation, binky-control pilot) are done and +proven (`CUST-WP-0060`, finished 2026-07-20). This workplan makes the +`intake` work-record kind a first-class hub entity, builds the promotion +transition that was the entire point of the reconciliation (AWQ-010 never +happens as a manual chore again), and starts the generated-index work. + +## Task: UUIDv7 helper + Intake entity in state-hub + +Add a dependency-free UUIDv7 generator (`api/models/base.py::new_uuid7`, +RFC 9562 layout) — new work-record entities use it per canon +(`work-record-types_v0.1.md`: "UUIDv7 is primary... stable across renames, +migrations, and terminology transitions"). Existing tables keep `new_uuid` +(UUIDv4) unchanged; migrating them is out of scope here. + +Add `Intake` + `IntakeNote` ORM models (`api/models/intake.py`) mirroring +`Decision`'s shape: `topic_id`/`workplan_id`/`repo_id` scoping, `lane` +(green/blue/yellow/orange/red per `autonomy-lanes_v0.1.md`), `status` +(open/vetted/routed/closed per the canon lifecycle), `outcome` +(promoted/declined/absorbed), `promoted_to` (free-text canonical id +back-link), `origin`. Alembic migration, Pydantic schemas +(`api/schemas/intake.py`), REST router (`api/routers/intake.py`: +list/create/get/patch + a `/route` action mirroring `/decisions/{id}/resolve`), +router registration in `main.py`, model registration in `models/__init__.py`. +MCP tool wrappers (`create_intake`, `list_intakes`, `route_intake`) in +`mcp_server/server.py`, mirroring `record_decision`'s pattern. Tests +mirroring `test_routers_core.py`/`test_suggestions.py` conventions. Blue +lane (schema + code), Green lane (tests). + +```task +id: CUST-WP-0061-T01 +status: done +priority: high +state_hub_task_id: "bd27606d-6b3e-4114-bcf2-82dd72373571" +``` + +## Task: fix-consistency registration for intake/decision/engagement kinds + +Extend `statehub fix-consistency` (mirroring the existing C-06 workplan +registration check) to register `kind: intake` YAML blocks found anywhere +in a repo's files (per canon: any file is a potential source), writing +`state_hub_intake_id` back to the source block. Decision and engagement +kinds get the same treatment where the file-level block doesn't already +have a hub-side counterpart (`DEC-`/`OH-` items in binky-control already +dual-exist manually today — this closes that gap for good). Blue lane. + +```task +id: CUST-WP-0061-T02 +status: todo +priority: high +state_hub_task_id: "00272ba0-683b-4396-bdf4-f424d176eeca" +``` + +## Task: Promotion transition — one call, both artefacts, both synced + +Build the promotion transition named in the canon: `intake.routed → +workplan | task | decision | engagement`. A single CLI (`statehub +promote-intake --to workplan --file ` or similar) or MCP +call that: (1) validates the intake is in `routed` status, (2) writes the +target work-record file per its kind's convention (ADR-001 workplan file, +task block, decision/engagement YAML block), (3) sets `promoted_to` on the +intake record and `origin` on the new record, (4) runs the equivalent of +`fix-consistency` registration for both, (5) closes the intake with +`outcome: promoted`. This is the mechanism that makes another AWQ-010-style +manual reintegration structurally unnecessary — it is the actual point of +stage 3. Blue lane. + +```task +id: CUST-WP-0061-T03 +status: todo +priority: high +state_hub_task_id: "43e04a5a-2033-4424-9fc2-75dbc79e4bfb" +``` + +## Task: Generated per-repo work-record index (design + first cut) + +Design the transclusion-style per-repo index (markitect-family scope per +the founder's review): a generated file (or hub-served view) listing every +registered work record in a repo with a reference to its source file and +location, refreshed by `fix-consistency`. First cut: a `[auto]`-marked +section or `WORK-RECORDS.md` generated by `statehub fix-consistency` +listing kind/id/status/lane/source-path for every record found. Full +transclusion rendering (markitect integration) is a follow-on, not blocking +this first cut. Green/Blue lane. + +```task +id: CUST-WP-0061-T04 +status: todo +priority: medium +state_hub_task_id: "985273dc-f70b-4aab-ae54-45350bab5503" +``` + +## Task: Regenerate binky-control queue view tails as [auto] + +Once T02–T04 land, retarget `AutopilotWorkQueue.md`'s Completed log, +`DecisionQueue.md`'s resolved log, and `OfficeHourQueue.md` similarly to be +generated `[auto]` sections sourced from the hub, per +`WorkOrchestrationArchitectureDraft.md` §4. Blue lane, binky-control pilot +continuation. + +```task +id: CUST-WP-0061-T05 +status: todo +priority: medium +state_hub_task_id: "bc4f249f-7a63-4050-beb2-c64212ef3cde" +``` + +## Task: Suggestion-table close-out + +Once the intake entity is live and proven (T01–T02), mark the state-hub +`suggestions` table/router read-only legacy (per the founder's resolved +question: fresh intake entity, not a suggestions rename-bridge). One-time +close-out of any live suggestion records into intake records or an +explicit archive note. Blue lane. + +```task +id: CUST-WP-0061-T06 +status: todo +priority: low +state_hub_task_id: "af5b6c2e-c7ea-422f-884f-7c23a74c2ae0" +```