Walls r1: marker retraction, re-earn and marker fault classes #60

Closed
opened 2026-11-19 21:48:25 +01:00 by SirStone · 2 comments
Owner

Part of #52

Goal

remove, switch off, no-longer-window and geometry move (incl. thickness/position) retract a marker; a move never reveals the new position early; a re-earned marker gets a fresh id and is never updated in place; inserts/deletes ride the derived-memory NORMAL transaction after the wall row commits and before the ack.

Acceptance criteria

  • Each of the four causes produces del only; re-earn produces a new id.
  • An untouched marker never re-sends; set and del never both for one id; no explored cell or tile written by a retraction.
  • New fault hooks MARKER_EARLY, MARKER_EXTRA, MARKER_OFF each caught as exactly their own class, with negative controls.
  • Standing: full nimble + node test suites green on a clean checkout; no existing test weakened or skipped; behaviour proven at the approved seams (WS black-box, leak checker + fault builds, schema-7 migration fixture).

User stories covered

37, 38, 53, 57, 67

Proven at

  • WS black-box (retraction script).
  • Fault builds.

Notes

  • Size: S/M.
  • Blocked by: #59.
Part of #52 ## Goal remove, switch off, no-longer-window and geometry move (incl. thickness/position) retract a marker; a move never reveals the new position early; a re-earned marker gets a fresh id and is never updated in place; inserts/deletes ride the derived-memory NORMAL transaction after the wall row commits and before the ack. ## Acceptance criteria - Each of the four causes produces `del` only; re-earn produces a new id. - An untouched marker never re-sends; `set` and `del` never both for one id; no explored cell or tile written by a retraction. - New fault hooks `MARKER_EARLY`, `MARKER_EXTRA`, `MARKER_OFF` each caught as exactly their own class, with negative controls. - Standing: full nimble + node test suites green on a clean checkout; no existing test weakened or skipped; behaviour proven at the approved seams (WS black-box, leak checker + fault builds, schema-7 migration fixture). ## User stories covered 37, 38, 53, 57, 67 ## Proven at - WS black-box (retraction script). - Fault builds. ## Notes - Size: S/M. - Blocked by: #59.
SirStone added the ready-for-agentenhancement labels 2026-11-19 21:48:25 +01:00
SirStone added a new dependency 2026-11-19 21:48:29 +01:00
Author
Owner

Implemented in c3c0a39.

Retraction / re-earn: syncMarkers retracts a marker when its wall is gone or its marker signature changed (endpoints, thickness, position, player_marker, derived window). Retraction sends del only and never the new anchor; a re-earned marker gets a fresh id (dead ids are excluded from reuse). Marker deletes run in the same derived-memory NORMAL transaction as the explored chunks, after the wall row commits and before the ack. WS black-box group tools/markers.test.mjs: all four causes (del only), fresh ids on five re-earns, no untouched re-send, no set+del for one id, no explored/vision frame from a pure retraction, and delete/cascade durability across a restart.

Fault classes: aggregate MARKER replaced by MARKER_EARLY, MARKER_EXTRA, MARKER_OFF; hooks markerEarly (drop extent gate), markerExtra (drop derived-window gate), markerOff (never mint), each caught as exactly its own class by tools/fault.test.mjs. Leak scenario gains an unseen marked window and a marked solid wall as negative controls; checker oracle now retracts expected markers on cause change.

Suites: nimble test -y green (all in-process suites); node --test --test-concurrency=1 tools/*.test.mjs 136/136 pass. No existing test weakened or skipped; results/* reverted before commit.

Standing note: #61 still owns the final leak scenario rewrite; this kept the scenario addition minimal for the fault controls.

Implemented in c3c0a39. **Retraction / re-earn:** `syncMarkers` retracts a marker when its wall is gone or its marker signature changed (endpoints, thickness, position, `player_marker`, derived `window`). Retraction sends `del` only and never the new anchor; a re-earned marker gets a fresh id (dead ids are excluded from reuse). Marker deletes run in the same derived-memory NORMAL transaction as the explored chunks, after the wall row commits and before the ack. WS black-box group `tools/markers.test.mjs`: all four causes (del only), fresh ids on five re-earns, no untouched re-send, no `set`+`del` for one id, no explored/vision frame from a pure retraction, and delete/cascade durability across a restart. **Fault classes:** aggregate `MARKER` replaced by `MARKER_EARLY`, `MARKER_EXTRA`, `MARKER_OFF`; hooks `markerEarly` (drop extent gate), `markerExtra` (drop derived-window gate), `markerOff` (never mint), each caught as exactly its own class by `tools/fault.test.mjs`. Leak scenario gains an unseen marked window and a marked solid wall as negative controls; checker oracle now retracts expected markers on cause change. **Suites:** `nimble test -y` green (all in-process suites); `node --test --test-concurrency=1 tools/*.test.mjs` 136/136 pass. No existing test weakened or skipped; `results/*` reverted before commit. Standing note: `#61` still owns the final leak scenario rewrite; this kept the scenario addition minimal for the fault controls.
Author
Owner

Crash-window leak fix landed in a69563f (fix: marker_seen deletes commit with the wall change).

A cause-change wall.update now deletes the affected marker_seen rows in the same FULL transaction as the wall row (like the wall.remove FK cascade); live del frames and the NORMAL-transaction marker inserts are unchanged. markerSig moved to world.markerSig so the write path and the online retraction share one rule.

Proof: leakfault-only LEAK_FAULT=markerCrash quits between the wall commit and the derived write. tools/markers.test.mjs covers all four causes (endpoint move, thickness, player_marker off, no longer a window), restarts clean, asserts none restores the old marker (endpoint move also asserts the new anchor is absent) and that an untouched window's marker is restored as positive control. Full nimble test -y and node --test --test-concurrency=1 tools/*.test.mjs green (141/141).

Crash-window leak fix landed in a69563f (`fix: marker_seen deletes commit with the wall change`). A cause-change `wall.update` now deletes the affected `marker_seen` rows in the same FULL transaction as the wall row (like the `wall.remove` FK cascade); live `del` frames and the NORMAL-transaction marker inserts are unchanged. `markerSig` moved to `world.markerSig` so the write path and the online retraction share one rule. Proof: leakfault-only `LEAK_FAULT=markerCrash` quits between the wall commit and the derived write. `tools/markers.test.mjs` covers all four causes (endpoint move, thickness, player_marker off, no longer a window), restarts clean, asserts none restores the old marker (endpoint move also asserts the new anchor is absent) and that an untouched window's marker is restored as positive control. Full `nimble test -y` and `node --test --test-concurrency=1 tools/*.test.mjs` green (141/141).
Sign in to join this conversation.