Walls r1: presets, label, one expand-and-validate path and switch-set invariants #55

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

Part of #52

Goal

preset "wall"|"door" expands server-side to switches before validation; preset xor raw switches; a preset never touches geometry. label 1–64 code points, trimmed, no control chars, null clears, stored verbatim, GM-only. All forbidden switch sets rejected by the single path used by add/update (and the future importer), and by the DB CHECKs.

Acceptance criteria

  • Presets wall/door expand correctly; preset+switch payload and preset with open:true are invalid; raw create defaults to wall, raw update patches only named switches; {door:false} closes and de-secrets.
  • open/secret/locked without door, secret not closed/two-way/opaque, sight_dir≠both with blocks_sight:false, open with secret or locked → invalid; a fieldless update is invalid before the id lookup.
  • Label set/change/clear round-trips; 0, 65 code points, untrimmed and control-char labels are invalid.
  • Standing: full nimble + node test suites green on a clean checkout; no existing test weakened or skipped; behaviour proven at the approved seams (WS black-box, leak checker + fault builds, schema-7 migration fixture).

User stories covered

1, 2, 3, 4, 18, 25, 26, 27, 63, 64

Proven at

  • WS black-box (walls group).

Notes

  • Size: M.
  • Blocked by: #54.
  • Story 1's window/one_way presets land in W5/W6.
Part of #52 ## Goal preset "wall"|"door" expands server-side to switches before validation; preset xor raw switches; a preset never touches geometry. label 1–64 code points, trimmed, no control chars, null clears, stored verbatim, GM-only. All forbidden switch sets rejected by the single path used by add/update (and the future importer), and by the DB CHECKs. ## Acceptance criteria - Presets wall/door expand correctly; preset+switch payload and preset with `open:true` are invalid; raw create defaults to wall, raw update patches only named switches; `{door:false}` closes and de-secrets. - open/secret/locked without door, secret not closed/two-way/opaque, sight_dir≠both with `blocks_sight:false`, open with secret or locked → invalid; a fieldless update is invalid before the id lookup. - Label set/change/clear round-trips; 0, 65 code points, untrimmed and control-char labels are invalid. - Standing: full nimble + node test suites green on a clean checkout; no existing test weakened or skipped; behaviour proven at the approved seams (WS black-box, leak checker + fault builds, schema-7 migration fixture). ## User stories covered 1, 2, 3, 4, 18, 25, 26, 27, 63, 64 ## Proven at - WS black-box (walls group). ## Notes - Size: M. - Blocked by: #54. - Story 1's window/one_way presets land in W5/W6.
SirStone added the ready-for-agentenhancement labels 2026-11-19 21:48:24 +01:00
SirStone added a new dependency 2026-11-19 21:48:29 +01:00
Author
Owner

Implemented in 484275e (feat(walls): presets, label rule and one switch-set validation path), pushed to main.

  • resolveWall is the one expand-and-validate path for wall.add/wall.update: preset xor raw switches, presets set switches only (never geometry), and every forbidden switch set is invalid.
  • Raw create defaults to wall; raw update patches only named switches; {door:false} closes and de-secrets. Raw open/secret/locked true on a non-door is now invalid instead of silently dropped, and open+locked is refused.
  • window/one_way presets are accepted and expanded to their 5.8 switch sets now; their player-facing behaviour remains with #57/#58.
  • label is trimmed, 1..64 code points, no control characters, null clears; stored verbatim and GM-only.
  • DB backstop gained CHECK (open = 0 OR locked = 0).

Standing suites green on a clean checkout: Nim 385, Node 117. No existing test weakened or skipped; new proofs are the walls WS black-box group plus Nim shape pins.

Implemented in 484275e (`feat(walls): presets, label rule and one switch-set validation path`), pushed to main. - `resolveWall` is the one expand-and-validate path for wall.add/wall.update: preset xor raw switches, presets set switches only (never geometry), and every forbidden switch set is invalid. - Raw create defaults to wall; raw update patches only named switches; `{door:false}` closes and de-secrets. Raw `open`/`secret`/`locked` true on a non-door is now `invalid` instead of silently dropped, and `open`+`locked` is refused. - window/one_way presets are accepted and expanded to their 5.8 switch sets now; their player-facing behaviour remains with #57/#58. - `label` is trimmed, 1..64 code points, no control characters, null clears; stored verbatim and GM-only. - DB backstop gained `CHECK (open = 0 OR locked = 0)`. Standing suites green on a clean checkout: Nim 385, Node 117. No existing test weakened or skipped; new proofs are the walls WS black-box group plus Nim shape pins.
Sign in to join this conversation.