fix(core): update stale registry + stair-opening tests to match behavior (#358)

Two unit-test groups had drifted from intentional implementation changes
and have been failing CI on main since before they were noticed:

- registry: re-registering a node kind is now HMR-aware — it warns and
  replaces in dev/test and only throws in production (registry._register,
  introduced in the in-world-selection work). `bun test` runs with
  NODE_ENV=test, so the duplicate-kind tests took the dev (warn) path and
  no longer threw. Pin NODE_ENV to 'production' for the throw-path
  assertions via an `inProduction` helper, and add explicit dev/HMR
  coverage for the warn-and-replace path.

- stair-opening-sync: the straight-flight opening geometry was
  deliberately enlarged ("increase stair opening buffer constraints",
  treadDepth*10 / length*0.8 / 3.0, openingOffset default 0.15). The
  enlarged opening now spans nearly the full slab depth, so the manual
  hole fixtures (which must *contain* the auto opening to suppress it) no
  longer covered it. Enlarge the manual-opening fixtures to genuinely
  cover the current opening, preserving each test's intent.

No production code changed — only test fixtures/assertions.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Wassim SAMAD
2026-06-02 10:44:15 -04:00
committed by GitHub
co-authored by Claude Opus 4.8
parent f7ff60561e
commit 96d6e0afdb
2 changed files with 45 additions and 18 deletions
@@ -79,10 +79,10 @@ describe('syncAutoStairOpenings', () => {
const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id })
const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id })
const manualOpening: Array<[number, number]> = [
[1.2, 0.8],
[2.8, 0.8],
[2.8, 2.9],
[1.2, 2.9],
[1.0, 0.0],
[3.0, 0.0],
[3.0, 3.0],
[1.0, 3.0],
]
const sourceCeiling = CeilingNode.parse({
name: 'Source Ceiling',
@@ -206,10 +206,10 @@ describe('syncAutoStairOpenings', () => {
const ground = LevelNode.parse({ name: 'Ground', level: 0, parentId: building.id })
const upper = LevelNode.parse({ name: 'Upper', level: 1, parentId: building.id })
const manualOpening: Array<[number, number]> = [
[1.2, 0.8],
[2.8, 0.8],
[2.8, 2.9],
[1.2, 2.9],
[1.0, 0.0],
[3.0, 0.0],
[3.0, 3.0],
[1.0, 3.0],
]
const staleAutoOpening: Array<[number, number]> = [
[1.5, 1],