Walls r1: schema step 8 — typed wall storage, marker_seen, height backfill #53

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

Part of #52

Goal

One migration step rebuilds wall into typed columns with CHECKs, drops legacy kind, creates marker_seen with the composite FK, and runs a data hook backfilling props_gm.height=1.8 (never eye_height, never a hand-set height). The world module loads/stores the typed record (SQL literals for height/label; create the text-literal helper DESIGN §4.4 names, formatting NULL as SQL literal); startup refuses a newer schema; re-open writes nothing.

Acceptance criteria

  • Schema-7 fixture migrates under the real binary: every decoded row equals DESIGN §4.4 mapping (thickness 0, center, both blocks 1, sight_dir both, marker/secret/locked 0, height/label NULL, kind=door→door=1+stored open, kind=wall→door=0,open=0).
  • Every entity and character without a height key gets 1.8; eye_height absent; hand-set height untouched.
  • Direct INSERT violating each CHECK fails.
  • Second run writes nothing.
  • A failing step rolls back DDL+history+version.
  • user_version=9 refused.
  • Harness tripwires move: LatestVersion 8, persistence test schema-8.
  • 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

33, 34, 65, 72, 73

Proven at

  • Schema-7 fixture DB through the real binary.
  • Existing DB unit test pins.

Notes

  • Size: M.
  • Blocked by: — (first ticket).
Part of #52 ## Goal One migration step rebuilds `wall` into typed columns with CHECKs, drops legacy `kind`, creates `marker_seen` with the composite FK, and runs a `data` hook backfilling `props_gm.height=1.8` (never `eye_height`, never a hand-set height). The world module loads/stores the typed record (SQL literals for `height`/`label`; create the text-literal helper DESIGN §4.4 names, formatting NULL as SQL literal); startup refuses a newer schema; re-open writes nothing. ## Acceptance criteria - Schema-7 fixture migrates under the real binary: every decoded row equals DESIGN §4.4 mapping (thickness 0, center, both blocks 1, sight_dir both, marker/secret/locked 0, height/label NULL, kind=door→door=1+stored open, kind=wall→door=0,open=0). - Every entity and character without a height key gets 1.8; `eye_height` absent; hand-set height untouched. - Direct INSERT violating each CHECK fails. - Second run writes nothing. - A failing step rolls back DDL+history+version. - `user_version=9` refused. - Harness tripwires move: `LatestVersion` 8, persistence test schema-8. - 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 33, 34, 65, 72, 73 ## Proven at - Schema-7 fixture DB through the real binary. - Existing DB unit test pins. ## Notes - Size: M. - Blocked by: — (first ticket).
SirStone added the ready-for-agentenhancement labels 2026-11-19 21:48:24 +01:00
Author
Owner

Progress: schema step 8 landed on main in c1b1e9c (not pushed).

  • Step 8 rebuilds wall into typed columns + CHECKs, drops legacy kind, adds marker_seen with the composite FK, and runs a data hook backfilling props_gm.height=1.8 (no eye_height, hand-set heights untouched). LatestVersion is 8.
  • world.WallRec now loads/stores the typed record; nullable height/label use sqlLitText/sqlLitReal SQL literals; the wire and sight/movement behaviour are unchanged (proto still 1).
  • Proven: schema-7 fixture through the real binary (mapping, backfill, second-run no-op, failing-step rollback, user_version=9 refusal), plus direct INSERT CHECK tests in tests/tdb.nim. Full suites green: 381 Nim tests, 110 node tests.
Progress: schema step 8 landed on `main` in c1b1e9c (not pushed). - Step 8 rebuilds `wall` into typed columns + CHECKs, drops legacy `kind`, adds `marker_seen` with the composite FK, and runs a `data` hook backfilling `props_gm.height=1.8` (no `eye_height`, hand-set heights untouched). `LatestVersion` is 8. - `world.WallRec` now loads/stores the typed record; nullable `height`/`label` use `sqlLitText`/`sqlLitReal` SQL literals; the wire and sight/movement behaviour are unchanged (proto still 1). - Proven: schema-7 fixture through the real binary (mapping, backfill, second-run no-op, failing-step rollback, `user_version=9` refusal), plus direct INSERT CHECK tests in `tests/tdb.nim`. Full suites green: 381 Nim tests, 110 node tests.
Author
Owner

Closed by c1b1e9c (typed wall storage, marker_seen, height backfill). Build green on clean checkout: 381 Nim / 110 Node tests.

Closed by c1b1e9c (typed wall storage, marker_seen, height backfill). Build green on clean checkout: 381 Nim / 110 Node tests.
Sign in to join this conversation.