Two test-quality gaps let real regressions pass the suite. (1) The restart test's "before" snapshot is taken from a server that has already been restarted, so it compares restart-to-restart instead of as-built-to-restart: any field silently dropped on the first restart is already missing from both sides and the assertion holds. (2) groups.mjs proves a group by looking for a test title substring, so a test hollowed out to the named title with no assertions (or with the assertions deleted) still counts as evidence.
Where
tools/restart.test.mjs:173-196 — restartAndCompare starts the server and takes before from that instance, then restarts and compares after to it. The as-built state (fresh DB, CRUD applied, before any restart) is never the baseline.
tools/groups.mjs — GROUPS entries are [file, titleSubstring]; tools/groups.test.mjs only checks the title exists in the file. There is no link between the evidence claim and the assertions inside the test.
Failure scenario
A persistence bug drops walls (or a token property bucket) on the first load after write. The restart test starts the server, sees the drop already applied, snapshots that, restarts, sees the same drop, and passes: the group is marked done on a test that cannot fail for the class of bug it exists to catch. Separately, someone trims a test body to just its title (or comments out half its assertions) while keeping the name; the group map still reports evidence present, and the finish line (#25) records a group as proven on an empty test.
Confidence
High — both are structural in the current helpers, and the restart ordering is visible at the cited lines.
Fix direction
Take the restart baseline from the as-built session: snapshot immediately after the CRUD, on the first server instance, then restart and compare that baseline — both before and after the kill variants. For the group map, require each evidence entry to carry something the harness can verify beyond the title (a declared minimum assertion count, or a marker the test must execute), so an emptied test fails the group check.
Acceptance
The restart test compares the first instance's post-CRUD snapshot to the post-restart snapshot for both SIGTERM and SIGKILL variants, and fails if a persisted field is lost on the first load.
groups.mjs/groups.test.mjs fail when an evidence test's body is hollowed out (title kept, assertions removed), demonstrated by a temporary mutation of one test during review.
A test that adds a new accept-group test without registering it, or registers one that does not run, is caught.
Related
#25 (slice 10: finish line), which trusts the group map.
## Summary
Two test-quality gaps let real regressions pass the suite. (1) The restart test's "before" snapshot is taken from a server that has already been restarted, so it compares restart-to-restart instead of as-built-to-restart: any field silently dropped on the *first* restart is already missing from both sides and the assertion holds. (2) `groups.mjs` proves a group by looking for a test title substring, so a test hollowed out to the named title with no assertions (or with the assertions deleted) still counts as evidence.
## Where
- `tools/restart.test.mjs:173-196` — `restartAndCompare` starts the server and takes `before` from that instance, then restarts and compares `after` to it. The as-built state (fresh DB, CRUD applied, before any restart) is never the baseline.
- `tools/groups.mjs` — `GROUPS` entries are `[file, titleSubstring]`; `tools/groups.test.mjs` only checks the title exists in the file. There is no link between the evidence claim and the assertions inside the test.
## Failure scenario
A persistence bug drops `walls` (or a token property bucket) on the first load after write. The restart test starts the server, sees the drop already applied, snapshots that, restarts, sees the same drop, and passes: the group is marked done on a test that cannot fail for the class of bug it exists to catch. Separately, someone trims a test body to just its title (or comments out half its assertions) while keeping the name; the group map still reports evidence present, and the finish line (#25) records a group as proven on an empty test.
## Confidence
High — both are structural in the current helpers, and the restart ordering is visible at the cited lines.
## Fix direction
Take the restart baseline from the as-built session: snapshot immediately after the CRUD, on the first server instance, then restart and compare that baseline — both before and after the kill variants. For the group map, require each evidence entry to carry something the harness can verify beyond the title (a declared minimum assertion count, or a marker the test must execute), so an emptied test fails the group check.
## Acceptance
- The restart test compares the first instance's post-CRUD snapshot to the post-restart snapshot for both SIGTERM and SIGKILL variants, and fails if a persisted field is lost on the first load.
- `groups.mjs`/`groups.test.mjs` fail when an evidence test's body is hollowed out (title kept, assertions removed), demonstrated by a temporary mutation of one test during review.
- A test that adds a new accept-group test without registering it, or registers one that does not run, is caught.
## Related
- #25 (slice 10: finish line), which trusts the group map.
- #2 (M3 planning map).
Category: bug Summary: the restart group must compare post-restart state against the state as built (not against a second restart), and the accept-group checklist must verify that each evidence test actually ran and asserted
Current behavior:
Two gaps let the acceptance suite pass on work it does not prove.
The restart baseline is itself a restart. The restart harness builds its world on one server instance, stops that instance, then starts a new one and takes the "before" snapshot from that next instance before restarting again and comparing. So the comparison is restart-to-restart. Any field the persistence load drops on the very first load after it was written is already missing from both snapshots and the deep-equal holds: the group cannot fail for the class of bug it exists to catch.
Evidence is a title substring. The accept-group evidence map declares each group's proving test as (file, title substring), and the checker only asserts the file exists and contains that text. A test reduced to its title with no assertions — or with its asserts deleted or its body skipped — still counts as evidence, and the checklist that the finish line trusts can report a group proven on an empty test. A registered evidence entry whose test never executes (skipped, renamed, filtered out) is equally invisible.
Desired behavior:
Baseline = as-built. The restart world is built on the first instance; once every mutation is acked and any pre-restart assertions the group makes have run (including the DB-level checks), that first instance's full resync is the baseline — before any restart of any kind. Each shutdown variant then stops that same instance (orderly signal and hard kill), starts a new one, and compares the post-restart resync against that baseline. The baseline must be captured for the GM connection and for every player connection, and must cover the same view content as today (hello scene block, roster, walls, characters, tokens, encountered, vision, full explored RLE), normalized only for the per-connection counter.
The comparison keeps its absolute truth checks, so two equally wrong snapshots cannot both pass: the per-player expected-name assertions and the "the world is not empty" inventory assertions stay, attached to the as-built baseline.
Evidence must prove execution and assertion. Every registered evidence entry carries something the harness can verify at run time, beyond the title string, and a hollowed or unexecuted evidence test fails the checklist. The mechanism is the implementer's choice; the constraints are:
it is required for every evidence entry (not opt-in for some groups);
it fails when the test's body is emptied, when its assertions are removed, when the test is skipped, and when it never runs in the suite pass at all;
it needs no npm dependency beyond what the harnesses already use (Node built-ins only) and no network;
it does not make the test suite order-dependent or racy (an evidence test and the checker may not depend on which ran first in the same pass).
A required runtime marker emitted by the evidence test and demanded by the checker, or a declared minimum assertion count enforced by a wrapper around the assertion library, are both acceptable shapes; pick one, apply it uniformly, and state the choice.
Registration drift is caught in both directions: a test that belongs to an accept group but is not registered, and a registered entry with no runtime evidence, both fail.
Demonstration, not assertion: the anti-hollow guarantee is demonstrated during review by temporarily hollowing one evidence test (title kept, assertions removed or body skipped), showing the checklist fail, and reverting. Same for a dropped field on load: a temporary mutation that makes the load omit one persisted field must make the restart group fail for both shutdown kinds; then revert (or add it to the repo's mutation set if that is the convention, in which case it stays).
Key interfaces:
The restart harness (the "restart" accept group): its world builder, its snapshot/resync capture, and its compare step. The change is where the baseline snapshot is taken, not what it contains.
The accept-group evidence map and its checker (the module that lists the groups with their files and evidence, plus the test that validates it): each evidence entry gains whatever field the chosen mechanism needs, and the checker enforces it.
The suite driver: if the chosen mechanism needs a place to collect markers per pass (a file under the state/results dir, an env var the driver sets), the driver that runs Nim tests then the Node harnesses provides it and must not leak that state between passes.
DESIGN 10.4's accept-group paragraph and 10.3's restart paragraph: record the as-built baseline rule and the chosen evidence mechanism, the latter marked as owner-delegated (decision taken during #36's triage), so the next reader knows why the map has more than a title in it.
DESIGN's finish-line checklist (section 14 entries left from #25): if it describes how the groups are proven, it must not now over-claim.
Acceptance criteria:
The restart group's baseline snapshot is taken on the first instance, after the world build and after the group's other pre-restart assertions, with no restart having happened yet.
Both shutdown variants (orderly signal and hard kill) compare the post-restart resync against that as-built baseline, for the GM view and for every player view, with the same content as today and only the per-connection counter normalized.
The absolute checks survive: the per-player expected encountered names and the non-empty inventory assertions are still asserted, now against the as-built baseline.
A temporary load-side omission of one persisted field (mutate the load path to skip a field of one persisted kind) makes the restart group fail for both shutdown variants; demonstrated and reverted (or kept in the repo's mutation set).
Temporarily hollowing one evidence test — title kept, assertions removed or the body skipped — makes the checklist fail; demonstrated and reverted.
A registered evidence entry whose test does not execute in the pass (skipped or renamed) makes the checklist fail.
An accept-group test added but not registered fails the checklist; a registered entry without the runtime evidence fails it too.
The full suite (devbox run test equivalent: Nim tests then the Node harnesses) is green, and no test's own assertions were weakened to make the new checks pass.
DESIGN records the as-built baseline rule and the chosen evidence mechanism as owner-delegated, and still describes the group map accurately.
Out of scope:
Fixing any persistence bug the corrected baseline uncovers: if a field turns out to be dropped on load, file it (or report it) separately — this issue is about the test being able to see it.
Extending the restart world's CRUD coverage beyond what the baseline change needs.
Reworking the other accept groups' harnesses, or turning the group map into a full test-report parser.
M4 browser e2e and CI wiring.
Changing what "restart" means (still a fresh process on the same state dir), or adding incremental/backup restore scenarios.
> *This was generated by AI during triage.*
## Agent Brief
**Category:** bug
**Summary:** the restart group must compare post-restart state against the state as built (not against a second restart), and the accept-group checklist must verify that each evidence test actually ran and asserted
**Current behavior:**
Two gaps let the acceptance suite pass on work it does not prove.
1. **The restart baseline is itself a restart.** The restart harness builds its world on one server instance, stops that instance, then starts a new one and takes the "before" snapshot from that *next* instance before restarting again and comparing. So the comparison is restart-to-restart. Any field the persistence load drops on the very first load after it was written is already missing from both snapshots and the deep-equal holds: the group cannot fail for the class of bug it exists to catch.
2. **Evidence is a title substring.** The accept-group evidence map declares each group's proving test as (file, title substring), and the checker only asserts the file exists and contains that text. A test reduced to its title with no assertions — or with its asserts deleted or its body skipped — still counts as evidence, and the checklist that the finish line trusts can report a group proven on an empty test. A registered evidence entry whose test never executes (skipped, renamed, filtered out) is equally invisible.
**Desired behavior:**
- **Baseline = as-built.** The restart world is built on the first instance; once every mutation is acked and any pre-restart assertions the group makes have run (including the DB-level checks), that first instance's full resync is the baseline — before any restart of any kind. Each shutdown variant then stops that same instance (orderly signal and hard kill), starts a new one, and compares the post-restart resync against that baseline. The baseline must be captured for the GM connection and for every player connection, and must cover the same view content as today (hello scene block, roster, walls, characters, tokens, encountered, vision, full explored RLE), normalized only for the per-connection counter.
- **The comparison keeps its absolute truth checks**, so two equally wrong snapshots cannot both pass: the per-player expected-name assertions and the "the world is not empty" inventory assertions stay, attached to the as-built baseline.
- **Evidence must prove execution and assertion.** Every registered evidence entry carries something the harness can verify at run time, beyond the title string, and a hollowed or unexecuted evidence test fails the checklist. The mechanism is the implementer's choice; the constraints are:
- it is required for **every** evidence entry (not opt-in for some groups);
- it fails when the test's body is emptied, when its assertions are removed, when the test is skipped, and when it never runs in the suite pass at all;
- it needs no npm dependency beyond what the harnesses already use (Node built-ins only) and no network;
- it does not make the test suite order-dependent or racy (an evidence test and the checker may not depend on which ran first in the same pass).
A required runtime marker emitted by the evidence test and demanded by the checker, or a declared minimum assertion count enforced by a wrapper around the assertion library, are both acceptable shapes; pick one, apply it uniformly, and state the choice.
- **Registration drift is caught in both directions**: a test that belongs to an accept group but is not registered, and a registered entry with no runtime evidence, both fail.
- **Demonstration, not assertion**: the anti-hollow guarantee is demonstrated during review by temporarily hollowing one evidence test (title kept, assertions removed or body skipped), showing the checklist fail, and reverting. Same for a dropped field on load: a temporary mutation that makes the load omit one persisted field must make the restart group fail for both shutdown kinds; then revert (or add it to the repo's mutation set if that is the convention, in which case it stays).
**Key interfaces:**
- **The restart harness** (the "restart" accept group): its world builder, its snapshot/resync capture, and its compare step. The change is where the baseline snapshot is taken, not what it contains.
- **The accept-group evidence map and its checker** (the module that lists the groups with their files and evidence, plus the test that validates it): each evidence entry gains whatever field the chosen mechanism needs, and the checker enforces it.
- **The suite driver**: if the chosen mechanism needs a place to collect markers per pass (a file under the state/results dir, an env var the driver sets), the driver that runs Nim tests then the Node harnesses provides it and must not leak that state between passes.
- **DESIGN 10.4's accept-group paragraph and 10.3's restart paragraph**: record the as-built baseline rule and the chosen evidence mechanism, the latter marked as owner-delegated (decision taken during #36's triage), so the next reader knows why the map has more than a title in it.
- **DESIGN's finish-line checklist (section 14 entries left from #25)**: if it describes how the groups are proven, it must not now over-claim.
**Acceptance criteria:**
- [ ] The restart group's baseline snapshot is taken on the first instance, after the world build and after the group's other pre-restart assertions, with no restart having happened yet.
- [ ] Both shutdown variants (orderly signal and hard kill) compare the post-restart resync against that as-built baseline, for the GM view and for every player view, with the same content as today and only the per-connection counter normalized.
- [ ] The absolute checks survive: the per-player expected encountered names and the non-empty inventory assertions are still asserted, now against the as-built baseline.
- [ ] A temporary load-side omission of one persisted field (mutate the load path to skip a field of one persisted kind) makes the restart group fail for both shutdown variants; demonstrated and reverted (or kept in the repo's mutation set).
- [ ] Temporarily hollowing one evidence test — title kept, assertions removed or the body skipped — makes the checklist fail; demonstrated and reverted.
- [ ] A registered evidence entry whose test does not execute in the pass (skipped or renamed) makes the checklist fail.
- [ ] An accept-group test added but not registered fails the checklist; a registered entry without the runtime evidence fails it too.
- [ ] The full suite (`devbox run test` equivalent: Nim tests then the Node harnesses) is green, and no test's own assertions were weakened to make the new checks pass.
- [ ] DESIGN records the as-built baseline rule and the chosen evidence mechanism as owner-delegated, and still describes the group map accurately.
**Out of scope:**
- Fixing any persistence bug the corrected baseline uncovers: if a field turns out to be dropped on load, file it (or report it) separately — this issue is about the test being able to see it.
- Extending the restart world's CRUD coverage beyond what the baseline change needs.
- Reworking the other accept groups' harnesses, or turning the group map into a full test-report parser.
- M4 browser e2e and CI wiring.
- Changing what "restart" means (still a fresh process on the same state dir), or adding incremental/backup restore scenarios.
Restart baseline (#36.1):tools/restart.test.mjs now snapshots the as-built world on the first server instance (after the CRUD, before the signal) and compares that baseline with the post-restart resync, for both SIGTERM and SIGKILL. SIGKILL now kills the server that holds the as-built state. Negative control: planting p[pbGm] = newJObject() in server/tokens.nim (a gm prop bucket dropped on first load) fails the new test (the GM resync after the restart is identical) while the old restart-to-restart test passed with the same planted regression. Players connect before the GM in the snapshot so the GM's derived encountered.grey is read against refreshed sight state on both sides.
Group evidence (#36.2):tools/groups.mjs evidence entries now name the exact test title (with ${...} for per-case titles), a minimum assertion count and the calls the body must keep. tools/groups.test.mjs checks the declaration is unique and its body still holds them. tools/evidence.mjs (new, last step of tools/test.sh) parses the Node spec-reporter output in results/node-test.log and fails unless every registered evidence test actually ran and passed; a skipped or never-run registration fails. Negative control: hollowing out the key.replace test to its title fails the new check (0 assertions, 6 required) while the old title-substring check still reported evidence present; run against the stale 107-test log the gate reports the four never-ran evidence tests.
Evidence trail:devbox run test exit 0 (Nim suites + 149 Node tests, 16 evidence tests verified); devbox run mutation exit 0 (control + all 78 mutations, s1-s7 included). docs/TESTING.md §13 updated to describe the executable evidence gate and the corrected counts.
Fixed in a11782f (plus 1f11779), pushed to main.
**Restart baseline (#36.1):** `tools/restart.test.mjs` now snapshots the as-built world on the *first* server instance (after the CRUD, before the signal) and compares that baseline with the post-restart resync, for both SIGTERM and SIGKILL. SIGKILL now kills the server that holds the as-built state. Negative control: planting `p[pbGm] = newJObject()` in `server/tokens.nim` (a gm prop bucket dropped on first load) fails the new test (`the GM resync after the restart is identical`) while the old restart-to-restart test passed with the same planted regression. Players connect before the GM in the snapshot so the GM's derived `encountered.grey` is read against refreshed sight state on both sides.
**Group evidence (#36.2):** `tools/groups.mjs` evidence entries now name the exact test title (with `${...}` for per-case titles), a minimum assertion count and the calls the body must keep. `tools/groups.test.mjs` checks the declaration is unique and its body still holds them. `tools/evidence.mjs` (new, last step of `tools/test.sh`) parses the Node spec-reporter output in `results/node-test.log` and fails unless every registered evidence test actually ran and passed; a skipped or never-run registration fails. Negative control: hollowing out the `key.replace` test to its title fails the new check (0 assertions, 6 required) while the old title-substring check still reported evidence present; run against the stale 107-test log the gate reports the four never-ran evidence tests.
**Evidence trail:** `devbox run test` exit 0 (Nim suites + 149 Node tests, 16 evidence tests verified); `devbox run mutation` exit 0 (control + all 78 mutations, s1-s7 included). `docs/TESTING.md` §13 updated to describe the executable evidence gate and the corrected counts.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Two test-quality gaps let real regressions pass the suite. (1) The restart test's "before" snapshot is taken from a server that has already been restarted, so it compares restart-to-restart instead of as-built-to-restart: any field silently dropped on the first restart is already missing from both sides and the assertion holds. (2)
groups.mjsproves a group by looking for a test title substring, so a test hollowed out to the named title with no assertions (or with the assertions deleted) still counts as evidence.Where
tools/restart.test.mjs:173-196—restartAndComparestarts the server and takesbeforefrom that instance, then restarts and comparesafterto it. The as-built state (fresh DB, CRUD applied, before any restart) is never the baseline.tools/groups.mjs—GROUPSentries are[file, titleSubstring];tools/groups.test.mjsonly checks the title exists in the file. There is no link between the evidence claim and the assertions inside the test.Failure scenario
A persistence bug drops
walls(or a token property bucket) on the first load after write. The restart test starts the server, sees the drop already applied, snapshots that, restarts, sees the same drop, and passes: the group is marked done on a test that cannot fail for the class of bug it exists to catch. Separately, someone trims a test body to just its title (or comments out half its assertions) while keeping the name; the group map still reports evidence present, and the finish line (#25) records a group as proven on an empty test.Confidence
High — both are structural in the current helpers, and the restart ordering is visible at the cited lines.
Fix direction
Take the restart baseline from the as-built session: snapshot immediately after the CRUD, on the first server instance, then restart and compare that baseline — both before and after the kill variants. For the group map, require each evidence entry to carry something the harness can verify beyond the title (a declared minimum assertion count, or a marker the test must execute), so an emptied test fails the group check.
Acceptance
groups.mjs/groups.test.mjsfail when an evidence test's body is hollowed out (title kept, assertions removed), demonstrated by a temporary mutation of one test during review.Related
Agent Brief
Category: bug
Summary: the restart group must compare post-restart state against the state as built (not against a second restart), and the accept-group checklist must verify that each evidence test actually ran and asserted
Current behavior:
Two gaps let the acceptance suite pass on work it does not prove.
Desired behavior:
A required runtime marker emitted by the evidence test and demanded by the checker, or a declared minimum assertion count enforced by a wrapper around the assertion library, are both acceptable shapes; pick one, apply it uniformly, and state the choice.
Key interfaces:
Acceptance criteria:
devbox run testequivalent: Nim tests then the Node harnesses) is green, and no test's own assertions were weakened to make the new checks pass.Out of scope:
Fixed in
a11782f(plus1f11779), pushed to main.Restart baseline (#36.1):
tools/restart.test.mjsnow snapshots the as-built world on the first server instance (after the CRUD, before the signal) and compares that baseline with the post-restart resync, for both SIGTERM and SIGKILL. SIGKILL now kills the server that holds the as-built state. Negative control: plantingp[pbGm] = newJObject()inserver/tokens.nim(a gm prop bucket dropped on first load) fails the new test (the GM resync after the restart is identical) while the old restart-to-restart test passed with the same planted regression. Players connect before the GM in the snapshot so the GM's derivedencountered.greyis read against refreshed sight state on both sides.Group evidence (#36.2):
tools/groups.mjsevidence entries now name the exact test title (with${...}for per-case titles), a minimum assertion count and the calls the body must keep.tools/groups.test.mjschecks the declaration is unique and its body still holds them.tools/evidence.mjs(new, last step oftools/test.sh) parses the Node spec-reporter output inresults/node-test.logand fails unless every registered evidence test actually ran and passed; a skipped or never-run registration fails. Negative control: hollowing out thekey.replacetest to its title fails the new check (0 assertions, 6 required) while the old title-substring check still reported evidence present; run against the stale 107-test log the gate reports the four never-ran evidence tests.Evidence trail:
devbox run testexit 0 (Nim suites + 149 Node tests, 16 evidence tests verified);devbox run mutationexit 0 (control + all 78 mutations, s1-s7 included).docs/TESTING.md§13 updated to describe the executable evidence gate and the corrected counts.