You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nodes that space-detection reconciliation generates — auto slabs, auto ceilings, auto zones, frontSide/backSide surface flips, and the level.children growth that comes with them — have no defined way to reach collaborators. Anything that moves reconciliation after the commit snapshot silently stops replicating.
Today it works by accident of ordering. initSpaceDetectionSync subscribes to the store, so its writes land before zundo's onSave snapshots the transaction, and the hosted editor's
picks them up inside commit.current. Nothing states this as a contract, and nothing tests it.
Why it needs writing down
#554 restructured reconciliation to run from subscribeSceneCommits instead — a reasonable design in isolation, since it gives reconciliation the before/after pair it needs for delta work. But commit listeners run after both snapshots are taken, and reconciliation writes under pauseSceneHistory, so they emit no commit of their own. Measured on that branch versus main, same four-walls-closing-a-room scenario:
The author gets a floor and a ceiling; collaborators get a bare wall and a divergent level.children. That drift doesn't self-heal.
What would resolve it
State the contract. Either "reconciliation must write within the triggering commit's transaction" or "reconciliation must emit its own commit that collaboration can transmit." Then document it in wiki/architecture/ next to the space-detection notes.
Test it at the boundary. A core-level test asserting that reconciliation-generated nodes appear in the emitted commit would have caught editor: keep room surfaces in sync with wall topology #554 automatically. The check is cheap: close a room, capture commits, assert every live node id appears in some current.nodes.
Decide about pauseSceneHistory. Reconciliation pauses history so its writes don't become a separate undo step, which is correct for undo but is also what suppresses the commit. Whether "one undo step" and "one transmittable commit" can be the same thing is the crux.
Option 2 is worth doing regardless of which way 1 goes — right now the invariant is enforced only by call ordering that any refactor can reverse without a single test turning red.
Context: #554 (closed; the TopologyIndex half is expected to return as a focused PR).
Problem
Nodes that space-detection reconciliation generates — auto slabs, auto ceilings, auto zones,
frontSide/backSidesurface flips, and thelevel.childrengrowth that comes with them — have no defined way to reach collaborators. Anything that moves reconciliation after the commit snapshot silently stops replicating.Today it works by accident of ordering.
initSpaceDetectionSyncsubscribes to the store, so its writes land before zundo'sonSavesnapshots the transaction, and the hosted editor'spicks them up inside
commit.current. Nothing states this as a contract, and nothing tests it.Why it needs writing down
#554 restructured reconciliation to run from
subscribeSceneCommitsinstead — a reasonable design in isolation, since it gives reconciliation the before/after pair it needs for delta work. But commit listeners run after both snapshots are taken, and reconciliation writes underpauseSceneHistory, so they emit no commit of their own. Measured on that branch versusmain, same four-walls-closing-a-room scenario:current.nodesmainThe author gets a floor and a ceiling; collaborators get a bare wall and a divergent
level.children. That drift doesn't self-heal.What would resolve it
wiki/architecture/next to the space-detection notes.current.nodes.pauseSceneHistory. Reconciliation pauses history so its writes don't become a separate undo step, which is correct for undo but is also what suppresses the commit. Whether "one undo step" and "one transmittable commit" can be the same thing is the crux.Option 2 is worth doing regardless of which way 1 goes — right now the invariant is enforced only by call ordering that any refactor can reverse without a single test turning red.
Context: #554 (closed; the
TopologyIndexhalf is expected to return as a focused PR).