gizmoduck: row 302 (#1809) d6: launcher-released.test:89 counts only a-run's delivery rows and pins the one routed row with holder_run null; #route writes that row for every message (gizmoduck-0388, sage-3294, sage-3296, Mos ruling pending sage-3293); local, not pushed

This commit is contained in:
jason.woltje committed 2026-10-23 03:22:31 -05:00
1 parent 64f6558ee4
commit 5b63ea3236
3 files changed
+59 -1

No files matched your search

@@ -83,3 +83,29 @@ In packages/bus/tests, only end-launch, land and threads call threadIdle or land
not-holder pins: end-launch:198, threads:383-385 and :392, land:457 and :463 are the ops' own refusals.
threads:493 follows assistant.stop. threads:416 releases a2-run as the test's last line. The fix reaches
none of them, so no hit goes to Mos.
## 5. packages/bus/tests/launcher-released.test.mjs:89, a new test's own line (d6, sage-3294, Mos ruling sage-3293)
This file is new in row 302, so nothing at the base changes. The line changed between the pushed tests
commit f799e8b15 and d6, after the first gate run went red on it (gizmoduck-0388). It's recorded here
because the change narrows what the line counts.
Old:
```
assert.equal(store.get('SELECT count(*) AS n FROM deliveries WHERE message=?', later.id).n, 0, 'nothing delivered to the released run');
```
New:
```
assert.equal(store.get('SELECT count(*) AS n FROM deliveries WHERE message=? AND holder_run=?', later.id, 'a-run').n, 0, 'nothing delivered to the released run');
assert.deepEqual(store.all('SELECT op, holder_run FROM deliveries WHERE message=?', later.id).map((r) => ({ ...r })), [{ op: 'routed', holder_run: null }]);
```
The old line counted every delivery row for the message. `#route` (broker.mjs:6482) writes one routed
row for each message, and `#recipient` (:832-834) gives it holder_run null when no run holds the role.
After threadIdle no run holds thread A, so the count was 1, with no row for a-run. The first new line
keeps the claim it was meant to make: no row names the released run. The second pins the whole set,
one routed row held by nobody. That is tighter than the old line on everything except the null-holder
row, which it requires.
+30
View File
@@ -412,3 +412,33 @@ The red run uses the tests commit as it stands, with these test blobs (identical
| 0792431b60314a17ed74b3df0c5b3748dc3c1286 | packages/harness/tests/runner.test.mjs |
The red run checks these blobs with `git rev-parse HEAD:<path>` before it starts.
## Round d6: the first gate run's red in launcher-released.test.mjs:89 (gizmoduck-0388, sage-3294)
The slot opened at 08:15Z (sage-3289). The gate tree was 649ec67ab, a local merge of 64f6558ee onto
origin/refactor 1ac655005. The red stage on f799e8b15 passed: seven expected reds, with the pins at
threads.test.mjs:394, land.test.mjs:464 and runner.test.mjs:771 (:772 sits behind :771 in one test).
On 649ec67ab, idle-stop-race 1/1, runner.test 40/40 and compactions-launch 5/5 went green. The bus
suite then had 875 of 876 pass. The one red was this row's own test, at launcher-released.test.mjs:89,
1 !== 0. The gate stopped there, and the red went to Sage before any fix or rerun.
The test was wrong. `#route` (broker.mjs:6482) writes one routed delivery row for every message.
After threadIdle no run holds thread A, so `#recipient` (:832-834) returns null and `#delivery`
(:6612) writes holder_run null. The line counted every row for the message. Nothing was delivered to
a-run. ASSERTION-PRESERVATION.md entry 5 has the old and new lines.
The fix narrows the count to rows for a-run and adds the line Sage made mandatory: the message has
exactly one row, routed, holder_run null. bus rows come from node:sqlite with a null prototype, and the
tests use assert/strict, so the second line spreads each row before deepEqual. That is the idiom in
sessions.test.mjs:385 and session-clear.test.mjs:564. Sage's draft compared store.all directly, which
would fail on the prototype alone.
Packaging (sage-3294): this is a third commit on gizmoduck/row302 after the pushed f799e8b15 and
64f6558ee. It touches only that test line, this note and ASSERTION-PRESERVATION.md. It goes out as a
fast-forward push in a gap Sage names, after Mos rules (sage-3293). Then:
1. The red run uses the final test files over f799e8b15's product: f799e8b15 checked out detached, with
the five test files from the new tip checked out on top. The script checks the new blobs first.
2. The whole gate runs again on a fresh merge of the new tip onto origin/refactor.
Dewey reviews the delta. The first run's logs stay in gizmo-302-out/gate-run1/.
@@ -86,7 +86,9 @@ test('row 302 a run threadIdle released answers launcher-released on receive, st
assert.throws(() => call('a', 'role.claim'), { code: 'launcher-released' });
assert.equal(store.get('SELECT count(*) AS n FROM thread_claims').n, claims);
assert.deepEqual(refused('a-run'), Array(5).fill('launcher-released'));
assert.equal(store.get('SELECT count(*) AS n FROM deliveries WHERE message=?', later.id).n, 0, 'nothing delivered to the released run');
// #route writes one routed row per message; with no holder its holder_run is null (broker #recipient).
assert.equal(store.get('SELECT count(*) AS n FROM deliveries WHERE message=? AND holder_run=?', later.id, 'a-run').n, 0, 'nothing delivered to the released run');
assert.deepEqual(store.all('SELECT op, holder_run FROM deliveries WHERE message=?', later.id).map((r) => ({ ...r })), [{ op: 'routed', holder_run: null }]);
// threadIdle's own refusal is unchanged.
assert.throws(() => idle('a-run'), { code: 'not-holder' });
// After the end the run's caps are gone.