feat(walls): player markers — emission, opaque ids, storage, resync (#59)

A wall that is player_marker:true and derives window sends a player one
anchor (the drawn midpoint, integer px) and an opaque per-player 12-char id
once any point of its segment enters that player's vision polygon. Markers
live in PlayerVision like explored, persist to marker_seen in the same
derived-memory transaction, load before the first connection and resync as a
full set after explored; the GM and other players never receive one.

- markers.nim: emission gate, visible-extent test, id mint, anchor, marker_seen I/O.
- views/main: PlayerView markers + full/diff frames, refresh sync, startup load.
- markers.test.mjs: window preset, switch off, solid wall, any-part anchor,
  walk-away/door/lost sight, full-after-explored, per-player privacy, GM none.
- leakcheck: marker allowed type + independent visible-extent oracle with a
  positive control (a marked window the subject sees).
- restart: marked window in the fixture; marker set and marker_seen rows
  identical before/after SIGTERM and SIGKILL.
- protocol/tviews: catalogue and frame order pin the 16th message.

Retraction, re-earning and MARKER_* faults are #60.

Ref #59
This commit is contained in:
2026-11-19 23:27:26 +01:00
parent e989100f50
commit edd4437f7e
11 changed files with 599 additions and 47 deletions
+7
View File
@@ -286,6 +286,13 @@ export async function runLeak({ origin, gmKey, stateDir, transcript, keepOpen =
id: wallIds[wallIds.length - 1] })
if (ack.ok !== true) throw new Error(`wall.remove refused: ${JSON.stringify(ack)}`)
})
// Walls r1 (#59): a marked window in the subject's sight. The window preset carries the marker,
// so the subject gets exactly one opaque-id anchor after the explored diff; the checker's own
// visible-extent oracle independently expects the drawn midpoint (520,800). It sits in the room,
// east of the x=500 walls and clear of every scripted path (x >= 560 or the door line).
await group('GM adds a marked window in the subject sight', async () => {
await addWall({ preset: 'window', a: [520, 700], b: [520, 900] })
})
// Slice 8 (#23): characters, names and the encountered list. Every group here is one the subject
// receives: A is in the room, and C1's token is placed next to A's own.
await group('GM creates a character owned by the other player', async () => {