Files
houseplan-card/test
Claude 5a1b0c20d4 refactor(cache): one source for the wall-union and bodies keys and pool entry (#769)
The #744 key formats were copied: the wall-union key `${floorKey}|${rooms}`
in the card's miss branch and three times in the resize runtime, the
physical-bodies key `${floorKey}|${cellCm}|${gridPitch}` in the card, the
runtime twice and the LED editor, the pool bound 8 as a literal three times
and the `sourceFingerprint` attachment twice. A copy that drifts makes the
resize lookup and the cancel alias stop hitting without any error.

src/floor-geometry-key.ts now owns `wallUnionKey`, `physicalBodiesKey`,
`WALL_UNION_POOL_LIMIT`, the entry factory `wallUnionPoolEntry` (it attaches
`lightGeometryFingerprint` of the record the union was built from) and
`writeWallUnionPool`. The card's miss branch, `_rszEdgeDown`, the
`_rszCancelDrag` alias and both bodies re-keys use only them; the LED editor
keys its own bodies with the same helper. `_rszEdgeDown` now reads the key
of the shown floor's model, as the card does, instead of its own room list.

The union seed in `_rszAcceptPreview` is removed, not moved: since #451 the
live preflight publishes no artifact (`artifact: null`), so the seed never
ran. A host render mid-drag builds the preview union once through the card's
miss branch and every later render hits it. The bodies re-key stays: a
resize never moves partitions, columns or a partition opening's host, and
the smoke proves the re-keyed bodies equal a fresh card's on the preview
record, a door cut into a partition next to the moving wall included.

AC8 in demo/smoke_floor_geometry_cache.mjs on the held AC2c drag: (a) host
renders mid-drag build no union and the drawn union equals a fresh card's on
the preview record, paths and `sourceFingerprint`; (b) cancel and the way back
to View build no union, bodies, contours or clean floors, and the union and
bodies equal a fresh card's on the stored record; (c) the drag never rebuilds
the bodies. Unit: the key formats, the bound and the entry
(test/floor-geometry-key.test.mjs) and a source contract that no copy of the
formats, the pool write or the fingerprint attachment is left outside the
module (test/performance-contract.test.mjs, red on dev). Two registry mutants
(bodies re-key in its own format, union fingerprint from the stored record),
caught by the smoke and checked by hand, as were the two #744 mutants whose
anchor moved; browser inventory 247/200.

Budgets: initial View 303032 B gzip (ceiling 302803 + 2000), lazy editor
245094 B (ceiling 244872 + 2000); monolith ratchet unchanged.

Issue: #769
User-Visible: no
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018qZfe7YS4rqEMKoVeS3GKd
2026-10-07 05:21:52 +03:00
..
2026-08-09 21:51:33 +03:00
2026-09-07 11:06:28 +03:00
2026-09-07 11:06:28 +03:00
2026-09-07 11:06:28 +03:00