From b8f04c2faf70819e907d69bef6db020ddcd5b51c Mon Sep 17 00:00:00 2001 From: Davide Cappellini Date: Mon, 16 Nov 2026 22:08:14 +0100 Subject: [PATCH] design: windows and one-way walls (#47) --- GLOSSARY.md | 10 ++++++--- docs/DESIGN.md | 56 ++++++++++++++++++++++++++++---------------------- 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/GLOSSARY.md b/GLOSSARY.md index 1bfe54e..7049b4b 100644 --- a/GLOSSARY.md +++ b/GLOSSARY.md @@ -75,11 +75,11 @@ One independent setting a wall's behaviour is made of: `blocks sight` or `blocks _Avoid_: flag, bit, property (that word already means token data), restriction type **Wall preset**: -A named combination of switches and door settings the GM picks in one action: wall, door, secret door, locked door, terrain, one-way wall. It is a shortcut and a label, not a stored kind: the wall keeps the switches, and the name is derived when they match a preset exactly (`custom` otherwise). So two presets can never drift from what the wall actually does. +A named combination of switches and door settings the GM picks in one action: wall, door, secret door, locked door, terrain, one-way wall, window. It is a shortcut and a label, not a stored kind: the wall keeps the switches, and the name is derived when they match a preset exactly (`custom` otherwise). So two presets can never drift from what the wall actually does. _Avoid_: wall kind, wall type, category **One-way wall**: -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. Which side is blocked is decided by the wall's `a -> b` order. +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 **Secret door**: @@ -91,9 +91,13 @@ A closed door the GM must unlock before it will open: opening a locked door is r _Avoid_: barred door **Terrain**: -A wall preset that blocks movement and not sight: a railing, bushes, a low barrier, a pit edge. People see over or through it and cannot pass. It is absent from the sight rules entirely, so its thickness and height never affect sight. +A wall preset that blocks movement and not sight: a railing, bushes, a low barrier, a pit edge, a fixed window. People see over or through it and cannot pass. It is absent from the sight rules entirely, so its thickness and height never affect sight. _Avoid_: transparent wall, invisible wall, obstacle (that names the thing, not the preset) +**Window**: +A see-through piece of a wall, drawn by the GM as its own short wall between wall pieces, like a door. There is no sill and no top: it can be seen through along its whole length, and no light comes through it. A fixed window cannot be passed and is the same as terrain; an opening window is a door that can be seen through while closed and walked through once opened. A window is a preset, not a kind. +_Avoid_: window wall, hole, opening, glass wall + **Property**: One named value a token carries, e.g. "aura" or "hp". The server stores it and does not interpret it in v1, apart from the few sight keys it reads itself (see Height and Eye height); FFF does the rest later. _Avoid_: attribute, stat, metadata diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 4f8a4e7..fc46484 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -1,6 +1,6 @@ # FFF_vtt design -Status: draft v0.25, 2026-11-15 (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. All of Q1-Q24 are RESOLVED or DEFERRED; none OPEN). Audience: the owner and coding agents. +Status: draft v0.26, 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. 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. @@ -24,8 +24,8 @@ A browser virtual tabletop for one table (1 GM + up to 6 players [FIXED, Q1]), s ### v1 scope [PROPOSED, trimmed to what the prototypes proved plus the minimum to be usable] - One table, 1 GM + up to 6 players (max 6 [FIXED, owner decision 2026-11-08, Q1]), a shared site link and per-player keys, no accounts. -- Exactly one scene in v1 (Q3, FIXED): large tiled map image, optional visual grid, walls and doors, tokens. A wall's behaviour is a set of switches (blocks sight, blocks movement, sight direction) plus door settings; named presets (`wall`, `door`, `secret door`, `locked door`, `terrain`, `one-way wall`) are one-drag defaults over them (5.8; supersedes Q6's `wall`|`door` only). A wall also has a per-wall thickness and height (5.10, 5.7). -- GM tools: author walls, doors, terrain and one-way barriers in the browser (Q6, FIXED; presets plus an advanced toggle, 5.8, 7.4), create/move/delete tokens, toggle doors, edit token properties, manage players and player keys. +- Exactly one scene in v1 (Q3, FIXED): large tiled map image, optional visual grid, walls and doors, tokens. A wall's behaviour is a set of switches (blocks sight, blocks movement, sight direction) plus door settings; named presets (`wall`, `door`, `secret door`, `locked door`, `terrain`, `one-way wall`, `window`) are one-drag defaults over them (5.8; supersedes Q6's `wall`|`door` only). A wall also has a per-wall thickness and height (5.10, 5.7). +- GM tools: author walls, doors, windows, terrain and one-way barriers in the browser (Q6, FIXED; presets plus an advanced toggle, 5.8, 7.4), create/move/delete tokens, toggle doors, edit token properties, manage players and player keys. - Player: move owned tokens only; see only line-of-sight area, previously explored area (dimmed), and tokens inside LOS. Character creation and edits and all prop writes are GM-only in v1; opening them to players later is a permission change on the existing intents (6.1), not a redesign. - Automatic LOS from owned tokens against walls/doors, server-side. Explored area = per-player cell grid, persisted. - Persistence across restarts; reconnect resync; backups. @@ -33,7 +33,7 @@ A browser virtual tabletop for one table (1 GM + up to 6 players [FIXED, Q1]), s ### Non-goals for v1 (later or never) - RPG rules, dice, character sheets, initiative. FFF engine plug-in: seam only (section 9). -- Dynamic lighting, light sources, darkvision tiers, per-token vision radius beyond one numeric property. Windows that see only within a distance: v1 has see-through/pass-through switches and a one-way sight direction (5.8), but no distance rule (window semantics are #47; the see-over, impassable barrier is the `terrain` preset). +- Dynamic lighting, light sources, darkvision tiers, per-token vision radius beyond one numeric property. Windows that see only within a distance: a v1 window is see-through along its whole drawn length, with no distance rule (5.8, #47). Windows with a real sill and top height, and light coming through windows, are future effort, to be discussed when lighting arrives. - Accounts, passwords, OAuth, multiple tables/campaigns per server, public hosting. - Players opening or closing doors, and players discovering secret doors (searching, revealing, finding a way in): in v1 only the GM touches a door, so the lock and `secret` are GM authoring state (#46, 5.8). Future effort; moving it to players is a permission change on the existing `door.set`, not a redesign. - Feeding from the owner's map generator [FIXED: does not feed in]. Map import is a CLI step in v1; browser upload is post-v1 (Q5, FIXED). @@ -282,7 +282,7 @@ explored_chunk(player_id, scene_id, cx, cy, bits BLOB, PRIMARY KEY(player_id, sc ## 5. Vision and explored ### 5.1 Algorithm (ported from `prototype-server-vision/src/geometry.nim`) -- **Visibility polygon** from token centre: cast rays to every blocking wall endpoint (for a thick wall, every corner of its body quad, 5.10) at angle -eps, 0, +eps (`RayEps` = 1e-4 rad), plus an inscribed 64-gon of radius R as range limit; sort by angle; each ray returns nearest hit among wall segments (body faces for a thick wall) + circle segments; result = CCW polygon. The wall list holds only walls whose sight switch is on; an open door and a `terrain` wall are absent from it, and a one-way wall is evaluated per observer (5.8). +- **Visibility polygon** from token centre: cast rays to every blocking wall endpoint (for a thick wall, every corner of its body quad, 5.10) at angle -eps, 0, +eps (`RayEps` = 1e-4 rad), plus an inscribed 64-gon of radius R as range limit; sort by angle; each ray returns nearest hit among wall segments (body faces for a thick wall) + circle segments; result = CCW polygon. The wall list holds only walls whose sight switch is on; an open door and a `terrain` wall are absent from it, and a one-way wall is skipped for a viewer on its blind side (5.8). - **Explored**: `cellsTouched(poly, cell)` marks every grid cell that the polygon overlaps; union into the player's explored set. Vertex-in-cell test added after a bug (polygon wholly inside one cell) [MEASURED bug log, prototype `NOTES.md`; covered by `tests/tgeometry.nim`, suite "cells", test "tiny polygon inside one cell"]. - **Token visibility** to a player: token centre inside any of the player's polygons (even-odd `inside`). - **Move validation (prototype)**: inclusive segment intersection on blocking walls (touching = blocked, so no squeezing through shared vertices) AND destination circle at distance >= token radius from every blocking wall. Replaced by the M2 rules in 5.5; the prototype result is a baseline only. @@ -375,18 +375,18 @@ 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 and one-way [FIXED (owner decision), 2026-11-15, #42] +### 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] 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].** `blocks_sight: bool`, `blocks_movement: bool`; door settings `door: bool`, `open: bool`, `secret: bool`, `locked: bool`; one direction field `sight_dir: "both"|"left"|"right"` (default `both`). No light axis, no sound axis in v1 (and none on the map). -- **Direction is sight only [FIXED (owner decision), Q4].** `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 read from `a` to `b`; `left` names the side whose view across the wall is blocked. Which side the editor offers first, and what a one-way wall does to explored cells and tiles, is #47. +- **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. - **A secret door is always closed.** `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` 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 or one-way secret door would show a gap or a sight seam. - **Player-observability [FIXED (owner-delegated), #42].** `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 and token frames. 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). - **Only the GM touches a door [FIXED (owner decision), 2026-11-15, #46].** In v1 `door.set` stays G-only: a player sender is refused `not-allowed` at the role step (6.5), whatever the door's settings and whether it is locked or secret. Player-opened doors, lock refusals addressed to a player and player discovery of secret doors (searching, revealing, finding a way in) are not in v1 and not in this map; they are future effort (1). The lock and `secret` are therefore GM authoring state: no player-facing lock message, no lock/unlock intent, and the uniform move nack (5.5) is the only refusal a player ever gets from a wall. - **A locked door does not open [FIXED (owner decision), 2026-11-15, #46].** `door.set open:true` on a door with `locked` is `invalid`, exactly as for a secret door: the GM unlocks first (editor: one click, hint "locked: unlock first", 7.4). Any write that would store `open:true` together with `locked` or `secret` is `invalid` too — `wall.add`, `wall.update` and a preset expansion alike (6.1) — so no path reaches that state. Closing a locked door is allowed (it is already closed; the setting only refuses opening). Otherwise a locked door is an ordinary closed door: same sight, same explored cells, same tiles, same door push, same refusals. -- **v1 presets [FIXED (owner-delegated), #42].** A preset is a named switch set used by the editor's one-drag default (7.4) and as the GM's label; never storage. +- **v1 presets [FIXED (owner-delegated), #42; `window` added 2026-11-16, #47].** A preset is a named switch set used by the editor's one-drag default (7.4) and as the GM's label; never storage. | preset | `blocks_sight` | `blocks_movement` | door settings | |---|---|---|---| @@ -394,13 +394,18 @@ What a wall's behaviour is made of. Heights are 5.7; what a low wall does to sig | door | yes | yes | `door`, closed | | secret door | yes | yes | `door`, closed, `secret` | | locked door | yes | yes | `door`, closed, `locked` | - | terrain | no | yes | none (railing, bushes, a low barrier: one preset) | - | one-way wall | yes, one side | yes | none | + | terrain | no | yes | none (railing, bushes, a low barrier, a fixed window: one preset) | + | one-way wall | yes, one side (`sight_dir:"left"` default) | yes | none | + | window | no | yes | `door`, closed (an opening window) | - No `window` preset in v1. The switch set *can* express the see-through door of Fantasy Grounds and Roll20 (a door with `blocks_sight:false`, `blocks_movement:true`: look through it while closed, open it to pass), but "window" also names Foundry's distance-limited wall, which two booleans cannot express, and `terrain` already covers the fixed see-over barrier. v1 therefore ships no preset under that ambiguous name; #47 picks the meaning. No "blocks nothing" preset either: a segment that blocks nothing is a marker, not a barrier, and the editor deletes instead. + `window` is the **opening** form: see-through while closed, passable once opened, because opening a door clears both blocks (above). The **fixed** window is the `terrain` switch set exactly and derives `terrain` (below). There is no distance-limited window: Foundry's distance rule is not expressible with switches, is not in v1 (1), and belongs to the lighting-era effort. No "blocks nothing" preset either: a segment that blocks nothing is a marker, not a barrier, and the editor deletes instead. +- **Window [FIXED (owner decision), 2026-11-16, #47].** A window is **see-through along its whole drawn length**: it is not a hole with a sill and a top, and no sill/top height is stored or used (a window's wall `height` is irrelevant, because its sight switch is off and 5.9/5.10 never read it). It is drawn as **its own wall piece inside a wall**, like a door — `wall | window | wall`, three segments — so it needs no new geometry, thickness rule or position rule. Two forms, both already expressible by the switches: **fixed** (`blocks_sight:false`, `blocks_movement:true`, no door: see through, never pass) and **opening** (the same plus `door:true`: see through while closed, pass when opened). A window piece of a thick wall is a thick window: its body occludes sight from both sides (5.10), so it is a see-through slot in a deep wall, not a widened hole. +- **Derived kind for the two window forms [FIXED (owner-delegated), 2026-11-16, #47].** The `window` preset is the opening form and derives `kind:"window"`. The fixed form's switches are exactly `terrain`'s, so it derives `kind:"terrain"`, and there is no second preset and no new kind. That collision is intended: the rules are identical (see through, do not pass) and `terrain` is the broader name (railing, pit edge, fixed window). The editor may annotate a `terrain` piece that sits between two `wall` pieces as a fixed window (M4 UI), but nothing on the wire distinguishes it. +- **What a one-way wall does to the floor [FIXED (owner decision), 2026-11-16, #47].** Explored cells and tiles differ per side **by construction, not by a new mechanism**: each viewer's sight wall list drops the one-way walls whose blind side that viewer stands on, so polygon, `cellsTouched`, explored and therefore tiles differ between the two sides with no extra state. Explored only grows (5.4), so flipping the direction or `a`/`b` never un-explores a cell and never revokes a tile; a flip only widens what the newly-seeing side may explore next. Movement is two-way (above). With a low wall the direction filters first, then 5.9/5.10 evaluate every crossed face of the walls that remain. +- **Per-viewer filter [FIXED (owner-delegated), 2026-11-16, #47].** Nothing per-viewer is stored or copied: the 5.10 quad faces stay hoisted and viewer-independent, and the fan skips a sight-blocking wall inline when it is one-way and the viewer is on its blind side — one sign test per **one-way** wall per viewer (cross product with `(-dy, dx)`), after the radius-bbox cull; two-way walls pay only a type check. Rejected: a per-viewer copy of the wall list (the prototype measured ~0.15 ms per viewer per frame for the copy, times tokens) and two prebuilt left/right lists (choosing between them needs the same per-viewer side test, and they duplicate the list). - **Derived label, not a stored kind [FIXED (owner-delegated), #42].** The record stores the switches. `kind` survives on the wire as a read-only label derived from them (exact match with the preset table 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 blocked side), 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 `terrain` cheap. +- **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 `terrain` 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 terrain wall 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. ### 5.9 Low walls: see-over [FIXED (owner decision), 2026-11-15, #44] @@ -425,12 +430,12 @@ What a wall shorter than a figure does to sight and movement. Heights and units ### 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. -- **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. Which side the editor offers first and how it draws the arrow are #47's. +- **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]. - **Unit and limits** [FIXED (owner-delegated), 2026-11-15, #45]. Thickness is **px**, a map distance like length and token radius: heights are metres (5.7) and no scale converts between the two (5.7). `0 <= thickness <= 256` px (8 tiles): 0 is the line, and 256 is already a room-sized block better drawn as several walls; the cap bounds the quad. The body may cross the map edge (a border wall thickened outward); only the map area exists, so nothing is drawn or explored outside it. -- **The body is opaque floor [FIXED (owner decision), #45].** It is never inside a player's polygon and its own area is never newly explored, so a player's fog stays black under it and no tile is newly revealed there. Explored only grows (5.4), so cells explored before a body was thickened over stay explored and tiles already held stay held; the rule is that a body reveals nothing, ever. +- **The body is opaque floor [FIXED (owner decision), #45; both sides for a one-way wall, #47].** It is never inside a player's polygon and its own area is never newly explored, so a player's fog stays black under it and no tile is newly revealed there. This holds on both sides of a one-way wall (5.8). Explored only grows (5.4), so cells explored before a body was thickened over stay explored and tiles already held stay held; the rule is that a body reveals nothing, ever. - **One shape, two readers [FIXED (owner decision), #45].** Sight and movement read the same exact rectangle, with the same square ends, so a corner cannot be generous to one and tight to the other. A wall with `blocks_sight: false` contributes nothing to sight, body included (a `terrain` wall's thickness is movement-only, 5.8); its collider still uses the thickness. -- **Sight: the body quad.** A sight-blocking thick wall enters the vision input as the four faces of its rectangle (two long, two square ends), hoisted once per wall edit and reused for every viewer and frame — viewer-independent, so it caches [#43 measured: 0.26 vs 0.94 ms on 5k sparse and 12.7 vs 13.2 dense, against the 3-face near+caps silhouette that is observer-dependent and cannot be hoisted]. The fan and `cellsTouched` are otherwise unchanged, and zero thickness is the segment of today. What a one-way wall's own body does on its seeing side is #47. +- **Sight: the body quad.** A sight-blocking thick wall enters the vision input as the four faces of its rectangle (two long, two square ends), hoisted once per wall edit and reused for every viewer and frame — viewer-independent, so it caches [#43 measured: 0.26 vs 0.94 ms on 5k sparse and 12.7 vs 13.2 dense, against the 3-face near+caps silhouette that is observer-dependent and cannot be hoisted]. The fan and `cellsTouched` are otherwise unchanged, and zero thickness is the segment of today. A one-way wall's own body is opaque floor on **both** sides (5.8, #47): the blind side gets no face at all, and the seeing side sees up to the near face — never into or past the body's floor. - **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. @@ -439,7 +444,7 @@ What a wall's thickness does to the floor it covers, the vision fan and the coll - **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"; a one-way wall occluding its own body on the side that sees across -> #47 "Windows and one-way walls"; columns, payload shape and migration -> #49. +- 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. --- @@ -490,22 +495,22 @@ Every row also carries `reqId` (omitted below). Codes are those of 6.5; `not-all | t | fields | who | ack ok / extra codes | effects and recipients | |---|---|---|---|---| | `scene.set` | `scene`; any of `name, grid_size, vision_radius_default, token_radius_default, extra` (at least one) | G | `{}`; `invalid`, `not-found` | `hello` plus full resync to **every** connection (hello-equivalent reset; no `scene.activate`, Q3). `token_radius_default` change resizes tokens using the default with grow push (5.6): `token` updates per view, `vision`/`explored` as needed. `w, h, tile_size, cell, art_version` are not settable on the wire (import is M6 CLI) | -| `wall.add` | `scene, a:[x,y], b:[x,y]`, then either a preset name (`preset:"wall"|"door"|"secret_door"|"locked_door"|"terrain"|"one_way"`) or the raw 5.8 switches (`blocks_sight?, blocks_movement?, sight_dir?, door?, open?, secret?, locked?`), `flags?` | G | `{id}`; `invalid`, `not-found` | `wall` to GM; vision recompute for all players (`vision`, `explored`, `token` as their views change); tokens whose circle overlaps get `stuck` source `walls` (5.5): `token` per view | +| `wall.add` | `scene, a:[x,y], b:[x,y]`, then either a preset name (`preset:"wall"|"door"|"secret_door"|"locked_door"|"terrain"|"one_way"|"window"`) or the raw 5.8 switches (`blocks_sight?, blocks_movement?, sight_dir?, door?, open?, secret?, locked?`), `flags?` | G | `{id}`; `invalid`, `not-found` | `wall` to GM; vision recompute for all players (`vision`, `explored`, `token` as their views change); tokens whose circle overlaps get `stuck` source `walls` (5.5): `token` per view | | `wall.update` | `scene, id`; any of `a, b`, a preset name or the raw switches, `flags` | G | `{}`; `not-found`, `invalid` | as `wall.add` (update = remove + add for the status rules, 5.5; PROPOSED there) | | `wall.remove` | `scene, id` | G | `{}`; `not-found` | `wall_gone` to GM; recompute; `walls`-sourced entries re-evaluated (Keep/Clear, 5.5) | | `door.set` | `scene, id, open:bool` | G | `{}`; `not-found`, `invalid` (wall is not a door, is a secret door, or is a locked door and `open:true`) | `wall` to GM (a door is a wall); recompute all players; close pushes overlapped tokens aside (server-originated position change: `token` per view; `squeezed` only if no side is valid), open re-evaluates `walls`-sourced entries (5.5). Players learn only through LOS changes. A player sender is `not-allowed` at the role step for every door (5.8, #46) | -Validation for `wall.*`: `a != b`, both in bounds; each switch a boolean and `sight_dir` one of `both|left|right`; `open`/`secret`/`locked` only with `door`; a secret door closed and two-way; `open:true` with `secret` or `locked` is `invalid` (#46, 5.8); `preset` and any raw switch in the same payload is `invalid` (5.8). +Validation for `wall.*`: `a != b`, both in bounds; each switch a boolean and `sight_dir` one of `both|left|right`, with a non-`both` `sight_dir` requiring `blocks_sight:true` (#47); `open`/`secret`/`locked` only with `door`; a secret door closed and two-way; `open:true` with `secret` or `locked` is `invalid` (#46, 5.8); `preset` and any raw switch in the same payload is `invalid` (5.8). **Wall payload rules [FIXED (owner-delegated, 2026-11-15, #19); amended by the 5.8 wall model, #42]** (6.1 was silent on these; slice 4 builds them): - `scene` is an integer scene id. v1 has exactly one scene (Q3), seeded by migration step 3 with id `1` (4.4); any other value is `not-found`, a non-integer is `invalid`. - `a`/`b` are `[x,y]` arrays of exactly two finite JSON numbers (integers accepted); `a == b` and any endpoint outside `0 <= x <= w, 0 <= y <= h` are `invalid`. The border itself is in bounds. - A wall's behaviour is the 5.8 switches, defaulted as the `wall` preset (`blocks_sight:true`, `blocks_movement:true`, `sight_dir:"both"`, `door:false`, `open:false`, `secret:false`, `locked:false`). A payload gives either `preset` (the server expands it from the 5.8 table) or raw switches, never both; a switch that is not a boolean or a `sight_dir` outside the three values is `invalid`. -- `open`, `secret` and `locked` without `door:true` are `invalid`; a secret door with `open:true` or with `sight_dir != "both"` is `invalid` (5.8: it must look exactly like a solid wall), and so is a locked door with `open:true` (#46, 5.8: unlock first). A stored non-door always has `open=false`, `secret=false`, `locked=false`, so clearing `door` through `wall.update` closes and de-secrets it. +- `open`, `secret` and `locked` without `door:true` are `invalid`; a secret door with `open:true` or with `sight_dir != "both"` is `invalid` (5.8: it must look exactly like a solid wall), and so is a locked door with `open:true` (#46, 5.8: unlock first). A `sight_dir` other than `"both"` with `blocks_sight:false` is `invalid` (a direction with nothing to block, #47). A stored non-door always has `open=false`, `secret=false`, `locked=false`, so clearing `door` through `wall.update` closes and de-secrets it. - `flags` is a JSON object or absent (absent = `{}`); anything else is `invalid`. It is stored verbatim and never interpreted — the switches are fields, not flags (5.8). - `wall.update` patches `a`, `b`, the switches (or one `preset`), and `flags`; at least one of them is required, otherwise `invalid`. A patch is absolute, not additive: a `preset` replaces the whole switch set, so `preset:"door"` on a terrain wall turns it into a closed door. `open` is not a patch field: it belongs to `door.set`, and an `open` field in `wall.update` is an unknown field (ignored, 6.2; a `preset` carrying `open:true` is `invalid` as above). Fields are checked before the target lookup (6.5 steps 7 then 8), so a fieldless `wall.update` is `invalid` whatever the id. - `id` is an integer; lookup failures are `not-found` (a GM's missing target, 6.5 step 8). `door.set` on a row whose `door` is false is `invalid`, and so is `open:true` on a secret door (5.8) or on a locked door (#46, 5.8). -- `kind` is **output only** on the `wall`/`walls` frames: the label derived from the switches (`wall`, `door`, `secret_door`, `locked_door`, `terrain`, `one_way`, else `custom`). It is not accepted as an input field; an input `kind` is an unknown field (ignored, 6.2). Field names, defaults and the existing-row migration are #49's; the rule here is that the switches are the authority and the label is derived. +- `kind` is **output only** on the `wall`/`walls` frames: the label derived from the switches (`wall`, `door`, `secret_door`, `locked_door`, `terrain`, `one_way`, `window`, else `custom`). It is not accepted as an input field; an input `kind` is an unknown field (ignored, 6.2). Field names, defaults and the existing-row migration are #49's; the rule here is that the switches are the authority and the label is derived. - `thickness` and `position` (5.10) are wall fields too: `thickness` a number in px `0 <= t <= 256`, `position` one of `center|left|right` (default `center`). Like the switches they are typed and validated server-side and never live in `flags`; their payload shape, whether they are columns or part of one validated object, and the existing-row migration are #49's. - `wall.add` assigns the id from the scene's `next_wall_id`, which is monotonic and never reused (#3, 8; removal does not touch it, and a restart reloads it from the DB). - Every write is one transaction with `synchronous=FULL` around it (Q12: GM authoring is the data that is expensive to lose) and `NORMAL` again afterwards; the in-memory scene is updated only after COMMIT, so a failed write leaves memory and DB identical. @@ -731,7 +736,7 @@ Prototype `client/src/main.ts`: explored rects appended to a `Graphics` mask for ### 7.4 Input and UI - Mouse: wheel zoom, drag pan, drag token. Touch: one finger drag/pan, two-finger pinch/pan [MEASURED works on Note 10]. -- Wall editor (GM) [FIXED, Q6, extended by 5.8, 5.10]: click-click segments, snap to grid/endpoints optional, delete, undo of last edit [PROPOSED]; submits `wall.*` intents; server is the validator. A preset row (`wall` (default), `door`, `secret door`, `locked door`, `terrain`, `one-way wall`) sets the switches for a one-drag default; an **advanced** toggle exposes the raw switches (`blocks_sight`, `blocks_movement`, `sight_dir`, `door`, `open`, `secret`, `locked`) for a custom wall. A thickness control and a **position flip** (`center|left|right`) sit beside them, the flip previewing the body live and never moving `a`/`b`; a new wall starts at the GM's last-used thickness (0 in a fresh editor). The editor draws `kind` (the derived label) only; no preset is a stored kind. The height control is M4's (5.7). A locked door's open action is the `invalid` case of 5.8, so the editor shows the hint "locked: unlock first" and offers the one click that clears `locked`; no door action is offered to players (#46). +- Wall editor (GM) [FIXED, Q6, extended by 5.8, 5.10, #47]: click-click segments, snap to grid/endpoints optional, delete, undo of last edit [PROPOSED]; submits `wall.*` intents; server is the validator. A preset row (`wall` (default), `door`, `secret door`, `locked door`, `terrain`, `one-way wall`, `window`) sets the switches for a one-drag default, so a window is authoring `wall | window | wall`; an **advanced** toggle exposes the raw switches (`blocks_sight`, `blocks_movement`, `sight_dir`, `door`, `open`, `secret`, `locked`) for a custom wall. A thickness control and a **position flip** (`center|left|right`) sit beside them, the flip previewing the body live and never moving `a`/`b`; a new wall starts at the GM's last-used thickness (0 in a fresh editor). A **one-way wall is drawn as an arrow at the wall's middle** pointing the way the view goes — from the seeing side toward the watched side — with a **direction flip** that swaps `sight_dir` `left`/`right` and never moves `a`/`b`, the same flip control as the position flip. Arrow and flip are GM-only like every wall fact and never on a player wire (3.1); the editor draws `kind` (the derived label) only, and no preset is a stored kind. The height control is M4's (5.7). A locked door's open action is the `invalid` case of 5.8, so the editor shows the hint "locked: unlock first" and offers the one click that clears `locked`; no door action is offered to players (#46). - Grid snap on drop: client option, off by default [FIXED, Q18]. Server accepts any in-bounds position within the step cap and clear of walls (5.5; step cap = effective vision radius, Q18 FIXED). - Who-sees-it view (GM only) [FIXED (owner decision), 2026-11-15, #44]: for each token, which player(s)/characters see it and its visible fraction (5.9, 100 % when unobstructed). GM-only and never on a player wire; the panel's shape belongs to the M4 editor/fog work. @@ -750,7 +755,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')`, the door settings `door, open, secret, locked`, and the free `flags`. Behaviour comes from the switches (5.8); `kind` is only a derived output label (`wall`, `door`, `secret_door`, `locked_door`, `terrain`, `one_way`, else `custom`) and is never stored. `blocks = blocks_movement and not (door and open)`; a `terrain` wall is absent from the sight input. GM-only everywhere. **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. 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 `window` kind before #47 gives it a rule (in v1 "sees over, does not pass" is `terrain`). +- **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')`, the door settings `door, open, secret, locked`, and the free `flags`. Behaviour comes from the switches (5.8); `kind` is only a derived output label (`wall`, `door`, `secret_door`, `locked_door`, `terrain`, `one_way`, `window`, else `custom`) and is never stored. `blocks = blocks_movement and not (door and open)`; a `terrain` wall is absent from the sight input. GM-only everywhere. **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]**: a window is the `window` preset (an opening see-through door) or, fixed, the `terrain` switch set; a one-way wall is `sight_dir` with `blocks_sight` on, naming the blind side — neither adds a field. 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. - **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]. @@ -813,6 +818,7 @@ Principles carried from the prototype: the checker must be independent of the co - **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` (preset) vs `secret door`; (ii) solid wall vs `secret door` with `locked`; (iii) closed `door` vs closed `locked door`. 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 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. - **Auth tests**: key replace (old key invalid, sessions revoked, live connections closed), remove player (key invalid, characters and tokens pass to GM), one key reused on several devices (Q10 FIXED), Origin mismatch rejected, cookie flags present. - **Protocol tests** (#18, `tools/protocol.test.mjs`): proto missing/non-integer (HTTP 400) and mismatch (`closing` 4003, no `hello`); unknown intent type (`unknown-type`) with unknown fields ignored; exactly one `ack` per `reqId` (reqId 0 and 2^31-1 included); `hello` first with `n = 1` and a per-connection `n` thereafter; `error malformed` for unreadable frames; the malformed flood (nine tolerated, the tenth closes 1008); the intent bucket (burst then `rate-limited`, connection stays open, a refused intent applies nothing, `error rate-limited` for an unreadable frame on an empty bucket); the 64 KB inbound boundary (exactly 64 KB is a message, 64 KB + 1 drops the TCP connection with no close frame); unmasked and bad-opcode frames; the server Ping and the Pong answer to a client Ping; the connection cap (503 + `Retry-After: 5`); and every server-initiated close as `closing` then 1005. - **Persistence**: migration tests (old DB -> new), chunked explored round trip, restart test extended to wall CRUD and entity props. **Slice 6 built** the explored half: `tests/texplored.nim` (chunk layout pinned, whole-chunk encoding, upsert replacement, per-player keying, restore, write cost) and `tools/persistence.test.mjs` (round trip through a fresh resync, per-player isolation, SIGTERM and SIGKILL restart equality, a wall removal's revealed cells after the wall returns, chunk rows decoded independently, move-ack timing, and a fixture schema-4 DB migrated by the real binary). @@ -958,7 +964,7 @@ Each is small, ends with a green gate, and no milestone depends on browser UI be 3. Q3 - Multiple scenes in v1 (GM switches the active scene, per-scene explored grids), or exactly one scene per table to start? **RESOLVED [FIXED (owner decision), 2026-11-08]:** exactly one scene in v1; schema may stay `scene_id`-keyed. 4. Q4 - Tile-edge leak: accept as documented, or reduce it (smaller tiles = more requests; gate tiles only when explored cells cover a minimum fraction; or server-side masked tiles at the cost of image processing in Nim)? What detail do you paint in map art that must stay secret? **RESOLVED [FIXED (owner decision), 2026-11-08]:** `tile_size` = explored cell size = 32 px. Residual leak is at most one cell, never revoked; no server-side masking. Authoring rule shrinks from ~256 px to ~32 px. M4 acceptance: (a) headless mobile-emulation test on the real server path, (b) one manual phone run; fallback 64 px (per-scene config). Evidence: `prototype-tile-leak/README.md`. Applied in 3.3, 3.4 (T5), 8, 12 (H8), 13 (M4, M6). 5. Q5 - Map import: CLI-only for v1, or upload + tiling from the browser (GM) from the start? **RESOLVED [FIXED (owner decision), 2026-11-08]:** map import is CLI-only in v1; browser upload is post-v1. -6. Q6 - Wall/door authoring: is an in-browser GM wall editor required in v1 (no generator feeds in), or is hand-edited/imported wall data acceptable at first? What other wall kinds are needed soon (windows, one-way, secret doors, locked doors)? **RESOLVED [FIXED (owner decision), 2026-11-08]:** in-browser GM wall editor in v1; wall kinds `wall` and `door` only. **Kind set SUPERSEDED [FIXED (owner decision), 2026-11-15, #42]** by 5.8: a wall's behaviour is independent switches and named kinds are presets; v1 presets are `wall`, `door`, `secret door`, `locked door`, `terrain` and `one-way wall`, with no `window` preset until #47 gives windows a rule. The editor requirement is unchanged. +6. Q6 - Wall/door authoring: is an in-browser GM wall editor required in v1 (no generator feeds in), or is hand-edited/imported wall data acceptable at first? What other wall kinds are needed soon (windows, one-way, secret doors, locked doors)? **RESOLVED [FIXED (owner decision), 2026-11-08]:** in-browser GM wall editor in v1; wall kinds `wall` and `door` only. **Kind set SUPERSEDED [FIXED (owner decision), 2026-11-15, #42]** by 5.8: a wall's behaviour is independent switches and named kinds are presets; v1 presets are `wall`, `door`, `secret door`, `locked door`, `terrain` and `one-way wall`, and `window` was added by #47 (2026-11-16) as a see-through opening, its fixed form being `terrain`. The editor requirement is unchanged. 7. Q7 - Vision model: single radius per token or per-token property from day one? Is any "darkvision/light" concept needed before FFF? **RESOLVED [FIXED (owner decision), 2026-11-08]:** per-entity numeric `vision_radius` plus scene default; no light sources or darkvision. 8. Q8 - Which "table convenience" features come first after v1, if any: freehand drawing (exists in the perf prototype), pings, ruler, chat, dice, token images/portraits, initiative tracker? **DEFERRED [FIXED (owner decision), 2026-11-08]:** decided at M7. 9. Q9 - Should players see each other's names/presence, and should party members share vision (shared explored/LOS) or is it strictly per player? **RESOLVED [FIXED (owner decision), 2026-11-08]:** vision and explored strictly per player; player names visible to all. @@ -1036,10 +1042,12 @@ Out of M3 accept, unchanged: concurrency (M5) and the 127.0.0.1 bind check (M6 d Owner also decided 2026-11-15 [FIXED (owner decision), 2026-11-15, #41]: the height model. Heights are metres, decimal; map distances stay px and no map scale is introduced, because see-over compares heights with heights (research #39 3.3). `height` and `eye_height` are properties, not fields: a character carries the base value, a plain token must carry its own (`token.create` without one is refused), a linked token uses the character's value and may carry a temporary on-map override that never writes the character. Effective token height = token override, else character, else the plain token's own. Eye height follows the same pattern; if nobody set one by hand anywhere it is 93% of the effective token height and follows changes live [93% FIXED (owner-delegated)]. A wall is full height (nobody sees over it) unless the GM gives it one in metres; existing walls are unchanged. Both keys live in the `gm` bucket, so players see only the outcome, their sight. They are the first two keys of the property-schema registry (`number`, `gm`), so "the server never interprets props in v1" becomes "the server interprets only registered keys used by core sight rules". Limits [FIXED (owner-delegated)]: all heights > 0; `height` <= 100 m; `eye_height` <= 100 m and may exceed `height`; a wall's height > 0 and <= 100 m. Deferred: the target's height in see-over (#44) and the height existing tokens and characters get at migration (#49); wall kinds were settled afterwards by #42 (5.8, v0.22), and what a low wall hides (#44) and thickness (#45) were settled afterwards in 5.9 and 5.10. See 5.7, 6.1, 8, 9. -Owner also decided 2026-11-15 [FIXED (owner decision), 2026-11-15, #42]: the wall model. A wall's behaviour is **independent switches**, and a named kind is only a **preset** over them: never a fixed kind enum in the record, and never client-interpreted free flags (the client may send a preset name; the server expands and validates it). v1 switches are `blocks_sight` and `blocks_movement` plus the door settings `door`, `open`, `secret`, `locked` and one direction field `sight_dir` (`both|left|right`); no light or sound axis. Direction is **sight only**: movement is two-way governed by its switch. A door is a wall with `door` set and independent `open`/`secret`/`locked` settings, not a separate kind or a state enum, and `door.set` keeps working as "set `open`". The switches describe the closed wall: an open door blocks neither sight nor movement. A secret door is always closed and two-way (`open:true` or `sight_dir != both` on it is `invalid`), so it can look exactly like a solid wall. `secret` and `locked` are GM-only and never observable to a player in any form; the obligations are byte-identical player frames and refusals for a closed secret door against a solid wall, and one uniform move nack. v1 presets (one-drag editor defaults and the GM's label) are `wall` (default), `door`, `secret door`, `locked door`, `terrain` (blocks movement, not sight: railing, bushes) and `one-way wall`; there is no `window` preset until #47 gives windows a rule, and "blocks nothing" is not a preset. The record stores the switches; `kind` survives on the wire as a derived read-only label (exact preset match, else `custom`), never an input and never the authority [FIXED (owner-delegated)]. The switches are typed validated fields on the record and in the payloads, not entries in the never-interpreted `flags`; columns vs one validated object, and the existing-row migration, are #49's [FIXED (owner-delegated)]. The GM editor has a preset row plus an **advanced** toggle that exposes the raw switches [FIXED (owner decision)]. Thickness and height compose through the switches (a wall with `blocks_sight=false` never reaches the sight predicate) and are decided in 5.10 and 5.9. See 1, 3.1, 5.1, 5.5, 5.8, 6.1, 7.4, 8, 14. +Owner also decided 2026-11-15 [FIXED (owner decision), 2026-11-15, #42]: the wall model. A wall's behaviour is **independent switches**, and a named kind is only a **preset** over them: never a fixed kind enum in the record, and never client-interpreted free flags (the client may send a preset name; the server expands and validates it). v1 switches are `blocks_sight` and `blocks_movement` plus the door settings `door`, `open`, `secret`, `locked` and one direction field `sight_dir` (`both|left|right`); no light or sound axis. Direction is **sight only**: movement is two-way governed by its switch. A door is a wall with `door` set and independent `open`/`secret`/`locked` settings, not a separate kind or a state enum, and `door.set` keeps working as "set `open`". The switches describe the closed wall: an open door blocks neither sight nor movement. A secret door is always closed and two-way (`open:true` or `sight_dir != both` on it is `invalid`), so it can look exactly like a solid wall. `secret` and `locked` are GM-only and never observable to a player in any form; the obligations are byte-identical player frames and refusals for a closed secret door against a solid wall, and one uniform move nack. v1 presets (one-drag editor defaults and the GM's label) are `wall` (default), `door`, `secret door`, `locked door`, `terrain` (blocks movement, not sight: railing, bushes) and `one-way wall`; windows were left to #47, which added the `window` preset (2026-11-16), and "blocks nothing" is not a preset. The record stores the switches; `kind` survives on the wire as a derived read-only label (exact preset match, else `custom`), never an input and never the authority [FIXED (owner-delegated)]. The switches are typed validated fields on the record and in the payloads, not entries in the never-interpreted `flags`; columns vs one validated object, and the existing-row migration, are #49's [FIXED (owner-delegated)]. The GM editor has a preset row plus an **advanced** toggle that exposes the raw switches [FIXED (owner decision)]. Thickness and height compose through the switches (a wall with `blocks_sight=false` never reaches the sight predicate) and are decided in 5.10 and 5.9. See 1, 3.1, 5.1, 5.5, 5.8, 6.1, 7.4, 8, 14. Owner also decided 2026-11-15 [FIXED (owner decision), 2026-11-15, #44]: low walls. A token is visible iff **its top clears every sight wall the line from the viewer's eye crosses**, strictly: the sight line's height at the wall (`h_e + (h_t - h_e)·d_W/d_T`) must exceed the wall's height, and one failing wall hides it. The target's own height therefore matters (a giant's head over a fence, a crouched figure hidden next to the wall it would clear from further away); there is no adjacent-visible exception and no distance rule. The visibility polygon stays **strict**, so the floor behind a low wall stays unexplored and black, no tile is sent, and a visible token may stand on a black cell; no per-cell height is tested anywhere. Movement never reads height: `blocks_movement` alone decides, so a knee-high wall with the switch on stops a walker. Players get a binary answer and the whole token, with no clipping and no cover percentages (a rules-engine judgement, still a non-goal). The GM gets a GM-only **who-sees-it** view: per token, which player(s)/characters see it and its visible fraction (the share of its height above the highest blocking sight line, 100 % unobstructed), derived from data the GM already receives, never on a player wire, its panel shape M4's. Knobs delegated: strict comparison with equality hidden, evaluated at the wall near face (a thick wall: every crossed face, 5.10, #45); every crossed wall must clear; the hook sits at `visibleTo` as `insideAny or predicate` with heights never entering `visibilityPolygon`; no "see-over" switch on the wall; the hidden band's cells and tiles are oracle-*maybe*, a band-hidden token gives no frame, name or churn, and the leak checker's clear-line oracle gets its own height test. See 5.7, 5.8, 5.9, 7.4. Owner also decided 2026-11-15 [FIXED (owner decision), 2026-11-15, #46]: secret and locked doors. (1) **Player door opening is out of v1** [FIXED (owner decision)]: only the GM opens or closes a door; `door.set` stays G-only and a player sender is `not-allowed` at the role step (6.5) whatever the door's settings. Player-opened doors, lock refusals addressed to players and player discovery of secret doors (searching, revealing, finding a way in) are future effort, not v1 and not this map; the lock is GM authoring state. (2) **A locked door does not open** [FIXED (owner decision)]: `door.set open:true` on a door with `locked` is `invalid`, exactly like a secret door, and the GM unlocks first (editor hint "locked: unlock first"); any write that would store `open:true` with `locked` or `secret` — `wall.add`, `wall.update`, a preset expansion — is `invalid`; closing a locked door is allowed. Otherwise a locked door is an ordinary closed door. (3) **The equivalence oracle** [FIXED (owner-delegated)]: `tools/doors.test.mjs` is a new Node accept group (built-ins only, 10.4) in the shape of `tools/probing.test.mjs` — two servers, fresh state, one identical script, scenes differing only in one segment (solid wall vs secret door; solid wall vs secret+locked; closed door vs locked closed door), player frames and per-tile statuses identical after canonicalisation with **no** normalisation; the positive control is the same script against an open door, which must differ; the negative control is `LEAK_FAULT=secretgap` (a secret door not blocking the player-facing computation), which must fail the doors group while a clean build passes and ships no fault string; `tools/leakcheck.nim`'s banned-key scan grows `secret`, `locked`, `door`, `blocks_sight`, `blocks_movement`, `sight_dir` (and #49's names) into `WALLDATA`, with a new fault leaking one door setting key and asserting exactly `WALLDATA`; a GM `door.set` on a secret or locked door is `invalid` and a player `door.set` is `not-allowed` for every door; timing and size side channels (T11) stay accepted and untested. See 1, 3.4, 5.8, 6.1, 6.5, 7.4, 10.3. Owner also decided 2026-11-15 [FIXED (owner decision), 2026-11-15, #45]: thick walls. (1) **Placement** [FIXED (owner decision)]: `position` is `center` (default), `left` or `right` of the drawn `a -> b` line, using 5.8's side convention; the line is the room's interior, the body grows outward, and a flip changes only the body, never `a`/`b`. (2) **Body** [FIXED (owner decision)]: a rectangle `|ab|` x `thickness` with square ends, offset per `position`; `thickness: 0` is today exactly and every existing wall migrates to zero and unchanged. It is opaque floor: never in a player polygon, never newly explored, no tile newly revealed under it. (3) **One shape** [FIXED (owner decision)]: sight footprint and movement collider are the same exact rectangle, sight as the 4-face quad hoisted per wall edit (#43 measured) and movement as exact circle-vs-rectangle distance with a centre inside the body counting as overlap; one rectangle-distance primitive serves `pathClear`, the overlap/`stuck` check, the door push, `pushOutOfWalls` and resize; a `blocks_sight:false` wall contributes nothing to sight, body included, while its collider keeps the thickness. (4) **Default thickness** [FIXED (owner decision)]: a new wall starts at the GM's last-used thickness, 0 in a fresh editor. (5) **See-over** [FIXED (owner decision)]: 5.9's line must clear **every crossed face** of the body, near and far, strictly; the faces coincide at zero thickness, so 5.9 stands. (6) **Edits never push** [FIXED (owner decision)]: a thickness change, flip or move that covers a token leaves it in place and `stuck`; only a door close pushes. (7) **A viewer inside a sight-blocking body sees nothing** [FIXED (owner decision)]: empty polygon until it leaves. (8) **No dead end** [FIXED (owner decision)]: v1 walls stay straight rectangles (a cave is a chain of walls; joints overlap with a small outer notch and no crack), the shape sits behind one seam, and curved/freeform walls and tracing walls from a map image are future effort. Delegated: px thickness `0..256`; the `(-dy, dx)` side formula; joints by overlap, no mitre; field names `thickness` and `position`; the last-used default as editor state. Downstream: thick doors and push geometry #50, one-way body occlusion #47, wire/schema/migration #49. See 1, 5.1, 5.3, 5.5, 5.7, 5.8, 5.9, 5.10, 6.1, 7.4, 8, 13. + +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.