From dae76ccc2030fe3f89927576d650154ac2171758 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Fri, 23 Oct 2026 15:20:54 -0500 Subject: [PATCH] researcher: row 216 r5, index-build test makes Book One/Places before the write and query test lists the hybrid paths in sorted order (mos-1528, sage-3702); tests only, BUILD.md round 4 --- agents/researcher/work/queue-216/BUILD.md | 32 +++++++++++++++++++++ packages/library/tests/index-build.test.mjs | 3 +- packages/library/tests/query.test.mjs | 6 ++-- 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/agents/researcher/work/queue-216/BUILD.md b/agents/researcher/work/queue-216/BUILD.md index b6dda17f3..e1c0905e8 100644 --- a/agents/researcher/work/queue-216/BUILD.md +++ b/agents/researcher/work/queue-216/BUILD.md @@ -203,3 +203,35 @@ one row 216 commit on 45dca69f6 (origin/refactor, 10-23). Earlier base: 48e450ce and this row's two new index.mjs exports (query and index build) are not iterated by any caller. - Gate additions for phase B: run bus library.test.mjs and library-sync.test.mjs whole (they import index.mjs), and the cli stack-copy and stack-release tests that copy packages/library/src. + +## Round 4: phase B on 4e5d28ab2, two test fixes for r5 (2026-10-23T20:20:51Z, sage-3702, mos-1528) + +Appended; nothing above is edited. + +Phase B receipts on 4e5d28ab2 (researcher-r216-kit/out-b1): library whole 114 pass, 2 fail; bus library.test and +library-sync.test 12 pass; cli 266 pass. The 3,000-file rebuild took 3807 ms (the test, with fixture setup, 4070 ms; +`t.diagnostic` in index-build.test.mjs). No row 216 mutant was required or thrown in that round. + +The 2 library reds are test faults, not product faults. Both are placed as first-run reds in files this row adds +(mos-1272); Mos ruled both fixes in mos-1528 and Sage relayed it in sage-3712. + +- R4: `packages/library/tests/index-build.test.mjs`, test "a different repo path, mapping or commit gets its own + index". Old: `writeFileSync(join(repo, 'Book One/Places/New.md'), …)` with no `Book One/Places` folder in FILES, so + the write failed with ENOENT. New: one `mkdirSync(join(repo, 'Book One/Places'), { recursive: true })` before the + write (import line gains `mkdirSync`). No assertion changes. +- R5: `packages/library/tests/query.test.mjs`, test "a hybrid sees its sources canon, minus exclusions, and no + playground". The assertion sorts the actual paths and compared them to an unsorted literal, so the literal had + the wrong order (Characters before Chapters; Second World Characters before Chapters). New: only the expected + literal is reordered into sorted order. The `.sort()` on the actual side stays, and the assertion still checks + order. The set of seven paths is unchanged. +- Product code: no edit. + +Reruns owed after the r5 commit (run on Sage's CLEAR, after the 283 gate): index-build.test.mjs whole, +query.test.mjs whole, library whole, and the mutants those two files kill (M-a to M-e above). Results are appended +below as a new entry. + +Run limit note: stack-release.test.mjs ran 644 s in the cli run. A per-file limit of 3 x 644 = 1932 s covers it. +Sage's gates run cli as one whole-package `node --test` under 2100 s. + +Carry notes from Filbert's static check (doc only, no change in r5): N1 and N2 stay recorded as he gave them. The +`After` list in this file still names row 268; row 268 landed at c27207f6e. diff --git a/packages/library/tests/index-build.test.mjs b/packages/library/tests/index-build.test.mjs index f3c694c4f..8bbe97974 100644 --- a/packages/library/tests/index-build.test.mjs +++ b/packages/library/tests/index-build.test.mjs @@ -2,7 +2,7 @@ // time on a 3,000-file fixture. Fixtures are made up and built under the scratch area. import { test } from 'node:test'; import assert from 'node:assert/strict'; -import { symlinkSync, writeFileSync } from 'node:fs'; +import { mkdirSync, symlinkSync, writeFileSync } from 'node:fs'; import { join } from 'node:path'; import { performance } from 'node:perf_hooks'; import { clearIndexCache, indexCacheSize, indexFor } from '../src/index-build.mjs'; @@ -40,6 +40,7 @@ test('a different repo path, mapping or commit gets its own index', async t => { symlinkSync(repo, alias); assert.notEqual(await indexFor({ repo: alias, commit, mapping: mapping() }), base); assert.notEqual(await indexFor({ repo, commit, mapping: named('Renamed Harbor') }), base); + mkdirSync(join(repo, 'Book One/Places'), { recursive: true }); writeFileSync(join(repo, 'Book One/Places/New.md'), note('place', 'New')); git(repo, 'add', '-A'); git(repo, 'commit', '-qm', 'second'); diff --git a/packages/library/tests/query.test.mjs b/packages/library/tests/query.test.mjs index 0c884705b..a65dcdb72 100644 --- a/packages/library/tests/query.test.mjs +++ b/packages/library/tests/query.test.mjs @@ -92,9 +92,9 @@ test('a hybrid sees its sources canon, minus exclusions, and no playground', asy const s = src(scratchRepo(t, FILES), mapping(WITH_BLEND)); const reply = await find(s, { universe: 'blend', query: '' }); assert.deepEqual(paths(reply).sort(), [ - 'Book One/Characters/Mara Vell.md', 'Book One/Characters/Tomas.md', 'Book One/Chapters/Chapter 01.md', - 'Book One/Chapters/Chapter 02.md', 'Book One/Places/Harbor Town.md', - 'Second World/Characters/Ilse.md', 'Second World/Chapters/01.md', + 'Book One/Chapters/Chapter 01.md', 'Book One/Chapters/Chapter 02.md', + 'Book One/Characters/Mara Vell.md', 'Book One/Characters/Tomas.md', 'Book One/Places/Harbor Town.md', + 'Second World/Chapters/01.md', 'Second World/Characters/Ilse.md', ]); assert.ok(reply.results.every(r => r.scope === 'canon' && ['harbor', 'second'].includes(r.universe))); assert.deepEqual((await find(s, { universe: 'blend', query: '', scope: 'playground' })).results, []);