Skip to content

core: author_scene revisions leave a derived surface's holes to the reconciler - #1187

Merged
wass08 merged 1 commit into
mainfrom
fix/author-scene-revision-derived-holes
Oct 27, 2026
Merged

wass08 merged 1 commit into
mainfrom
fix/author-scene-revision-derived-holes

Conversation

@wass08

@wass08 wass08 commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

A second author_scene call with replace: true was refused in production (Architect Medium on a plan photo, 2026-10-27):

Refusing to change holes on the derived ceiling ceiling_as4a66ada3. The structure reconciler owns it…

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, and authoredSceneChanges let a reconciler-owned field "follow the design where it changed", so the update carried the new holes. The host's filterDerivedNodeWrites strips polygon silently but lets holes through, mergeRoomHoles kept 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 / holeMetadata never 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

  1. 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.
  2. In the editor or over MCP: author_scene a plan with a closet inside a bedroom, then author_scene again with replace: true and 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

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

🤖 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_scene with replace: true failing when a nested room moves and the conversion would rewrite a derived ceiling’s holes / 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. personView still treats manual cut-outs as user edits (via manualHoles) so regeneration cannot drop a person-edited ceiling without conflict. reconcilerOwned no longer special-cases hole ownership from a base/current comparison.

Adds a regression test: living room + closet, reconcile, then replace: true revision 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.

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 Aymericr added the bug Something isn't working label Oct 27, 2026 — with Cursor

@Aymericr Aymericr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@wass08
wass08 merged commit 410069d into main Oct 27, 2026
5 checks passed
@Aymericr
Aymericr deleted the fix/author-scene-revision-derived-holes branch November 5, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants