design: door geometry, thick doors and door push (#50)

This commit is contained in:
2026-11-17 22:17:16 +01:00
parent 409d2c8621
commit 2a160fb274
2 changed files with 20 additions and 12 deletions
+6 -2
View File
@@ -21,7 +21,7 @@ A lock condition meaning the token is held in place: a wall runs through it, or
_Avoid_: blocked
**Squeezed**:
A lock condition meaning the token is pressed with no room: walls surround it, or a closing hand presses it. A player cannot move a squeezed token; the GM always can.
A lock condition meaning the token is pressed with no room: walls around it, a closing door with no room on either side, or a closing hand presses it. A player cannot move a squeezed token; the GM always can.
_Avoid_: blocked, crushed
Neither term names its cause. Stuck and squeezed both lock a token for its player in the same way; they differ only in why.
@@ -63,7 +63,7 @@ An optional free-text name the GM gives a wall, e.g. "railing", "pit edge", "the
_Avoid_: wall name, wall description, wall type
**Wall body**:
The strip of floor a thick wall occupies: the drawn line widened by the wall's thickness, with square ends, sitting either half on each side of the line or all on one side (the GM's placement). The line itself is the room's interior edge, so a GM can draw an exact room and put its thickness outward. A body is solid floor: nobody sees into it or through it, nobody stands in it, and a figure the GM covers with one is stuck. A wall with no thickness has no body, only the line.
The strip of floor a thick wall occupies: the drawn line widened by the wall's thickness, with square ends, sitting either half on each side of the line or all on one side (the GM's placement). The line itself is the room's interior edge, so a GM can draw an exact room and put its thickness outward. A body is solid floor: nobody sees into it or through it, nobody stands in it, and a figure the GM covers with one is stuck. A wall with no thickness has no body, only the line. A door's body is its leaf; an open door has no body at all, only the gap it leaves between the walls beside it.
_Avoid_: footprint, collider, hitbox, thickness (that is the number, not the strip)
**Low wall**:
@@ -90,6 +90,10 @@ _Avoid_: wall kind, wall type, category
A wall whose sight switch carries a direction: it blocks sight from one side and lets the other side see across it. Movement is unaffected by the direction, so a one-way wall still blocks (or lets through) movement on both sides alike. The side is read from the wall's `a -> b` order: `left` is the left of that order, and the named side is the side that **cannot** see across — a viewer on the left of a `left` wall is blind across it, while a viewer on the right sees across. Explored area and tiles differ between the two sides as a consequence of that, and flipping the direction never takes back what either side has already explored. The GM's editor draws an arrow at the wall's middle from the seeing side toward the watched side.
_Avoid_: one-sided wall, directed wall, mirror wall
**Door**:
A piece of wall that can be opened. Closed, it blocks and pushes exactly as its switches say; its leaf is its own body, with the wall's thickness and placement, and nothing else. Open, that whole piece disappears from sight and movement — no leaf, no hinge, no swing, no arc — so the doorway is only the gap between the wall pieces on either side, and closing puts the same body back. A door has no shape of its own: jambs, leaf and thickness are just walls. In v1 only the GM opens or closes a door.
_Avoid_: gateway, portal, door object, swinging door, leaf as a separate thing
**Secret door**:
A door the players never learn exists. It is always closed and, to a player, behaves exactly like a solid wall: same sight, same explored cells, same refusals, nothing that marks it as a door. The GM reveals it by making it an ordinary door and opening it. In v1 no player action finds or opens a door, so the reveal is always the GM's.
_Avoid_: hidden door, concealed door, illusionary wall
+14 -10
View File
@@ -1,6 +1,6 @@
# FFF_vtt design
Status: draft v0.27, 2026-11-16 (owner decisions recorded in section 14; v0.4 records Q4 (tile_size 32 px), the outbox lock invariant (4.2, 4.3), and the follow-ups in 3.4, 8, 11.1, 12, 13; v0.5 records the M2 move-rule decisions in 5.5 and updates 3.4, 4.2, 5.1, 5.4, 6.1, 7.4, 8, 10.3, 12, 13; v0.6 records #14 (characters and player data) in 3.1, 3.4, 4.1, 4.4, 6.1, 8, 9, 10.3, 13, 14; v0.7 records #6 (players and invites) in 3.1, 3.2, 3.4, 4.4, 6.1, 8, 12, 13, 14; v0.8 records #7 (map tiles) in 3.3, 3.4, 11.1, 13, 14; v0.9 records #9 (test tools) in 2, 10.4, 13, 14; v0.10 records #12 (what M3 done means) in 13, 14; v0.11 records #15 (M3 limits) in 4.3, 6.4, 10.1, 13, 14; v0.12 records #11 (M3 message list) in 3.1, 3.2, 3.4, 4.2, 4.3, 5.5, 5.6, 6, 7.5, 13, 14; v0.13 records the owner review of #11 flags in 1, 3.1, 5.5, 6.1, 8, 14; v0.14 records #17 (getting in: keys, sessions, the auth slice) in 3.2, 4.4, 6.5, 6.6, 8, 11.1, 13, 14; v0.15 records #18 (talking safely: the protocol shell and the `closing` close-reason message) in 3.2, 4.3, 6, 6.1, 6.2, 6.4, 6.5, 10.3, 13, 14; v0.16 records #19 (walls and doors: the scene/wall schema, the wall payload rules and the slice-4 rollout) in 4.4, 6.1, 8, 13, 14; v0.17 records #20 (tokens and sight: the `entity` step, the typed views and the single egress, vision and explored, and the slice-5 rollout) in 4.4, 6.1, 6.3, 8, 10.3, 13, 14; v0.18 records #23 (characters and names: the `character`/`name_reveal`/`encountered` step, the name rule, the players' names and the `roster` frame, and the four name/character fault classes) in 4.1, 4.4, 6.1, 6.3, 6.4, 6.5, 8, 10.3, 13, 14; v0.19 records the owner confirmation of the #22 property-schema registry (keep the empty registry with the permissive fallback in v1; strict mode comes with the FFF seam, post-v1) in 6.1, 14; v0.20 records the #27-#31 correctness and cost fixes (per-player reveal persistence, one encountered rewrite path, link-by-update, the borrowed egress context, one scene read per request) in 4.3, 6.1, 10.3, 14; v0.21 records #41 (the height model: metres, `height` and `eye_height` as GM-only registered props with a token override, eye height 93% by default, walls full height unless the GM gives a height) in 5.7, 6.1, 8, 9, 14; v0.22 records #42 (the wall model: independent sight/movement switches with door settings and a sight-only direction, kinds as presets, a derived `kind` label, the v1 preset table, and secret/locked unobservable to players) in 1, 3.1, 5.1, 5.5, 5.8, 6.1, 7.4, 8, 14; v0.23 records #44 (low walls: see-over as a per-target predicate over the strict fog polygon, movement blind to height, the floor behind a low wall left unexplored, and the GM-only who-sees-it view) in 5.7, 5.8, 5.9, 7.4, 14; v0.24 records #46 (secret and locked doors: doors stay GM-only in v1, a locked door refuses to open, and the differential door-equivalence oracle with its fault, leakcheck and tile sweeps) in 1, 3.4, 5.8, 6.1, 6.5, 7.4, 10.3, 14; v0.25 records #45 (thick walls: the rectangular body and its placement, the shared sight/collider rectangle with square ends, see-over at every crossed face, no push on a wall edit, and the shape seam) in 1, 5.1, 5.3, 5.5, 5.7, 5.8, 5.9, 5.10, 6.1, 7.4, 8, 13, 14; v0.26 records #47 (windows as see-through wall pieces with no sill or top and the `window` preset, one-way direction wording, the body opaque from both sides, and the one-way oracle and fault class) in 1, 5.1, 5.8, 5.9, 5.10, 6.1, 7.4, 8, 10.3, 14; v0.27 records #48 (`terrain` dropped, four presets, the `player_marker` switch and its player-wire exception, the GM-only wall `label`, and the "fewest things" principle) in 1, 3.1, 3.4, 5.1, 5.8, 5.9, 5.10, 6.1, 7.4, 8, 10.3, 14. All of Q1-Q24 are RESOLVED or DEFERRED; none OPEN). Audience: the owner and coding agents.
Status: draft v0.28, 2026-11-17 (owner decisions recorded in section 14; v0.4 records Q4 (tile_size 32 px), the outbox lock invariant (4.2, 4.3), and the follow-ups in 3.4, 8, 11.1, 12, 13; v0.5 records the M2 move-rule decisions in 5.5 and updates 3.4, 4.2, 5.1, 5.4, 6.1, 7.4, 8, 10.3, 12, 13; v0.6 records #14 (characters and player data) in 3.1, 3.4, 4.1, 4.4, 6.1, 8, 9, 10.3, 13, 14; v0.7 records #6 (players and invites) in 3.1, 3.2, 3.4, 4.4, 6.1, 8, 12, 13, 14; v0.8 records #7 (map tiles) in 3.3, 3.4, 11.1, 13, 14; v0.9 records #9 (test tools) in 2, 10.4, 13, 14; v0.10 records #12 (what M3 done means) in 13, 14; v0.11 records #15 (M3 limits) in 4.3, 6.4, 10.1, 13, 14; v0.12 records #11 (M3 message list) in 3.1, 3.2, 3.4, 4.2, 4.3, 5.5, 5.6, 6, 7.5, 13, 14; v0.13 records the owner review of #11 flags in 1, 3.1, 5.5, 6.1, 8, 14; v0.14 records #17 (getting in: keys, sessions, the auth slice) in 3.2, 4.4, 6.5, 6.6, 8, 11.1, 13, 14; v0.15 records #18 (talking safely: the protocol shell and the `closing` close-reason message) in 3.2, 4.3, 6, 6.1, 6.2, 6.4, 6.5, 10.3, 13, 14; v0.16 records #19 (walls and doors: the scene/wall schema, the wall payload rules and the slice-4 rollout) in 4.4, 6.1, 8, 13, 14; v0.17 records #20 (tokens and sight: the `entity` step, the typed views and the single egress, vision and explored, and the slice-5 rollout) in 4.4, 6.1, 6.3, 8, 10.3, 13, 14; v0.18 records #23 (characters and names: the `character`/`name_reveal`/`encountered` step, the name rule, the players' names and the `roster` frame, and the four name/character fault classes) in 4.1, 4.4, 6.1, 6.3, 6.4, 6.5, 8, 10.3, 13, 14; v0.19 records the owner confirmation of the #22 property-schema registry (keep the empty registry with the permissive fallback in v1; strict mode comes with the FFF seam, post-v1) in 6.1, 14; v0.20 records the #27-#31 correctness and cost fixes (per-player reveal persistence, one encountered rewrite path, link-by-update, the borrowed egress context, one scene read per request) in 4.3, 6.1, 10.3, 14; v0.21 records #41 (the height model: metres, `height` and `eye_height` as GM-only registered props with a token override, eye height 93% by default, walls full height unless the GM gives a height) in 5.7, 6.1, 8, 9, 14; v0.22 records #42 (the wall model: independent sight/movement switches with door settings and a sight-only direction, kinds as presets, a derived `kind` label, the v1 preset table, and secret/locked unobservable to players) in 1, 3.1, 5.1, 5.5, 5.8, 6.1, 7.4, 8, 14; v0.23 records #44 (low walls: see-over as a per-target predicate over the strict fog polygon, movement blind to height, the floor behind a low wall left unexplored, and the GM-only who-sees-it view) in 5.7, 5.8, 5.9, 7.4, 14; v0.24 records #46 (secret and locked doors: doors stay GM-only in v1, a locked door refuses to open, and the differential door-equivalence oracle with its fault, leakcheck and tile sweeps) in 1, 3.4, 5.8, 6.1, 6.5, 7.4, 10.3, 14; v0.25 records #45 (thick walls: the rectangular body and its placement, the shared sight/collider rectangle with square ends, see-over at every crossed face, no push on a wall edit, and the shape seam) in 1, 5.1, 5.3, 5.5, 5.7, 5.8, 5.9, 5.10, 6.1, 7.4, 8, 13, 14; v0.26 records #47 (windows as see-through wall pieces with no sill or top and the `window` preset, one-way direction wording, the body opaque from both sides, and the one-way oracle and fault class) in 1, 5.1, 5.8, 5.9, 5.10, 6.1, 7.4, 8, 10.3, 14; v0.27 records #48 (`terrain` dropped, four presets, the `player_marker` switch and its player-wire exception, the GM-only wall `label`, and the "fewest things" principle) in 1, 3.1, 3.4, 5.1, 5.8, 5.9, 5.10, 6.1, 7.4, 8, 10.3, 14; v0.28 records #50 (door geometry: the door leaf is the wall's own body, an open door is only a gap, and the thick-door push geometry) in 5.4, 5.5, 5.8, 5.10, 10.3, 14. All of Q1-Q24 are RESOLVED or DEFERRED; none OPEN). Audience: the owner and coding agents.
Legend:
- **[FIXED]** owner decision, not up for debate here.
@@ -317,7 +317,7 @@ Conclusions:
### 5.4 Known limitations (carry forward)
- Token exactly on a wall cannot move off it: `moveBlocked` counts any touch as a hit, so every move from that point is blocked, even a perpendicular step to the open side [MEASURED limit, `tests/tgeometry.nim` test "KNOWN LIMITATION: token exactly on a wall cannot move off it"; also in the `server/geometry.nim` header]. Known limitation, not a policy. Fixed in M2 by the escape rule (5.5). The escape is required by Q14 so the GM can move such a token: mechanism [PROPOSED], requirement [FIXED]. A validated move cannot reach this state (a destination within r of a wall is rejected) [INFERRED from `moveBlocked`]; it arises from a wall/door edit (`stuck` trigger, 5.5) or from a GM placement on a wall (GM placements ignore walls, 5.5); the escape rule covers both.
- Closing a door on a token [FIXED, owner 2026-11-08, supersedes the earlier `blocked` decision for doors; 2026-11-10 #4: failure is `squeezed`]: the token is pushed aside (5.5), `squeezed` only if neither side is valid. Editing or adding a wall on a token [FIXED, Q14]: the token gets `stuck` (trigger narrowed to circle overlap, 5.5). The server refuses that token's player moves; the GM can still move it; status clears per the 5.5 Keep/Clear rules (wall removed or door opened and no other wall overlaps, GM move to a free spot, or GM clear). Current pin: `tests/tgeometry.nim`, suite "door/wall closing on a token", test "door closed on a token: Q14 undecided, DESIGN 5.4 vs 12 H2 conflict": a token whose centre is 10 px off a closed door may move to a clear spot, may not stay overlapped, and may not cross the door. It pins `moveBlocked` only; it is replaced in M2 by tests of the 5.5 policy (under the 5.5 trigger this token is `stuck`, so player moves are refused).
- Closing a door on a token [FIXED, owner 2026-11-08, supersedes the earlier `blocked` decision for doors; 2026-11-10 #4: failure is `squeezed`]: the token is pushed aside (5.5), `squeezed` only if neither side is valid. With thickness the push is measured from the door's body, not its drawn line (5.5, 5.10; #50), and the leaf is that same body — a close is never a swing. Editing or adding a wall on a token [FIXED, Q14]: the token gets `stuck` (trigger narrowed to circle overlap, 5.5). The server refuses that token's player moves; the GM can still move it; status clears per the 5.5 Keep/Clear rules (wall removed or door opened and no other wall overlaps, GM move to a free spot, or GM clear). Current pin: `tests/tgeometry.nim`, suite "door/wall closing on a token", test "door closed on a token: Q14 undecided, DESIGN 5.4 vs 12 H2 conflict": a token whose centre is 10 px off a closed door may move to a clear spot, may not stay overlapped, and may not cross the door. It pins `moveBlocked` only; it is replaced in M2 by tests of the 5.5 policy (under the 5.5 trigger this token is `stuck`, so player moves are refused).
- Boundary epsilon ambiguity (RayEps 1e-4, inclusive tolerances).
- Explored and tile checks in the leak test recompute with the server's own `cellsTouched`: self-consistency only (caveat in 10.2). New independent oracle in section 10.
- Doors/walls changing does not un-explore anything; explored only grows [MEASURED behaviour].
@@ -335,7 +335,7 @@ Notation: token centre `c`, radius `r` (entity `radius` if set, else scene `toke
- Set (source `walls`): a wall is added or updated -> every token overlapping that wall gets `stuck`. (A door CLOSING on a token does not set it: push rule below.) The GM places or moves a token to a position overlapping any blocking wall -> `stuck`.
- Keep: while any blocking wall still overlaps the token, its `walls`-sourced entries stay (opening a door does not free it if another wall overlaps).
- Clear: a wall is removed or a door opened -> each token that overlapped that wall keeps its `walls`-sourced entries only if it still overlaps a remaining blocking wall; otherwise they clear. A shrink (5.6) that ends the overlap clears them likewise. The GM moves the token to a position overlapping no blocking wall -> `walls`-sourced entries cleared. `GM`-sourced entries clear only by GM action (any single `(status, source)` entry; wire intent `status.clear`, 6.1).
- **Door closing on a token = push aside, not stuck** [FIXED, owner, 2026-11-08; changes the door case only]: each token (player or GM-owned) with `dist(c, door) < r` is moved perpendicular to the door segment (with thickness the body of 5.10; a thick door's shape is #50), to the side its centre is already on, by the minimal distance that ends `>= r` from the door (+ `PushEps` = 1e-6 px; past the door's end the offset is `sqrt(r^2 - e^2)`, `e` = along-axis overshoot). Centre exactly on the door line: side of the token's previous position (position before its most recent move or push; `prev`/`hasPrev` on the token); no history, or previous also on the line: left of the door's a->b direction (deterministic default). The pushed position must be in bounds and `>= r` from every blocking wall (the closed door included); else the opposite side is tried; if neither is valid the token stays and gets `squeezed` (source `walls`), and opening that door later clears it per the Clear rule. A pushed token is clear of walls, so its `walls`-sourced entries clear. The push is a server-originated position change returned by the move-rules module (list of token index + new position) so M3 can broadcast it and recompute vision; no step cap applies. Each token is pushed independently; tokens do not block tokens (no token-token collision; the `blocks_move` flag is not modelled in M2), so pushed tokens may overlap each other. Wall add / wall update / GM placement or move inside a wall are unchanged (stuck). Door open is unchanged.
- **Door closing on a token = push aside, not stuck** [FIXED, owner, 2026-11-08; thick-door geometry FIXED (owner-delegated), 2026-11-17, #50; changes the door case only]: a door is a wall like any other, so its **body is the leaf** (5.10) and the push is measured from that body, never from the drawn line. Each token (player or GM-owned) with `dist(c, body) < r` is moved out of the side its centre is on, along that side's normal, by the smallest offset that ends `>= r` from the body (+ `PushEps` = 1e-6 px) — minimal on the push line, which is the owner's "minimal distance" whenever the foot falls on the body; past an end the radial line from the corner would be shorter, but it would also move the token along the axis and is rejected below (it would change today's zero-thickness result). *Geometry:* let `u = (b-a)/|ab|`, `n = (-dy, dx)` (the left normal, 5.8/5.10), `s = (c-a)·u`, `q = (c-a)·n`, and the body's normal span `[q0, q1]` (`center`: `[-t/2, t/2]`; `left`: `[0, t]`; `right`: `[-t, 0]`). *Side:* the face the centre is beyond — `q > q1` is the `+n` (left) side, `q < q0` the `-n` (right) side. A centre inside the body, or past an end but within the normal span (`q0 <= q <= q1`, `Eps` slack), has no side of its own: it takes the side of its previous position (before its most recent move or push; `prev`/`hasPrev` on the token), and if that is undetermined too (also within the span) or there is no history, the left side of `a -> b` — the same test and the same default as today's centre-on-the-line rule. *Target:* with `e = max(0, -s, s-|ab|)` the along-axis overshoot and `F` the chosen face (`q1` on the left, `q0` on the right), `c' = foot + n·(F + σ·(sqrt(max(0, r^2 - e^2)) + PushEps))` where `foot = a + u·s` and `σ = ±1` is the chosen side. Within the axial span (`e = 0`) that is the face offset by `r`; past an end it is the offset from the nearest end corner, keeping the along-axis coordinate so the displacement stays on the normal line — today's `foot + n·sqrt(r^2 - e^2)` generalised to a thick end face. Rejected: a radial displacement from the end corner, which would move the token along the axis as well and change today's zero-thickness result. *Zero thickness:* with `t = 0`, `q0 = q1 = 0`, so `c' = foot + n·σ·(sqrt(r^2 - e^2) + PushEps)`, which is today's `pushFrom` term for term — keep that arithmetic shape (`foot` from the same projection, `perp = sqrt(max(0, r^2 - e^2)) + PushEps`, then `foot + n·σ·perp`), so a zero-thickness door returns identical values on the same inputs; the unchanged existing tests are the regression gate (10.3). *Validity:* the pushed position must be in bounds and `>= r` from every blocking wall's body (the closed door included, other thick bodies included), using the same rectangle-distance primitive as the collider (5.10); else the opposite side is tried; if neither is valid the token stays and gets `squeezed` (source `walls`), and opening that door later clears it per the Clear rule. *Effects:* a pushed token is clear of walls, so its `walls`-sourced entries clear. The push is a server-originated position change returned by the move-rules module (list of token index + new position) so M3 can broadcast it and recompute vision; no step cap applies. Each token is pushed independently and no token's result feeds another's: tokens do not block tokens (no token-token collision; the `blocks_move` flag is not modelled), pushed tokens may overlap each other, and scene order decides nothing — it only rewrites `prev`/`hasPrev` on each pushed token (its pre-push position) exactly as a move would. Explicitly not added later as a "fix": no axial slide out of a doorway, no chain push, no retry loop, no leaf swing or slide. *Which doors:* a locked door, an opening window (`door` on, `blocks_sight:false`) and a secret door all push exactly as a plain closed door — the lock and `secret` are GM authoring state and reach no player, so #46's equivalence holds for thick doors too; a fixed window (`door:false`) never closes and so never pushes; an open door has no body for this rule and never pushes; height never enters the push (5.9). A wall add, a wall update, a thickness change, a position flip and a GM placement or move inside a wall are unchanged: `stuck`, never a push (5.10).
- An event changes only the tokens it touches (those overlapping the changed wall, or the moved token). An unrelated wall change elsewhere never re-sets a GM-cleared token.
- After the GM clears the `walls`-sourced entries while a wall still overlaps and no other entry remains, the player escape rule (step 3 below) applies unchanged: the token may step out without crossing, destination >= r from every blocking wall.
- `wall.update` = remove then add for this rule [PROPOSED; not in the owner's list].
@@ -380,14 +380,15 @@ What the vertical dimension is made of, and in what unit. Vision only: what a lo
- Deferred: what height existing tokens and characters get at migration (`height` is required) -> #49 "Wall wire format, schema and migration". The *target's* height in see-over (a giant's head over a fence) is settled by #44 (5.9): the target's top is what has to clear the line.
- Conflict note (settled later): section 1's non-goals (windows/transparent walls, one-way walls) and Q6's `wall`|`door` only were contradicted by the wall-model work. That is 5.8 [FIXED, 2026-11-15, #42], which superseded both; this block fixed heights and units only, and what a low wall hides (#44) and thickness (#45) were settled afterwards in 5.9 and 5.10.
### 5.8 Wall switches, presets, doors, windows and one-way [FIXED (owner decision), 2026-11-15, #42; windows and the direction settled 2026-11-16, #47; presets, `player_marker` and `label` settled 2026-11-16, #48]
### 5.8 Wall switches, presets, doors, windows and one-way [FIXED (owner decision), 2026-11-15, #42; windows and the direction settled 2026-11-16, #47; presets, `player_marker` and `label` settled 2026-11-16, #48; the door leaf and its push settled 2026-11-17, #50]
What a wall's behaviour is made of. Heights are 5.7; what a low wall does to sight and movement is 5.9 (#44); thickness is 5.10 (#45); the wire and the migration are #49.
- **Behaviour is independent switches, not a kind [FIXED (owner decision), Q1].** A wall carries its own settings and the server reads those. A named kind is only a preset over them. Rejected: a fixed kind enum as the record's behaviour, and client-interpreted free flags; the client may send a preset name, and the **server** expands it and validates the resulting switch set (6.1).
- **v1 switches [FIXED (owner decision), Q2; `player_marker` added 2026-11-16, #48].** `blocks_sight: bool`, `blocks_movement: bool`, `player_marker: bool` (default `false`; what it sends a player is below); door settings `door: bool`, `open: bool`, `secret: bool`, `locked: bool`; one direction field `sight_dir: "both"|"left"|"right"` (default `both`). `label` is a separate GM-only free-text field, not a switch (below). No light axis, no sound axis and no material in v1 (and none on the map) (#48: material is future lighting effort).
- **One object, names are labels [FIXED (owner decision), 2026-11-16, #48].** There is no `terrain` name, preset or derived kind: a railing, a bush, a pit edge and a fixed window are all the same switch set (`blocks_sight:false`, `blocks_movement:true`) and all derive `window`. They differ only in the GM's `label`. This is the §1 principle applied to walls: one object, switches on top, names are labels.
- **Direction is sight only, and `left` names the blind side [FIXED (owner decision), Q4; wording settled 2026-11-16, #47].** `sight_dir` says sight is blocked from one side only; movement is always governed by `blocks_movement` and is two-way (a one-way wall blocks movement both ways). `left`/`right` are the sides of the wall's `a -> b` order: **left is the `(-dy, dx)` normal of `a -> b`**, the same side and the same formula as `position` (5.10) and 5.5's default door-push side. **`sight_dir:"left"` means a viewer standing on the left side cannot see across the wall; a viewer on the right side sees across it** — the field names the side that is blind, never the side that sees. The `one_way` preset defaults to `sight_dir:"left"`, and the editor's flip swaps `left`/`right` without moving `a`/`b` (7.4). `sight_dir != "both"` with `blocks_sight:false` is `invalid` (a direction with nothing to block), and a secret door stays two-way (below).
- **Doors are walls with `door` set, and their settings are independent [FIXED (owner decision), Q3].** `open`, `secret` and `locked` exist only with `door` (`invalid` otherwise). `door.set` keeps working and keeps meaning "set `open`" (6.1); it is not replaced by a door-state enum, and secret/locked are not separate kinds.
- **Closed vs open.** The switches describe the *closed* wall. An open door blocks neither sight nor movement, both sides and direction included, and its stored switches are unchanged; closing restores them. This keeps today's rule (`blocks = not (door and open)`, 5.5) and makes opening a door the only way a door stops blocking.
- **Closed vs open.** The switches describe the *closed* wall. An open door blocks neither sight nor movement, both sides and direction included, and its stored switches are unchanged; closing restores them. This keeps today's rule (`blocks = not (door and open)`, 5.5) and makes opening a door the only way a door stops blocking. An open door leaves nothing behind: no leaf, no hinge, no drawn arc. The doorway is simply the gap between the wall pieces on either side (the jambs are ordinary walls), so opening removes the door's block and closing puts it back (5.5's push, #50).
- **The door leaf is its own body [FIXED (owner decision), 2026-11-17, #50].** There is no separate leaf rectangle inside an opening and no clamp to the neighbouring pieces: a door stores the same `a`, `b`, `thickness` and `position` as any wall (5.10) and its leaf **is** that body, for sight, movement and the push alike. A thick door therefore bulges out of the doorway on its placement's side, or leaves a step behind its jambs, exactly as the GM drew it; that is authoring, not a rule. A deep opening between thick jambs keeps the thick-jamb tunnel/keyhole view accepted in #43. Nothing swings, slides or hinges: opening and closing are the same body appearing and disappearing, so a close never sweeps an arc through the room.
- **A secret door is always closed, two-way and opaque.** `door.set open:true` on a secret door is `invalid`; the GM clears `secret` first (one click in the editor). `secret` with `sight_dir != both`, with `blocks_sight:false` or with `blocks_movement:false` is also `invalid`; `secret` with `locked` is allowed. Why: a secret door must be indistinguishable from a solid wall to every player (3.1), and an open, one-way or see-through secret door would show a gap or a sight seam. A see-through door cannot be secret; it can be locked (an opening window whose lock the GM must clear first).
- **Player-observability [FIXED (owner-delegated), #42; marker exception 2026-11-16, #48].** `secret` and `locked` never reach a player in any form: wall data is GM-only (3.1), and the only player-visible effects of a wall are the vision polygon, the explored grid, tiles, token frames and — for a marked wall only — the marker (next two bullets). Consequences: a closed secret door must give byte-identical player frames and identical refusals to a solid wall of the same switches; a locked door is just a closed door to sight and movement; no refusal names locked, secret, solid or any other cause (the uniform move nack, 5.5/6.5, already holds). The oracle that pins this is the differential door-equivalence test (10.3, T17, #46). **No other hint of a barrier ever reaches a player**: a refused move stays the uniform nack, with no marker added, no shape change and no cause.
- **Player marker: the one wall fact a player receives [FIXED (owner decision), 2026-11-16, #48; shape delegated].** `player_marker` is a switch on the wall. On for the `window` preset, **off** for every other preset and for raw switches (a GM may toggle it on any wall). It sends a player **one anchor point and nothing else** — no type, no `kind`, no open/closed, no `sight_dir`, no `label`, no thickness, no height, no wall id, no switch — and the client draws the window icon there. An invisible barrier is simply a window with the marker off. This is the exact, only exception to "walls never reach a player" (3.1) and it is deliberately thin: the marker says "a window is around here", never what it does.
@@ -414,7 +415,7 @@ What a wall's behaviour is made of. Heights are 5.7; what a low wall does to sig
- **Derived label, not a stored kind [FIXED (owner-delegated), #42; derivation rule #48].** The record stores the switches. `kind` survives on the wire as a read-only shape label derived from them (rule above, else `custom`); it is never an input and never the authority, so the label and what the rules do cannot drift. Rejected: storing `kind` next to the switches.
- **Where the switches live [FIXED (owner-delegated), #42].** Typed, validated fields on the wall record and in the wall payloads, defaulted server-side; never inside `flags`, because the server interprets sight and movement and `flags` stays the never-interpreted free object (6.1, 8). Whether they become columns or one validated restrictions object is #49's; the direction is named fields, not a free-form blob.
- **Composition with thickness and height (height decided in 5.9, thickness in 5.10).** The switches choose *which* predicate reads a wall: the sight wall list holds a wall only when `blocks_sight` (one-way: only for the blind side, 5.8), the movement collider only when `blocks_movement`. 5.9 then decides how the sight predicate treats a wall's height, 5.10 how thickness widens the sight footprint and the movement collider. A wall with `blocks_sight=false` is absent from the vision input entirely, height and thickness included — that is what keeps a window cheap.
- **Status model (5.5).** "Blocking wall" for `stuck`, `squeezed`, the door push and the move checks means `blocks_movement` and, for a door, closed. So a fixed or closed window sticks and pushes exactly as a solid wall; a one-way wall blocks movement both ways; a secret door pushes a token exactly as a solid wall would, with no signal.
- **Status model (5.5).** "Blocking wall" for `stuck`, `squeezed`, the door push and the move checks means `blocks_movement` and, for a door, closed. So a fixed or closed window sticks exactly as a solid wall; a closed opening window or a secret door pushes exactly as a solid wall would on a close, with no signal; a fixed window (`door:false`) never closes, so it never pushes (5.5, #50); a one-way wall blocks movement both ways.
### 5.9 Low walls: see-over [FIXED (owner decision), 2026-11-15, #44]
What a wall shorter than a figure does to sight and movement. Heights and units are 5.7; the switches and the one-way direction are 5.8; thickness is 5.10 (#45); the wire and the migration are #49. Answers #41's open question: the *target's* height matters.
@@ -436,7 +437,7 @@ What a wall shorter than a figure does to sight and movement. Heights and units
- Deferred: nothing about see-over itself. A window is unaffected (its `blocks_sight` is off, so it never reaches sight, 5.8). Whether the client or the server computes the GM's numbers is M4's build call.
### 5.10 Thick walls: the body, sight and movement [FIXED (owner decision), 2026-11-15, #45]
What a wall's thickness does to the floor it covers, the vision fan and the collider. Heights and units are 5.7, the switches 5.8, see-over 5.9; the wire fields and the migration are #49; a thick door's leaf and its push are #50.
What a wall's thickness does to the floor it covers, the vision fan and the collider. Heights and units are 5.7, the switches 5.8, see-over 5.9; the wire fields and the migration are #49; a thick door's leaf is the body itself and its push is 5.5 (settled 2026-11-17, #50, 5.8).
- **The body.** Thickness is a strip of floor: a rectangle of length `|ab|` with **square ends** and no extension past `a` or `b`, and width `thickness`. `position` places it: `center` (default) straddles the drawn `a -> b` line, half the thickness each side; `left` keeps the whole body on the left of `a -> b`, so the line is the inner face and the room's interior; `right` on the other side. A flip moves only the body: `a` and `b` never move, so the GM draws the exact interior size and puts the thickness outward. `left`/`right` are the sides of the `a -> b` order, the same pair `sight_dir` uses (5.8): left is the `(-dy, dx)` normal of `a -> b`, the same left as 5.5's default door-push side. The editor draws each one-way wall's direction as an arrow at its middle and offers a flip (7.4, 5.8, #47).
- **Zero thickness is today, exactly.** `thickness: 0` degrades the rectangle to the segment: same polygon, same collider, same see-over crossing point. Every existing wall migrates to `thickness: 0, position: "center"` and changes nothing [FIXED (owner decision), #45].
@@ -447,12 +448,12 @@ What a wall's thickness does to the floor it covers, the vision fan and the coll
- **Movement: exact circle-vs-rectangle.** `dist(c, body)` is the true Euclidean distance from the token's centre to the rectangle, and a centre **inside** the body is distance 0, so it overlaps (`0 < r`). One rectangle-distance primitive, in one place, serves every reader: `pathClear` (the capsule/segment check and the escape rule of 5.5), the `stuck`/`squeezed` overlap check, the door push, `pushOutOfWalls` and resize/grow push. Movement still never reads height (5.9).
- **See-over across a body [FIXED (owner decision), #45].** 5.9's comparison is evaluated at **every face the eye -> target-top line crosses**: entering and leaving a body is two crossings (near and far), and an oblique line may cross an end face instead, so the rule is "every crossed face of the rectangle", strictly above the wall's height at each. Both must clear: a target shorter than the viewer's eye has the line falling, so the far face is stricter; a taller one has it rising, so the near face is. With zero thickness the two faces coincide with the wall line, and 5.9 is unchanged. The visible fraction's per-wall minimum becomes a minimum over that wall's crossed faces, so the number cannot drift from the binary answer. Candidate walls still come from the radius-bbox cull, now over the body's box.
- **A viewer inside a sight-blocking body sees nothing [FIXED (owner decision), #45].** A token whose vision origin (its centre) lies inside such a body gets an empty polygon until it leaves: no cells, no other tokens, no tiles. It normally overlaps the body and is `stuck` too, so it cannot walk out by itself; the GM moves it out.
- **A wall edit never pushes [FIXED (owner decision), #45].** A thickness change, a position flip or a move that puts a body over a token leaves the token where it is and makes it `stuck` (5.5's rule for a wall edit over a token: it may only move to reduce or leave the overlap). Only a door **closing** pushes (5.5; thick-door push geometry is #50). So the GM can thicken a wall through a crowd and nobody teleports.
- **A wall edit never pushes [FIXED (owner decision), #45].** A thickness change, a position flip or a move that puts a body over a token leaves the token where it is and makes it `stuck` (5.5's rule for a wall edit over a token: it may only move to reduce or leave the overlap). Only a door **closing** pushes (5.5; with thickness the push is measured from this same body, and the body is the leaf, 5.8 and 5.5, #50). So the GM can thicken a wall through a crowd and nobody teleports.
- **Joints: overlap, never a mitre [FIXED (owner-delegated), #45].** Two walls meeting at a corner keep their own rectangles; the bodies overlap at the joint and the outside corner shows a small notch. No mitre, no merged joint, no joint object, and no crack: the overlap is what closes it. A cave is a chain of straight walls. #43 measured that joints need no thickness: zero-width corners show no crack either.
- **Shape behind a seam [FIXED (owner-delegated), #45].** A wall's occupied area is produced by **one** wall-shape function, and no other code reads `a`/`b` to build geometry; in v1 that function returns the 5.10 rectangle. Curved, freeform and image-traced walls are out of v1 (1) and land by changing that function alone, so no sight, move, editor or wire code may assume "a wall is a straight segment".
- **Editor and fields** [FIXED (owner-delegated), #45]. The GM editor gains a thickness control and a **position flip** with a live preview of the body, the flip never moving `a`/`b` (7.4). A new wall starts at the GM's last-used thickness, held as editor state for the session (not a scene field, not on the wire); a fresh editor starts at 0. The record and the payloads carry `thickness` (number, px, 0..256) and `position` (`center|left|right`, default `center`); the payload shape, columns vs one validated object, and the existing-row migration are #49's (6.1, 8).
- Oracles: the independent explored/tile oracle and the leak checker build the body rectangle from `a`, `b`, `thickness` and `position` with their own code, never by calling `vision.nim` or the move rules, and use it for both the sight footprint and the distance test. Assertions land with the build tickets (10.2, 10.3).
- Deferred: what a door is with thickness (a leaf inside a deep opening or the full thick segment) and its push geometry -> #50 "Door geometry: thick doors and door push"; columns, payload shape and migration -> #49.
- Deferred: columns, payload shape and migration -> #49. What a door is with thickness is settled: the leaf is the wall's own body (5.8) and the push is measured from that body, reducing to today exactly at zero thickness (5.5) [FIXED, 2026-11-17, #50].
---
@@ -765,7 +766,7 @@ Prototype `client/src/main.ts`: explored rects appended to a `Graphics` mask for
All ids are server-assigned. **Walls [FIXED, owner decision 2026-11-10, #3]**: per-scene ids, each scene counts from 1. Removal never renumbers; ids are never reused. Each scene stores `next_wall_id` (monotonic, never decreases, even if the newest wall is deleted). The column lives on the `scene` row created by migration step 3 (4.4), and the wire rules for the four wall intents are in 6.1. Wall identity = `(scene, id)` in DB, server and wire. Wall ids are GM-only in v1. **Tokens/entities [FIXED, owner decision 2026-11-10, #3]**: random opaque id, 12 chars from `[A-Za-z0-9_-]`, from a CSPRNG; server checks collision on create. Unique game-wide (not per-scene), so a token may later change scene keeping its id (cross-scene move not in M3). Counted ids would leak hidden tokens through gaps. **Doors are walls** and use wall ids; toggling is GM-only in v1, so any door-id exposure later leaks at most about the wall count (accepted). Rejected: dense ids with renumber broadcast (in-flight intents hit the wrong wall); game-wide wall counter (per-scene ids keep scene copy/export stable).
- **Scene** (exactly one in v1, Q3): `id, name, w, h` (px), `tile_size` (32 default = `explored_cell` [FIXED, Q4]; 64 is the per-scene fallback), `explored_cell` (32 default; `tile_size % cell == 0` required, prototype assumes it silently), `grid_size`, `vision_radius_default`, `token_radius_default` (px, > 0, no upper cap [FIXED, #4]), `art_version`, `active`, free-form `extra`.
- **Wall [FIXED, owner decision 2026-11-15, #42]**: `scene, id` (per-scene, see above), `a:[x,y], b:[x,y]`, the switches `blocks_sight, blocks_movement, sight_dir ('both'|'left'|'right')`, `player_marker` (bool, default false, 5.8 #48), the door settings `door, open, secret, locked`, the GM-only free-text `label` (optional, <= 64 code points, 5.8 #48) and the free `flags`. Behaviour comes from the switches (5.8); `kind` is only a derived output label (`wall`, `door`, `window`, `one_way`, else `custom`; `secret`/`locked` are flags, not kinds, #48) and is never stored. `blocks = blocks_movement and not (door and open)`; a window (`blocks_sight:false`) is absent from the sight input. GM-only everywhere except the player marker: a player receives only an anchor point and its own opaque marker id (3.1, 5.8), and the per-player marker set is state like the explored grid (persisted per player, retracted only by a GM change). **Height [FIXED, 2026-11-15, #41]**: an optional height in metres on the wall record (> 0, <= 100 m); absent = full height, which blocks sight for every viewer (5.7). Existing walls carry none and are unchanged. **Thickness and position [FIXED, 2026-11-15, #45]**: `thickness` (px, 0..256, default 0 = the drawn line) and `position` (`center|left|right`, default `center`) turn the segment into a rectangular body with square ends for both sight and movement (5.10); existing walls get `0`/`center` and behave exactly as before. **Windows and one-way [FIXED, 2026-11-16, #47; #48]**: a window is the see-through switch set (`blocks_sight:false`, `blocks_movement:true`, `door` either: fixed or opening) and derives `window`; a one-way wall is `sight_dir` with `blocks_sight` on, naming the blind side. The wire fields, columns vs one validated object, and the migration are #49's. The low-wall rules are 5.9 (#44). Rejected: a stored `kind` enum, and a `terrain` preset or kind (#48).
- **Wall [FIXED, owner decision 2026-11-15, #42]**: `scene, id` (per-scene, see above), `a:[x,y], b:[x,y]`, the switches `blocks_sight, blocks_movement, sight_dir ('both'|'left'|'right')`, `player_marker` (bool, default false, 5.8 #48), the door settings `door, open, secret, locked`, the GM-only free-text `label` (optional, <= 64 code points, 5.8 #48) and the free `flags`. Behaviour comes from the switches (5.8); `kind` is only a derived output label (`wall`, `door`, `window`, `one_way`, else `custom`; `secret`/`locked` are flags, not kinds, #48) and is never stored. `blocks = blocks_movement and not (door and open)`; a window (`blocks_sight:false`) is absent from the sight input. GM-only everywhere except the player marker: a player receives only an anchor point and its own opaque marker id (3.1, 5.8), and the per-player marker set is state like the explored grid (persisted per player, retracted only by a GM change). **Height [FIXED, 2026-11-15, #41]**: an optional height in metres on the wall record (> 0, <= 100 m); absent = full height, which blocks sight for every viewer (5.7). Existing walls carry none and are unchanged. **Thickness and position [FIXED, 2026-11-15, #45]**: `thickness` (px, 0..256, default 0 = the drawn line) and `position` (`center|left|right`, default `center`) turn the segment into a rectangular body with square ends for both sight and movement (5.10); existing walls get `0`/`center` and behave exactly as before. **A door's leaf is this same body** [FIXED, 2026-11-17, #50]: opening and closing change only `open`, never the geometry, and a door stores no leaf field of its own (5.8, 5.5). **Windows and one-way [FIXED, 2026-11-16, #47; #48]**: a window is the see-through switch set (`blocks_sight:false`, `blocks_movement:true`, `door` either: fixed or opening) and derives `window`; a one-way wall is `sight_dir` with `blocks_sight` on, naming the blind side. The wire fields, columns vs one validated object, and the migration are #49's. The low-wall rules are 5.9 (#44). Rejected: a stored `kind` enum, and a `terrain` preset or kind (#48).
- **Entity (token and anything else) [PROPOSED, FFF seam]**:
- `id` (random text, see above), `scene, kind` (free string: `pc`, `npc`, `item`...), `character_id` (NULL = plain token, e.g. monster or item; else the character it figures), `descriptive_name`, `actual_name` (plain tokens only; a character's tokens use the character's names), `pos`, `radius` (px, > 0, no upper cap; NULL = use scene `token_radius_default`; GM-only to set [FIXED, #4]; 5.6), `owner` = token controller (player id or null = GM-controlled; independent of the character's owner, 8), `gm_only`, `flags` (`vision`, `blocks_move`...), `vision_radius` (optional; per-entity numeric with scene default, Q7 FIXED; also the player step cap, 5.5), `statuses` (set of `(status, source)` entries; status `stuck`|`squeezed`, source `walls`|`GM`; locked while any entry exists; Q14, 5.5, #4).
- `props`: three JSON objects by visibility bucket: `public` (anyone who sees the entity), `owner` (token controller + GM), `gm` (GM only). Keys are strings, values JSON scalars/arrays/objects with a size cap. No hidden state beyond these buckets and `gm_only` in v1 [FIXED, Q19]. **`height` and `eye_height` (5.7) are the first two registered keys**, both in the `gm` bucket and both `number`: on a plain token they are its own values, on a linked token the token's values are a temporary override of the character's base (5.7) [FIXED, 2026-11-15, #41].
@@ -827,6 +828,7 @@ Principles carried from the prototype: the checker must be independent of the co
- **Tiles (#24)**: `tools/tiles.test.mjs` is the group's leak check (d) and the smoke tile-steal checks, through the real binary and a test nginx (`tools/nginx.mjs`, nginx from devbox; config generated per run in the state dir). An **independent explored oracle** (born in 10.2) recomputes visibility per cell from the GM's walls and the token's vision radius with its own clear-segment maths (inscribed 64-gon radius - 0.5 px for "sure", radius + 0.5 px and proper crossings for "maybe"): a `200` must be oracle-maybe (no invented disclosure) and oracle-sure must be `200` (no withheld tile). The 32x32-tile sweep is 1024 requests; slice 9's scene allows 283, all 283 oracle-sure, 0 maybe-refused. Also checked: a player with no sight state gets `403`; another player gets `403` on a tile its neighbour sees; direct `/_tiles/` is `404` (the file exists) for every identity; malformed/canonical/out-of-range/stale-version/scene paths are `404` (with and without a session, including the GM); traversal and encoded shapes never reach a file; the direct-from-Nim answer carries `X-Accel-Redirect: /_tiles/1/v1/<x>_<y>.png`, `Cache-Control: private` and an empty body. Fixture tiles are 32 px PNGs written by `tools/tilefixture.mjs` under the state dir at test time; the test asserts the repo tracks no `.png` at all.
- **Probing test (T8)**: M2, in-process against the move-rules module (5.5): arbitrary far moves; assertion: facts about walls/doors beyond LOS recoverable from replies <= a bounded amount (step cap), and uniform nack shape. M3: same test over WS with a hostile client (moved from M2).
- **Door equivalence (#46, T17)**: `tools/doors.test.mjs` is the accept group for the "a player cannot tell a secret or locked door from a wall" obligation 5.8 states. Node harness, built-ins only (10.4), shaped like `tools/probing.test.mjs`: two servers, fresh state, two scenes identical except one segment, one identical scripted sequence. Pairs: (i) solid `wall` vs a closed `door` with `secret`; (ii) solid wall vs a closed door with `secret` and `locked`; (iii) closed `door` vs a closed `door` with `locked` (since #48 there are no `secret_door`/`locked_door` presets: the switches are the same, only the name changed). Script, run against both servers in lockstep: player tokens with vision near and around the segment; player moves along, into and across it (accepted, collision nacks, over-cap nacks); the GM adds the segment over a player token (`stuck`); the GM edits and toggles unrelated walls and doors elsewhere and moves tokens; a resync/reconnect; a GM `door.set open` on the secret/locked segment, refused `invalid` and GM-side only. **Assertion:** each player's complete received frame sequence — `hello`, `vision`, `explored` (full and delta), `token` (statuses included), `encountered`, and every `ack`/nack with its `code` and `pos` — is identical between the two runs after JSON canonicalisation (keys sorted, no numeric reformatting). **Normalisation allowed: none**; `n` is per connection and wall ids never reach a player, so nothing run-local leaks into the comparison. If the build ever forces a run-local difference it must be named in the test header with the reason. **Tiles:** the same per-player tile sweep in both runs, through the test nginx (`tools/nginx.mjs`, 11.1), must give the same status per tile. **Positive control:** the same script against a third scene whose segment is an open door (or absent) must produce *different* transcripts, otherwise the harness cannot fail (10, first paragraph). **Negative control:** a `-d:leakfault` build with `LEAK_FAULT=secretgap` makes a secret door not block sight (or movement) in the player-facing computation; the doors group must fail with that build, pass on a clean one, and the shipped binary must carry no fault hook (10.1, `tools/fault.test.mjs`). **Refusal codes:** `door.set` on a secret or locked door is `invalid` for the GM; a player `door.set` is `not-allowed` for every door (6.5), so the player side has one code and no oracle. **Not covered:** timing and size side channels (T11), accepted and unchanged.
- **Door push with thickness (#50)**: in-process pins in `tests/tmoverules.nim` (5.5). **Zero-thickness regression gate:** the existing push tests run **unchanged** and keep their exact positions (including "past the end", where the along-axis coordinate does not move), so a zero-thickness door's `pushFrom` must return byte-identical values to today's — no expectation may be rewritten to fit the generalised rule. **Thick cases:** a token beside a long face is pushed off the body face by `r` with its along-axis coordinate kept; a token past an end is pushed to `r` around the nearest end corner with its along-axis coordinate kept; a token inside the body is pushed out of its `prev` side (left with no history); the first side's target overlapping another blocking body or leaving the map falls back to the other side, and both invalid leaves the token in place with `squeezed` while the door closes; the validity check runs over the full collider, so a neighbouring thick body or the thick closed door itself refuses a target the old segment test would have accepted; `position` `left`/`right` move the body, and with it the pushed target, by the thickness. **Equivalence:** the #46 two-server test (T17) gains thick pairs — a thick secret door against a thick solid wall of the same body, and a thick locked door against a thick plain door — with byte-identical player frames, statuses, refusals and per-tile statuses. Also pinned: a fixed window (`door:false`) and an open door never push, and neither does any wall edit. **Mutations:** the push measured from the drawn line instead of the body; the push ignoring the body's normal span; the ambiguous side ignoring `prev`; the validity check testing only the door instead of every blocking body. Each must fail >= 1 test.
- **Door settings in the leak checker (#46)**: `tools/leakcheck.nim`'s `BannedAlways` deep-key scan grows the wall setting keys — `secret`, `locked`, `door`, `blocks_sight`, `blocks_movement`, `sight_dir`, plus whatever names #49 fixes — so a door setting that reaches a player frame is `WALLDATA` (T2/T17). The existing `walls` fault already injects the frame class; a new fault variant leaks one door setting key inside a player frame and asserts exactly `WALLDATA`, nothing more. Because the scan is deep, the leak and doors fixtures must not name a player-visible prop like a wall setting (that would be a false positive).
- **One-way direction (#47)**: `tools/leakcheck.nim` and the independent explored/tile oracle apply **their own** side test — sign of the cross product of `viewer - a` with the `(-dy, dx)` normal of `a -> b`, positive = left — never by calling `vision.nim`: a sight-blocking one-way wall is dropped from the oracle's wall list for a viewer on its blind side, and a wall that is `blocks_sight:false` is dropped for everyone. Assertions: a token on the blind side gets no polygon point, explored cell or tile beyond the wall, and a token across it gives no `token` frame, no name and no encountered entry; a viewer on the seeing side does see across (the positive control, so the oracle can fail). Tolerances as elsewhere: the 0.5 px boundary band along the blind side is oracle-*maybe* (a `200` there is legitimate, but never *sure*), and anything clearly behind the blind wall is oracle-refused (a withheld proof cell still fails). New fault class `ONEWAY` — the player-facing computation drops `sight_dir` and lets the blind side see across — with its injected fault and exact-class assertion, shaped like the existing classes.
- **Player marker (#48)**: the first wall-derived player data, so it gets its own oracle. `tools/leakcheck.nim` computes by its own code (never calling `vision.nim`) that a marker frame exists for a player exactly when some point of the wall's visible extent (segment, or body boundary for a thick wall) has entered that player's vision polygon, and that the frame carries **only** the player's opaque marker id and the anchor point: any `kind`, `open`/`closed`, `sight_dir`, `label`, `thickness`, `height`, wall id or switch in a player frame is `WALLDATA`/`MARKER_EXTRA`. Positive control: a window placed in the open yields exactly one marker once its anchor is seen (so the oracle can fail); a marker-bearing wall behind a sight-blocking wall, or a `player_marker:false` wall, yields none. The `BannedAlways` deep-key scan grows `label` and `player_marker` alongside the door keys, with the same caveat that fixtures must not name a player-visible prop with those keys. Three fault classes, each with an injected fault and an exact-class set, shaped like the existing ones: **`MARKER_EARLY`** — a marker sent before any part of the wall entered the polygon; **`MARKER_EXTRA`** — a marker frame carrying one extra field (a `kind`, a `label` or the wall id); **`MARKER_OFF`** — a marker sent for a wall whose `player_marker` is off. Retraction is checked on the GM side: removing the wall, clearing the marker switch or moving the geometry retracts the marker and never sends the new position early; a marker change writes no explored cell and revokes no tile.
@@ -1064,3 +1066,5 @@ Owner also decided 2026-11-15 [FIXED (owner decision), 2026-11-15, #45]: thick w
Owner also decided 2026-11-16 [FIXED (owner decision), 2026-11-16, #47]: windows and one-way walls. (1) **Window** [FIXED (owner decision)]: v1 has no sill and no top — a window is see-through along its whole drawn length, height unused, drawn as its own wall piece inside a wall (`wall | window | wall`, like a door), with two forms: fixed (no pass) and opening (door settings; pass when open). The editor gets a `window` preset. No distance-limited window. (2) **One-way** [FIXED (owner decision)]: a thick one-way wall's body is opaque floor from **both** sides — no player polygon, never explored, no tile — and only pass-through past the wall is directional; explored cells and tiles differ per side with no new mechanism (per-viewer sight), and explored only grows, so a flip never takes anything back. (3) **Editor** [FIXED (owner decision)]: a one-way wall shows an arrow at its middle pointing the way the view goes (from the seeing side toward the watched side) plus a flip that swaps `sight_dir` without moving `a`/`b`; GM-only, never on a player wire. (4) **`left` wording** [FIXED (owner-delegated)]: `sight_dir:"left"` means a viewer on the left side — the `(-dy, dx)` normal of `a -> b`, the same side as `position` — cannot see across; a viewer on the right sees across. The one-way preset defaults to `left`; `sight_dir != "both"` with `blocks_sight:false` is `invalid`; `left` and `right` both derive `one_way`. (5) **Filter shape** [FIXED (owner-delegated)]: hoisted viewer-independent faces plus one sign test per one-way wall per viewer inline in the fan, no per-viewer list copy (the prototype's ~0.15 ms per viewer per frame, times tokens, rejected). (6) **Windows as a kind** [FIXED (owner-delegated)]: the `window` preset is the opening form and derives `window`; the fixed form's switches are `terrain`'s and derive `terrain` (the rules are identical), with no second preset and no new kind — the editor may hint at it. Downstream: the wire/schema/migration and the preset list are #49; terrain stays #48. Out of scope for v1: windows with a real sill and top height, and light through windows (future effort with lighting). See 1, 5.1, 5.8, 5.9, 5.10, 6.1, 7.4, 8, 10.3, 14. **[Superseded 2026-11-16, #48: `terrain` is dropped, the fixed form is a window, and the presets are four.]**
Owner also decided 2026-11-16 [FIXED (owner decision), 2026-11-16, #48]: terrain walls, and the principle behind the answer. (1) **`terrain` is dropped, everywhere** [FIXED (owner decision)]: no preset, no derived kind and no stored name. The switch set `blocks_sight:false`, `blocks_movement:true`, no door, is a **fixed window** and derives `kind:"window"`. A railing, a bush, a pit edge and a fixed window are one object with one switch set; they differ only in the GM's `label`. This supersedes #42's and #47's `terrain` preset/kind (and #47's fixed-form wording) and is itself an application of the new principle. (2) **Principle** [FIXED (owner decision)]: "Do the most with the fewest things: one object, switches on top, names are only labels" — recorded in §1 and to be applied to future cards. (3) **Four editor presets** [FIXED (owner decision)]: `wall` (default), `door`, `window`, `one_way`; `secret` and `locked` are checkboxes on any door, including an opening window (`door` + `blocks_sight:false`), and keep #46's semantics (GM-only, a locked door refuses to open until the GM unlocks, never observable to a player). (4) **Preset names and kinds resolved** [FIXED (owner-delegated)]: `secret_door` and `locked_door` are **removed** as wire preset names (the wire takes `wall|door|window|one_way`; #49 implements), and the derived kind list is `wall`, `door`, `window`, `one_way`, else `custom`, derived by shape (window first, then one-way, then door, then wall) with `secret`/`locked` as flags that never change the label. A secret door also requires both block switches on and `sight_dir:"both"` (a secret window would show itself); a locked window is allowed. (5) **Player marker** [FIXED (owner decision); name and shape delegated]: a new wall switch `player_marker`, on by default for the `window` preset and off for every other preset (GM may toggle it on any wall); an invisible barrier is simply a window with the marker off. It is the **first and only wall-derived data on a player wire**, an exact exception to 3.1: once any point of the wall's visible extent has entered that player's vision polygon, the player receives an anchor (the wall's drawn midpoint; a thick wall's midpoint is inside its own opaque body, so the gate is the visible extent, not the midpoint in the polygon) and its own opaque marker id, and **nothing else** — no type, kind, open/closed, direction, label, thickness, height or wall id; the client draws the window icon. The marker is per-player memory like explored: persisted, survives disconnect, never lost to LOS or a door, and retracted only when the GM removes the wall, clears `player_marker`, makes it not a window, or moves its geometry; a moved wall re-earns its marker only when the new geometry is seen. (6) **Wall `label`** [FIXED (owner-delegated)]: every wall may carry an optional GM-only free-text `label`, at most 64 code points (the 6.5 text rule), no behaviour, never on a player wire and in `BannedAlways` (`WALLDATA`). (7) **No other hint** [FIXED (owner decision)]: players get no other sign of a barrier; a refused move stays the uniform nack. (8) **Out of scope** [FIXED (owner decision)]: per-wall material (stone, wood, glass) waits for the lighting effort, alongside sill/top and light through windows; difficult terrain, movement cost and pit/fall semantics are rules-engine work, not wall behaviour. Downstream: the preset set, `player_marker`, `label` and the player `marker` message are inputs to #49 (wire/schema/migration); locked/secret as door checkboxes and window doors are inputs to #50. See 1, 3.1, 3.4, 5.1, 5.8, 5.9, 5.10, 6.1, 7.4, 8, 10.3.
Owner also decided 2026-11-17 [FIXED (owner decision), 2026-11-17, #50]: door geometry. (1) **The door leaf is the wall's own body** [FIXED (owner decision)]: a door is a wall like any other, and its leaf is the 5.10 body rectangle with the same `thickness` and `position` fields — no separate leaf inside a deep opening, no clamp to the neighbouring pieces. The jambs are ordinary walls, so the doorway is the gap between wall pieces. A thick door bulges out of its doorway or leaves a step behind the jambs, exactly as drawn (authoring, not a rule), and a deep opening between thick jambs keeps the tunnel/keyhole view accepted in #43. Opening and closing add and remove that body and nothing else: no swing, no slide, no hinge, no arc, and an open door is absent from sight and movement as today. (2) **The close push** [FIXED (owner decision)]: each token whose centre is within `r` of the door's **body** is pushed out of the side its centre is on, by the minimal distance that ends `>= r` from the body (+ `PushEps`); a centre inside the body takes the side of `prev` (its position before the most recent move or push), and the left side of `a -> b` when that is undetermined; if the first side's position is invalid (out of bounds or within `r` of any blocking body) the other side is tried; if both are invalid the token stays and gets `squeezed`, and the door still closes. No axial slide, no chain, no retry. Each token is pushed independently, tokens never block tokens, and scene order only rewrites `prev`. Edits never push (5.10) and height never enters (5.9). (3) **Delegated and picked** [FIXED (owner-delegated)]: within the body's axial span the target is the face offset by `r`; past an end it is the offset from the nearest end corner **keeping the along-axis coordinate**, i.e. today's `foot + n·sqrt(r^2 - e^2)` generalised to the end face — a radial displacement from the corner was rejected because it also moves the token along the axis and would break the zero-thickness gate. A centre "inside the body" for the side test means inside the body or past an end but within the body's normal span, which reduces to today's centre-on-the-line test at zero thickness. The target and the validity check use the same rectangle-distance primitive as the collider (other thick bodies included), and `PushEps` = 1e-6 px is reused. **Zero thickness must return byte-identical values to today's `pushFrom` on the same inputs**, and the existing push tests are the regression gate, unchanged (10.3). (4) **Settled consequences** [FIXED (owner decision)]: a locked door and an opening window push exactly like a plain closed door; a fixed window (`door:false`) never closes, so it never pushes; a secret door pushes exactly as a solid wall, so #46's equivalence holds for thick doors too; the independent-per-token, no-token-collision, `prev`-rewriting order rule above is final and not a later "fix". (5) **Downstream**: #49 needs **no new wire field for doors** — the leaf is the existing `thickness`/`position` body and the existing switch set, and an open door changes no geometry, only `open`. See 5.4, 5.5, 5.8, 5.10, 10.3.