diff --git a/docs/TESTING.md b/docs/TESTING.md index fcd1ad8..4e48f58 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md @@ -602,8 +602,13 @@ from the prototype, what was missing, what the M3 build added, and the tools it - **M3 accept result.** Measured 2026-11-20: `devbox run test` exit 0 (Nim suite all pass; 142 Node harness tests) and `devbox run mutation` exit 0 (control passes, all 73 mutations fail at least one - expected test). The nine groups map to their proving tests in `tools/groups.mjs`; - `tools/groups.test.mjs` fails if a group or its named evidence test disappears. + expected test). The nine groups map to their proving tests in `tools/groups.mjs`. Evidence is + executable, not a title substring (#36): `tools/groups.test.mjs` pins each test's exact title, a + minimum assertion count and the calls its body must keep, and the last step of `devbox run test` + (`tools/evidence.mjs`) parses the reporter output in `results/node-test.log` and fails unless every + registered test ran and passed. The restart group takes its baseline from the as-built state on the + first server instance, before any restart, not from a state that has already been through one + (#36). - **M4 gate harness.** (a) automated headless-Chromium test with mobile emulation (viewport, dpr, CPU and network throttle) against the real server path (nginx HTTP/2 + caching); (b) one manual run on the owner's 5-year-old Android phone. The 2026-11-08 prototype phone run is evidence, not the gate diff --git a/results/leak-A.log b/results/leak-A.log index 73fdd80..b891eee 100644 --- a/results/leak-A.log +++ b/results/leak-A.log @@ -1 +1 @@ -leakcheck: subject A (player 2), 55 groups, 2 tokens in view at the end, 10 withdrawals, 1338 explored cells, 0 failures +leakcheck: subject A (player 2), 62 groups, 3 tokens in view at the end, 12 withdrawals, 1733 explored cells, 0 failures diff --git a/results/leak-B.log b/results/leak-B.log index 83f7169..0b360be 100644 --- a/results/leak-B.log +++ b/results/leak-B.log @@ -1 +1 @@ -leakcheck: subject B (player 3), 55 groups, 2 tokens in view at the end, 6 withdrawals, 1767 explored cells, 0 failures +leakcheck: subject B (player 3), 62 groups, 2 tokens in view at the end, 6 withdrawals, 1682 explored cells, 0 failures diff --git a/results/mutation.log b/results/mutation.log index 5385f96..7e8bb23 100644 --- a/results/mutation.log +++ b/results/mutation.log @@ -88,6 +88,16 @@ [OK] a failing step rolls back: no DDL, no history, version unchanged [OK] a slice-2 DB migrates on: the scene is seeded, players and keys survive [OK] a schema-4 DB migrates on: explored_chunk and entity_status appear, the world survives + [OK] every impossible wall row is rejected by the database + [OK] a failing step 8 rolls back the rebuild, the history row and the version + [OK] a malformed props_gm refuses step 8 and leaves the schema-7 DB untouched + [OK] rebuilds nodes and string payloads + [OK] mutating the source leaves the copy alone + [OK] absent (nil) stays nil and null stays null + [OK] does not share the payload + [OK] empty strings stay empty + [OK] three independent buckets, keys and values included + [OK] parseFlags returns the caller's node by reference, not a copy [OK] the chunk bitmap layout is pinned [OK] one chunk covers 64x64 cells [OK] a dirty chunk carries the whole chunk, not just the new cells @@ -112,6 +122,9 @@ [OK] T-junction: no leak and correct shadow [OK] pillar mid-room casts a shadow, sides visible [OK] closed door blocks, open door passes + [OK] one-way: sight_dir names the blind side (left is the (-dy, dx) normal) + [OK] one-way: flipping the direction swaps the blind side and moves nothing + [OK] one-way: an open door blocks neither side whatever the direction says [OK] token exactly at wall endpoint [OK] token at endpoint of free-standing wall sees along it [OK] long thin corridor @@ -146,6 +159,11 @@ [OK] a value cannot forge a second log line [OK] messages below the level are dropped [OK] no fields is still one valid line + [OK] a marked window seen by any part of its extent mints one anchor marker + [OK] an untouched marker survives a refresh: it is memory, not current sight + [OK] a geometry change retracts the marker and a re-earn gets a fresh id + [OK] a placement change retracts too; height and label never do + [OK] a solid wall with the switch on mints nothing; clearing the switch retracts [OK] crossing blocked, parallel ok [OK] grazing an endpoint is blocked [OK] no leak through shared vertex @@ -254,7 +272,7 @@ [OK] the uniform move refusal carries pos and no code (5.5, T9) [OK] error and closing frames have no reqId [OK] the close-code table of 6.5 is the app range plus 1008 - [OK] one wall carries id, a, b, kind, open and flags in the 6.1 shape + [OK] one wall carries the typed record plus the derived kind in the proto-2 shape [OK] `walls` is the full list plus the scene, `wall` is one upsert, `wall_gone` an id [OK] the fan-out frames carry no n: the sender stamps it per recipient [OK] exactly n walls, deterministic per seed, seeds differ @@ -350,19 +368,26 @@ [OK] the migration seeds scene 1 with the v1 defaults, no walls, next_wall_id 1 [OK] an unknown scene id is not there (the wire answers not-found) [OK] a point is exactly two finite numbers, ints included - [OK] kind, open and flags accept only their own shape + [OK] position, sight_dir and flags accept only their own shape + [OK] kind is derived from the switches, never stored (5.8) [OK] undefined and null are the same as an absent field [OK] adds count from 1 and the counter advances [OK] a removal never renumbers and the next add never reuses the id [OK] the id counter survives a reload, even when the newest wall was removed [OK] add, update, door set and remove round-trip through a reload + [OK] door.set refuses to open a secret or locked door, closing either is allowed (#56) + [OK] nullable height and label use SQL literals and round-trip as none, not 0 or '' [OK] authoring runs with synchronous=FULL and leaves NORMAL behind (Q12) [OK] a failing write leaves memory and the pragma alone [OK] walls load in id order whatever the insertion order was [OK] a zero-length wall is invalid and writes nothing [OK] both endpoints must be inside [0,w] x [0,h]; the border itself is allowed + [OK] presets expand to switches only through the one resolve path (#55) + [OK] the switch-set invariants reject door-only settings on a non-door (#55) + [OK] storable is the last gate: a secret or locked non-door is refused + [OK] a label is 1..64 code points, trimmed and free of control characters (#55) [OK] a wall is never open: the stored row normalizes it - [OK] update keeps the row's id and open flag unless the kind changes + [OK] update keeps the row's id and open flag unless the door switch is cleared [OK] dot patching: only the given fields change [OK] unknown ids are not-found, wrong kinds are their own outcome [OK] the first wall of a fresh scene is id 1, not 0 @@ -375,7 +400,7 @@ control: exit=0 expected_failed=0 ok ## a: remove the +-RayEps rays # diff server/geometry.nim -> mutated copy: -# 62,63d61 +# 105,106d104 # < angles.add ang - RayEps # < angles.add ang + RayEps [OK] open space is a circle @@ -391,6 +416,9 @@ control: exit=0 expected_failed=0 ok [OK] T-junction: no leak and correct shadow [OK] pillar mid-room casts a shadow, sides visible [OK] closed door blocks, open door passes + [OK] one-way: sight_dir names the blind side (left is the (-dy, dx) normal) + [OK] one-way: flipping the direction swaps the blind side and moves nothing + [OK] one-way: an open door blocks neither side whatever the direction says [OK] token exactly at wall endpoint [OK] token at endpoint of free-standing wall sees along it [OK] long thin corridor @@ -411,14 +439,14 @@ control: exit=0 expected_failed=0 ok [FAILED] prototype scene, all tokens, doors closed and opened [FAILED] random wall fields, cell 32 and 25 [OK] negative control: the oracle notices a missing and an invented cell -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/a/w/tests/tgeometry' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/a/w/tests/tgeometry' # test exit=1; expected tests failed: 1 [FAILED] rays nudged past a corner: area just beyond a wall end is visible a: exit=1 expected_failed=1 ok ## b: upper segment end exclusive # diff server/geometry.nim -> mutated copy: -# 39c39 +# 78c78 # < if t > Eps and u >= -Eps and u <= 1 + Eps: t else: Inf # --- # > if t > Eps and u >= -Eps and u < 1 - Eps: t else: Inf @@ -435,6 +463,9 @@ a: exit=1 expected_failed=1 ok [OK] T-junction: no leak and correct shadow [OK] pillar mid-room casts a shadow, sides visible [OK] closed door blocks, open door passes + [OK] one-way: sight_dir names the blind side (left is the (-dy, dx) normal) + [OK] one-way: flipping the direction swaps the blind side and moves nothing + [OK] one-way: an open door blocks neither side whatever the direction says [OK] token exactly at wall endpoint [OK] token at endpoint of free-standing wall sees along it [OK] long thin corridor @@ -455,7 +486,7 @@ a: exit=1 expected_failed=1 ok [OK] prototype scene, all tokens, doors closed and opened [OK] random wall fields, cell 32 and 25 [OK] negative control: the oracle notices a missing and an invented cell -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/b/w/tests/tgeometry' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/b/w/tests/tgeometry' # test exit=1; expected tests failed: 2 [FAILED] '<' apex: ray through the shared tip must not leak [FAILED] every segment endpoint is a polygon vertex (lower and upper end inclusive) @@ -463,7 +494,7 @@ Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/b/w/tests/tg b: exit=1 expected_failed=2 ok ## c: lower segment end exclusive # diff server/geometry.nim -> mutated copy: -# 39c39 +# 78c78 # < if t > Eps and u >= -Eps and u <= 1 + Eps: t else: Inf # --- # > if t > Eps and u > Eps and u <= 1 + Eps: t else: Inf @@ -480,6 +511,9 @@ b: exit=1 expected_failed=2 ok [OK] T-junction: no leak and correct shadow [OK] pillar mid-room casts a shadow, sides visible [OK] closed door blocks, open door passes + [OK] one-way: sight_dir names the blind side (left is the (-dy, dx) normal) + [OK] one-way: flipping the direction swaps the blind side and moves nothing + [OK] one-way: an open door blocks neither side whatever the direction says [OK] token exactly at wall endpoint [OK] token at endpoint of free-standing wall sees along it [OK] long thin corridor @@ -500,7 +534,7 @@ b: exit=1 expected_failed=2 ok [FAILED] prototype scene, all tokens, doors closed and opened [OK] random wall fields, cell 32 and 25 [OK] negative control: the oracle notices a missing and an invented cell -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/c/w/tests/tgeometry' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/c/w/tests/tgeometry' # test exit=1; expected tests failed: 2 [FAILED] '<' apex: ray through the shared tip must not leak [FAILED] every segment endpoint is a polygon vertex (lower and upper end inclusive) @@ -525,6 +559,9 @@ c: exit=1 expected_failed=2 ok [OK] T-junction: no leak and correct shadow [OK] pillar mid-room casts a shadow, sides visible [OK] closed door blocks, open door passes + [OK] one-way: sight_dir names the blind side (left is the (-dy, dx) normal) + [OK] one-way: flipping the direction swaps the blind side and moves nothing + [OK] one-way: an open door blocks neither side whatever the direction says [OK] token exactly at wall endpoint [OK] token at endpoint of free-standing wall sees along it [OK] long thin corridor @@ -545,7 +582,7 @@ c: exit=1 expected_failed=2 ok [OK] prototype scene, all tokens, doors closed and opened [OK] random wall fields, cell 32 and 25 [OK] negative control: the oracle notices a missing and an invented cell -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/d1/w/tests/tgeometry' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/d1/w/tests/tgeometry' # test exit=1; expected tests failed: 1 [FAILED] shared vertex: both arms required (mutation d1/d2) @@ -569,6 +606,9 @@ d1: exit=1 expected_failed=1 ok [OK] T-junction: no leak and correct shadow [OK] pillar mid-room casts a shadow, sides visible [OK] closed door blocks, open door passes + [OK] one-way: sight_dir names the blind side (left is the (-dy, dx) normal) + [OK] one-way: flipping the direction swaps the blind side and moves nothing + [OK] one-way: an open door blocks neither side whatever the direction says [OK] token exactly at wall endpoint [OK] token at endpoint of free-standing wall sees along it [OK] long thin corridor @@ -589,33 +629,40 @@ d1: exit=1 expected_failed=1 ok [OK] prototype scene, all tokens, doors closed and opened [OK] random wall fields, cell 32 and 25 [OK] negative control: the oracle notices a missing and an invented cell -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/d2/w/tests/tgeometry' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/d2/w/tests/tgeometry' # test exit=1; expected tests failed: 1 [FAILED] shared vertex: both arms required (mutation d1/d2) d2: exit=1 expected_failed=1 ok ## d3: scene.set accepts a patch with no field # diff server/world.nim -> mutated copy: -# 179c179 +# 349c349 # < if not any: return none(ScenePatch) # --- # > discard [OK] the migration seeds scene 1 with the v1 defaults, no walls, next_wall_id 1 [OK] an unknown scene id is not there (the wire answers not-found) [OK] a point is exactly two finite numbers, ints included - [OK] kind, open and flags accept only their own shape + [OK] position, sight_dir and flags accept only their own shape + [OK] kind is derived from the switches, never stored (5.8) [OK] undefined and null are the same as an absent field [OK] adds count from 1 and the counter advances [OK] a removal never renumbers and the next add never reuses the id [OK] the id counter survives a reload, even when the newest wall was removed [OK] add, update, door set and remove round-trip through a reload + [OK] door.set refuses to open a secret or locked door, closing either is allowed (#56) + [OK] nullable height and label use SQL literals and round-trip as none, not 0 or '' [OK] authoring runs with synchronous=FULL and leaves NORMAL behind (Q12) [OK] a failing write leaves memory and the pragma alone [OK] walls load in id order whatever the insertion order was [OK] a zero-length wall is invalid and writes nothing [OK] both endpoints must be inside [0,w] x [0,h]; the border itself is allowed + [OK] presets expand to switches only through the one resolve path (#55) + [OK] the switch-set invariants reject door-only settings on a non-door (#55) + [OK] storable is the last gate: a secret or locked non-door is refused + [OK] a label is 1..64 code points, trimmed and free of control characters (#55) [OK] a wall is never open: the stored row normalizes it - [OK] update keeps the row's id and open flag unless the kind changes + [OK] update keeps the row's id and open flag unless the door switch is cleared [OK] dot patching: only the given fields change [OK] unknown ids are not-found, wrong kinds are their own outcome [OK] the first wall of a fresh scene is id 1, not 0 @@ -623,14 +670,14 @@ d2: exit=1 expected_failed=1 ok [FAILED] one field is enough; a patch with none is invalid [FAILED] the non-settable columns are unknown fields: alone they leave no patch field [OK] field shapes: text by the 6.5 rule, numbers finite, extra an object -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/d3/w/tests/tworld' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/d3/w/tests/tworld' # test exit=1; expected tests failed: 1 [FAILED] one field is enough; a patch with none is invalid d3: exit=1 expected_failed=1 ok ## e: cellsTouched without fill spans # diff server/geometry.nim -> mutated copy: -# 138d137 +# 181d180 # < for k in countup(0, xs[row].len - 2, 2): mark(row, xs[row][k], xs[row][k + 1]) [OK] open space is a circle [OK] wall blocks @@ -645,6 +692,9 @@ d3: exit=1 expected_failed=1 ok [OK] T-junction: no leak and correct shadow [OK] pillar mid-room casts a shadow, sides visible [OK] closed door blocks, open door passes + [OK] one-way: sight_dir names the blind side (left is the (-dy, dx) normal) + [OK] one-way: flipping the direction swaps the blind side and moves nothing + [OK] one-way: an open door blocks neither side whatever the direction says [OK] token exactly at wall endpoint [OK] token at endpoint of free-standing wall sees along it [OK] long thin corridor @@ -665,7 +715,7 @@ d3: exit=1 expected_failed=1 ok [FAILED] prototype scene, all tokens, doors closed and opened [FAILED] random wall fields, cell 32 and 25 [FAILED] negative control: the oracle notices a missing and an invented cell -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/e/w/tests/tgeometry' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/e/w/tests/tgeometry' # test exit=1; expected tests failed: 4 [FAILED] random visibility polygons: identical cell lists [FAILED] random simple polygons (star-shaped, concave): identical cell lists @@ -706,7 +756,7 @@ e: exit=1 expected_failed=4 ok [FAILED] a character rename follows the snapshots of everyone who met it [OK] player.remove hands the player's characters to the GM (DESIGN 3.2) [OK] a character still figured by a token is in use (6.5) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/e1/w/tests/tcharacters' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/e1/w/tests/tcharacters' # test exit=1; expected tests failed: 1 [FAILED] a link change moves the snapshot to the character's names, link and knowledge (#29) @@ -744,7 +794,7 @@ e1: exit=1 expected_failed=1 ok [FAILED] a character rename follows the snapshots of everyone who met it [OK] player.remove hands the player's characters to the GM (DESIGN 3.2) [OK] a character still figured by a token is in use (6.5) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/e2/w/tests/tcharacters' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/e2/w/tests/tcharacters' # test exit=1; expected tests failed: 1 [FAILED] a character rename rewrites the live snapshots and the rows alike (#30, #27) @@ -782,7 +832,7 @@ e2: exit=1 expected_failed=1 ok [OK] a character rename follows the snapshots of everyone who met it [OK] player.remove hands the player's characters to the GM (DESIGN 3.2) [OK] a character still figured by a token is in use (6.5) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/e3/w/tests/tcharacters' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/e3/w/tests/tcharacters' # test exit=1; expected tests failed: 1 [FAILED] linking through a patch hands the names over (#29) @@ -859,7 +909,7 @@ e3: exit=1 expected_failed=1 ok [OK] a GM-sourced lock refuses player moves without touching the walls entries [OK] a wall added over a GM-locked token only adds the walls entry [OK] the GM clear of the walls entries leaves a GM-sourced entry alone (no rule runs) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/f/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/f/w/tests/tmoverules' # test exit=1; expected tests failed: 1 [FAILED] overlapping 10 px off: may leave away from the wall, not cross it, not stay overlapped @@ -936,7 +986,7 @@ f: exit=1 expected_failed=1 ok [OK] a GM-sourced lock refuses player moves without touching the walls entries [OK] a wall added over a GM-locked token only adds the walls entry [OK] the GM clear of the walls entries leaves a GM-sourced entry alone (no rule runs) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/g/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/g/w/tests/tmoverules' # test exit=1; expected tests failed: 1 [FAILED] GM: ignores walls, step cap and the lock; bounds still apply @@ -1013,7 +1063,7 @@ g: exit=1 expected_failed=1 ok [OK] a GM-sourced lock refuses player moves without touching the walls entries [OK] a wall added over a GM-locked token only adds the walls entry [OK] the GM clear of the walls entries leaves a GM-sourced entry alone (no rule runs) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/h/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/h/w/tests/tmoverules' # test exit=1; expected tests failed: 2 [FAILED] corner clipping: path passes the wall end closer than r though both ends are clear [FAILED] leg of the path inside r of a non-start wall blocks even if start and end are clear @@ -1089,13 +1139,13 @@ h: exit=1 expected_failed=2 ok [OK] a GM-sourced lock refuses player moves without touching the walls entries [OK] a wall added over a GM-locked token only adds the walls entry [OK] the GM clear of the walls entries leaves a GM-sourced entry alone (no rule runs) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/i/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/i/w/tests/tmoverules' [FAILED] P1: probes longer than the cap get one fixed nack regardless of the scene [OK] P2: scenes differing only beyond the bound give identical replies over 3000 probes [OK] P3 negative control: a wall inside the disc IS visible through replies (the harness can fail) [OK] P4: probing cannot unlock or move a locked token [OK] doors beyond the bound: opening or closing them changes no reply -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/i/w/tests/tprobing' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/i/w/tests/tprobing' # test exit=1; expected tests failed: 2 [FAILED] step cap = scene default without vision, token vision radius with it [FAILED] P1: probes longer than the cap get one fixed nack regardless of the scene @@ -1173,7 +1223,7 @@ i: exit=1 expected_failed=2 ok [OK] a GM-sourced lock refuses player moves without touching the walls entries [FAILED] a wall added over a GM-locked token only adds the walls entry [OK] the GM clear of the walls entries leaves a GM-sourced entry alone (no rule runs) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/j/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/j/w/tests/tmoverules' # test exit=1; expected tests failed: 2 [FAILED] wall added within r of the circle (centre not on it) sets stuck; exactly r does not [FAILED] Q14: a door closed 10 px from a token: pushed to its side, clear by r, not blocked; GM-owned too @@ -1251,7 +1301,7 @@ j: exit=1 expected_failed=2 ok [OK] a GM-sourced lock refuses player moves without touching the walls entries [OK] a wall added over a GM-locked token only adds the walls entry [OK] the GM clear of the walls entries leaves a GM-sourced entry alone (no rule runs) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/k/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/k/w/tests/tmoverules' # test exit=1; expected tests failed: 2 [FAILED] KEEP: opening one door / removing one wall while another overlaps -> still blocked; last one frees [FAILED] KEEP: wall update away from one of two overlapping walls keeps blocked @@ -1327,7 +1377,7 @@ k: exit=1 expected_failed=2 ok [OK] a GM-sourced lock refuses player moves without touching the walls entries [OK] a wall added over a GM-locked token only adds the walls entry [OK] the GM clear of the walls entries leaves a GM-sourced entry alone (no rule runs) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/l/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/l/w/tests/tmoverules' # test exit=1; expected tests failed: 3 [FAILED] GM moves a stuck token clear -> free; to another wall-overlapping spot -> still blocked [FAILED] GM drops a token inside a wall -> blocked; a door counts only while closed @@ -1406,7 +1456,7 @@ l: exit=1 expected_failed=3 ok [OK] a GM-sourced lock refuses player moves without touching the walls entries [OK] a wall added over a GM-locked token only adds the walls entry [OK] the GM clear of the walls entries leaves a GM-sourced entry alone (no rule runs) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/m/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/m/w/tests/tmoverules' # test exit=1; expected tests failed: 3 [FAILED] Q14: a door closed 10 px from a token: pushed to its side, clear by r, not blocked; GM-owned too [FAILED] push: centre on the door line -> side of the previous position; no history -> left of a->b @@ -1485,7 +1535,7 @@ m: exit=1 expected_failed=3 ok [OK] a GM-sourced lock refuses player moves without touching the walls entries [OK] a wall added over a GM-locked token only adds the walls entry [OK] the GM clear of the walls entries leaves a GM-sourced entry alone (no rule runs) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/n/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/n/w/tests/tmoverules' # test exit=1; expected tests failed: 2 [FAILED] push: one side blocked by another wall -> the other side; out of bounds -> the other side [FAILED] push: both sides invalid -> squeezed in place; door open -> still squeezed (KEEP); GM can move it @@ -1497,7 +1547,7 @@ n: exit=1 expected_failed=2 ok # < side = if t.hasPrev: dot(t.prev - w.a, n) else: 0.0 # --- # > side = 0.0 -# 330c330 +# 333c333 # < var side = if t.hasPrev: dot(t.prev - w.a, n) else: 0.0 # --- # > var side = 0.0 @@ -1567,14 +1617,14 @@ n: exit=1 expected_failed=2 ok [OK] a GM-sourced lock refuses player moves without touching the walls entries [OK] a wall added over a GM-locked token only adds the walls entry [OK] the GM clear of the walls entries leaves a GM-sourced entry alone (no rule runs) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/o/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/o/w/tests/tmoverules' # test exit=1; expected tests failed: 1 [FAILED] push: centre on the door line -> side of the previous position; no history -> left of a->b o: exit=1 expected_failed=1 ok ## p: token bucket never refills # diff server/protocol.nim -> mutated copy: -# 244d243 +# 275d274 # < r.tokens = min(r.burst, r.tokens + float(elapsed) * r.perSecond / 1000.0) [OK] a well-formed intent parses and keeps its reqId and node [OK] reqId boundaries: 0 and 2^31-1 pass, 2^31 and -1 are malformed @@ -1598,17 +1648,17 @@ o: exit=1 expected_failed=1 ok [OK] the uniform move refusal carries pos and no code (5.5, T9) [OK] error and closing frames have no reqId [OK] the close-code table of 6.5 is the app range plus 1008 - [OK] one wall carries id, a, b, kind, open and flags in the 6.1 shape + [OK] one wall carries the typed record plus the derived kind in the proto-2 shape [OK] `walls` is the full list plus the scene, `wall` is one upsert, `wall_gone` an id [OK] the fan-out frames carry no n: the sender stamps it per recipient -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/p/w/tests/tprotocol' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/p/w/tests/tprotocol' # test exit=1; expected tests failed: 1 [FAILED] refill is continuous at 30/s, capped at the burst p: exit=1 expected_failed=1 ok ## q: reqId upper bound dropped # diff server/protocol.nim -> mutated copy: -# 139c139 +# 141c141 # < if reqId < 0 or reqId > MaxReqId: return # --- # > if reqId < 0: return @@ -1634,17 +1684,17 @@ p: exit=1 expected_failed=1 ok [OK] the uniform move refusal carries pos and no code (5.5, T9) [OK] error and closing frames have no reqId [OK] the close-code table of 6.5 is the app range plus 1008 - [OK] one wall carries id, a, b, kind, open and flags in the 6.1 shape + [OK] one wall carries the typed record plus the derived kind in the proto-2 shape [OK] `walls` is the full list plus the scene, `wall` is one upsert, `wall_gone` an id [OK] the fan-out frames carry no n: the sender stamps it per recipient -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/q/w/tests/tprotocol' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/q/w/tests/tprotocol' # test exit=1; expected tests failed: 1 [FAILED] reqId boundaries: 0 and 2^31-1 pass, 2^31 and -1 are malformed q: exit=1 expected_failed=1 ok ## r: malformed flood never fires # diff server/protocol.nim -> mutated copy: -# 265c265 +# 296c296 # < result = f.count >= MalformedFloodLimit and (nowMs - oldest) <= MalformedFloodWindowMs # --- # > result = f.count > MalformedFloodLimit and (nowMs - oldest) <= MalformedFloodWindowMs @@ -1670,10 +1720,10 @@ q: exit=1 expected_failed=1 ok [OK] the uniform move refusal carries pos and no code (5.5, T9) [OK] error and closing frames have no reqId [OK] the close-code table of 6.5 is the app range plus 1008 - [OK] one wall carries id, a, b, kind, open and flags in the 6.1 shape + [OK] one wall carries the typed record plus the derived kind in the proto-2 shape [OK] `walls` is the full list plus the scene, `wall` is one upsert, `wall_gone` an id [OK] the fan-out frames carry no n: the sender stamps it per recipient -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/r/w/tests/tprotocol' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/r/w/tests/tprotocol' # test exit=1; expected tests failed: 1 [FAILED] nine malformed frames are tolerated, the tenth closes @@ -1699,21 +1749,22 @@ r: exit=1 expected_failed=1 ok [OK] the malformed window is per connection and fires on the tenth frame [OK] a Pong is recorded on the right connection [OK] a snapshot hands out every live connection without holding the lock afterwards -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/s/w/tests/tconns' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/s/w/tests/tconns' # test exit=1; expected tests failed: 1 [FAILED] the frame counter starts at 1 on each connection and is never global s: exit=1 expected_failed=1 ok ## t: wall removal renumbers next_wall_id # diff server/world.nim -> mutated copy: -# 306c306 +# 521c521 # < sc.walls.delete idx.get # --- # > sc.walls.delete idx.get; sc.nextWallId = sc.walls.len + 1 [OK] the migration seeds scene 1 with the v1 defaults, no walls, next_wall_id 1 [OK] an unknown scene id is not there (the wire answers not-found) [OK] a point is exactly two finite numbers, ints included - [OK] kind, open and flags accept only their own shape + [OK] position, sight_dir and flags accept only their own shape + [OK] kind is derived from the switches, never stored (5.8) [OK] undefined and null are the same as an absent field [OK] adds count from 1 and the counter advances /home/davide/Projects/GDR/FFF_vtt/.devbox/nimble/pkgs2/db_connector-0.1.0-4f2e67d0e4b61af9ac5575509305660b473f01a4/db_connector/db_sqlite.nim(211) dbError @@ -1721,6 +1772,8 @@ s: exit=1 expected_failed=1 ok [FAILED] a removal never renumbers and the next add never reuses the id [OK] the id counter survives a reload, even when the newest wall was removed [OK] add, update, door set and remove round-trip through a reload + [OK] door.set refuses to open a secret or locked door, closing either is allowed (#56) + [OK] nullable height and label use SQL literals and round-trip as none, not 0 or '' [OK] authoring runs with synchronous=FULL and leaves NORMAL behind (Q12) [OK] a failing write leaves memory and the pragma alone /home/davide/Projects/GDR/FFF_vtt/.devbox/nimble/pkgs2/db_connector-0.1.0-4f2e67d0e4b61af9ac5575509305660b473f01a4/db_connector/db_sqlite.nim(211) dbError @@ -1728,8 +1781,12 @@ s: exit=1 expected_failed=1 ok [FAILED] walls load in id order whatever the insertion order was [OK] a zero-length wall is invalid and writes nothing [OK] both endpoints must be inside [0,w] x [0,h]; the border itself is allowed + [OK] presets expand to switches only through the one resolve path (#55) + [OK] the switch-set invariants reject door-only settings on a non-door (#55) + [OK] storable is the last gate: a secret or locked non-door is refused + [OK] a label is 1..64 code points, trimmed and free of control characters (#55) [OK] a wall is never open: the stored row normalizes it - [OK] update keeps the row's id and open flag unless the kind changes + [OK] update keeps the row's id and open flag unless the door switch is cleared [OK] dot patching: only the given fields change [OK] unknown ids are not-found, wrong kinds are their own outcome [OK] the first wall of a fresh scene is id 1, not 0 @@ -1737,21 +1794,22 @@ s: exit=1 expected_failed=1 ok [OK] one field is enough; a patch with none is invalid [OK] the non-settable columns are unknown fields: alone they leave no patch field [OK] field shapes: text by the 6.5 rule, numbers finite, extra an object -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/t/w/tests/tworld' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/t/w/tests/tworld' # test exit=1; expected tests failed: 1 [FAILED] a removal never renumbers and the next add never reuses the id t: exit=1 expected_failed=1 ok ## u: the id counter is not loaded from the DB # diff server/world.nim -> mutated copy: -# 359c359 +# 588c588 # < nextWallId: parseInt(row[10]), # --- # > nextWallId: 1, [OK] the migration seeds scene 1 with the v1 defaults, no walls, next_wall_id 1 [OK] an unknown scene id is not there (the wire answers not-found) [OK] a point is exactly two finite numbers, ints included - [OK] kind, open and flags accept only their own shape + [OK] position, sight_dir and flags accept only their own shape + [OK] kind is derived from the switches, never stored (5.8) [OK] undefined and null are the same as an absent field [OK] adds count from 1 and the counter advances [OK] a removal never renumbers and the next add never reuses the id @@ -1759,13 +1817,19 @@ t: exit=1 expected_failed=1 ok Unhandled exception: UNIQUE constraint failed: wall.scene_id, wall.id [DbError] [FAILED] the id counter survives a reload, even when the newest wall was removed [FAILED] add, update, door set and remove round-trip through a reload + [OK] door.set refuses to open a secret or locked door, closing either is allowed (#56) + [OK] nullable height and label use SQL literals and round-trip as none, not 0 or '' [OK] authoring runs with synchronous=FULL and leaves NORMAL behind (Q12) [OK] a failing write leaves memory and the pragma alone [OK] walls load in id order whatever the insertion order was [OK] a zero-length wall is invalid and writes nothing [OK] both endpoints must be inside [0,w] x [0,h]; the border itself is allowed + [OK] presets expand to switches only through the one resolve path (#55) + [OK] the switch-set invariants reject door-only settings on a non-door (#55) + [OK] storable is the last gate: a secret or locked non-door is refused + [OK] a label is 1..64 code points, trimmed and free of control characters (#55) [OK] a wall is never open: the stored row normalizes it - [OK] update keeps the row's id and open flag unless the kind changes + [OK] update keeps the row's id and open flag unless the door switch is cleared [OK] dot patching: only the given fields change [OK] unknown ids are not-found, wrong kinds are their own outcome [OK] the first wall of a fresh scene is id 1, not 0 @@ -1773,19 +1837,20 @@ t: exit=1 expected_failed=1 ok [OK] one field is enough; a patch with none is invalid [OK] the non-settable columns are unknown fields: alone they leave no patch field [OK] field shapes: text by the 6.5 rule, numbers finite, extra an object -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/u/w/tests/tworld' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/u/w/tests/tworld' # test exit=1; expected tests failed: 1 [FAILED] the id counter survives a reload, even when the newest wall was removed u: exit=1 expected_failed=1 ok ## v: the id counter is never written to the DB # diff server/world.nim -> mutated copy: -# 283d282 +# 492d491 # < db.exec(sql"UPDATE scene SET next_wall_id = ? WHERE id = ?", stored.id + 1, sc.id) [OK] the migration seeds scene 1 with the v1 defaults, no walls, next_wall_id 1 [OK] an unknown scene id is not there (the wire answers not-found) [OK] a point is exactly two finite numbers, ints included - [OK] kind, open and flags accept only their own shape + [OK] position, sight_dir and flags accept only their own shape + [OK] kind is derived from the switches, never stored (5.8) [OK] undefined and null are the same as an absent field [OK] adds count from 1 and the counter advances [OK] a removal never renumbers and the next add never reuses the id @@ -1793,13 +1858,19 @@ u: exit=1 expected_failed=1 ok Unhandled exception: UNIQUE constraint failed: wall.scene_id, wall.id [DbError] [FAILED] the id counter survives a reload, even when the newest wall was removed [FAILED] add, update, door set and remove round-trip through a reload + [OK] door.set refuses to open a secret or locked door, closing either is allowed (#56) + [OK] nullable height and label use SQL literals and round-trip as none, not 0 or '' [OK] authoring runs with synchronous=FULL and leaves NORMAL behind (Q12) [OK] a failing write leaves memory and the pragma alone [OK] walls load in id order whatever the insertion order was [OK] a zero-length wall is invalid and writes nothing [OK] both endpoints must be inside [0,w] x [0,h]; the border itself is allowed + [OK] presets expand to switches only through the one resolve path (#55) + [OK] the switch-set invariants reject door-only settings on a non-door (#55) + [OK] storable is the last gate: a secret or locked non-door is refused + [OK] a label is 1..64 code points, trimmed and free of control characters (#55) [OK] a wall is never open: the stored row normalizes it - [OK] update keeps the row's id and open flag unless the kind changes + [OK] update keeps the row's id and open flag unless the door switch is cleared [OK] dot patching: only the given fields change [OK] unknown ids are not-found, wrong kinds are their own outcome [OK] the first wall of a fresh scene is id 1, not 0 @@ -1807,33 +1878,44 @@ u: exit=1 expected_failed=1 ok [OK] one field is enough; a patch with none is invalid [OK] the non-settable columns are unknown fields: alone they leave no patch field [OK] field shapes: text by the 6.5 rule, numbers finite, extra an object -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/v/w/tests/tworld' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/v/w/tests/tworld' # test exit=1; expected tests failed: 1 [FAILED] the id counter survives a reload, even when the newest wall was removed v: exit=1 expected_failed=1 ok ## w: a wall may stay open # diff server/world.nim -> mutated copy: -# 206c206 -# < if result.kind == wkWall: result.open = false +# 382c382 +# < if not result.door: # --- -# > discard +# > if false: [OK] the migration seeds scene 1 with the v1 defaults, no walls, next_wall_id 1 [OK] an unknown scene id is not there (the wire answers not-found) [OK] a point is exactly two finite numbers, ints included - [OK] kind, open and flags accept only their own shape + [OK] position, sight_dir and flags accept only their own shape + [OK] kind is derived from the switches, never stored (5.8) [OK] undefined and null are the same as an absent field [OK] adds count from 1 and the counter advances [OK] a removal never renumbers and the next add never reuses the id [OK] the id counter survives a reload, even when the newest wall was removed [OK] add, update, door set and remove round-trip through a reload + [OK] door.set refuses to open a secret or locked door, closing either is allowed (#56) + [OK] nullable height and label use SQL literals and round-trip as none, not 0 or '' [OK] authoring runs with synchronous=FULL and leaves NORMAL behind (Q12) [OK] a failing write leaves memory and the pragma alone [OK] walls load in id order whatever the insertion order was [OK] a zero-length wall is invalid and writes nothing [OK] both endpoints must be inside [0,w] x [0,h]; the border itself is allowed + [OK] presets expand to switches only through the one resolve path (#55) + [OK] the switch-set invariants reject door-only settings on a non-door (#55) + [OK] storable is the last gate: a secret or locked non-door is refused + [OK] a label is 1..64 code points, trimmed and free of control characters (#55) +/home/davide/Projects/GDR/FFF_vtt/.devbox/nimble/pkgs2/db_connector-0.1.0-4f2e67d0e4b61af9ac5575509305660b473f01a4/db_connector/db_sqlite.nim(211) dbError + Unhandled exception: CHECK constraint failed: open = 0 OR door = 1 [DbError] [FAILED] a wall is never open: the stored row normalizes it - [FAILED] update keeps the row's id and open flag unless the kind changes +/home/davide/Projects/GDR/FFF_vtt/.devbox/nimble/pkgs2/db_connector-0.1.0-4f2e67d0e4b61af9ac5575509305660b473f01a4/db_connector/db_sqlite.nim(211) dbError + Unhandled exception: CHECK constraint failed: open = 0 OR door = 1 [DbError] + [FAILED] update keeps the row's id and open flag unless the door switch is cleared [OK] dot patching: only the given fields change [OK] unknown ids are not-found, wrong kinds are their own outcome [OK] the first wall of a fresh scene is id 1, not 0 @@ -1841,33 +1923,40 @@ v: exit=1 expected_failed=1 ok [OK] one field is enough; a patch with none is invalid [OK] the non-settable columns are unknown fields: alone they leave no patch field [OK] field shapes: text by the 6.5 rule, numbers finite, extra an object -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/w/w/tests/tworld' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/w/w/tests/tworld' # test exit=1; expected tests failed: 1 [FAILED] a wall is never open: the stored row normalizes it w: exit=1 expected_failed=1 ok ## x: zero-length walls accepted # diff server/world.nim -> mutated copy: -# 201c201 -# < (rec.a.x != rec.b.x or rec.a.y != rec.b.y) and inBounds(sc, rec.a) and inBounds(sc, rec.b) +# 372c372 +# < (rec.a.x != rec.b.x or rec.a.y != rec.b.y) and inBounds(sc, rec.a) and inBounds(sc, rec.b) and # --- -# > inBounds(sc, rec.a) and inBounds(sc, rec.b) +# > inBounds(sc, rec.a) and inBounds(sc, rec.b) and [OK] the migration seeds scene 1 with the v1 defaults, no walls, next_wall_id 1 [OK] an unknown scene id is not there (the wire answers not-found) [OK] a point is exactly two finite numbers, ints included - [OK] kind, open and flags accept only their own shape + [OK] position, sight_dir and flags accept only their own shape + [OK] kind is derived from the switches, never stored (5.8) [OK] undefined and null are the same as an absent field [OK] adds count from 1 and the counter advances [OK] a removal never renumbers and the next add never reuses the id [OK] the id counter survives a reload, even when the newest wall was removed [OK] add, update, door set and remove round-trip through a reload + [OK] door.set refuses to open a secret or locked door, closing either is allowed (#56) + [OK] nullable height and label use SQL literals and round-trip as none, not 0 or '' [OK] authoring runs with synchronous=FULL and leaves NORMAL behind (Q12) [OK] a failing write leaves memory and the pragma alone [OK] walls load in id order whatever the insertion order was [FAILED] a zero-length wall is invalid and writes nothing [OK] both endpoints must be inside [0,w] x [0,h]; the border itself is allowed + [OK] presets expand to switches only through the one resolve path (#55) + [OK] the switch-set invariants reject door-only settings on a non-door (#55) + [OK] storable is the last gate: a secret or locked non-door is refused + [OK] a label is 1..64 code points, trimmed and free of control characters (#55) [OK] a wall is never open: the stored row normalizes it - [OK] update keeps the row's id and open flag unless the kind changes + [OK] update keeps the row's id and open flag unless the door switch is cleared [OK] dot patching: only the given fields change [OK] unknown ids are not-found, wrong kinds are their own outcome [OK] the first wall of a fresh scene is id 1, not 0 @@ -1875,33 +1964,40 @@ w: exit=1 expected_failed=1 ok [OK] one field is enough; a patch with none is invalid [OK] the non-settable columns are unknown fields: alone they leave no patch field [OK] field shapes: text by the 6.5 rule, numbers finite, extra an object -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/x/w/tests/tworld' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/x/w/tests/tworld' # test exit=1; expected tests failed: 1 [FAILED] a zero-length wall is invalid and writes nothing x: exit=1 expected_failed=1 ok ## y: wall endpoints unchecked against the world bounds # diff server/world.nim -> mutated copy: -# 196c196 +# 366c366 # < p.x >= 0 and p.y >= 0 and p.x <= sc.w and p.y <= sc.h # written so NaN fails # --- # > p.x >= 0 and p.y >= 0 # written so NaN fails [OK] the migration seeds scene 1 with the v1 defaults, no walls, next_wall_id 1 [OK] an unknown scene id is not there (the wire answers not-found) [OK] a point is exactly two finite numbers, ints included - [OK] kind, open and flags accept only their own shape + [OK] position, sight_dir and flags accept only their own shape + [OK] kind is derived from the switches, never stored (5.8) [OK] undefined and null are the same as an absent field [OK] adds count from 1 and the counter advances [OK] a removal never renumbers and the next add never reuses the id [OK] the id counter survives a reload, even when the newest wall was removed [OK] add, update, door set and remove round-trip through a reload + [OK] door.set refuses to open a secret or locked door, closing either is allowed (#56) + [OK] nullable height and label use SQL literals and round-trip as none, not 0 or '' [OK] authoring runs with synchronous=FULL and leaves NORMAL behind (Q12) [OK] a failing write leaves memory and the pragma alone [OK] walls load in id order whatever the insertion order was [OK] a zero-length wall is invalid and writes nothing [FAILED] both endpoints must be inside [0,w] x [0,h]; the border itself is allowed + [OK] presets expand to switches only through the one resolve path (#55) + [OK] the switch-set invariants reject door-only settings on a non-door (#55) + [OK] storable is the last gate: a secret or locked non-door is refused + [OK] a label is 1..64 code points, trimmed and free of control characters (#55) [OK] a wall is never open: the stored row normalizes it - [OK] update keeps the row's id and open flag unless the kind changes + [OK] update keeps the row's id and open flag unless the door switch is cleared [OK] dot patching: only the given fields change [OK] unknown ids are not-found, wrong kinds are their own outcome [OK] the first wall of a fresh scene is id 1, not 0 @@ -1909,65 +2005,83 @@ x: exit=1 expected_failed=1 ok [OK] one field is enough; a patch with none is invalid [OK] the non-settable columns are unknown fields: alone they leave no patch field [OK] field shapes: text by the 6.5 rule, numbers finite, extra an object -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/y/w/tests/tworld' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/y/w/tests/tworld' # test exit=1; expected tests failed: 1 [FAILED] both endpoints must be inside [0,w] x [0,h]; the border itself is allowed y: exit=1 expected_failed=1 ok ## z: door.set accepted on a plain wall # diff server/world.nim -> mutated copy: -# 313d312 -# < if sc.walls[idx.get].kind != wkDoor: return waNotDoor +# 531d530 +# < if current.door == false: return waNotDoor [OK] the migration seeds scene 1 with the v1 defaults, no walls, next_wall_id 1 [OK] an unknown scene id is not there (the wire answers not-found) [OK] a point is exactly two finite numbers, ints included - [OK] kind, open and flags accept only their own shape + [OK] position, sight_dir and flags accept only their own shape + [OK] kind is derived from the switches, never stored (5.8) [OK] undefined and null are the same as an absent field [OK] adds count from 1 and the counter advances [OK] a removal never renumbers and the next add never reuses the id [OK] the id counter survives a reload, even when the newest wall was removed [OK] add, update, door set and remove round-trip through a reload - [OK] authoring runs with synchronous=FULL and leaves NORMAL behind (Q12) + [OK] door.set refuses to open a secret or locked door, closing either is allowed (#56) + [OK] nullable height and label use SQL literals and round-trip as none, not 0 or '' +/home/davide/Projects/GDR/FFF_vtt/.devbox/nimble/pkgs2/db_connector-0.1.0-4f2e67d0e4b61af9ac5575509305660b473f01a4/db_connector/db_sqlite.nim(211) dbError + Unhandled exception: CHECK constraint failed: open = 0 OR door = 1 [DbError] + [FAILED] authoring runs with synchronous=FULL and leaves NORMAL behind (Q12) [OK] a failing write leaves memory and the pragma alone [OK] walls load in id order whatever the insertion order was [OK] a zero-length wall is invalid and writes nothing [OK] both endpoints must be inside [0,w] x [0,h]; the border itself is allowed + [OK] presets expand to switches only through the one resolve path (#55) + [OK] the switch-set invariants reject door-only settings on a non-door (#55) + [OK] storable is the last gate: a secret or locked non-door is refused + [OK] a label is 1..64 code points, trimmed and free of control characters (#55) [OK] a wall is never open: the stored row normalizes it - [OK] update keeps the row's id and open flag unless the kind changes + [OK] update keeps the row's id and open flag unless the door switch is cleared [OK] dot patching: only the given fields change +/home/davide/Projects/GDR/FFF_vtt/.devbox/nimble/pkgs2/db_connector-0.1.0-4f2e67d0e4b61af9ac5575509305660b473f01a4/db_connector/db_sqlite.nim(211) dbError + Unhandled exception: CHECK constraint failed: open = 0 OR door = 1 [DbError] [FAILED] unknown ids are not-found, wrong kinds are their own outcome [OK] the first wall of a fresh scene is id 1, not 0 [OK] a patch changes only the fields it names and the row round-trips [OK] one field is enough; a patch with none is invalid [OK] the non-settable columns are unknown fields: alone they leave no patch field [OK] field shapes: text by the 6.5 rule, numbers finite, extra an object -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/z/w/tests/tworld' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/z/w/tests/tworld' # test exit=1; expected tests failed: 1 [FAILED] unknown ids are not-found, wrong kinds are their own outcome z: exit=1 expected_failed=1 ok ## z2: persisted open state loaded inverted # diff server/world.nim -> mutated copy: -# 336c336 -# < open: row[6] == "1", +# 561c561 +# < open: row[12] == "1", # --- -# > open: row[6] == "0", +# > open: row[12] == "0", [OK] the migration seeds scene 1 with the v1 defaults, no walls, next_wall_id 1 [OK] an unknown scene id is not there (the wire answers not-found) [OK] a point is exactly two finite numbers, ints included - [OK] kind, open and flags accept only their own shape + [OK] position, sight_dir and flags accept only their own shape + [OK] kind is derived from the switches, never stored (5.8) [OK] undefined and null are the same as an absent field [OK] adds count from 1 and the counter advances [OK] a removal never renumbers and the next add never reuses the id [OK] the id counter survives a reload, even when the newest wall was removed [FAILED] add, update, door set and remove round-trip through a reload + [FAILED] door.set refuses to open a secret or locked door, closing either is allowed (#56) + [OK] nullable height and label use SQL literals and round-trip as none, not 0 or '' [OK] authoring runs with synchronous=FULL and leaves NORMAL behind (Q12) [OK] a failing write leaves memory and the pragma alone [OK] walls load in id order whatever the insertion order was [OK] a zero-length wall is invalid and writes nothing [OK] both endpoints must be inside [0,w] x [0,h]; the border itself is allowed + [OK] presets expand to switches only through the one resolve path (#55) + [OK] the switch-set invariants reject door-only settings on a non-door (#55) + [OK] storable is the last gate: a secret or locked non-door is refused + [OK] a label is 1..64 code points, trimmed and free of control characters (#55) [FAILED] a wall is never open: the stored row normalizes it - [FAILED] update keeps the row's id and open flag unless the kind changes + [FAILED] update keeps the row's id and open flag unless the door switch is cleared [OK] dot patching: only the given fields change [OK] unknown ids are not-found, wrong kinds are their own outcome [OK] the first wall of a fresh scene is id 1, not 0 @@ -1975,14 +2089,257 @@ z: exit=1 expected_failed=1 ok [OK] one field is enough; a patch with none is invalid [OK] the non-settable columns are unknown fields: alone they leave no patch field [OK] field shapes: text by the 6.5 rule, numbers finite, extra an object -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/z2/w/tests/tworld' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/z2/w/tests/tworld' # test exit=1; expected tests failed: 1 [FAILED] add, update, door set and remove round-trip through a reload z2: exit=1 expected_failed=1 ok +## s1: a preset may ride along with raw switches +# diff server/world.nim -> mutated copy: +# 255c255 +# < if sw.hasAnySetting: return none(WallRec) +# --- +# > discard + [OK] the migration seeds scene 1 with the v1 defaults, no walls, next_wall_id 1 + [OK] an unknown scene id is not there (the wire answers not-found) + [OK] a point is exactly two finite numbers, ints included + [OK] position, sight_dir and flags accept only their own shape + [OK] kind is derived from the switches, never stored (5.8) + [OK] undefined and null are the same as an absent field + [OK] adds count from 1 and the counter advances + [OK] a removal never renumbers and the next add never reuses the id + [OK] the id counter survives a reload, even when the newest wall was removed + [OK] add, update, door set and remove round-trip through a reload + [OK] door.set refuses to open a secret or locked door, closing either is allowed (#56) + [OK] nullable height and label use SQL literals and round-trip as none, not 0 or '' + [OK] authoring runs with synchronous=FULL and leaves NORMAL behind (Q12) + [OK] a failing write leaves memory and the pragma alone + [OK] walls load in id order whatever the insertion order was + [OK] a zero-length wall is invalid and writes nothing + [OK] both endpoints must be inside [0,w] x [0,h]; the border itself is allowed + [FAILED] presets expand to switches only through the one resolve path (#55) + [OK] the switch-set invariants reject door-only settings on a non-door (#55) + [OK] storable is the last gate: a secret or locked non-door is refused + [OK] a label is 1..64 code points, trimmed and free of control characters (#55) + [OK] a wall is never open: the stored row normalizes it + [OK] update keeps the row's id and open flag unless the door switch is cleared + [OK] dot patching: only the given fields change + [OK] unknown ids are not-found, wrong kinds are their own outcome + [OK] the first wall of a fresh scene is id 1, not 0 + [OK] a patch changes only the fields it names and the row round-trips + [OK] one field is enough; a patch with none is invalid + [OK] the non-settable columns are unknown fields: alone they leave no patch field + [OK] field shapes: text by the 6.5 rule, numbers finite, extra an object +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/s1/w/tests/tworld' +# test exit=1; expected tests failed: 1 + [FAILED] presets expand to switches only through the one resolve path (#55) + +s1: exit=1 expected_failed=1 ok +## s2: a secret on a non-door is storable +# diff server/world.nim -> mutated copy: +# 189d188 +# < if rec.secret and not rec.door: return false + [OK] the migration seeds scene 1 with the v1 defaults, no walls, next_wall_id 1 + [OK] an unknown scene id is not there (the wire answers not-found) + [OK] a point is exactly two finite numbers, ints included + [OK] position, sight_dir and flags accept only their own shape + [OK] kind is derived from the switches, never stored (5.8) + [OK] undefined and null are the same as an absent field + [OK] adds count from 1 and the counter advances + [OK] a removal never renumbers and the next add never reuses the id + [OK] the id counter survives a reload, even when the newest wall was removed + [OK] add, update, door set and remove round-trip through a reload + [OK] door.set refuses to open a secret or locked door, closing either is allowed (#56) + [OK] nullable height and label use SQL literals and round-trip as none, not 0 or '' + [OK] authoring runs with synchronous=FULL and leaves NORMAL behind (Q12) + [OK] a failing write leaves memory and the pragma alone + [OK] walls load in id order whatever the insertion order was + [OK] a zero-length wall is invalid and writes nothing + [OK] both endpoints must be inside [0,w] x [0,h]; the border itself is allowed + [OK] presets expand to switches only through the one resolve path (#55) + [OK] the switch-set invariants reject door-only settings on a non-door (#55) + [FAILED] storable is the last gate: a secret or locked non-door is refused + [OK] a label is 1..64 code points, trimmed and free of control characters (#55) + [OK] a wall is never open: the stored row normalizes it + [OK] update keeps the row's id and open flag unless the door switch is cleared + [OK] dot patching: only the given fields change + [OK] unknown ids are not-found, wrong kinds are their own outcome + [OK] the first wall of a fresh scene is id 1, not 0 + [OK] a patch changes only the fields it names and the row round-trips + [OK] one field is enough; a patch with none is invalid + [OK] the non-settable columns are unknown fields: alone they leave no patch field + [OK] field shapes: text by the 6.5 rule, numbers finite, extra an object +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/s2/w/tests/tworld' +# test exit=1; expected tests failed: 1 + [FAILED] storable is the last gate: a secret or locked non-door is refused + +s2: exit=1 expected_failed=1 ok +## s3: a window still blocks sight +# diff server/world.nim -> mutated copy: +# 214c214 +# < result.blocksSight = false +# --- +# > result.blocksSight = true + [OK] the migration seeds scene 1 with the v1 defaults, no walls, next_wall_id 1 + [OK] an unknown scene id is not there (the wire answers not-found) + [OK] a point is exactly two finite numbers, ints included + [OK] position, sight_dir and flags accept only their own shape + [OK] kind is derived from the switches, never stored (5.8) + [OK] undefined and null are the same as an absent field + [OK] adds count from 1 and the counter advances + [OK] a removal never renumbers and the next add never reuses the id + [OK] the id counter survives a reload, even when the newest wall was removed + [OK] add, update, door set and remove round-trip through a reload + [OK] door.set refuses to open a secret or locked door, closing either is allowed (#56) + [OK] nullable height and label use SQL literals and round-trip as none, not 0 or '' + [OK] authoring runs with synchronous=FULL and leaves NORMAL behind (Q12) + [OK] a failing write leaves memory and the pragma alone + [OK] walls load in id order whatever the insertion order was + [OK] a zero-length wall is invalid and writes nothing + [OK] both endpoints must be inside [0,w] x [0,h]; the border itself is allowed + [FAILED] presets expand to switches only through the one resolve path (#55) + [OK] the switch-set invariants reject door-only settings on a non-door (#55) + [OK] storable is the last gate: a secret or locked non-door is refused + [OK] a label is 1..64 code points, trimmed and free of control characters (#55) + [OK] a wall is never open: the stored row normalizes it + [OK] update keeps the row's id and open flag unless the door switch is cleared + [OK] dot patching: only the given fields change + [OK] unknown ids are not-found, wrong kinds are their own outcome + [OK] the first wall of a fresh scene is id 1, not 0 + [OK] a patch changes only the fields it names and the row round-trips + [OK] one field is enough; a patch with none is invalid + [OK] the non-settable columns are unknown fields: alone they leave no patch field + [OK] field shapes: text by the 6.5 rule, numbers finite, extra an object +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/s3/w/tests/tworld' +# test exit=1; expected tests failed: 1 + [FAILED] presets expand to switches only through the one resolve path (#55) + +s3: exit=1 expected_failed=1 ok +## s4: the blind side becomes the seeing side +# diff server/geometry.nim -> mutated copy: +# 67c67 +# < of wdLeft: s >= -Eps +# --- +# > of wdLeft: s <= Eps + [OK] open space is a circle + [OK] wall blocks + [OK] shared endpoint: no leak at the vertex + [OK] shared vertex: both arms required (mutation d1/d2) + [OK] '<' apex: ray through the shared tip must not leak + [OK] every segment endpoint is a polygon vertex (lower and upper end inclusive) + [OK] rays nudged past a corner: area just beyond a wall end is visible + [OK] shared endpoint: closed corner of box has no crack + [OK] collinear walls act as one + [OK] collinear walls with a gap let light through + [OK] T-junction: no leak and correct shadow + [OK] pillar mid-room casts a shadow, sides visible + [OK] closed door blocks, open door passes + [FAILED] one-way: sight_dir names the blind side (left is the (-dy, dx) normal) + [FAILED] one-way: flipping the direction swaps the blind side and moves nothing + [OK] one-way: an open door blocks neither side whatever the direction says + [OK] token exactly at wall endpoint + [OK] token at endpoint of free-standing wall sees along it + [OK] long thin corridor + [OK] wall endpoints behind the viewer: fan stays angularly ordered + [OK] radius clips + [OK] square polygon + [OK] tiny polygon inside one cell + [OK] polygon spanning a cell with no vertex in it + [OK] big polygon includes fully covered interior cells + [OK] degenerate input: fewer than 3 vertices + [OK] touching a cell line: inclusive on the max side, not on the bbox minimum side + [OK] concave polygon: a notch cell is not filled + [OK] every token in seed sees itself and is not walled in + [OK] visibilityPolygon and cellsTouched equal the prototype results + [OK] random visibility polygons: identical cell lists + [OK] random simple polygons (star-shaped, concave): identical cell lists + [OK] grid-aligned integer polygons (edges on cell lines): identical cell lists + [OK] prototype scene, all tokens, doors closed and opened + [OK] random wall fields, cell 32 and 25 + [OK] negative control: the oracle notices a missing and an invented cell +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/s4/w/tests/tgeometry' +# test exit=1; expected tests failed: 1 + [FAILED] one-way: sight_dir names the blind side (left is the (-dy, dx) normal) + +s4: exit=1 expected_failed=1 ok +## s5: an opening secret or locked door is accepted +# diff server/world.nim -> mutated copy: +# 532c532 +# < if open and (current.secret or current.locked): return waInvalid +# --- +# > discard + [OK] the migration seeds scene 1 with the v1 defaults, no walls, next_wall_id 1 + [OK] an unknown scene id is not there (the wire answers not-found) + [OK] a point is exactly two finite numbers, ints included + [OK] position, sight_dir and flags accept only their own shape + [OK] kind is derived from the switches, never stored (5.8) + [OK] undefined and null are the same as an absent field + [OK] adds count from 1 and the counter advances + [OK] a removal never renumbers and the next add never reuses the id + [OK] the id counter survives a reload, even when the newest wall was removed + [OK] add, update, door set and remove round-trip through a reload +/home/davide/Projects/GDR/FFF_vtt/.devbox/nimble/pkgs2/db_connector-0.1.0-4f2e67d0e4b61af9ac5575509305660b473f01a4/db_connector/db_sqlite.nim(211) dbError + AND sight_dir = 'both') [DbError] + [FAILED] door.set refuses to open a secret or locked door, closing either is allowed (#56) + [OK] nullable height and label use SQL literals and round-trip as none, not 0 or '' + [OK] authoring runs with synchronous=FULL and leaves NORMAL behind (Q12) + [OK] a failing write leaves memory and the pragma alone + [OK] walls load in id order whatever the insertion order was + [OK] a zero-length wall is invalid and writes nothing + [OK] both endpoints must be inside [0,w] x [0,h]; the border itself is allowed + [OK] presets expand to switches only through the one resolve path (#55) + [OK] the switch-set invariants reject door-only settings on a non-door (#55) + [OK] storable is the last gate: a secret or locked non-door is refused + [OK] a label is 1..64 code points, trimmed and free of control characters (#55) + [OK] a wall is never open: the stored row normalizes it + [OK] update keeps the row's id and open flag unless the door switch is cleared + [OK] dot patching: only the given fields change + [OK] unknown ids are not-found, wrong kinds are their own outcome + [OK] the first wall of a fresh scene is id 1, not 0 + [OK] a patch changes only the fields it names and the row round-trips + [OK] one field is enough; a patch with none is invalid + [OK] the non-settable columns are unknown fields: alone they leave no patch field + [OK] field shapes: text by the 6.5 rule, numbers finite, extra an object +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/s5/w/tests/tworld' +# test exit=1; expected tests failed: 1 + [FAILED] door.set refuses to open a secret or locked door, closing either is allowed (#56) + +s5: exit=1 expected_failed=1 ok +## s6: the marker signature ignores thickness +# diff server/world.nim -> mutated copy: +# 177c177 +# < MarkerSig(a: w.a, b: w.b, thickness: w.thickness, position: w.position, +# --- +# > MarkerSig(a: w.a, b: w.b, position: w.position, + [OK] a marked window seen by any part of its extent mints one anchor marker + [OK] an untouched marker survives a refresh: it is memory, not current sight + [FAILED] a geometry change retracts the marker and a re-earn gets a fresh id + [OK] a placement change retracts too; height and label never do + [OK] a solid wall with the switch on mints nothing; clearing the switch retracts +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/s6/w/tests/tmarkers' +# test exit=1; expected tests failed: 1 + [FAILED] a geometry change retracts the marker and a re-earn gets a fresh id + +s6: exit=1 expected_failed=1 ok +## s7: every refresh retracts the marker +# diff server/markers.nim -> mutated copy: +# 87c87 +# < if not byId.hasKey(wallId) or pv.markers[wallId].sig != markerSig(byId[wallId]): +# --- +# > if true: + [OK] a marked window seen by any part of its extent mints one anchor marker + [FAILED] an untouched marker survives a refresh: it is memory, not current sight + [OK] a geometry change retracts the marker and a re-earn gets a fresh id + [FAILED] a placement change retracts too; height and label never do + [OK] a solid wall with the switch on mints nothing; clearing the switch retracts +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/s7/w/tests/tmarkers' +# test exit=1; expected tests failed: 1 + [FAILED] an untouched marker survives a refresh: it is memory, not current sight + +s7: exit=1 expected_failed=1 ok ## aa: the egress ignores LOS, gm_only and ownership # diff server/views.nim -> mutated copy: -# 260c260 +# 268c268 # < if not pv[].visibleTo(t, playerId): continue # --- # > if false: continue @@ -2021,14 +2378,14 @@ z2: exit=1 expected_failed=1 ok [OK] a player never receives another player's list [OK] a Context is six addresses: in-place changes are visible through the borrow [OK] building a Context and egressing does not scale with the explored sets -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/aa/w/tests/tviews' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/aa/w/tests/tviews' # test exit=1; expected tests failed: 1 [FAILED] the set of tokens follows the visibility rule aa: exit=1 expected_failed=1 ok ## ab: gm_only ignored by the view rule # diff server/vision.nim -> mutated copy: -# 100d99 +# 130d129 # < if t.gmOnly: return false [OK] only the player's own vision tokens produce one, in token order [OK] a player with no vision token has no polygons at all @@ -2045,14 +2402,14 @@ aa: exit=1 expected_failed=1 ok [OK] another token needs to be inside the polygon [FAILED] a gm_only token inside the LOS is not visible to anyone else [OK] a player with no vision token sees only what they control -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/ab/w/tests/tvision' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/ab/w/tests/tvision' # test exit=1; expected tests failed: 1 [FAILED] a gm_only token inside the LOS is not visible to anyone else ab: exit=1 expected_failed=1 ok ## ac: a controlled token is not always visible # diff server/vision.nim -> mutated copy: -# 99d98 +# 129d128 # < if t.owner == playerId: return true [OK] only the player's own vision tokens produce one, in token order [OK] a player with no vision token has no polygons at all @@ -2069,14 +2426,14 @@ ab: exit=1 expected_failed=1 ok [OK] another token needs to be inside the polygon [OK] a gm_only token inside the LOS is not visible to anyone else [FAILED] a player with no vision token sees only what they control -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/ac/w/tests/tvision' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/ac/w/tests/tvision' # test exit=1; expected tests failed: 1 [FAILED] a controlled token is always visible, gm_only included ac: exit=1 expected_failed=1 ok ## ad: no token_gone when a token leaves the view # diff server/views.nim -> mutated copy: -# 638c638 +# 698c698 # < result.add tokenGoneFrame(id) # --- # > discard @@ -2115,14 +2472,14 @@ ac: exit=1 expected_failed=1 ok [OK] a player never receives another player's list [OK] a Context is six addresses: in-place changes are visible through the borrow [OK] building a Context and egressing does not scale with the explored sets -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/ad/w/tests/tviews' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/ad/w/tests/tviews' # test exit=1; expected tests failed: 1 [FAILED] leaving view sends `token_gone` once, and never for a token that was never sent ad: exit=1 expected_failed=1 ok ## ae: a player token frame carries the GM-only kind # diff server/views.nim -> mutated copy: -# 419c419 +# 433c433 # < "statuses": statusKindsJson(v.statuses), "props": buckets, "cprops": cprops # --- # > "statuses": statusKindsJson(v.statuses), "props": buckets, "kind": "npc", "cprops": cprops @@ -2161,14 +2518,14 @@ ad: exit=1 expected_failed=1 ok [OK] a player never receives another player's list [OK] a Context is six addresses: in-place changes are visible through the borrow [OK] building a Context and egressing does not scale with the explored sets -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/ae/w/tests/tviews' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/ae/w/tests/tviews' # test exit=1; expected tests failed: 1 [FAILED] a player frame carries no GM-only field and no wall-like key ae: exit=1 expected_failed=1 ok ## af: explored forgets cells outside the current polygon # diff server/vision.nim -> mutated copy: -# 73c73 +# 101c101 # < for idx in added: pv.explored.incl idx # --- # > pv.explored = added @@ -2187,7 +2544,7 @@ ae: exit=1 expected_failed=1 ok [OK] another token needs to be inside the polygon [OK] a gm_only token inside the LOS is not visible to anyone else [OK] a player with no vision token sees only what they control -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/af/w/tests/tvision' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/af/w/tests/tvision' # test exit=1; expected tests failed: 1 [FAILED] moving adds cells and never forgets the old ones @@ -2209,7 +2566,7 @@ af: exit=1 expected_failed=1 ok [OK] restore: two players' explored never mix [OK] restore: an empty store restores nothing and a removed player takes its chunks [OK] a mutation-scale chunk write stays inside the 4.3 commit budget -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/ag/w/tests/texplored' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/ag/w/tests/texplored' # test exit=1; expected tests failed: 1 [FAILED] the chunk bitmap layout is pinned @@ -2233,7 +2590,7 @@ ag: exit=1 expected_failed=1 ok [FAILED] restore: two players' explored never mix [OK] restore: an empty store restores nothing and a removed player takes its chunks [OK] a mutation-scale chunk write stays inside the 4.3 commit budget -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/ah/w/tests/texplored' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/ah/w/tests/texplored' # test exit=1; expected tests failed: 1 [FAILED] one chunk covers 64x64 cells @@ -2263,7 +2620,7 @@ ah: exit=1 expected_failed=1 ok [FAILED] restore: two players' explored never mix [OK] restore: an empty store restores nothing and a removed player takes its chunks [OK] a mutation-scale chunk write stays inside the 4.3 commit budget -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/ai/w/tests/texplored' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/ai/w/tests/texplored' # test exit=1; expected tests failed: 1 [FAILED] restore: the stored cells come back exactly @@ -2293,7 +2650,7 @@ ai: exit=1 expected_failed=1 ok [FAILED] restore: two players' explored never mix [FAILED] restore: an empty store restores nothing and a removed player takes its chunks [OK] a mutation-scale chunk write stays inside the 4.3 commit budget -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/aj/w/tests/texplored' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/aj/w/tests/texplored' # test exit=1; expected tests failed: 1 [FAILED] restore: two players' explored never mix @@ -2315,7 +2672,7 @@ aj: exit=1 expected_failed=1 ok [OK] restore: two players' explored never mix [OK] restore: an empty store restores nothing and a removed player takes its chunks [OK] a mutation-scale chunk write stays inside the 4.3 commit budget -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/ak/w/tests/texplored' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/ak/w/tests/texplored' # test exit=1; expected tests failed: 1 [FAILED] a second write to the same chunk replaces the bitmap @@ -2337,14 +2694,14 @@ ak: exit=1 expected_failed=1 ok [OK] restore: two players' explored never mix [OK] restore: an empty store restores nothing and a removed player takes its chunks [OK] a mutation-scale chunk write stays inside the 4.3 commit budget -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/al/w/tests/texplored' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/al/w/tests/texplored' # test exit=1; expected tests failed: 1 [FAILED] two chunks in one chunk row are both written al: exit=1 expected_failed=1 ok ## am: the owner bucket reaches a non-controller # diff server/views.nim -> mutated copy: -# 276c276 +# 284c284 # < propsOwner: (if mine: objectOf(t.props[pbOwner]) else: nil), # --- # > propsOwner: t.props[pbOwner], @@ -2383,7 +2740,7 @@ al: exit=1 expected_failed=1 ok [OK] a player never receives another player's list [OK] a Context is six addresses: in-place changes are visible through the borrow [OK] building a Context and egressing does not scale with the explored sets -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/am/w/tests/tviews' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/am/w/tests/tviews' # test exit=1; expected tests failed: 1 [FAILED] a player who sees the token gets the public bucket only @@ -2460,14 +2817,14 @@ am: exit=1 expected_failed=1 ok [OK] a GM-sourced lock refuses player moves without touching the walls entries [FAILED] a wall added over a GM-locked token only adds the walls entry [OK] the GM clear of the walls entries leaves a GM-sourced entry alone (no rule runs) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/an/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/an/w/tests/tmoverules' # test exit=1; expected tests failed: 1 [FAILED] wall added within r of the circle (centre not on it) sets stuck; exactly r does not an: exit=1 expected_failed=1 ok ## ao: a shrink never clears the walls entries # diff server/moverules.nim -> mutated copy: -# 371c371 +# 374c374 # < sc.tokens[ti].clearWalls() # --- # > discard @@ -2537,7 +2894,7 @@ an: exit=1 expected_failed=1 ok [OK] a GM-sourced lock refuses player moves without touching the walls entries [OK] a wall added over a GM-locked token only adds the walls entry [OK] the GM clear of the walls entries leaves a GM-sourced entry alone (no rule runs) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/ao/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/ao/w/tests/tmoverules' # test exit=1; expected tests failed: 2 [FAILED] a squeeze from a failed grow clears when a later shrink ends the overlap [FAILED] a shrink that still overlaps keeps the stuck entry @@ -2562,14 +2919,14 @@ ao: exit=1 expected_failed=2 ok [OK] propsJson carries all three buckets, always as objects [OK] clone gives fresh buckets: editing the copy cannot reach the original [OK] normalize repairs nil buckets -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/ap/w/tests/tprops' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/ap/w/tests/tprops' # test exit=1; expected tests failed: 1 [FAILED] 64 keys per bucket, the 65th is refused and nothing changes ap: exit=1 expected_failed=1 ok ## aq: the grow push is skipped # diff server/moverules.nim -> mutated copy: -# 373c373 +# 376c376 # < if not grew: # --- # > if true: @@ -2639,14 +2996,14 @@ ap: exit=1 expected_failed=1 ok [OK] a GM-sourced lock refuses player moves without touching the walls entries [OK] a wall added over a GM-locked token only adds the walls entry [OK] the GM clear of the walls entries leaves a GM-sourced entry alone (no rule runs) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/aq/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/aq/w/tests/tmoverules' # test exit=1; expected tests failed: 1 [FAILED] grow inside r of a wall pushes it out by the minimal perpendicular distance aq: exit=1 expected_failed=1 ok ## ar: a failed grow is not flagged squeezed # diff server/moverules.nim -> mutated copy: -# 384d383 +# 387d386 # < sc.tokens[ti].squeezedWalls = true [OK] crossing blocked, parallel ok [OK] grazing an endpoint is blocked @@ -2714,17 +3071,17 @@ aq: exit=1 expected_failed=1 ok [OK] a GM-sourced lock refuses player moves without touching the walls entries [OK] a wall added over a GM-locked token only adds the walls entry [OK] the GM clear of the walls entries leaves a GM-sourced entry alone (no rule runs) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/ar/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/ar/w/tests/tmoverules' # test exit=1; expected tests failed: 1 [FAILED] grow with no room on either side squeezes the token and leaves it in place ar: exit=1 expected_failed=1 ok ## as: a failed door push sticks instead of squeezing # diff server/moverules.nim -> mutated copy: -# 291c291 -# < sc.tokens[i].squeezedWalls = true +# 294c294 +# < sc.tokens[i].squeezedWalls = true # --- -# > sc.tokens[i].stuckWalls = true +# > sc.tokens[i].stuckWalls = true [OK] crossing blocked, parallel ok [OK] grazing an endpoint is blocked [OK] no leak through shared vertex @@ -2791,7 +3148,7 @@ ar: exit=1 expected_failed=1 ok [OK] a GM-sourced lock refuses player moves without touching the walls entries [OK] a wall added over a GM-locked token only adds the walls entry [OK] the GM clear of the walls entries leaves a GM-sourced entry alone (no rule runs) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/as/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/as/w/tests/tmoverules' # test exit=1; expected tests failed: 1 [FAILED] push: both sides invalid -> squeezed in place; door open -> still squeezed (KEEP); GM can move it @@ -2817,14 +3174,14 @@ as: exit=1 expected_failed=1 ok [OK] propsJson carries all three buckets, always as objects [OK] clone gives fresh buckets: editing the copy cannot reach the original [OK] normalize repairs nil buckets -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/at/w/tests/tprops' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/at/w/tests/tprops' # test exit=1; expected tests failed: 1 [FAILED] 64 keys per bucket, the 65th is refused and nothing changes at: exit=1 expected_failed=1 ok ## au: a grow that already fits still pushes # diff server/moverules.nim -> mutated copy: -# 370c370 +# 373c373 # < if not overlapsAny(sc, sc.tokens[ti]): # --- # > if false: @@ -2894,7 +3251,7 @@ at: exit=1 expected_failed=1 ok [OK] a GM-sourced lock refuses player moves without touching the walls entries [OK] a wall added over a GM-locked token only adds the walls entry [OK] the GM clear of the walls entries leaves a GM-sourced entry alone (no rule runs) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/au/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/au/w/tests/tmoverules' # test exit=1; expected tests failed: 1 [FAILED] a grow that already fits does not move the token @@ -2932,7 +3289,7 @@ au: exit=1 expected_failed=1 ok [FAILED] a character rename follows the snapshots of everyone who met it [OK] player.remove hands the player's characters to the GM (DESIGN 3.2) [OK] a character still figured by a token is in use (6.5) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/av/w/tests/tcharacters' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/av/w/tests/tcharacters' # test exit=1; expected tests failed: 2 [FAILED] a character owner sees the actual name without any reveal row [FAILED] a linked token borrows the character's names, so one reveal covers all of them @@ -2971,7 +3328,7 @@ av: exit=1 expected_failed=2 ok [OK] a character rename follows the snapshots of everyone who met it [OK] player.remove hands the player's characters to the GM (DESIGN 3.2) [OK] a character still figured by a token is in use (6.5) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/aw/w/tests/tcharacters' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/aw/w/tests/tcharacters' # test exit=1; expected tests failed: 2 [FAILED] a first sighting records what the player knows right now [FAILED] a rename follows the subject, and a player who was never told keeps not knowing @@ -3010,7 +3367,7 @@ aw: exit=1 expected_failed=2 ok [OK] a character rename follows the snapshots of everyone who met it [OK] player.remove hands the player's characters to the GM (DESIGN 3.2) [OK] a character still figured by a token is in use (6.5) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/ax/w/tests/tcharacters' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/ax/w/tests/tcharacters' # test exit=1; expected tests failed: 1 [FAILED] a rename follows the subject, and a player who was never told keeps not knowing @@ -3048,7 +3405,7 @@ ax: exit=1 expected_failed=1 ok [OK] a character rename follows the snapshots of everyone who met it [OK] player.remove hands the player's characters to the GM (DESIGN 3.2) [FAILED] a character still figured by a token is in use (6.5) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/ay/w/tests/tcharacters' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/ay/w/tests/tcharacters' # test exit=1; expected tests failed: 1 [FAILED] a linked token carries no names of its own (they belong to the character) @@ -3086,7 +3443,7 @@ ay: exit=1 expected_failed=1 ok [OK] a character rename follows the snapshots of everyone who met it [OK] player.remove hands the player's characters to the GM (DESIGN 3.2) [FAILED] a character still figured by a token is in use (6.5) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/az/w/tests/tcharacters' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/az/w/tests/tcharacters' # test exit=1; expected tests failed: 1 [FAILED] a character still figured by a token is in use (6.5) @@ -3124,7 +3481,7 @@ az: exit=1 expected_failed=1 ok [OK] a character rename follows the snapshots of everyone who met it [FAILED] player.remove hands the player's characters to the GM (DESIGN 3.2) [OK] a character still figured by a token is in use (6.5) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/b1/w/tests/tcharacters' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/b1/w/tests/tcharacters' [OK] 12 characters from the documented alphabet [OK] freshId never returns an id that is taken [OK] a name is trimmed, non-empty and free of control characters @@ -3187,7 +3544,7 @@ b1: exit=1 expected_failed=1 ok [FAILED] a character rename follows the snapshots of everyone who met it [OK] player.remove hands the player's characters to the GM (DESIGN 3.2) [OK] a character still figured by a token is in use (6.5) -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/b2/w/tests/tcharacters' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/b2/w/tests/tcharacters' # test exit=1; expected tests failed: 2 [FAILED] a character rename rewrites the live snapshots and the rows alike (#30, #27) [FAILED] a character rename follows the snapshots of everyone who met it @@ -3195,7 +3552,7 @@ Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/b2/w/tests/t b2: exit=1 expected_failed=2 ok ## b3: cprops carries the character owner bucket # diff server/views.nim -> mutated copy: -# 279c279 +# 287c287 # < cpropsPublic: objectOf(if ch.isSome and not ownsCharacter: ch.get.props[pbPublic] # --- # > cpropsPublic: objectOf(if ch.isSome and not ownsCharacter: ch.get.props[pbOwner] @@ -3236,14 +3593,14 @@ b2: exit=1 expected_failed=2 ok [OK] a player never receives another player's list [OK] a Context is six addresses: in-place changes are visible through the borrow [OK] building a Context and egressing does not scale with the explored sets -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/b3/w/tests/tviews' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/b3/w/tests/tviews' # test exit=1; expected tests failed: 1 [FAILED] cprops carries the character's public bucket to a non-owner, and never the owner bucket b3: exit=1 expected_failed=1 ok ## b4: a player is sent every character # diff server/views.nim -> mutated copy: -# 282c282 +# 290c290 # < if c.owner != playerId: continue # --- # > if false: continue @@ -3282,7 +3639,7 @@ b3: exit=1 expected_failed=1 ok [OK] a player never receives another player's list [OK] a Context is six addresses: in-place changes are visible through the borrow [OK] building a Context and egressing does not scale with the explored sets -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/b4/w/tests/tviews' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/b4/w/tests/tviews' # test exit=1; expected tests failed: 1 [FAILED] a player gets only its own characters, without owner, reveal_all or revealed @@ -3305,7 +3662,7 @@ b4: exit=1 expected_failed=1 ok [FAILED] a tile is allowed when any overlapping cell is explored [FAILED] the explored overlap respects the scene border [OK] a request built from one record stays internally consistent when the scene is swapped -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/c1/w/tests/ttiles' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/c1/w/tests/ttiles' # test exit=1; expected tests failed: 2 [FAILED] an unexplored tile is refused [FAILED] a tile is allowed when any overlapping cell is explored @@ -3329,7 +3686,7 @@ c1: exit=1 expected_failed=2 ok [FAILED] a tile is allowed when any overlapping cell is explored [FAILED] the explored overlap respects the scene border [FAILED] a request built from one record stays internally consistent when the scene is swapped -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/c2/w/tests/ttiles' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/c2/w/tests/ttiles' # test exit=1; expected tests failed: 2 [FAILED] an unexplored tile is refused [FAILED] a tile is allowed when any overlapping cell is explored @@ -3353,7 +3710,7 @@ c2: exit=1 expected_failed=2 ok [OK] a tile is allowed when any overlapping cell is explored [OK] the explored overlap respects the scene border [OK] a request built from one record stays internally consistent when the scene is swapped -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/c3/w/tests/ttiles' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/c3/w/tests/ttiles' # test exit=1; expected tests failed: 1 [FAILED] a tile coordinate outside the grid is out of range @@ -3376,7 +3733,7 @@ c3: exit=1 expected_failed=1 ok [OK] a tile is allowed when any overlapping cell is explored [OK] the explored overlap respects the scene border [OK] a request built from one record stays internally consistent when the scene is swapped -Error: execution of an external program failed: '/tmp/fffmut.zrTIgu/c4/w/tests/ttiles' +Error: execution of an external program failed: '/tmp/fffmut.cA4aoJ/c4/w/tests/ttiles' # test exit=1; expected tests failed: 1 [FAILED] leading zero tile coordinates are malformed diff --git a/results/nimble-test.log b/results/nimble-test.log index c7a1e73..552c070 100644 --- a/results/nimble-test.log +++ b/results/nimble-test.log @@ -1,6 +1,6 @@ - Info: Using the environment variable: NIMBLE_DIR='/home/davide/Projects/GDR/FFF_vtt/.devbox/nimble' + Info: Using the environment variable: NIMBLE_DIR='/home/davide/Projects/GDR/FFF_vtt-b36/.devbox/nimble' Info: using /nix/store/0cbdz34lsakfirycixckf6ypsd8hazhg-x86_64-unknown-linux-gnu-nim-wrapper-2.2.12/bin/nim for compilation - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tauth (from package fff_vtt) using c backend + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tauth (from package fff_vtt) using c backend Nim Output [Suite] GM key (fff-vtt gm-key) ... [OK] first run creates the single GM and prints a key; re-run prints the same key ... [OK] --new rotates: new key, old key invalid, GM sessions revoked, same player @@ -15,7 +15,7 @@ ... [OK] only the hash is stored; the token itself appears nowhere ... [OK] unknown hash gives no player; revoking one player leaves the other alone Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tcharacters (from package fff_vtt) using c backend + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tcharacters (from package fff_vtt) using c backend Nim Output [Suite] the name rule (DESIGN 8: one copy, used by every frame) ... [OK] an owner, a reveal_all and a per-player reveal each expose the actual name ... [OK] visibleName picks the name the recipient knows @@ -48,7 +48,7 @@ ... [OK] player.remove hands the player's characters to the GM (DESIGN 3.2) ... [OK] a character still figured by a token is in use (6.5) Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tconfig (from package fff_vtt) using c backend + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tconfig (from package fff_vtt) using c backend Nim Output [Suite] config defaults ... [OK] defaults: dev origin, port 9000, state dir run ... [OK] state dir is joined, not concatenated @@ -75,7 +75,7 @@ ... [OK] --help is not an error and asks for usage, even with a broken env ... [OK] usage lists the three keys and says the bind is fixed Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tconns (from package fff_vtt) using c backend + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tconns (from package fff_vtt) using c backend Nim Output [Suite] total cap ... [OK] 16 reservations succeed, the 17th is refused ... [OK] a cancelled reservation gives the slot back @@ -96,7 +96,7 @@ ... [OK] a Pong is recorded on the right connection ... [OK] a snapshot hands out every live connection without holding the lock afterwards Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tcrypto (from package fff_vtt) using c backend + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tcrypto (from package fff_vtt) using c backend Nim Output [Suite] sha256 ... [OK] FIPS 180-4 known answers ... [OK] padding boundaries: 55, 56 and 64 byte messages differ and are stable @@ -110,7 +110,7 @@ ... [Suite] constant-time compare ... [OK] equal only for identical strings, including the empty case Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tdb (from package fff_vtt) using c backend + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tdb (from package fff_vtt) using c backend Nim Output [Suite] open ... [OK] creates the file, sets WAL, synchronous NORMAL, busy_timeout, foreign_keys ... [Suite] migrate @@ -121,11 +121,30 @@ ... [OK] a failing step rolls back: no DDL, no history, version unchanged ... [OK] a slice-2 DB migrates on: the scene is seeded, players and keys survive ... [OK] a schema-4 DB migrates on: explored_chunk and entity_status appear, the world survives + ... [Suite] step 8 wall CHECKs (DESIGN 4.4) + ... [OK] every impossible wall row is rejected by the database + ... [OK] a failing step 8 rolls back the rebuild, the history row and the version + ... [OK] a malformed props_gm refuses step 8 and leaves the schema-7 DB untouched Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/testutil (from package fff_vtt) using c backend + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tdetach (from package fff_vtt) using c backend + Nim Output [Suite] detachedJson + ... [OK] rebuilds nodes and string payloads + ... [OK] mutating the source leaves the copy alone + ... [OK] absent (nil) stays nil and null stays null + ... [Suite] detachedString + ... [OK] does not share the payload + ... [OK] empty strings stay empty + ... [Suite] detachedProps + ... [OK] three independent buckets, keys and values included + ... [Suite] the premise this guards (world.parseFlags) + ... [OK] parseFlags returns the caller's node by reference, not a copy Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/texplored (from package fff_vtt) using c backend - Nim Output [Suite] chunk format + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/testutil (from package fff_vtt) using c backend + Success: Execution finished + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/texplored (from package fff_vtt) using c backend + Nim Output /home/davide/Projects/GDR/FFF_vtt-b36/server/worldmap.nim(18, 44) Warning: imported and not used: 'faults' [UnusedImport] + ... /home/davide/Projects/GDR/FFF_vtt-b36/server/vision.nim(31, 43) Warning: imported and not used: 'faults' [UnusedImport] + ... [Suite] chunk format ... [OK] the chunk bitmap layout is pinned ... [OK] one chunk covers 64x64 cells ... [OK] a dirty chunk carries the whole chunk, not just the new cells @@ -139,10 +158,10 @@ ... [OK] restore: two players' explored never mix ... [OK] restore: an empty store restores nothing and a removed player takes its chunks ... [Suite] cost - ... chunk write: avg 0.021 ms, p99 0.054 ms over 200 commits + ... chunk write: avg 0.016 ms, p99 0.033 ms over 200 commits ... [OK] a mutation-scale chunk write stays inside the 4.3 commit budget Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tgeometry (from package fff_vtt) using c backend + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tgeometry (from package fff_vtt) using c backend Nim Output [Suite] visibility ... [OK] open space is a circle ... [OK] wall blocks @@ -157,6 +176,9 @@ ... [OK] T-junction: no leak and correct shadow ... [OK] pillar mid-room casts a shadow, sides visible ... [OK] closed door blocks, open door passes + ... [OK] one-way: sight_dir names the blind side (left is the (-dy, dx) normal) + ... [OK] one-way: flipping the direction swaps the blind side and moves nothing + ... [OK] one-way: an open door blocks neither side whatever the direction says ... [OK] token exactly at wall endpoint ... [OK] token at endpoint of free-standing wall sees along it ... [OK] long thin corridor @@ -183,12 +205,12 @@ ... [OK] random wall fields, cell 32 and 25 ... [OK] negative control: the oracle notices a missing and an invented cell Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tinstancelock (from package fff_vtt) using c backend + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tinstancelock (from package fff_vtt) using c backend Nim Output [Suite] instance lock ... [OK] acquires, creates the lock file, releases and re-acquires ... [OK] release is idempotent Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tlogging (from package fff_vtt) using c backend + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tlogging (from package fff_vtt) using c backend Nim Output [Suite] redaction by value ... [OK] a secret passed as a field value never appears in the output ... [OK] a secret inside free text, the event name or a nested value is scrubbed too @@ -205,7 +227,18 @@ ... [OK] messages below the level are dropped ... [OK] no fields is still one valid line Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tmoverules (from package fff_vtt) using c backend + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tmarkers (from package fff_vtt) using c backend + Nim Output /home/davide/Projects/GDR/FFF_vtt-b36/server/worldmap.nim(18, 44) Warning: imported and not used: 'faults' [UnusedImport] + ... /home/davide/Projects/GDR/FFF_vtt-b36/server/vision.nim(31, 43) Warning: imported and not used: 'faults' [UnusedImport] + ... /home/davide/Projects/GDR/FFF_vtt-b36/server/markers.nim(29, 8) Warning: imported and not used: 'faults' [UnusedImport] + ... [Suite] player markers (5.8, #59/#60) + ... [OK] a marked window seen by any part of its extent mints one anchor marker + ... [OK] an untouched marker survives a refresh: it is memory, not current sight + ... [OK] a geometry change retracts the marker and a re-earn gets a fresh id + ... [OK] a placement change retracts too; height and label never do + ... [OK] a solid wall with the switch on mints nothing; clearing the switch retracts + Success: Execution finished + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tmoverules (from package fff_vtt) using c backend Nim Output [Suite] pathClear, r = 0 (ported prototype move tests) ... [OK] crossing blocked, parallel ok ... [OK] grazing an endpoint is blocked @@ -282,7 +315,7 @@ ... [OK] a wall added over a GM-locked token only adds the walls entry ... [OK] the GM clear of the walls entries leaves a GM-sourced entry alone (no rule runs) Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tprobing (from package fff_vtt) using c backend + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tprobing (from package fff_vtt) using c backend Nim Output [Suite] probing (T8) ... [OK] P1: probes longer than the cap get one fixed nack regardless of the scene ... [OK] P2: scenes differing only beyond the bound give identical replies over 3000 probes @@ -290,7 +323,7 @@ ... [OK] P4: probing cannot unlock or move a locked token ... [OK] doors beyond the bound: opening or closing them changes no reply Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tprops (from package fff_vtt) using c backend + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tprops (from package fff_vtt) using c backend Nim Output [Suite] caps (6.1, numbers FIXED owner-delegated by #22) ... [OK] 64 keys per bucket, the 65th is refused and nothing changes ... [OK] an existing key can still be overwritten at the cap @@ -311,7 +344,7 @@ ... [OK] clone gives fresh buckets: editing the copy cannot reach the original ... [OK] normalize repairs nil buckets Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tprotocol (from package fff_vtt) using c backend + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tprotocol (from package fff_vtt) using c backend Nim Output [Suite] envelope (6.5 step 2) ... [OK] a well-formed intent parses and keeps its reqId and node ... [OK] reqId boundaries: 0 and 2^31-1 pass, 2^31 and -1 are malformed @@ -339,18 +372,20 @@ ... [OK] error and closing frames have no reqId ... [OK] the close-code table of 6.5 is the app range plus 1008 ... [Suite] wall frames (6.1 `walls`, `wall`, `wall_gone`; GM only) - ... [OK] one wall carries id, a, b, kind, open and flags in the 6.1 shape + ... [OK] one wall carries the typed record plus the derived kind in the proto-2 shape ... [OK] `walls` is the full list plus the scene, `wall` is one upsert, `wall_gone` an id ... [OK] the fan-out frames carry no n: the sender stamps it per recipient Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tscenegen (from package fff_vtt) using c backend + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tscenegen (from package fff_vtt) using c backend Nim Output [Suite] scenegen (bench scenes) ... [OK] exactly n walls, deterministic per seed, seeds differ ... [OK] doors are every 10th wall, all closed; walls stay inside the world (+- jitter) ... [OK] walls are non-degenerate and axis-ish segments of room-edge length Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/ttiles (from package fff_vtt) using c backend - Nim Output [Suite] tile URL grammar + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/ttiles (from package fff_vtt) using c backend + Nim Output /home/davide/Projects/GDR/FFF_vtt-b36/server/worldmap.nim(18, 44) Warning: imported and not used: 'faults' [UnusedImport] + ... /home/davide/Projects/GDR/FFF_vtt-b36/server/vision.nim(31, 43) Warning: imported and not used: 'faults' [UnusedImport] + ... [Suite] tile URL grammar ... [OK] canonical numbers: digits only, bounded, no leading zero ... [OK] a canonical URL parses to its three integers ... [OK] leading zero tile coordinates are malformed @@ -366,7 +401,7 @@ ... [Suite] one scene record per request (#31) ... [OK] a request built from one record stays internally consistent when the scene is swapped Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/ttokens (from package fff_vtt) using c backend + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/ttokens (from package fff_vtt) using c backend Nim Output [Suite] ids (DESIGN 8, FIXED #3: random, opaque, 12 chars) ... [OK] 12 characters from the documented alphabet ... [OK] freshId never returns an id that is taken @@ -399,8 +434,10 @@ ... [OK] removing a token removes its status rows (FK cascade) ... [OK] status helpers keep the entry set unique and ordered Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tviews (from package fff_vtt) using c backend - Nim Output [Suite] GM view (3.1: everything, with the GM-only extras) + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tviews (from package fff_vtt) using c backend + Nim Output /home/davide/Projects/GDR/FFF_vtt-b36/server/worldmap.nim(18, 44) Warning: imported and not used: 'faults' [UnusedImport] + ... /home/davide/Projects/GDR/FFF_vtt-b36/server/vision.nim(31, 43) Warning: imported and not used: 'faults' [UnusedImport] + ... [Suite] GM view (3.1: everything, with the GM-only extras) ... [OK] every token, in token order, with controller and both names ... [OK] a GM-controlled token shows controller null ... [OK] the GM never gets vision polygons or explored cells @@ -442,13 +479,16 @@ ... [OK] a player never receives another player's list ... [Suite] egress borrows the world instead of copying it (#28) ... [OK] a Context is six addresses: in-place changes are visible through the borrow - ... #28 context build, 262144 cells x 6 players: 0.008 us - ... #28 egress, 262144 cells x 6 players x 40 entries: GM 0.788 ms, player 0.322 ms - ... #28 egress, 16384 cells x 6 players x 40 entries: GM 0.806 ms + ... #28 context build, 262144 cells x 6 players: 0.007 us + ... #28 egress, 262144 cells x 6 players x 40 entries: GM 0.824 ms, player 0.332 ms + ... #28 egress, 16384 cells x 6 players x 40 entries: GM 0.862 ms ... [OK] building a Context and egressing does not scale with the explored sets Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tvision (from package fff_vtt) using c backend - Nim Output [Suite] polygons (5.1: one per controlled token with the `vision` flag) + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tvision (from package fff_vtt) using c backend + Nim Output /home/davide/Projects/GDR/FFF_vtt-b36/server/worldmap.nim(18, 44) Warning: imported and not used: 'faults' [UnusedImport] + ... /home/davide/Projects/GDR/FFF_vtt-b36/server/vision.nim(31, 43) Warning: imported and not used: 'faults' [UnusedImport] + ... /home/davide/Projects/GDR/FFF_vtt-b36/tests/tvision.nim(4, 13) Warning: imported and not used: 'algorithm' [UnusedImport] + ... [Suite] polygons (5.1: one per controlled token with the `vision` flag) ... [OK] only the player's own vision tokens produce one, in token order ... [OK] a player with no vision token has no polygons at all ... [OK] the polygon is bounded by the token's range, and a closer wall cuts it @@ -468,13 +508,14 @@ ... [OK] a gm_only token inside the LOS is not visible to anyone else ... [OK] a player with no vision token sees only what they control Success: Execution finished - Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tworld (from package fff_vtt) using c backend + Compiling /home/davide/Projects/GDR/FFF_vtt-b36/tests/tworld (from package fff_vtt) using c backend Nim Output [Suite] scene (migration step 3, Q3: exactly one scene) ... [OK] the migration seeds scene 1 with the v1 defaults, no walls, next_wall_id 1 ... [OK] an unknown scene id is not there (the wire answers not-found) ... [Suite] field parsing (6.1 field notes) ... [OK] a point is exactly two finite numbers, ints included - ... [OK] kind, open and flags accept only their own shape + ... [OK] position, sight_dir and flags accept only their own shape + ... [OK] kind is derived from the switches, never stored (5.8) ... [OK] undefined and null are the same as an absent field ... [Suite] wall ids (FIXED #3: per scene, monotonic, never reused) ... [OK] adds count from 1 and the counter advances @@ -482,14 +523,20 @@ ... [OK] the id counter survives a reload, even when the newest wall was removed ... [Suite] persistence (write-through, restart-identical) ... [OK] add, update, door set and remove round-trip through a reload + ... [OK] door.set refuses to open a secret or locked door, closing either is allowed (#56) + ... [OK] nullable height and label use SQL literals and round-trip as none, not 0 or '' ... [OK] authoring runs with synchronous=FULL and leaves NORMAL behind (Q12) ... [OK] a failing write leaves memory and the pragma alone ... [OK] walls load in id order whatever the insertion order was ... [Suite] validation (DESIGN 6.1 `wall.*`) ... [OK] a zero-length wall is invalid and writes nothing ... [OK] both endpoints must be inside [0,w] x [0,h]; the border itself is allowed + ... [OK] presets expand to switches only through the one resolve path (#55) + ... [OK] the switch-set invariants reject door-only settings on a non-door (#55) + ... [OK] storable is the last gate: a secret or locked non-door is refused + ... [OK] a label is 1..64 code points, trimmed and free of control characters (#55) ... [OK] a wall is never open: the stored row normalizes it - ... [OK] update keeps the row's id and open flag unless the kind changes + ... [OK] update keeps the row's id and open flag unless the door switch is cleared ... [OK] dot patching: only the given fields change ... [Suite] lookup outcomes (main.nim's 6.5 mapping) ... [OK] unknown ids are not-found, wrong kinds are their own outcome diff --git a/tools/evidence.mjs b/tools/evidence.mjs new file mode 100644 index 0000000..1c5c236 --- /dev/null +++ b/tools/evidence.mjs @@ -0,0 +1,101 @@ +// #36: the evidence half of the M3 group map. `GROUPS` (tools/groups.mjs) names, per acceptance +// group, the exact test that proves it plus the assertions/calls its body must keep. This module +// turns that claim into something checkable in two places: +// +// * `findTestBody` (static, used by tools/groups.test.mjs): the declaration exists exactly once, +// its body still holds at least `minAsserts` assertions and every required snippet; +// * this file's CLI (run by tools/test.sh AFTER the Node suite): the reporter output shows every +// registered test actually ran and passed, and none of them was skipped. A title substring in a +// comment, an emptied test body, or a registration that never runs cannot satisfy it. +import fs from 'node:fs' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import { GROUPS } from './groups.mjs' + +const escapeRe = s => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + +// A test title as written in the source, with `${...}` standing for the case it is built for. +export function titleToRegExp(title) { + const parts = String(title).split(/\$\{[^}]*\}/g).map(escapeRe) + return new RegExp(`^${parts.join('.*?')}$`) +} + +// The source text of one test declaration: located by its exact title literal, bounded by the +// matching close of the `test(` call at the declaration's own indentation. +export function findTestBody(fileText, title) { + const needles = ['`', "'", '"'].map(q => `test(${q}${title}${q}`) + const hits = needles.map(n => fileText.indexOf(n)).filter(i => i >= 0) + if (hits.length !== 1) return null // absent, or declared under more than one quoting/title + const start = fileText.lastIndexOf('\n', hits[0]) + 1 + const indent = fileText.slice(start, hits[0]) + if (/\S/.test(indent)) return null + const closer = new RegExp(`^${escapeRe(indent)}\\}\\)\\s*$`, 'm') + const rest = fileText.slice(start) + const m = closer.exec(rest) + if (!m) return null + return { start, end: start + m.index, body: rest.slice(0, m.index) } +} + +const GLYPH = /^\s*(✔|✖|﹣)\s+(.+?)\s+\((?:<1|\d+(?:\.\d+)?)ms\)(?:\s+#\s+(SKIP|TODO))?\s*$/ + +// The spec reporter's per-test lines, as `devbox run test` records them in results/node-test.log. +export function parseReporter(text) { + const out = [] + for (const line of text.split('\n')) { + const m = GLYPH.exec(line) + if (!m) continue + const [, glyph, name, skipped] = m + const status = glyph === '✖' ? 'fail' : (skipped || glyph === '﹣') ? 'skipped' : 'pass' + out.push({ name, status }) + } + return out +} + +export function checkLog(logText, groups = GROUPS) { + const ran = parseReporter(logText) + const errors = [] + let checked = 0 + for (const [group, spec] of Object.entries(groups)) { + for (const ev of spec.evidence) { + checked += 1 + const rx = titleToRegExp(ev.test) + const hits = ran.filter(t => rx.test(t.name)) + const passed = hits.filter(t => t.status === 'pass').length + const failed = hits.filter(t => t.status === 'fail').length + const skipped = hits.filter(t => t.status === 'skipped').length + const want = ev.minTests ?? 1 + const where = `${group}: ${ev.file} "${ev.test}"` + if (passed < want) { + errors.push(`${where}: ${passed} passing run(s), expected at least ${want}` + + (hits.length ? ` (saw ${JSON.stringify(hits.slice(0, 4))})` : ' (never ran)')) + } + if (failed > 0) errors.push(`${where}: ${failed} failing run(s)`) + if (skipped > 0) errors.push(`${where}: ${skipped} skipped run(s)`) + } + } + return { checked, errors } +} + +function main(argv) { + const root = path.dirname(fileURLToPath(import.meta.url)) + const logPath = argv[2] ?? path.join(root, '..', 'results', 'node-test.log') + let text + try { + text = fs.readFileSync(logPath, 'utf8') + } catch (e) { + console.error(`evidence: cannot read ${logPath}: ${e.message}`) + return 1 + } + const { checked, errors } = checkLog(text) + if (errors.length) { + console.error(`evidence: ${errors.length} group evidence problem(s) in ${logPath}:`) + for (const e of errors) console.error(` - ${e}`) + return 1 + } + console.log(`evidence: ${checked} registered group evidence test(s) ran and passed (${logPath})`) + return 0 +} + +if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) { + process.exitCode = main(process.argv) +} diff --git a/tools/groups.mjs b/tools/groups.mjs index fd27999..8a236cd 100644 --- a/tools/groups.mjs +++ b/tools/groups.mjs @@ -1,8 +1,14 @@ // The nine M3 acceptance groups of DESIGN 13 (FIXED by owner decision #12) and the test that proves // each one. `devbox run test` runs every `tools/*.test.mjs`; this map is the checklist the finish -// line (#25) records in DESIGN 14, and tools/groups.test.mjs fails if a group's file or its named -// evidence test disappears. Slice-level test files that are not an accept group (smoke, walls, -// tokens, details, scene, wsheaders) still run; they are not listed here. +// line (#25) records in DESIGN 14. +// +// #36: an evidence entry is not a title substring. It names the test's exact title (a `${...}` +// placeholder marks a title the file builds per case), the minimum number of `assert.*` calls its +// body must keep, and any distinctive call the body must keep executing. `tools/groups.test.mjs` +// checks those against the source statically; the final step of `tools/test.sh` parses the Node +// test runner's reporter output and fails unless every registered title actually ran and passed +// (tools/evidence.mjs). A test hollowed out to its title, or one that is registered but never runs, +// therefore fails the gate. export const GROUPS = { 'leak+fault': { // The transcript checker and its negative controls, plus the two Walls r1 harnesses whose @@ -10,50 +16,100 @@ export const GROUPS = { // #56) and the player marker group (#59/#60). #61's scenario rewrite keeps all of them green. files: ['leak.test.mjs', 'fault.test.mjs', 'doors.test.mjs', 'markers.test.mjs'], evidence: [ - ['leak.test.mjs', 'leak test ${subject}: the subject\'s whole view matches the GM\'s truth'], - ['fault.test.mjs', 'caught as exactly'], - ['doors.test.mjs', 'fault secretgap: the equivalence group fails as exactly SECRETGAP'], - ['markers.test.mjs', 'retraction: every cause sends del only, a re-earned marker gets a fresh id (#60)'], + { file: 'leak.test.mjs', + test: "leak test ${subject}: the subject's whole view matches the GM's truth", + minTests: 2, minAsserts: 8, requires: ['runChecker(transcript, subject)'] }, + { file: 'fault.test.mjs', + test: "fault ${fault}: caught as exactly ${expected.join(' ')}", + minAsserts: 2, requires: ['classesOf(check.output)'] }, + { file: 'doors.test.mjs', + test: 'fault secretgap: the equivalence group fails as exactly SECRETGAP', + minAsserts: 1, requires: ["equivalenceClasses(a, b), ['SECRETGAP']"] }, + { file: 'markers.test.mjs', + test: 'retraction: every cause sends del only, a re-earned marker gets a fresh id (#60)', + minAsserts: 12, requires: ['assertMarkerShape(seen)'] }, ], }, tiles: { files: ['tiles.test.mjs', 'oneway.test.mjs'], - evidence: [['tiles.test.mjs', 'tile gate: leak check (d) matches the independent explored oracle'], - ['oneway.test.mjs', 'one-way sight: the blind side sees nothing across, the seeing side does (#58)']], + evidence: [ + { file: 'tiles.test.mjs', + test: 'tile gate: leak check (d) matches the independent explored oracle', + minAsserts: 6, requires: ['oracle'] }, + { file: 'oneway.test.mjs', + test: 'one-way sight: the blind side sees nothing across, the seeing side does (#58)', + minAsserts: 12, requires: ['withOneWayStack'] }, + ], }, probing: { files: ['probing.test.mjs'], - evidence: [['probing.test.mjs', 'probing over WS: walls beyond cap + radius change no reply']], + evidence: [ + { file: 'probing.test.mjs', + test: 'probing over WS: walls beyond cap + radius change no reply', + minAsserts: 3, requires: ['assert.deepEqual(shape(ra), shape(rb)'] }, + ], }, protocol: { files: ['protocol.test.mjs'], - evidence: [['protocol.test.mjs', 'an unknown type is refused, unknown fields are ignored']], + evidence: [ + { file: 'protocol.test.mjs', + test: 'an unknown type is refused, unknown fields are ignored, and every intent gets one ack', + minAsserts: 6, requires: ['assert.equal'] }, + ], }, auth: { files: ['auth.test.mjs'], - evidence: [['auth.test.mjs', 'key.replace: old key and old sessions die']], + evidence: [ + { file: 'auth.test.mjs', + test: 'key.replace: old key and old sessions die, live connections close, the new key works', + minAsserts: 6, requires: ['assert.notEqual'] }, + ], }, 'characters and names': { files: ['characters.test.mjs'], - evidence: [['characters.test.mjs', 'encountered: a sighting is kept under the name the player knows']], + evidence: [ + { file: 'characters.test.mjs', + test: 'encountered: a sighting is kept under the name the player knows, and survives everything', + minAsserts: 8, requires: ['encountered'] }, + ], }, restart: { files: ['restart.test.mjs'], - evidence: [['restart.test.mjs', 'restart: full state, all CRUD, before and after SIGTERM'], - ['restart.test.mjs', 'restart: full state, all CRUD, before and after SIGKILL']], + evidence: [ + // #36: both variants take the baseline from the first (as-built) server, before the signal; + // the thin wrappers must keep calling the only code path that can prove it. + { file: 'restart.test.mjs', + test: 'restart: full state, all CRUD, before and after SIGTERM', + minAsserts: 0, requires: ['restartGroup(false)'] }, + { file: 'restart.test.mjs', + test: 'restart: full state, all CRUD, before and after SIGKILL', + minAsserts: 0, requires: ['restartGroup(true)'] }, + ], }, persistence: { // The schema-7 fixture driven through the real binary (migration mapping, explored round trip) // plus the behaviour-preservation pair: migrated walls vs the same walls authored through // `wall.add`, byte-identical to a player (stories 29/30/77, #52). files: ['persistence.test.mjs', 'wallbehaviour.test.mjs'], - evidence: [['persistence.test.mjs', 'explored round trip: a fresh connection gets the whole grid'], - ['persistence.test.mjs', 'migration: a schema-4 DB (fixture) migrates under the real binary'], - ['wallbehaviour.test.mjs', 'behaviour preservation: a migrated schema-7 scene and the same scene authored via raw switches are byte-identical to a player']], + evidence: [ + { file: 'persistence.test.mjs', + test: 'explored round trip: a fresh connection gets the whole grid the server accumulated', + minAsserts: 3, requires: ['exploredSnapshot(s.origin, alice)'] }, + { file: 'persistence.test.mjs', + test: 'migration: a schema-4 DB (fixture) migrates under the real binary to the latest schema', + minAsserts: 6, requires: ['assert.equal'] }, + { file: 'wallbehaviour.test.mjs', + test: 'behaviour preservation: a migrated schema-7 scene and the same scene authored via raw switches are byte-identical to a player', + minAsserts: 2, requires: ['assert.deepEqual'] }, + ], }, logs: { files: ['logs.test.mjs'], - evidence: [['logs.test.mjs', 'logs: no key, session cookie or session hash reaches the log']], + evidence: [ + { file: 'logs.test.mjs', + test: 'logs: no key, session cookie or session hash reaches the log', + minAsserts: 8, requires: ['assert.equal'] }, + ], }, } diff --git a/tools/groups.test.mjs b/tools/groups.test.mjs index 8a2915b..3ffd165 100644 --- a/tools/groups.test.mjs +++ b/tools/groups.test.mjs @@ -1,12 +1,14 @@ // The M3 acceptance checklist as a test: the nine groups of DESIGN 13 exist, each points at a real -// harness in tools/, and each carries the named test that proves it (DESIGN 14, #12 / #25). This -// fails if someone renames a group test or deletes a group file, so `devbox run test` cannot go -// green with a group silently unproven. +// harness in tools/, and each carries the exact test that proves it (DESIGN 14, #12 / #25). #36: +// "proves it" is not a substring — the declaration and its body must still hold the assertions and +// the call the group claims, and `tools/test.sh` separately requires the reporter to show every one +// of these tests passing (tools/evidence.mjs), so a hollowed or unrun test cannot count. import test from 'node:test' import assert from 'node:assert/strict' import fs from 'node:fs' import path from 'node:path' import { GROUP_COUNT, GROUPS } from './groups.mjs' +import { findTestBody } from './evidence.mjs' import { projectRoot } from './lib.mjs' const tools = path.join(projectRoot, 'tools') @@ -24,9 +26,23 @@ test('M3 accept: the nine groups of DESIGN 13 are mapped to named harness tests' assert.ok(fs.statSync(full).size > 0, `${group}: ${file} is not empty`) } assert.ok(spec.evidence.length >= 1, `${group}: names its proving test`) - for (const [file, needle] of spec.evidence) { - const text = fs.readFileSync(path.join(tools, file), 'utf8') - assert.ok(text.includes(needle), `${group}: ${file} contains the test "${needle}"`) + for (const ev of spec.evidence) { + assert.ok(spec.files.includes(ev.file), `${group}: evidence file ${ev.file} is one of the group files`) + assert.equal(typeof ev.test, 'string', `${group}: evidence names an exact test title`) + assert.ok(!ev.test.includes('*'), `${group}: the evidence title is exact, not a glob`) + const text = fs.readFileSync(path.join(tools, ev.file), 'utf8') + const found = findTestBody(text, ev.test) + assert.ok(found, + `${group}: ${ev.file} declares exactly one test with the title "${ev.test}" ` + + '(a renamed, duplicated or absent evidence test fails the group)') + const asserts = (found.body.match(/\bassert\.[A-Za-z]+/g) ?? []).length + const min = ev.minAsserts ?? 1 + assert.ok(asserts >= min, + `${group}: "${ev.test}" keeps its assertions (${asserts} found, at least ${min} required)`) + for (const needle of ev.requires ?? []) { + assert.ok(found.body.includes(needle), + `${group}: "${ev.test}" still executes \`${needle}\``) + } } } // Every *group* harness is run by `tools/test.sh` (one glob over tools/*.test.mjs). diff --git a/tools/restart.test.mjs b/tools/restart.test.mjs index 5d3eb57..fc718e3 100644 --- a/tools/restart.test.mjs +++ b/tools/restart.test.mjs @@ -201,15 +201,24 @@ function expectedEncounteredName(who, ids) { [ids.linked]: 'a cloaked figure', [ids.pc]: 'Wanderer' } } -// The full before/after comparison: one fresh GM connection and one fresh connection per player. -async function compareAcross(origin, gmKey, players, ids, expected) { - const beforeGm = await snapshot(origin, gmKey, expected, true) - const before = { gm: beforeGm } +// The full before/after comparison: one fresh connection per player and one fresh GM connection. +// #36: players connect first, so their live sight state is computed before the GM's per-player +// `encountered` lists (whose `grey` is a live sight test, not stored state) are read. Connecting +// them only after the GM would compare a refreshed restarted server against an unrefreshed one. +async function snapshotAll(origin, gmKey, players, expected) { + const all = {} for (const [who, p] of Object.entries(players)) { // Only the character's owner is sent a `character` record (6.1). - before[who] = await snapshot(origin, p.key, - { ...expected, characters: who === 'alice' ? 1 : 0 }, false) + all[who] = await snapshot(origin, p.key, + { ...expected, characters: who === 'alice' ? 1 : 0 }, false) } + all.gm = await snapshot(origin, gmKey, expected, true) + return all +} + +async function compareAcross(origin, gmKey, players, ids, expected) { + const before = await snapshotAll(origin, gmKey, players, expected) + const beforeGm = before.gm // The CRUD inventory is not empty: a restart test over an empty world would prove nothing. assert.ok(beforeGm.walls.walls.length >= 2, 'the wall and the door are there') assert.equal(beforeGm.walls.walls.find(w => w.id === ids.door).open, true, 'the door is open') @@ -242,11 +251,10 @@ async function compareAcross(origin, gmKey, players, ids, expected) { return before } -async function restartAndCompare(stateDir, gmKey, players, ids, expected, hard) { - let s = await startServer({ stateDir }) - const before = await compareAcross(s.origin, gmKey, players, ids, expected) +// Kill the server that holds the as-built world. SIGKILL is deliberate for the hard variant: every +// ack is sent after COMMIT (4.2), so a hard kill cannot lose an acked mutation. +async function stopWithSignal(s, hard) { if (hard) { - // Every ack is sent after COMMIT (4.2), so a hard kill cannot lose an acked mutation. s.child.kill('SIGKILL') const deadline = Date.now() + 5000 while (s.child.signalCode === null && s.child.exitCode === null && Date.now() < deadline) { @@ -254,19 +262,22 @@ async function restartAndCompare(stateDir, gmKey, players, ids, expected, hard) } } await stopServer(s) +} - s = await startServer({ stateDir }) +// #36: `before` is the snapshot of the *as-built* world on the first server instance, taken after +// the CRUD and before any restart. The old version took it after a restart, so a field silently +// dropped on the first load was missing from both sides and the deepEqual held. +async function restartAndCompare(stateDir, before, gmKey, players, ids, expected) { + let s = await startServer({ stateDir }) try { - const afterGm = await snapshot(s.origin, gmKey, expected, true) - assert.deepEqual(afterGm, before.gm, 'the GM resync after the restart is identical') - for (const [who, p] of Object.entries(players)) { - const after = await snapshot(s.origin, p.key, - { ...expected, characters: who === 'alice' ? 1 : 0 }, false) - assert.deepEqual(after, before[who], + const after = await snapshotAll(s.origin, gmKey, players, expected) + assert.deepEqual(after.gm, before.gm, 'the GM resync after the restart is identical') + for (const who of Object.keys(players)) { + assert.deepEqual(after[who], before[who], `${who}'s resync after the restart is identical`) // ... and the absolute truth, so two equally wrong snapshots cannot pass (#27). for (const [id, name] of Object.entries(expectedEncounteredName(who, ids))) { - assert.equal(after.encountered.set.find(e => e.id === id)?.name, name, + assert.equal(after[who].encountered.set.find(e => e.id === id)?.name, name, `${who}'s encountered entry for ${id} after the restart`) } } @@ -305,6 +316,7 @@ async function restartGroup(hard) { let s = await startServer({ stateDir }) let saved let markerRows + let before try { saved = await buildWorld(s.origin, gmKey) players.alice = saved.alice @@ -331,11 +343,14 @@ async function restartGroup(hard) { assert.equal(linkedRows[String(saved.bob.id)], '') assert.equal(linkedRows[String(saved.carol.id)], '', 'the reveal to Alice did not write Bob\'s or Carol\'s row (#27)') + // #36: the baseline is this live server's full resync, built by the CRUD above and never + // reloaded from disk. A field lost when the first server reloads the DB fails the comparison. + before = await compareAcross(s.origin, gmKey, players, saved.ids, EXPECTED) } finally { - await stopServer(s) + await stopWithSignal(s, hard) } try { - await restartAndCompare(stateDir, gmKey, players, saved.ids, EXPECTED, hard) + await restartAndCompare(stateDir, before, gmKey, players, saved.ids, EXPECTED) assert.deepEqual(dbMarkerRows(stateDir, saved.ids.window), markerRows, 'the marker_seen rows (player and opaque id) survive the restart unchanged') } finally { diff --git a/tools/test.sh b/tools/test.sh index 36021e7..d4d0c26 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -11,7 +11,10 @@ fi cat results/nimble-test.log # One file at a time: every harness builds and runs the same real binary (run/test/server) and # starts real servers; serialising removes build/write races. Ports and state dirs are isolated. -node --test --test-concurrency=1 tools/*.test.mjs > results/node-test.log 2>&1 +node --test --test-concurrency=1 --test-reporter=spec tools/*.test.mjs > results/node-test.log 2>&1 rc=$? cat results/node-test.log -exit $rc +[ $rc -eq 0 ] || exit $rc +# #36: the group map's evidence is only proof if the named tests actually ran and passed. This is a +# separate post-run step because groups.test.mjs runs inside the suite it would have to inspect. +node tools/evidence.mjs results/node-test.log || exit 1