Context
A package combining multiple native record edits needs one publication boundary. For example, a validated multi-row import can still fail in a field converter on the last row. Observers must be able to read the final rows together. On failure the earlier rows must keep their original values, identities, versions and dirty state. This is a data-primitive leaf for #20667.
The problem
A read-back value is not necessarily an admissible parser input. A real Store with tags.convert = value => value.split(',') stores ['a', 'b'] for input 'a,b'. After an unpublished change to 'c,d' and a numeric field, a later adoption failure requires compensation. record.setSilent({tags: savedArray, n: savedNumber}) calls the parser again, throws, and leaves both new fields visible. Even in a Date-only case where compensation restores the original Date reference, the version advances 1 → 2 → 3. setSilent is a new field write.
The generated record and RecordFactory#setRecordFields own conversion, calculated values, data and dirty/version metadata. Collection startUpdate/endUpdate covers structural mutations. A window topology Group owns a different domain.
Intended behavior
Provide one synchronous RecordFactory operation for prepared, declared, non-key field edits on distinct records of the same model. Keep the native field-validation/calculation path and record instances. Capture only the affected state required to unwind an unpublished change, perform/admit all writes, and make the corresponding native change receipts available at the publication boundary. A caller staging another local data effect must be able to refuse before publication. No restore handle may be replayed after successful publication.
Before choosing the API signature, compare a factory-owned prepared-write operation with a scoped checkpoint around an owner-managed silent write. Prefer the shape that enforces the boundary, cuts consumer code and avoids access to engine-private record fields. A successful ordinary record.set retains its current behavior.
Contract ledger
| Surface |
Authority |
Expected result |
Edge and proof |
| Prepared native changes |
RecordFactory resolves each field, conversion, dependent calculations and native payload |
All participating field values are settled before the first change notification. Original old/new field values are retained. |
Two distinct records, including a calculated field; a before-listener on the first row reads the second. |
| Failed adoption |
The generated record owns its storage and metadata |
Restore original values, field absence/identity, dirty markers and versions. No partial native change is published. |
Second record converter or final synchronous adoption refuses; verify normal retry. |
| Publication failure |
The accepted data is already committed |
A downstream subscriber failure cannot undo committed values or publish a false refusal. |
Throwing subscriber and readback. |
Acceptance criteria
- Compare with unmodified Engine on the parser and Date controls above. Exercise native records with tracked and untracked modification modes.
- Preserve nested and calculated fields when applicable; reject unsupported keys, foreign rows or asynchronous adoption before they can create inconsistent state.
- Prove native receipts and record identity on success, exact compensation on failure, ordinary non-batched
set behavior, and retry safety.
- Document the actual public method, callback boundaries, and limits in its owning JSDoc.
Outside this ticket
Cross-store policy, durable transaction history, distributed writes, rollback of already published effects and changes to mutable raw Turbo-row ingestion. The concurrent work in #20802 concerns soft hydration before record construction.
Live adjacency sweep: latest 25 open plus closed title searches for prepared fields / record rollback, own Engine assignments and recent A2A claims. No matching owning leaf found. The parser and version controls were run on real Engine stores. A separate package can use the same seam for a multi-row editor or for a store-backed import; the API contains no package-specific types.
Origin Session ID: 3f151045-f5a6-490e-bc72-920bfc251820
Context
A package combining multiple native record edits needs one publication boundary. For example, a validated multi-row import can still fail in a field converter on the last row. Observers must be able to read the final rows together. On failure the earlier rows must keep their original values, identities, versions and dirty state. This is a data-primitive leaf for #20667.
The problem
A read-back value is not necessarily an admissible parser input. A real Store with
tags.convert = value => value.split(',')stores['a', 'b']for input'a,b'. After an unpublished change to'c,d'and a numeric field, a later adoption failure requires compensation.record.setSilent({tags: savedArray, n: savedNumber})calls the parser again, throws, and leaves both new fields visible. Even in a Date-only case where compensation restores the original Date reference, the version advances 1 → 2 → 3.setSilentis a new field write.The generated record and
RecordFactory#setRecordFieldsown conversion, calculated values, data and dirty/version metadata. CollectionstartUpdate/endUpdatecovers structural mutations. A window topology Group owns a different domain.Intended behavior
Provide one synchronous RecordFactory operation for prepared, declared, non-key field edits on distinct records of the same model. Keep the native field-validation/calculation path and record instances. Capture only the affected state required to unwind an unpublished change, perform/admit all writes, and make the corresponding native change receipts available at the publication boundary. A caller staging another local data effect must be able to refuse before publication. No restore handle may be replayed after successful publication.
Before choosing the API signature, compare a factory-owned prepared-write operation with a scoped checkpoint around an owner-managed silent write. Prefer the shape that enforces the boundary, cuts consumer code and avoids access to engine-private record fields. A successful ordinary
record.setretains its current behavior.Contract ledger
Acceptance criteria
setbehavior, and retry safety.Outside this ticket
Cross-store policy, durable transaction history, distributed writes, rollback of already published effects and changes to mutable raw Turbo-row ingestion. The concurrent work in #20802 concerns soft hydration before record construction.
Live adjacency sweep: latest 25 open plus closed title searches for prepared fields / record rollback, own Engine assignments and recent A2A claims. No matching owning leaf found. The parser and version controls were run on real Engine stores. A separate package can use the same seam for a multi-row editor or for a store-backed import; the API contains no package-specific types.
Origin Session ID: 3f151045-f5a6-490e-bc72-920bfc251820