An independent review pass flagged that a self-returning toJSON recursed
without incrementing depth, so the depth cap never engaged and the stack
overflowed. Increment depth when unwrapping; the payload now terminates
at the cap and serializes like native JSON.stringify. Regression test
added (npm run test:settings, 10 tests).
Review feedback on the first revision:
1. Queued A -> B -> A could lose the final A: the unchanged-write check
ran at request time, before preceding writes settled. The comparison
now happens inside the serialized queue, after all earlier writes
complete, against the cache value at execution time.
2. The suppression cache could block corruption recovery: repairing an
invalid externally synchronized data.json with content equal to the
cache was skipped. persistSnapshot() gained a force path used by the
invalid-data write-back and the startup recovery choice.
3. Canonicalization now preserves native JSON.stringify value semantics:
toJSON results are serialized instead of the source object (Date ->
ISO string), and objects accumulate into a null-prototype map so an
own __proto__ key stays data instead of hitting the prototype setter.
4. Added committed regression tests (npm run test:settings): key-order
equivalence, array order, Date/toJSON, __proto__ safety, unchanged
skip, queued A -> B -> A, failed-write retry, force repair, cache
seeding.
5. Restored the 2.29.1 release-note line about script input suggesters
that the previous revision dropped.
The canonical serializer moved into SerializedSettingsWriter.ts so the
node:test suite can import one module without bundler resolution.
master now builds the factory's Canvas leaf directly and inserts it into the
detached split, instead of calling workspace.createLeafInParent(). The check
script's stand-in WorkspaceSplit gains insertChild, and the fake workspace
drops the createLeafInParent it no longer needs. All 21 mount plan checks and
the call site checks pass on the merged tree.
Events that used to be sequenced with timers now land on a named poll of the
wait, through the injected delay, so each block asserts the poll it ended on
rather than an elapsed time. The one block whose subject is elapsed time, the
slow real factory, still runs against the clock.
The wiring checks pinned where the dispatch sits and how it cancels, but
not what else the effect does beside it. A readiness read in the effect's
own body (an early return onto the workspace leaf, or a ternary choosing
it) restores the whole-file leaf on a slow start while every existing
check stays green, and so does a direct createNode() or
mountWorkspaceLeaf() call next to the dispatch, which mounts a second
host. Reject both: the effect may not name canvasNodeFactory outside the
closures it hands the helper, and may not call either mount path itself.