What does this PR do? / ## How to test / ## Screenshots / screen recording / ## Checklist (bun dev, bun check, docs, main-branch boxes)
Preserve initSpaceDetectionSync as a synchronous scene-store subscriber and add a focused rationale at that integration point explaining that reconciliation must finish within the triggering local transaction before its commit snapshot is emitted. Add an architecture page that defines the two-sided replication contract: local reconciliation output is included in the originating commit, while host patches consume those nodes under read-only mode rather than re-running reconciliation. Link that page from the architecture index so future changes to space detection, history pausing, or commit delivery encounter the invariant during design review.
Low Risk
No runtime behavior change beyond comments and tests; the doc/test guard a collaboration and undo invariant that was already intended.
Overview
Documents and locks in the local commit boundary for wall-driven room reconciliation: derived slabs, ceilings, wall sides, and level children must land in the same SceneCommit and undo step as the wall edit that triggered them.
Adds wiki/architecture/space-detection.md (linked from the architecture index) describing why initSpaceDetectionSync must stay a synchronous scene-store subscriber—not subscribeSceneCommits—and the host patch rule for collaboration (originator reconciles and mints IDs; peers apply the transmitted graph without re-running detection).
Adds an integration test that closes a room with the fourth wall and asserts one local commit contains the full reconciled graph and a single undo removes the wall plus auto surfaces. initSpaceDetectionSync gains an inline comment restating the zundo/history-pause timing rationale at the integration point.
Reviewed by Cursor Bugbot for commit cfb544a. Bugbot is set up for automated code reviews on this repo. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do? / ## How to test / ## Screenshots / screen recording / ## Checklist (bun dev, bun check, docs, main-branch boxes)
Preserve initSpaceDetectionSync as a synchronous scene-store subscriber and add a focused rationale at that integration point explaining that reconciliation must finish within the triggering local transaction before its commit snapshot is emitted. Add an architecture page that defines the two-sided replication contract: local reconciliation output is included in the originating commit, while host patches consume those nodes under read-only mode rather than re-running reconciliation. Link that page from the architecture index so future changes to space detection, history pausing, or commit delivery encounter the invariant during design review.
Fixes #586
Note
Low Risk
No runtime behavior change beyond comments and tests; the doc/test guard a collaboration and undo invariant that was already intended.
Overview
Documents and locks in the local commit boundary for wall-driven room reconciliation: derived slabs, ceilings, wall sides, and level children must land in the same SceneCommit and undo step as the wall edit that triggered them.
Adds wiki/architecture/space-detection.md (linked from the architecture index) describing why initSpaceDetectionSync must stay a synchronous scene-store subscriber—not subscribeSceneCommits—and the host patch rule for collaboration (originator reconciles and mints IDs; peers apply the transmitted graph without re-running detection).
Adds an integration test that closes a room with the fourth wall and asserts one local commit contains the full reconciled graph and a single undo removes the wall plus auto surfaces. initSpaceDetectionSync gains an inline comment restating the zundo/history-pause timing rationale at the integration point.
Reviewed by Cursor Bugbot for commit cfb544a. Bugbot is set up for automated code reviews on this repo. Configure here.