test: tie group evidence to passing tests and baseline restart on the as-built server (#36)

- tools/groups.mjs evidence entries now name the exact test, a minimum assertion
  count and the calls its body must keep; groups.test.mjs checks all three.
- tools/evidence.mjs parses the spec reporter log and fails the gate unless every
  registered evidence test ran and passed; test.sh runs it after the Node suite.
- restart.test.mjs snapshots the live as-built world on the first server, then
  compares it to the post-SIGTERM/SIGKILL state (players connect before the GM, so
  the GM's derived encountered grey is computed on both sides).
- Negative controls: a hollowed auth test fails the new evidence check; a planted
  first-load drop of a token's gm prop bucket fails the new restart baseline while
  the old restart-to-restart test passed.
- Refresh the gate evidence (control + 73 mutations incl. s1-s7, 142 node tests).
This commit is contained in:
2026-11-20 21:55:50 +01:00
parent b0e1633aa9
commit 1f11779658
10 changed files with 816 additions and 216 deletions
+80 -33
View File
@@ -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