Walls r1: player markers — emission, opaque ids, storage, resync #59

Closed
opened 2026-11-19 21:48:24 +01:00 by SirStone · 1 comment
Owner

Part of #52

Goal

a marker is emitted only for a wall that is both player_marker:true and derives window; anchor = drawn midpoint (integer px); it qualifies once any point of the visible extent enters the player's polygon. marker {full,set,del} after explored on connect/resync; marker_seen per player/wall with a fresh opaque 12-char id; loaded before first connection; survives restart; never sent to the GM or another player.

Acceptance criteria

  • Window preset ships marker on; toggling it off yields an invisible barrier; a solid wall with the switch on emits nothing.
  • Anchor and marker count exact; no wall id or wall field in the frame.
  • Marker persists across walk-away, door close and lost sight; full set after explored; per-player privacy; GM gets none.
  • Restart: identical resync before/after incl. marker set; marker_seen row present per player/wall.
  • Leak checker: marker allowed type + independent visible-extent oracle with positive control.
  • 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

9, 10, 39, 51, 52, 54, 55, 56, 58, 59, 60, 66, 68, 69

Proven at

  • WS black-box (restart, walls/token-details).
  • Leak checker.
  • Restart fixture.

Notes

  • Size: L.
  • Blocked by: #57, W6.
Part of #52 ## Goal a marker is emitted only for a wall that is both `player_marker:true` and derives window; anchor = drawn midpoint (integer px); it qualifies once any point of the visible extent enters the player's polygon. marker {full,set,del} after explored on connect/resync; `marker_seen` per player/wall with a fresh opaque 12-char id; loaded before first connection; survives restart; never sent to the GM or another player. ## Acceptance criteria - Window preset ships marker on; toggling it off yields an invisible barrier; a solid wall with the switch on emits nothing. - Anchor and marker count exact; no wall id or wall field in the frame. - Marker persists across walk-away, door close and lost sight; full set after explored; per-player privacy; GM gets none. - Restart: identical resync before/after incl. marker set; `marker_seen` row present per player/wall. - Leak checker: `marker` allowed type + independent visible-extent oracle with positive control. - 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 9, 10, 39, 51, 52, 54, 55, 56, 58, 59, 60, 66, 68, 69 ## Proven at - WS black-box (restart, walls/token-details). - Leak checker. - Restart fixture. ## Notes - Size: L. - Blocked by: #57, W6.
SirStone added the ready-for-agentenhancement labels 2026-11-19 21:48:24 +01:00
SirStone added a new dependency 2026-11-19 21:48:29 +01:00
SirStone added a new dependency 2026-11-19 21:48:29 +01:00
Author
Owner

Implemented on main in edd4437 (pushed to origin/main).

  • Emission/storage: server/markers.nim gates on player_marker:true + derived window and the player's own vision polygon (segment endpoint inside or edge crossing; thickness inert this round). Anchor = drawn midpoint, rounded once. Per-player opaque 12-char id minted fresh, persisted in marker_seen in the same derived-memory transaction as explored, loaded at startup before the first connection.
  • Wire/resync: PlayerView carries markers; marker {full,set:[{id,pos}],del} is sent only to the owning player, full set after explored on connect/resync, diffs afterwards. GM branch never emits it; no wall id/field in the frame.
  • Tests: new tools/markers.test.mjs (window preset vs switch off vs solid wall, exact anchor/count, any-part qualification with midpoint outside the radius, walk-away/door/lost sight, full-after-explored, per-player privacy, GM none); leak checker now allows marker and has an independent visible-extent oracle with a positive control (marked window in the tools/leak.mjs scenario); restart fixture carries a marked window and asserts identical marker sets and marker_seen rows across SIGTERM/SIGKILL; protocol/tviews pin the 16th message and its order.

Suites on a clean tree: nimble test -y all passed (389 [OK] across 22 test binaries); node --test --test-concurrency=1 tools/*.test.mjs 131/131 passed.

Out of scope per the ticket and left for #60: retraction (remove/switch off/no-longer-window/geometry move), re-earn with a fresh id, and the MARKER_EARLY/MARKER_EXTRA/MARKER_OFF fault classes. Note: wall.remove's DB cascade drops marker_seen rows, so a marker for a removed wall disappears on restart; that retraction rule is #60.

Implemented on `main` in edd4437 (pushed to origin/main). - **Emission/storage:** `server/markers.nim` gates on `player_marker:true` + derived `window` and the player's own vision polygon (segment endpoint inside or edge crossing; thickness inert this round). Anchor = drawn midpoint, rounded once. Per-player opaque 12-char id minted fresh, persisted in `marker_seen` in the same derived-memory transaction as explored, loaded at startup before the first connection. - **Wire/resync:** `PlayerView` carries markers; `marker {full,set:[{id,pos}],del}` is sent only to the owning player, full set after `explored` on connect/resync, diffs afterwards. GM branch never emits it; no wall id/field in the frame. - **Tests:** new `tools/markers.test.mjs` (window preset vs switch off vs solid wall, exact anchor/count, any-part qualification with midpoint outside the radius, walk-away/door/lost sight, full-after-explored, per-player privacy, GM none); leak checker now allows `marker` and has an independent visible-extent oracle with a positive control (marked window in the `tools/leak.mjs` scenario); restart fixture carries a marked window and asserts identical marker sets and `marker_seen` rows across SIGTERM/SIGKILL; protocol/tviews pin the 16th message and its order. Suites on a clean tree: `nimble test -y` all passed (389 `[OK]` across 22 test binaries); `node --test --test-concurrency=1 tools/*.test.mjs` 131/131 passed. Out of scope per the ticket and left for #60: retraction (remove/switch off/no-longer-window/geometry move), re-earn with a fresh id, and the `MARKER_EARLY`/`MARKER_EXTRA`/`MARKER_OFF` fault classes. Note: `wall.remove`'s DB cascade drops `marker_seen` rows, so a marker for a removed wall disappears on restart; that retraction rule is #60.
Sign in to join this conversation.