Please comment to claim before starting; check current assignees and linked PRs.
Context
A Turbo Mode TreeStore can visibly accept a raw row batch, then restore an older value when the tree reprojects. Found while reviewing #20989; it reproduces on both its base c78adac361a8894d563bbaae800e9fdc5f9621c2 and head 3f32b2283c6f68b59a7c953d328d7c16fcffc467. It is inherited debt, not a blocker introduced by that PR.
Design authority: Store#updateRows writes a held raw row’s own data in place, and TreeStore’s Structural Layer retains the complete population while its visible layer is a projection. A later sort must not undo an accepted value.
The Problem
Using the normal Neo unit setup, Neo plus core exports, TreeStore and a TreeModel with String id/name and Integer score:
const store = Neo.create(TreeStore, {
autoInitRecords: false,
model: TestTreeModel,
data: [
{id: 'a', name: 'A', score: 1},
{id: 'b', name: 'B', score: 2}
]
});
await store.ready();
store.add({id: 'a', name: 'A readded', score: 1}, false);
store.updateRows([{key: 'a', values: {name: 'A batched'}}]);
store.sorters = [{property: 'score', reapplyOnRecordChange: true}];
store.destroy();The source-bound probe loaded complete exact-head Store/RecordFactory/TreeStore modules, checked other imports against each immutable Git tree, and used real instances. Both refs lose the value. The existing hydration repair can hide this: calling get() before reprojecting heals the identity split, so a test that does so misses the raw path.
The Architectural Reality
src/data/TreeStore.mjs: Structural Layer, visible projection and re-add/reprojection handoff.
src/collection/Base.mjs: keyed replacement and visible item identity.
src/data/RecordFactory.mjs: hydration can reconcile the two identities.
src/data/Store.mjs: updateRows must keep the raw batch raw.
Closed #17855 corrected duplicate hierarchy entries; PR #18030 explicitly retained stale projection objects as follow-up. #20568 / #20569 heal during hydration and leave Collection replacement semantics outside their scope. None owns this unhydrated batch → reprojection loss.
The Fix
Repair the existing re-add/identity handoff at the owning Collection/TreeStore writer so the current raw row remains authoritative across projection changes. Read those existing methods at intake; no new module or provider is proposed. Preserve the batch’s non-hydrating path and the hierarchy’s key/count invariants.
Contract Ledger Matrix
| Surface |
Authority |
Required behavior |
Fallback / docs |
Evidence |
| TreeStore re-add/current row |
TreeStore Structural Layer and Collection keyed replacement |
One current row/value survives structural and visible projection access |
Existing API; TreeStore guide |
Re-add produces the divergence used above |
Store#updateRows |
Its JSDoc / Turbo Mode contract |
Accepted raw data survives sort/filter reprojection |
No forced hydration |
Base and head source-bound reproducer |
| Hydration |
RecordFactory and #20568 |
Continue healing/returning the current identity without being necessary to preserve a batch |
Existing API |
get() is a positive masking control, not the fix |
Acceptance Criteria
Out of Scope
Numeric-parent coercion (#20913 / #20995), the single-edit 401-filter cascade, container migration (#20974), and #20989’s separate dependency-path regression. No grid repaint workaround or new identity registry.
Avoided Traps
Do not call get() merely to make the test pass; do not write the stale Structural Layer while leaving a newer visible row, or the reverse. Preserve one current identity through the existing owner rather than choosing a map per caller.
Ownership / sweeps
unowned-rationale: Ready for a contributor; maintainers provide planning and review. Public source, exact reproducer and acceptance are self-contained; no private service is required. No implementation lane is claimed while Stage #810 is active.
Live latest-open + closed sweep: latest20 open plus all-state TreeStore/re-add/updateRows searches and the complete direct open queue checked; open issue count50 (orange), no matching open owner. #20985/#20989 are positive scope controls; #17855, #18030, #20568 and #20913/#20995 were read for surviving scope/exclusions. Recent all-state A2A claims have no overlap. MC symptom sweep found no owning decision; own-assignment sweep has only unrelated #19058. No epic filing.
Decision Record impact: none; repair existing data ownership, no new architectural convention.
Related: #17855, #18030, #20568, #20569, #20968, #20985, #20989.
Origin Session ID: be2573b3-54d0-4f1c-8363-ce46c7e1f535
Retrieval Hint: "TreeStore raw re-add row batch value lost after sort reprojection get hydration masks"
Please comment to claim before starting; check current assignees and linked PRs.
Context
A Turbo Mode
TreeStorecan visibly accept a raw row batch, then restore an older value when the tree reprojects. Found while reviewing #20989; it reproduces on both its basec78adac361a8894d563bbaae800e9fdc5f9621c2and head3f32b2283c6f68b59a7c953d328d7c16fcffc467. It is inherited debt, not a blocker introduced by that PR.Design authority:
Store#updateRowswrites a held raw row’s own data in place, andTreeStore’s Structural Layer retains the complete population while its visible layer is a projection. A later sort must not undo an accepted value.The Problem
Using the normal Neo unit setup,
Neoplus core exports,TreeStoreand aTreeModelwith Stringid/nameand Integerscore:const store = Neo.create(TreeStore, { autoInitRecords: false, model: TestTreeModel, data: [ {id: 'a', name: 'A', score: 1}, {id: 'b', name: 'B', score: 2} ] }); await store.ready(); store.add({id: 'a', name: 'A readded', score: 1}, false); store.updateRows([{key: 'a', values: {name: 'A batched'}}]); // The raw visible row now says 'A batched'. Do not call get() here. store.sorters = [{property: 'score', reapplyOnRecordChange: true}]; // Reprojection/get now says 'A readded': the batch is lost. store.destroy();The source-bound probe loaded complete exact-head Store/RecordFactory/TreeStore modules, checked other imports against each immutable Git tree, and used real instances. Both refs lose the value. The existing hydration repair can hide this: calling
get()before reprojecting heals the identity split, so a test that does so misses the raw path.The Architectural Reality
src/data/TreeStore.mjs: Structural Layer, visible projection and re-add/reprojection handoff.src/collection/Base.mjs: keyed replacement and visible item identity.src/data/RecordFactory.mjs: hydration can reconcile the two identities.src/data/Store.mjs:updateRowsmust keep the raw batch raw.Closed #17855 corrected duplicate hierarchy entries; PR #18030 explicitly retained stale projection objects as follow-up. #20568 / #20569 heal during hydration and leave Collection replacement semantics outside their scope. None owns this unhydrated batch → reprojection loss.
The Fix
Repair the existing re-add/identity handoff at the owning Collection/TreeStore writer so the current raw row remains authoritative across projection changes. Read those existing methods at intake; no new module or provider is proposed. Preserve the batch’s non-hydrating path and the hierarchy’s key/count invariants.
Contract Ledger Matrix
Store#updateRowsget()is a positive masking control, not the fixAcceptance Criteria
A batched, with no interveningget()or hydration.Out of Scope
Numeric-parent coercion (#20913 / #20995), the single-edit 401-filter cascade, container migration (#20974), and #20989’s separate dependency-path regression. No grid repaint workaround or new identity registry.
Avoided Traps
Do not call
get()merely to make the test pass; do not write the stale Structural Layer while leaving a newer visible row, or the reverse. Preserve one current identity through the existing owner rather than choosing a map per caller.Ownership / sweeps
unowned-rationale: Ready for a contributor; maintainers provide planning and review. Public source, exact reproducer and acceptance are self-contained; no private service is required. No implementation lane is claimed while Stage #810 is active.
Live latest-open + closed sweep: latest20 open plus all-state TreeStore/re-add/updateRows searches and the complete direct open queue checked; open issue count50 (orange), no matching open owner. #20985/#20989 are positive scope controls; #17855, #18030, #20568 and #20913/#20995 were read for surviving scope/exclusions. Recent all-state A2A claims have no overlap. MC symptom sweep found no owning decision; own-assignment sweep has only unrelated #19058. No epic filing. Decision Record impact: none; repair existing data ownership, no new architectural convention.
Related: #17855, #18030, #20568, #20569, #20968, #20985, #20989. Origin Session ID: be2573b3-54d0-4f1c-8363-ce46c7e1f535 Retrieval Hint: "TreeStore raw re-add row batch value lost after sort reprojection get hydration masks"