Share detached JSON provenance with copy checkpoints and finish step-four verification

This commit is contained in:
2026-11-11 14:16:45 +08:00
parent 2089b63e79
commit e3a2335160
11 changed files with 149 additions and 48 deletions
+24 -7
View File
@@ -1001,8 +1001,8 @@ is suspended; the old image still contains its captured state, and the next cut
is saved after it. Request dispatch retains the durable-prefix barrier. Encoding
or scheduling failures retain the pending Root for retry and produce no partial
storage commit. Initial DTO membership copying, synchronous preparation, unknown
subtrees and individual scalar operations remain synchronous. First-time element
normalization can defer only when its detached JSON provenance is established. This is partial time slicing, not a strict whole-Root latency
subtrees and individual scalar operations remain synchronous. First-time JSON
normalization can defer only when its detached provenance is established. This is partial time slicing, not a strict whole-Root latency
bound. Grouped history entries now keep shape ownership for newly built changes and
operation-ID arrays, including undo/redo lifecycle remaps. Import runners keep it
for their own job envelopes, completed-key arrays, binding dictionaries and
@@ -1137,9 +1137,10 @@ when the same source occurs twice in one image, the second occurrence can reuse
the first completed encoding. Preparation still captures unsafe occurrences
independently; getters and mutable descendants never qualify for this reuse.
First-time element recovery encoding now uses the core's detached-JSON ownership
proof instead of synchronously normalizing every field before the first yield.
Only `detachElementData` results qualify: JSON-cloned, recursively frozen records
First-time element and planning-checkpoint recovery encoding uses the core's
detached-JSON ownership proof instead of synchronously normalizing every field
before the first yield.
Only `detachJsonData` results qualify: JSON-cloned, recursively frozen records
with immutable JSON descendants. A shallow freeze, a document factory envelope,
or an arbitrary host object does not qualify. Preparation requires the standard
Object/Array prototype chain without inherited `toJSON`; otherwise it captures
@@ -1151,6 +1152,22 @@ earlier record's meaning. Cold and cached subtrees both retain the depth limit.
This moves the first full field/row walk into the shared budget; container-member
capture and individual native/scalar operations still have synchronous work.
Step 4's current acceptance evidence, commands and explicit remaining checkpoint
encoding work are recorded in [STEP4_ACCEPTANCE.md](STEP4_ACCEPTANCE.md). Passing
Step 4's acceptance evidence, commands and checkpoint encoding boundaries
are recorded in [STEP4_ACCEPTANCE.md](STEP4_ACCEPTANCE.md). Passing
functional fixtures is not a claim that all performance limits are resolved.
The shared core `json-data.ts` factory gives element data and duplicate planner
checkpoints the same unforgeable clone provenance; element validity and schema
proofs remain separate. It replaces their existing `freeze(clone(...))` operation
without a second clone or a wire-format change. Engine-created job/source/
preparation envelopes keep shape ownership through admission, checkpoint refresh,
ready mapping, source verification and pause/resume/cancel. Fresh allocation
arrays, ready ID tables and root lists use the same shape constructors. Unknown
children still require synchronous capture; copying an envelope never grants a
deep-data fact to them. Legacy/restored data retains defensive capture until a
new planner snapshot supplies fresh provenance.
A final ready plan has already crossed its required preparation durability
barrier. Its encoded facts may therefore already exist, and the ready source
can reuse them without an artificial yield. Tests distinguish first-time
preparation slicing from ready-source byte/mapping preservation and reopening.