Unclaimed files left in the canonical checkout. Inventory: canonical-cleanup-inventory.md (commit-as-evidence groups). detect-secrets scan clean on 2026-11-02: hits are sha256 pins, git object ids, test sentinels already in tracked tests and unit-file lines.
6.2 KiB
Row 94 — Every message to the human, live (#1588)
Author: Rocko, gpt-6.1-sol. Reviewer: Dewey. Landing and gate rerun: Sage. Base: see base.txt. Candidate is uncommitted code in a detached worktree.
Scope additions approved by Sage
Sage, 2026-10-12 22:47Z, row 94 scope (message to Rocko d99326cc):
- views.mjs adds one messages entry passing paging arguments to client.call.
- serve.mjs adds messages to BUS_VERBS and a messages-only busRead branch: strict limit/after parsing and paging metadata. Existing verb branches and responses stay unchanged.
- cli.mjs's new follow command is owned by this row.
Sage, 2026-10-12 22:54Z, row 94 inbox JSON ruling: Keep inbox --json byte-compatible as the decision-row array. Text inbox lists unread messages below decisions. No new JSON flag or shape.
Design and acceptance
Messages is human/reader-only, business-scoped, to_role human only. Returns messages newest first by immutable seq, total, unread, next. Defaults to 50; limit 1–200. after names the last message in the previous page; unknown, other-business and non-human cursors refuse. read means a read receipt exists, not merely delivery. Successful reads write nothing. Unread counts cover the whole feed, including beyond the page.
Plain talk keeps its timeout/direct-reply behavior. talk --follow and follow receive, print and read until Ctrl-C; the latter sends nothing. --follow and --wait together refuse. Text inbox walks all pages, lists unread messages and writes no delivery/read receipts; JSON stays the exact existing decision array.
Console Messages polls with existing page cadence, displays sender, class, time, body, read state and trail; older/newest links page through history. The nav count is read on every page. Console does not receive or read messages.
Verification
Pending final gate and mutation receipts. Red runs: out/red.txt and out/red-web.txt show missing broker/CLI functionality and missing Console route.
Acceptance evidence map
- bus/tests/messages.test.mjs: first/default/max/remaining pages, newest order, total/unread counts, read bool after the human reads, no delivery writes, strict arguments, role refusal, foreign-business and role-target cursor refusal, and views passthrough.
- cli/tests/follow.test.mjs: plain talk returns at direct reply; both continuous commands print a later message with no in_reply_to exactly once and mark it read; text inbox reads every page without delivery; inbox --json matches the existing decision-array bytes even with 205 unread messages; Ctrl-C wakes a long sleep; handlers cleaned after errors.
- webui/tests/messages.test.mjs: limit/after 400s, duplicate/extra key refusal, paging metadata, unchanged existing read response rows/shape, automatic polling without Refresh, escaping, sender/class/time/trail, read-state updates, 54-message count with a 50-message page, older links, unchanged delivery receipts and no horizontal page overflow at 400px.
- Existing cli.test, bus-browser, shell and views tests adjust only the expected extra text-inbox read and the eighth nav/palette item.
The optional nav count does not disable repository pages when no bus is configured: it hides the count. A 403 still follows the existing refusal path, clearing kept data. Messages itself uses the existing full loading/empty/stale/refused/signed-out page behavior. The screenshot out/messages-400.png was visually inspected.
Corrections during verification
The first full CLI run lacked node_modules in the detached worktree and failed launcher fixtures. The worktree now links the canonical checkout's already pinned dependencies; no package was installed or upgraded. The next CLI suite passed. Existing tests needed updated text-inbox call and nav-item expectations. A missing bus count initially prevented local Queue/Business/Settings reads; it now hides only the optional count. The regression rerun passed 10/10.
The first mutation pass (out/mutants-first) detected a Ctrl-C test that failed but left its receive loop pending, causing a 20s runner timeout. The test now aborts its own injected cleanup signal in finally. That pass also stopped at an ambiguous escaped-body replacement shared by the send receipt; the final mutant targets only the Messages body. Every mutation restores original candidate text in finally.
Earlier progress messages used inaccurate UTC timestamps; final gate receipts and stage reports take their timestamps from the host clock.
Reproduce
Create a detached worktree at the full commit in base.txt (not a branch),
apply build.patch, and link the canonical checkout's node_modules into
that worktree. No dependency install, commit or service change is needed.
From the patched tree, sha256sum -c the absolute path to this packet's
candidate-manifest.sha256. Every manifest path is relative to the patched
tree. bash /mnt/storage/src/mosaic-stack/agents/rocko/work/queue-94/r1/verify.sh <absolute-output-directory> runs the required gate. python on mutants.py
with a separate absolute output directory reproduces the mutants; do not
run mutations while other tests are running against that tree.
build.patch contains only the 16 product/documentation/test files in files.txt. This packet is independently hashed by packet-manifest.sha256. No candidate code or packet was committed. The canonical source is untouched.
Final result
Final gate: bus 112, CLI 125, webui 103 pass; no failures, cancellations
or skips. All nine scripts/test-*.sh exit 0. Final shell gate ran
2026-10-12T22:58:22Z–23:00:54Z in the detached worktree at dad20531.
Receipts: out/final/, out/gate-summary.json. Mutants: 27/27 killed with
nonzero test exits, no timeout, in out/mutants/.
All 16 candidate hashes match after mutation restoration. git diff --check and patch applicability on the canonical checkout pass. No candidate-path drift from base to the checkout HEAD at packet creation (out/drift.txt). Dewey review and Sage's independent gate rerun remain required. Row 85 waits for row 94 done. No live service was started, stopped or restarted; no live bus/store/secret access, commit, push or merge was performed.
Queue receipts: out/queue-in-review.txt. Rev 830 opens round 1; rev 831 records the expected failed tokenless request. Sage must retry as jarvis.