diff --git a/GLOSSARY.md b/GLOSSARY.md index 2348bc8..8f31443 100644 --- a/GLOSSARY.md +++ b/GLOSSARY.md @@ -51,8 +51,32 @@ A figure on the map. It may belong to a character; a plain token (monster, item) _Avoid_: entity, piece, counter **Wall**: -A barrier on the map with a length, a thickness and a height. It hides what its dimensions hide. A wall is full height unless the GM gives it a height in metres, so by default nobody sees over it; an older wall without a height keeps hiding everything behind it. In v1 a wall has zero thickness; per-wall thickness and the wall kinds are pending (map #38). -_Avoid_: blocker, collider, obstacle, sight blocker +A barrier on the map with a length, a thickness and a height. It hides what its dimensions hide. What it *does* is a set of **switches** it carries: blocks sight, blocks movement, and (for sight) a direction; a door is a wall with the door setting plus open/secret/locked. A named wall kind is only a preset over those switches, never the wall's own identity. A wall is full height unless the GM gives it a height in metres, so by default nobody sees over it; an older wall without a height keeps hiding everything behind it. In v1 a wall has zero thickness; per-wall thickness and what a low wall hides are pending (map #38). +_Avoid_: blocker, collider, obstacle, sight blocker, wall type (use preset) + +**Wall switch**: +One independent setting a wall's behaviour is made of: `blocks sight` or `blocks movement`. Neither implies the other: a wall can hide what is behind it and let people walk through, or the reverse. A door's settings (open, secret, locked) and the sight direction are settings of the same wall but not switches. Switches are stored on the wall and read by the server. +_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. +_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. +_Avoid_: one-sided wall, directed wall, mirror wall + +**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. +_Avoid_: hidden door, concealed door, illusionary wall + +**Locked door**: +A closed door the server refuses to open until it is unlocked. The lock is the GM's business only: players get no signal of it, and a locked door behaves exactly as a closed door to sight and movement. In v1 only the GM opens doors, so the setting is authoring state waiting for player door interaction. +_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. +_Avoid_: transparent wall, invisible wall, obstacle (that names the thing, not the preset) **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. diff --git a/docs/DESIGN.md b/docs/DESIGN.md index cba204a..425925a 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -1,6 +1,6 @@ # FFF_vtt design -Status: draft v0.21, 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. All of Q1-Q24 are RESOLVED or DEFERRED; none OPEN). Audience: the owner and coding agents. +Status: draft v0.22, 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. 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 (kinds `wall`|`door` only, Q6), tokens. -- GM tools: author walls/doors in the browser (Q6, FIXED), 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`) are one-drag defaults over them (5.8; supersedes Q6's `wall`|`door` only). +- 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. - 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/transparent walls, one-way walls. +- 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). - Accounts, passwords, OAuth, multiple tables/campaigns per server, public hosting. - 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). - Freehand drawing, rulers, pings, chat, audio, video (order decided at M7, Q8). @@ -96,7 +96,7 @@ A browser virtual tabletop for one table (1 GM + up to 6 players [FIXED, Q1]), s | Data | GM | Player (own) | Player (others) | |---|---|---|---| -| Walls, doors (geometry, open/closed) | all, always | **never** (WS or HTTP) | never | +| Walls: geometry, switches, door settings and the derived `kind` label (5.8) | all, always | **never** (WS or HTTP) | never | | Tokens/entities (position, radius, statuses without `source`, name per 8) | all | controlled by this player (`entity.owner`): always. Others: only if inside own LOS polygon **and** not `gm_only` | -- | | Token props, `public` bucket | all | for visible tokens | -- | | Token props, `owner` bucket (owner = token controller) | all | only for tokens this player controls | never | @@ -244,7 +244,7 @@ player_key(player_id PK FK, secret, created_at) -- indicative; one current key session(id PK, player_id FK, token_hash, created_at, last_seen) -- never expires (Q10) scene(id PK, name, w, h, tile_size, cell, grid_size, vision_radius_default, token_radius_default, art_version, active, next_wall_id, extra_json) -- next_wall_id: monotonic, §8 [FIXED, #3]; token_radius_default [FIXED, #4] -wall(scene_id FK, id, ax, ay, bx, by, kind, open, flags, PRIMARY KEY(scene_id, id)) -- kind: wall|door|(later: window, one-way) +wall(scene_id FK, id, ax, ay, bx, by, kind, open, flags, PRIMARY KEY(scene_id, id)) -- behaviour = switches (5.8); `kind` is a derived label, never the authority; columns vs a validated object are #49's character(id PK, owner_player_id FK NOT NULL, descriptive_name, actual_name, reveal_all BOOL, props_public JSON, props_owner JSON, props_gm JSON) -- NOT NULL: exactly one owner; GM owns via the GM's player id [FIXED, #14] entity(id TEXT PK, scene_id FK, kind, character_id FK NULL, descriptive_name NULL, actual_name NULL, reveal_all BOOL, @@ -279,7 +279,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 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 + circle segments; result = CCW polygon. Open doors (`door && open`) do not block. +- **Visibility polygon** from token centre: cast rays to every blocking wall endpoint 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 + 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). - **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. @@ -318,7 +318,7 @@ Conclusions: ### 5.5 Move rules and statuses (M2 decisions, 2026-11-08; status model 2026-11-10, #4) Normative for M2. Replaces the prototype move validation (5.1) and the move-related limitations in 4.2 and 5.4. Implemented as a pure in-process module with unit tests; the WebSocket layer only maps its result to `ack` (6.1). The WebSocket probing test is M3. -Notation: token centre `c`, radius `r` (entity `radius` if set, else scene `token_radius_default`; 5.6), start `s`, destination `d`. Blocking wall: segment with `kind=wall`, or `kind=door` with `open=false`; open doors do not block. `dist(X, W)` = distance from point or segment `X` to segment `W`. "Overlaps" = `dist < r` (strict; touching at exactly r is clear). +Notation: token centre `c`, radius `r` (entity `radius` if set, else scene `token_radius_default`; 5.6), start `s`, destination `d`. Blocking wall: segment with `blocks_movement` on, and for a door only while it is closed (5.8); open doors do not block, and a one-way wall blocks movement both ways. `dist(X, W)` = distance from point or segment `X` to segment `W`. "Overlaps" = `dist < r` (strict; touching at exactly r is clear). **Statuses `stuck` and `squeezed`** (replace the M2 `blocked` bool) [FIXED, owner (B), Q14, refined 2026-11-08; FIXED, owner 2026-11-10, #4]. Both are cause-agnostic lock conditions: a locked token cannot be moved by its player; the GM always can. `stuck` = held in place (wall through it, ropes, magic grasp); `squeezed` = pressed, no room (walls around it, closing hand). - Storage: a token holds a set of `(status, source)` entries (stored on the entity, persisted); the same status may come from several sources. Locked while any entry exists. Both statuses may show at once. Sources: `walls` (set by the rules below) and `GM` (GM sets either status by hand for any reason; GM can clear any single entry at any time). Visibility: every recipient who sees the token gets `status` only; `source` is GM-only (6.1, amended 2026-11-14). @@ -359,7 +359,7 @@ Notation: token centre `c`, radius `r` (entity `radius` if set, else scene `toke - Wire intents: `token.resize`, `status.set`, `status.clear` (6.1) [FIXED (owner-delegated, 2026-11-14, #11)]. ### 5.7 Heights [FIXED (owner decision), 2026-11-15, #41] -What the vertical dimension is made of, and in what unit. Vision only: what a low wall does to sight is #44, thickness is #45, the wall kinds are #42, the wire and migration are #49. +What the vertical dimension is made of, and in what unit. Vision only: what a low wall does to sight is #44, thickness is #45, the wall kinds were #42 (5.8), the wire and migration are #49. - **Unit: metres, decimal.** Map distances stay px and no map scale is introduced: see-over compares heights with heights, so no px -> m conversion exists anywhere [FIXED (owner decision), 2026-11-15, #41]. Research #39 3.3 needs only `h_eye` and `h_wall` for the hidden band behind a low wall (`d_floor = s * h_eye / (h_eye - h_wall)`), never a ground distance in metres. - **Height is a property, not a field.** `height` and `eye_height` live in the `gm` bucket of the three-bucket `props` (8), on the character or on the token; there is no dedicated column and no wire field of their own. - **Token height.** A character carries its base `height` (the character-sheet value). A plain token (no character) carries its own `height`, and `token.create` without one is refused `invalid` (`invalid`, not `not-found`: a missing field, 6.5). A linked token uses its character's `height` by default; it may carry its own `height` as a temporary on-map override (an enlarge spell doubling it) that never writes the character. Removing the override restores the character's value. **Effective token height** = the token's override, else the character's `height`, else the plain token's own `height`. @@ -369,7 +369,33 @@ What the vertical dimension is made of, and in what unit. Vision only: what a lo - **Limits** [FIXED (owner-delegated), 2026-11-15, #41]: every height > 0; `height` <= 100 m; `eye_height` <= 100 m and **may exceed** `height` (a floating eye); a wall's height > 0 and <= 100 m. The registered kind is enforced on write, so a non-number is `invalid` (8, 9). - **First registered keys.** `height` and `eye_height` are the first two keys of the property-schema registry (8, 9): `kind` number, bucket `gm`. This is the first time the server interprets props, so the "the server never interprets props in v1" wording of 8 and 9 is narrowed to **the server interprets only registered keys used by core sight rules** (6.1, 8, 9). - Deferred: whether the *target's* height matters for see-over (a giant's head over a fence) -> #44 "Low walls: sight and movement"; what height existing tokens and characters get at migration (`height` is required) -> #49 "Wall wire format, schema and migration". -- Conflict note: section 1's non-goals (windows/transparent walls, one-way walls) and Q6's `wall`|`door` only are contradicted by the wall-model work. That is map #38's territory and is being settled there; this block fixes heights and units only, not kinds, thickness or what a low wall hides. +- 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) are still open. + +### 5.8 Wall switches, presets, doors and one-way [FIXED (owner decision), 2026-11-15, #42] +What a wall's behaviour is made of. Heights are 5.7; what a low wall does to sight and movement is #44; thickness is #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. +- **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 oracles that pin this are #46's. +- **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. + + | preset | `blocks_sight` | `blocks_movement` | door settings | + |---|---|---|---| + | wall (default) | yes | yes | none | + | 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 | + + 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. +- **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 (hook, decided in #44/#45, not here).** 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`. #44 then decides how the sight predicate treats a wall's height, #45 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. --- @@ -420,20 +446,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], kind:"wall"|"door", open?:bool (default false), 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, kind, flags` | G | `{}`; `not-found`, `invalid` | as `wall.add` (update = remove + add for the status rules, 5.5; PROPOSED there) | +| `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.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) | `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 | +| `door.set` | `scene, id, open:bool` | G | `{}`; `not-found`, `invalid` (wall is not a door, or is a secret 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 | -Validation for `wall.*`: `a != b`, both in bounds, `kind` in `wall|door`, `flags` an object or absent. +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; `preset` and any raw switch in the same payload is `invalid` (5.8). -**Wall payload rules [FIXED (owner-delegated, 2026-11-15, #19)]** (6.1 was silent on these; slice 4 builds them): +**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. -- `open` is a boolean; omitted = `false`. `wall.add` with `kind:"wall"` and `open:true` is `invalid` (a wall is never open), and a stored wall always has `open=false` (a `kind` change door -> wall through `wall.update` therefore closes the door). -- `flags` is a JSON object or absent (absent = `{}`); anything else is `invalid`. It is stored verbatim and never interpreted. -- `wall.update` patches `a`, `b`, `kind`, `flags` only; at least one of them is required, otherwise `invalid`. `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). 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 `kind` is not `door` is `invalid`. +- 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). 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). +- `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. - `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. @@ -528,8 +556,8 @@ All are built per recipient at egress (single egress rule, 2). "Sent" always mea | `ack` | see Conventions | sender connection only | | `error` | `code` (`malformed` or `rate-limited`; 6.5) | sender connection only; only for frames that cannot be acked | | `roster` | `players:[{id, name, role, colour, connected}]`, always the full list | everyone (Q9). Players receive named players only (an unused key is not visible); GM receives all, `name:null` for unnamed | -| `walls` | `scene, walls:[{id, a, b, kind, open, flags}]` | GM, on connect and resync (6.3) | -| `wall` | `scene, id, a, b, kind, open, flags` (upsert; doors included; this replaces the old `door` message) | GM only | +| `walls` | `scene, walls:[{id, a, b, kind, blocks_sight, blocks_movement, sight_dir, door, open, secret, locked, flags}]`; `kind` is the derived 5.8 label | GM, on connect and resync (6.3) | +| `wall` | `scene, id, a, b, kind, blocks_sight, blocks_movement, sight_dir, door, open, secret, locked, flags` (upsert; doors included; this replaces the old `door` message) | GM only | | `wall_gone` | `scene, id` | GM only | | `vision` | `polys:[{id:, pts:[[x,y],...]}]` integer px, the full set for this player's controlled tokens with `vision` | player only; never GM | | `explored` | `full:true, rle:[[cy, x0, len, x0, len, ...], ...]` on connect and resync; `full:false, cells:[[cx,cy],...]` afterwards (fresh cells) [format PROPOSED, 6.4] | player only; never GM | @@ -658,7 +686,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: in v1, kinds `wall`|`door` only]: click-click segments, snap to grid/endpoints optional, door tool, delete, undo of last edit [PROPOSED]; submits `wall.*` intents; server is the validator. +- Wall editor (GM) [FIXED, Q6, extended by 5.8]: 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. The editor draws `kind` (the derived label) only; no preset is a stored kind. Thickness and height controls arrive with #45 and M4. - 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). ### 7.5 Prediction and rollback for own moves @@ -676,7 +704,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/Door**: `scene, id` (per-scene, see above), `a:[x,y], b:[x,y], kind ('wall'|'door'), open:bool, flags`. `blocks = not (door and open)`. GM-only everywhere. Later kinds (window, one-way, secret door) are extra `kind`/`flags` values; v1 geometry treats any non-open blocker identically. **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, hit rules and the kind set are map #38's; the wire and the migration are #49. +- **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 the low-wall rules are #44/#45; the wire fields and the migration are #49. Rejected: a stored `kind` enum, and a `window` kind before #47 gives it a rule (in v1 "sees over, does not pass" is `terrain`). - **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]. @@ -857,7 +885,7 @@ Each is small, ends with a green gate, and no milestone depends on browser UI be 8. **persistence**: explored chunks round trip; old DB migrates to new (H13, 4.4, 10.3; migrations are PROPOSED in 4.4). 9. **logs**: no secret in any log; the test greps the logs for every key and session value it used (T6, 11.3 PROPOSED). **Built by slice 10 (#25):** `tools/logs.test.mjs` (two runs incl. a GM-key rotation, keys/sessions/hashes, and a `keylog` leak-fault negative control; details in 10.3). - **M4 - Client v1.** - - Scope: new `client/` dir (first real client build): Vite + TS + Pixi v8 client: layers, tiles, grid, tokens (BitmapText), character list, encountered list (greyed), reveal buttons (#14 UI; server side in M3), fog textures, wall/door editor, token drag with prediction/rollback, DOM overlay, reconnect backoff, reducer tests; after the client port, archive `prototype-*` dirs (Q24). + - Scope: new `client/` dir (first real client build): Vite + TS + Pixi v8 client: layers, tiles, grid, tokens (BitmapText), character list, encountered list (greyed), reveal buttons (#14 UI; server side in M3), fog textures, wall editor with presets (5.8), token drag with prediction/rollback, DOM overlay, reconnect backoff, reducer tests; after the client port, archive `prototype-*` dirs (Q24). - Accept: headless e2e: fog pixel checks, player traffic audit clean, reconnect restores; manual run on laptop and Note 10 at 60 fps with 50 tokens, 16384 px map (tiled; PROPOSED test target, Q2), fog active. - Tile-size gates [FIXED, Q4]: (a) automated headless-Chromium test with mobile emulation (viewport, dpr, CPU + network throttle) against the real server path (nginx HTTP/2 + caching): viewport fills in < 1 s at zoom 1; (b) one manual run on the owner's 5-year-old Android phone (worst-case reference). If either fails: `tile_size` 64 px (per-scene config, no code change). The 2026-11-08 prototype phone run (`prototype-tile-leak/README.md`) is evidence, not the gate: HTTP/1.1, no-store, zoom 0.5 only, first cold load up to 3.3 s. - **M5 - Robustness and observability.** @@ -882,7 +910,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. +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. 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. @@ -958,4 +986,6 @@ Owner also decided 2026-11-15 [FIXED (owner-delegated, 2026-11-15, #25)]: the M3 Out of M3 accept, unchanged: concurrency (M5) and the 127.0.0.1 bind check (M6 deploy) [FIXED, #12]. **Measured 2026-11-15 on the final tree:** `devbox run test` exit 0 (Nim suite all pass; 103 Node harness tests, 0 fail) and `devbox run mutation` exit 0 (control passes, all 63 mutations fail >= 1 expected test, the new `d3` included; log `results/mutation.log`). See 6.1, 10.3, 10.4, 13. -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, thickness and what a low wall hides stay with map #38. See 5.7, 6.1, 8, 9. +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), while thickness (#45) and what a low wall hides (#44) stay with map #38. 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 #45 and #44. See 1, 3.1, 5.1, 5.5, 5.8, 6.1, 7.4, 8, 14.