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
+3 -3
View File
@@ -524,7 +524,7 @@ proc markerEntryJson(m: MarkerView): JsonNode =
proc markerFrame*(entries: seq[MarkerView], full: bool, del: seq[string]): JsonNode =
## `marker {full, set:[{id, pos}], del:[id]}` (DESIGN 6.1). `full:true` replaces the whole set on
## connect/resync and carries no `del`; a diff carries additions in `set` and retractions in `del`,
## never both for one id. Retraction emission is #60; this builder already has the shape.
## never both for one id.
var set: JsonNode = newJArray()
for m in entries: set.add markerEntryJson(m)
result = %*{"t": "marker", "full": full, "set": set}
@@ -593,8 +593,8 @@ proc diffEncountered(known: var Known, key: string, entries: seq[EncounteredView
proc diffMarkers(known: var Known, markers: seq[MarkerView], full: bool): JsonNode =
## One `marker` message or nil (DESIGN 5.8, 6.1): on connect/resync `full:true` with the whole set
## (after `explored`, 6.3); afterwards only new ids in `set`. The `del` path exists in the frame
## shape but the r1 map is add-only: retraction is #60, so it stays empty here.
## (after `explored`, 6.3); afterwards additions in `set` and retractions in `del`, each sorted and
## never the same id in both (a re-earned marker is a new id, 5.8, #60).
var seen = initHashSet[string]()
var set: seq[MarkerView]
var del: seq[string]