feat(walls): marker retraction, re-earn and marker fault classes (#60)

Retract a player marker when the GM removes the wall, clears
player_marker, makes the wall stop deriving window, or moves its
geometry (a/b, thickness, position). Retraction emits del only and
never the new anchor; a re-earned marker gets a fresh id. The
marker_seen deletes ride the same derived-memory NORMAL transaction as
the explored chunks, after the wall row commits and before the ack.

Replace the leak checker's aggregate MARKER class with MARKER_EARLY,
MARKER_EXTRA and MARKER_OFF, add their leakfault hooks and exact-class
fault tests, and extend the leak scenario with an unseen marked window
and a marked solid wall as the negative controls. WS black-box tests
cover all four causes, fresh re-earns, no untouched re-send, no
set/del for one id in a frame, no explored write from a retraction,
and delete/cascade durability across a restart.
This commit is contained in:
2026-11-19 23:43:44 +01:00
parent edd4437f7e
commit c3c0a39188
9 changed files with 425 additions and 60 deletions
+20 -10
View File
@@ -60,7 +60,7 @@ How to run: `devbox run test` = Nim in-process tests first, then the Node black-
| # | Proving test |
|---|---|
| T1 | leak test + fault classes |
| T2 | fault `walls` [MEASURED caught]; door-equivalence test (T17, §10.3) [MEASURED caught: fault `secretgap`]; `MARKER_EARLY`/`MARKER_EXTRA`/`MARKER_OFF` (§10.3) — planned: Walls r1 #59/#60 |
| T2 | fault `walls` [MEASURED caught]; door-equivalence test (T17, §10.3) [MEASURED caught: fault `secretgap`]; `MARKER_EARLY`/`MARKER_EXTRA`/`MARKER_OFF` (§10.3) [MEASURED caught: `tools/fault.test.mjs`, Walls r1 #60] |
| T3 | faults `other-*` [MEASURED caught] |
| T4 | leak (d) against the independent oracle, smoke steal check, direct `/_tiles/` -> 404 (M3 test nginx) |
| T5 | documented, not testable as a leak; M4 timing gates (§13) |
@@ -350,9 +350,12 @@ from the prototype, what was missing, what the M3 build added, and the tools it
exact-class assertion; the shipped binary must contain no `LEAK_FAULT`. Built: `HIDDEN_TOKEN`,
`GMONLY_TOKEN`, `WALLDATA`, `WITHHELD`, `NO_REMOVE`, `OWN_VIEW`, `OTHER_PLAYER`, `EXPLORED`,
`OWNER_PROP`, `GM_PROP`, `STATUS_SOURCE`, `ACTUAL_NAME`, `STALE_NAME`, `CHAR_LIST`,
`CONTROLLER_CHANGE`, `CHAR_OWNER_PROP`, `KEY_IN_LOG`, `ONEWAY` (#58). Walls r1 built: `secretgap`
`CONTROLLER_CHANGE`, `CHAR_OWNER_PROP`, `KEY_IN_LOG`, `ONEWAY` (#58), `MARKER_EARLY`,
`MARKER_EXTRA`, `MARKER_OFF` (#60). Walls r1 built: `secretgap`
(#56), asserted as exactly `SECRETGAP` by `tools/doors.test.mjs` (the differential group, not the
transcript checker). Planned: Walls r1 — `MARKER_EARLY`/`MARKER_EXTRA`/`MARKER_OFF` (#59/#60).
transcript checker); `MARKER_EARLY`/`MARKER_EXTRA`/`MARKER_OFF` (#60), each asserted as exactly
its own class by `tools/fault.test.mjs` (the leak transcript checker, with the scenario's unseen
marked window and marked solid wall as the negative controls).
`tools/leakcheck.nim`
refuses the `gm` bucket, the `owner` bucket on a
non-controller and any `source` on a player status entry. Two consequences: the `hidden` and
@@ -446,13 +449,20 @@ from the prototype, what was missing, what the M3 build added, and the tools it
calling `vision.nim`), checks that a marker exists for a player exactly when some point of the
wall's visible extent has entered that player's polygon **and** the wall is `player_marker:true`
and derives `window`, and that the frame carries only the opaque marker id and the anchor: anything
else is `WALLDATA`/`MARKER`. Positive control: a marked window the subject sees yields exactly one
marker at its drawn midpoint; a wall behind a sight blocker, `player_marker:false`, or a solid wall
with the switch on yields none. The oracle's expected set accumulates like explored memory, so
walking away, a door or lost sight never makes a sent marker wrong. Faults `MARKER_EARLY`,
`MARKER_EXTRA`, `MARKER_OFF` and retraction (removing the wall, clearing the switch, moving the
geometry retracts the marker, never sending the new position early and writing no explored cell or
tile) remain #60.
else is `WALLDATA`/`PROTOCOL`. Positive control: a marked window the subject sees yields exactly
one marker at its drawn midpoint; a wall behind a sight blocker, `player_marker:false`, or a solid
wall with the switch on yields none. The oracle's expected set accumulates like explored memory,
so walking away, a door or lost sight never makes a sent marker wrong; a wall removal, a cleared
switch, a lost `window` or a geometry move retract it (the oracle drops the entry when the GM's
wall frame shows the cause changed, mirroring the server). An extra marker at a candidate's anchor
before its extent was seen is `MARKER_EARLY`; an extra marker with no candidate wall is
`MARKER_EXTRA`; an expected marker never sent is `MARKER_OFF`. Faults `MARKER_EARLY`,
`MARKER_EXTRA`, `MARKER_OFF` (`markerEarly`/`markerExtra`/`markerOff`) are built and asserted as
exactly their own class by `tools/fault.test.mjs`, with the scenario's far unseen marked window
and marked solid wall as the negative controls. The WS group `tools/markers.test.mjs` proves the
four retraction causes (del only), a fresh id on re-earn, no re-send of an untouched marker, no
`set` and `del` for one id in a frame, no explored write from a pure retraction, and durability
of the deletes across a restart.
- **Wall fields, storage and migration (#49).** Three gates. **Leak:** `BannedAlways` contains every
wall field name (`thickness`, `position`, `height`, `blocks_sight`, `blocks_movement`, `sight_dir`,
`player_marker`, `door`, `open`, `secret`, `locked`, `label`, `a`, `b`), so any of them in a player