From 8652158d32d81c2a521c0e39edd9413312b4bbd5 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Wed, 21 Oct 2026 18:32:08 -0500 Subject: [PATCH] gizmoduck: row 264 phase A build notes, code at da9555ca2, consumer audit first pass, five proposed slices and Q1-Q7 to Sage (sage-2233, #1769, Vikunja 463) --- agents/gizmoduck/work/queue-264/BUILD.md | 65 ++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 agents/gizmoduck/work/queue-264/BUILD.md diff --git a/agents/gizmoduck/work/queue-264/BUILD.md b/agents/gizmoduck/work/queue-264/BUILD.md new file mode 100644 index 000000000..692428310 --- /dev/null +++ b/agents/gizmoduck/work/queue-264/BUILD.md @@ -0,0 +1,65 @@ +# Row 264 build notes (Gizmoduck) + +T1 item 7: independent sessions, compaction counts and clear context. Gitea #1769, Vikunja 463 +(design) and 466 (Claude compaction format, T3's dependency, linked and not built here). Brief: +docs/plans/2026-10-21_t1-sessions.md, "T1 item 7: independent sessions, compaction counts and clear +context" (blob ff0be0c79). Reviewer Duckworth, gate owner Sage. Branch gizmoduck/row264 from refactor +da9555ca2. MVP due 10-27. + +The brief pins its code citations at cca206cdc. `git diff --stat cca206cdc da9555ca2` over every cited +source file is empty, so F1-F11 still hold line for line. Only docs/prd/mosaic-stack.md moved. + +## Phase A: what the code has today + +- Bus. `threads` binds one `instance` per thread (schema.sql:240-250). `thread_claims` keys on + `thread` alone (:251-261), and `message_threads` maps a message to a thread (:262-265). Schema is + 3j (store.mjs:17). The thread tables first appear in migrations/3d-3e.sql. +- Launcher. `check()` refuses a second run for the same instance and thread + (launcher.mjs:233-240, `registry.running(b.id, instance, thread)`). +- Seat. `threadStore()` makes one `session/` and one `claude-projects/` per thread + (session.mjs:51-74). The registry's running key is business, instance and thread (:215-218). +- Runner. `stop()` sends TERM to the child group, then KILL after 5 s (runner.mjs:402-414). It has + no drain, no idle acknowledgement and no dequeue fence. D7 step 2 needs all three. + +## Consumer audit (D9), first pass + +`git grep -F` over packages/*/src/* and adapters/* at da9555ca2: + +| Name | Files and hits | +| --- | --- | +| `thread_claims` | broker.mjs 12, store.mjs 1 | +| `message_threads` | broker.mjs 9 | +| `thread_opens` | broker.mjs 4, store.mjs 1 | +| `threadStore` | launcher.mjs 4, sandbox.mjs 7, session.mjs 3 | +| `running(` | launcher.mjs 5, session.mjs 1 | + +Still to read: the broker holder, agents, end, usage, reply correlation and pending-approval paths +named in D9, the two adapters (F5), both harness plugins, the conversation reader (F8) and the +Console. Each gets a file:line row here before the first code commit. + +## Proposed slices + +One seat can't build D1-D9 in six days and keep every slice reviewable. I propose five candidates +under row 264, each with its own manifest and Duckworth round: + +1. 264a bus. Session tables, claim key `(organization, thread, instance, session)` with a + generation, the D3 default session, the D9 bus mapping, `session.list|get|create|open|send` and an + optional session selector on the thread verbs. Tests: T1 bus half, T2 claims, T7 legacy clients and + the rollback refusal. +2. 264b seat and launcher. Per-session native store and workspace, the single-writer fence, the + registry key with session, sandbox mounts of the selected store only, and pinned native ids in both + adapters. Tests: T1 run half, T2 workspace and path mutants. +3. 264c compaction count. Host collector, exact for Pi. Claude shows `unknown` with the 466 reason + until that format is pinned. Tests: T3 Pi half. +4. 264d clear. The D7 journal, the runner drain fence and idle acknowledgement, stop proof, then + retirement and successor in one transaction. Tests: T4, T6. +5. 264e surface. `mosaic session` CLI and the Console chooser, count and clear confirmation. Tests: + T5 for the legacy single human, T7 Console half. + +## Phase A questions (sent to Sage) + +Q1-Q7 went to Sage in gizmoduck-0154. Answers land here as they come. + +## Runs + +None yet. Every run waits for Sage's CLEAR.