Files
stack/agents/researcher/work/queue-107/build.md
T

3.8 KiB

Row 107 (#1601) build notes

Researcher, 2026-10-13. Brief: docs/plans/2026-10-13_landing-follow-ups.md, "Queue add: pin the retry order and drop the row history from the refusal". Base: aedc5db8f. Reviewer: Filbert. Covers Filbert's N1 and N2 on row 101 (#1595).

Candidate change: row107.patch (two files). Built and run in /mnt/storage/scratch/researcher/q107, detached at aedc5db8f, node_modules linked to the canonical one.

N2: refusal text

packages/queue/src/store.mjs: the privileged-add refusal no longer ends in "(row 100 got jason by default)". It still names --gate-owner SEAT and says why: a privileged add has no default gate owner, so a row never gets a gate nobody meant. The code comment above the check dropped "row 100" too and now says the check stays below step 3.

packages/queue/tests/gate-owner.test.mjs: the CLI refusal test keeps /--gate-owner/ and /no default gate owner/ and adds doesNotMatch(r.err, /row \d+/).

Nothing else in src, tests, README.md or docs/TOOLS.md cites row 100 (grep). SEMANTICS stays 2; no change to the log format, to applyEntry, or to what any reader loads.

N1: the retry-order test

New test in gate-owner.test.mjs: "a retried sage add recorded with no gate owner answers (already recorded at rev N) and writes nothing".

  1. Scratch repo with committed genesis.
  2. addUnder(doc, "sage", addArgs(), 2) appends a sage add with gateOwner: null the way the pre-row-101 write path left it (applyEntry, no write-time check).
  3. The test writes queue.json, the QUEUE.md table body (render between the markers) and the witness mosaic-queue.head (revision, logDigest, fileSha) so all three sit at the add's rev. The witness state is match, so the retry reaches step 3 without a tail confirmation.
  4. It retries the same op and arguments through the CLI as sage with no --gate-owner. Expected: exit 0, stdout (already recorded at rev N), queue.json and QUEUE.md byte-identical, revision unchanged.
  5. It then sends a fresh op id with the same arguments and expects the refusal (exit 2, names --gate-owner, queue.json unchanged), so the test also shows the check was not removed.

Mutant (the kill)

n1-mutant.sh <worktree> <outdir> runs gate-owner.test.mjs twice and restores store.mjs on exit. The mutant moves the privileged-add check block above const prior = ... (step 3). Output is in n1/; run summary in n1-run.txt.

  • control, real store.mjs: exit 0, 6 tests, 6 pass.
  • mutant, check hoisted above step 3: exit 1, 6 tests, 5 pass, 1 fail. The failing test is a retried sage add recorded with no gate owner answers (already recorded at rev N) and writes nothing. The other five still pass, so the hoist is caught by this test alone.
  • n1/mutant.patch is git diff of the mutated tree against the base, so it also shows the candidate's own edits; the mutation is the added hunk at @@ -501.
  • The mutant was applied to the worktree file only and restored; the candidate patch does not contain it.

Suites (all in the q107 worktree, output teed)

  • node --test packages/queue/tests/*.test.mjs: 156 tests, 156 pass, 0 fail (node-suite.out).
  • scripts/test-queue.sh: 28 passed, 0 failed (test-queue.out). The queue verify and render --check case was skipped in my tree because q107 is not the queue's canonical root (/mnt/storage/src/mosaic-stack); this is Filbert's N3 from row 101. That case is covered by Sage's canonical-root gate rerun, which is the evidence of record. I did not run suites or apply the patch in the canonical checkout.
  • Slot: granted by Sage at 22:00:29Z, released ("clear") at 22:01:30Z; no process of mine left in q107.

Scope

Owned files only: packages/queue/src/store.mjs (message and comment), packages/queue/tests/gate-owner.test.mjs, this packet. No change to who may pass --gate-owner or to the default for non-privileged seats.