test(walls): rewrite the leak scenario as one world, gate every fault class (#61)

The Walls r1 scenario had grown appendages: a marked window bolted on in the
room, a one-way wall tacked onto the southern walk, and no secret or locked
door at all. #61 makes it one coherent world and proves the world itself.

The world now holds a room entered through an opening door, a far wall with a
solid stretch, a secret door and a locked door (a token behind each, so their
absence from the transcript is the leak proof), a one-way screen the subject
sees across, a marked window in the room, the same window's switch cleared and
restored (retraction and re-earn end to end), a marked solid wall, and a marked
window the subject never sees.

- tools/leak.mjs: declarative WORLD with role handles (no wallIds[1] indexing),
  narrative groups, and a scenarioCoverage() reading the GM's wall frames and
  the subject's marker frames.
- tools/leak.test.mjs: asserts the coverage on subject A: one-way wall, secret
  door, locked door, a marked window on each side of the sight gate and a
  marked non-window.
- tools/groups.mjs: the leak+fault group lists doors.test.mjs (#56) and
  markers.test.mjs (#59/#60) with their proving tests.
- docs/TESTING.md: the scenario, the coverage gate and the marker retraction
  exercise are recorded as built.

Fault matrix: all 21 fault classes still caught as exactly their own class
(oneWay, markerEarly/Extra/Off included); 22 tests with the clean-build gate.
That build passes and its bytes carry no LEAK_FAULT. nimble test and the
136-test node suite green.

Ref #61
This commit is contained in:
2026-11-19 23:58:45 +01:00
parent a69563f701
commit f9f26a4a01
4 changed files with 202 additions and 88 deletions
+15
View File
@@ -22,6 +22,21 @@ for (const subject of ['A', 'B']) {
try {
const run = await runLeak({ origin: s.origin, gmKey, stateDir, transcript })
assert.ok(run.groups > 15, `the scenario must have real coverage, got ${run.groups} groups`)
if (subject === 'A') {
// #61: the world's own contract, read off the GM's wall frames and the subject's markers.
// A rewrite that drops an element (or a side of the marker sight test) fails here, not in
// a fault that happens to stop firing.
const cov = run.coverage
assert.ok(cov.oneWay >= 1, `the world needs a one-way wall: ${JSON.stringify(cov)}`)
assert.ok(cov.secretDoors >= 1, `the world needs a secret door: ${JSON.stringify(cov)}`)
assert.ok(cov.lockedDoors >= 1, `the world needs a locked door: ${JSON.stringify(cov)}`)
assert.ok(cov.markedNonWindows >= 1,
`the world needs a marked non-window wall (MARKER_EXTRA control): ${JSON.stringify(cov)}`)
assert.ok(cov.markedWindowsSeen >= 1,
`the world needs a marked window the subject sees: ${JSON.stringify(cov)}`)
assert.ok(cov.markedWindowsUnseen >= 1,
`the world needs a marked window the subject never sees (MARKER_EARLY control): ${JSON.stringify(cov)}`)
}
const check = runChecker(transcript, subject)
fs.writeFileSync(path.join(results, `leak-${subject}.log`), check.output)
assert.equal(check.status, 0, `${check.output}\n--- server log ---\n${s.log()}`)