2.6 KiB
2.6 KiB
Implementation Plan
Checklist
- Capture a parity baseline before product-code edits:
node scripts/parity.js capture feature-registry-before --stages blender,cesium - Add
blender/osmassets/features.pywith a smallFeatureHandlercontract anddispatch_ways(...). - Import
features.pyinblender/generate_scene.py. - Convert the current OSM way
if/elifchain into ordered local handlers: water, grass, scrub, tree-row, building. - Keep handler bodies mechanically equivalent to the current branch bodies.
- Leave road GeoJSON/fallback, tree placement, fountain point processing,
scene metadata, and
SCENE_DONEbehavior unchanged except for any small phase comments needed to clarify ordering. - Run Python checks:
python3 -m py_compile blender/osmassets/features.pypython3 -m py_compile blender/generate_scene.pypython3 -m unittest blender/tests/test_pure.py
- Capture parity after the refactor:
node scripts/parity.js capture feature-registry-after --stages blender,cesium - Compare parity:
node scripts/parity.js compare feature-registry-before feature-registry-after - Update
.trellis/specanddocs/changelog.mdonly for durable registry conventions or P2 status changes discovered during implementation. - Commit, archive the task, and record the journal entry.
Validation Commands
node scripts/parity.js capture feature-registry-before --stages blender,cesium
python3 -m py_compile blender/osmassets/features.py
python3 -m py_compile blender/generate_scene.py
python3 -m unittest blender/tests/test_pure.py
node scripts/parity.js capture feature-registry-after --stages blender,cesium
node scripts/parity.js compare feature-registry-before feature-registry-after
Risk Points
- Handler order is equivalent to the old
elifchain. Changing it can alter which feature claims a way. - Object creation phase order affects
.blendand GLB digests. - Material creation order affects GLB material indices.
- Tree rows and scrub interior trees feed the later tree placement phase; do not place trees inside the way dispatch loop.
catalog.check_layers()must stay warning-only and keep the exact printed prefix.- Do not add a new road layer id list; keep deriving road layers from
catalog.ROAD_LAYERS.
Rollback Point
If parity shows a non-ignored difference, first compare object order, object
names, mesh/material names, SCENE_DONE, and scene custom properties. If the
cause is not obvious, revert the registry dispatch and return to the current
way loop before trying a narrower refactor.