Repository navigation
core: author_scene revisions leave a derived surface's holes to the reconciler - #1187
Conversation
A revision with replace: true that moved a room inside another was refused by the derived-node guard: author_scene's own reconcile re-cut the outer ceiling's room hole, the merge wrote the design's new holes because reconciler-owned fields "follow the design where it changed", and the host's guard refuses a room hole written by anyone but the reconciler (it strips an outline silently but refuses a hole), so the whole write failed with "Refusing to change holes on the derived ceiling". On a derived surface, holes and holeMetadata now always stay as the scene holds them: the host's reconciler re-cuts the room ones from the walls the revision did change and re-applies the person's. A person's cut-out still counts as their edit for the removal check, through the person view rather than a base-to-current comparison of manual holes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Aymericr
left a comment
There was a problem hiding this comment.
Looks good. Keeping holes / holeMetadata at the scene's current value on derived surfaces is the right split: the reconciler re-cuts the room holes, so the write no longer trips the derived-node guard, and moving the manual cut-out check into personView keeps a person's cut-out counting as their edit. The new nested-closet test covers the production failure end to end.
One non-blocking question: with SURFACE_HOLES the design can never set holes on a derived surface during a revision. If a payload can ever author a cut-out on a derived ceiling or slab directly, that revision would silently drop it. If that can't happen today, a one-line comment saying so would help the next reader.
I'll merge once CI is green.
What does this PR do?
A second
author_scenecall withreplace: truewas refused in production (Architect Medium on a plan photo, 2026-10-27):Cause: when a revision moves a room that sits inside another room, the conversion's own reconcile pass re-cuts the outer ceiling's
source: 'room'hole, andauthoredSceneChangeslet a reconciler-owned field "follow the design where it changed", so the update carried the newholes. The host'sfilterDerivedNodeWritesstripspolygonsilently but letsholesthrough,mergeRoomHoleskept both holes, and the derived-node guard refused the whole write. The model then spent its turn working around it.Fix in
authored-scene-merge.ts: on a derived surface,holes/holeMetadatanever follow the design; the update keeps the scene's current value and the host's reconciler re-cuts the room holes from the walls the revision did change (manual cut-outs are re-applied by the kernel). A person's manual cut-out still counts as their edit for the "cannot be removed by regeneration" check, compared metadata-aware on both sides. No schema or stored-shape change.How to test
cd packages/core && bun test src/agent-operations/author-scene.test.ts src/store/derived-node-guard.test.ts→ 75 pass. The new case "a room moved inside another leaves the outer ceiling's re-cut hole to the reconciler" fails on main's merge code and passes here.author_scenea plan with a closet inside a bedroom, thenauthor_sceneagain withreplace: trueand an edit moving the closet's walls: the write succeeds and the bedroom's ceiling hole follows the closet.Screenshots / screen recording
N/A — non-visual change
Checklist
bun devbun checkto verify)mainbranch🤖 Generated with Claude Code
Note
Medium Risk
Touches authored-scene merge and edit-conflict rules for derived surfaces; wrong behavior could block revisions or overwrite manual ceiling cut-outs, but scope is narrow and covered by new tests.
Overview
Fixes
author_scenewithreplace: truefailing when a nested room moves and the conversion would rewrite a derived ceiling’sholes/holeMetadata, which tripped the derived-node guard in production.In
authored-scene-merge.ts, reconciler-owned surface hole fields no longer follow the design on merge: updates keep the scene’s current holes and rely on the host’s structure reconciler to re-cut room holes from changed walls.personViewstill treats manual cut-outs as user edits (viamanualHoles) so regeneration cannot drop a person-edited ceiling without conflict.reconcilerOwnedno longer special-cases hole ownership from a base/current comparison.Adds a regression test: living room + closet, reconcile, then
replace: truerevision that shifts the closet—asserts the ceiling update omits hole fields, the derived-node guard accepts the write, and reconcile moves the room hole to match the new walls.Reviewed by Cursor Bugbot for commit ac12a56. Bugbot is set up for automated code reviews on this repo. Configure here.