fix: delete auto-resolve validation repairs in favor of engine normalization - #3247
Conversation
…ization
`validateValue` carried four `autoResolve` resolutions (missing block
`_key`, missing or empty `children`, orphaned `markDefs`, missing
child `_key`) that repaired synced blocks before ingestion and
reported the patches through the sync actor's out-of-band `patch`
channel. Engine normalization repairs the same structural defects on
intake and its patches emit, so the pre-ingestion repairs were a
second repairer running ahead of the real one, with its own patch
shapes and its own addressing bugs.
The four resolutions are deleted; validation passes those shapes
through and the engine repairs them, emitting engine-shaped patches
(minimal `set` on the minted `_key`, placeholder-span `insert` before
`children[0]`). With them go `reportAutoResolution`,
`applyAutoResolution`, `rebaseBlockPatchPath`, and the sync actor's
`patch` channel end to end. `updateBlock` gains the wholesale-set
fallback for raw input: children arrays containing keyless children,
or replacing a raw empty `children`, are set wholesale instead of
reconciled per child, so no `{_key: undefined}` path segment is ever
applied; normalization then mints the keys. Remaining block-anchored
resolutions resolve their paths through `nodeSegment`, so a keyless
block with a non-mechanical defect addresses its resolution at the
block's numeric index instead of `{_key: undefined}` (which keyed
matching would resolve to the first keyless sibling).
Deliberate deltas: orphaned `markDefs` are no longer pruned at
intake (the engine's prune is local-only by the two-class model);
they go when a local edit next dirties the block, as a `set` of the
filtered array. Sync `insert` operations carry the raw block, and
normalization repairs follow as their own operations.
`InvalidValueResolution.autoResolve` is deprecated, never set.
🦋 Changeset detectedLatest commit: 918ffda The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bundle Stats✅ No significant changes. All scenario measurements (7)🗺️
Significant means at least 1.0 KB and 1% gzip, or at least 5 ms and 10% import time. |
|
Folded into #3246 as its third commit; one PR, same commits. |
With #3246, the editor emits its structural repair patches the moment a value settles. That left
validateValue'sautoResolveresolutions as a second repairer running ahead of the engine: four rules (missing block_key, missing or emptychildren, orphanedmarkDefs, missing child_key) repaired blocks before ingestion and reported through the sync actor's out-of-bandpatchchannel, with their own patch shapes and their own addressing quirks.This PR deletes them and makes engine normalization the sole repairer. Validation passes mechanically fixable shapes through untouched; the engine repairs them on intake and its patches emit in engine shapes: a keyless block gets a minimal
seton its minted_key(previously a whole-blockset), an empty text block gets its placeholder span as aninsertbeforechildren[0]. The sync actor'spatchchannel and its reporting machinery go with the rules. The invalid-value flow is untouched for defects that genuinely need a human, and its remaining resolutions now resolve their block anchors throughnodeSegment, so a keyless block with a non-mechanical defect is addressed by its numeric index instead of a{_key: undefined}segment that keyed matching would resolve to the first keyless sibling (pinned red-on-old).Raw input reaches
updateBlockfor the first time, so it gains a wholesale-set fallback: children arrays with keyless members, or a raw emptychildrenreplacing populated children, are set wholesale and normalization mints the keys; no{_key: undefined}segment is ever applied (pinned by unit tests asserting the full applied-operation streams).Two deliberate deltas. Orphaned
markDefsare no longer pruned at intake: the engine's prune is local-only by design, so orphans go when a local edit next dirties the block, emitted as asetof the filtered array (a read-only editor never prunes them). And syncinsertoperations now carry the raw block, with normalization repairs following as their own operations.InvalidValueResolution.autoResolveis deprecated rather than removed, never set.One caveat: the empty-block placeholder span now travels as
insert ... before children[0]where the deleted rule usedinsert ... after children[0]; both anchor index 0 of an empty array, and whether Content Lake treats the two anchors identically on an empty array is not verifiable from this repo. Client-side application (applyAll) is pinned equivalent.Stacked on #3246 and merges after it; the base branch is
emit-repair-patches-immediately.