You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 924d909
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix(signals): a fold repeats no unchanged presence to a held node (#3743, supersedes #3744) (#3791)
* fix(signals): a fold repeats no unchanged presence to a held node (#3743)
Port of #3744 (brenelz) onto L2 (#3774). The fold's presence loop
(`notifyFoldTail`) wrote every observed `in` node with `key in neu`;
`setSignal` joins a held node's transaction before its equality gate
(A34 (1): a write to a held node is a proposal, the same value or
another), so a `reconcile()` outside an action that had deleted an
observed key — the snapshot leaving it absent too — made the whole
mainline tick the action's: an unrelated `a.value` stayed stale until
the action settled. Presence is now diffed `old` -> `neu` like the
leaves (the fold's contract, #3296: the view the nodes were last told);
a live chained `old` (a store proxy) is written unconditionally as
before. `notifyFold` shares the tail.
`applyAdopt` materializes a nested overlay draft before taking its diff
base (`adoptPB` did so after it was taken): through the overlay's
prototype a deleted key still read as present, so the presence skip
fired on a real deletion, and a reconcile restoring the key never
re-proposed on the held leaf, which committed the draft's `undefined`
beside a backing that had the key.
Two L2 fixes the diff uncovered, pinned by the existing #2719/#3164 and
Q-D twin tests and a new leaf-only reader case: a container carrying an
arrangement guess is told of an arrangement change whether or not
anything subscribes to it (`notifyFoldTail`/`notifyWrites`) — for a
guessed container the write is the landing that judges the guess
(Q-D, plan sec. 39), and before only the unconditional presence write
reached the lane, so a newer question's rows landing beneath an
optimistic push published beside it for a reader of leaves alone; and
`_laneRebase` no longer re-stages a slot whose row the committed
backing already shows by key, nor an unchanged `length` (a spurious
identical frame).
Signals 4900 / 0 / 3 expected fails (+9 pins: 8 green, one `it.fails`
for the open setter-path case — `t.wk` is cumulative, not per-setter),
solid 819 / 0, web 1132 / 1411 / 275, 0
failures. Size (br): + createStore 14517 -> 14523, every store family
28770 -> 28765, page base 44017 -> 44028, page live 47656 -> 47668
(minified -97..-100 B each); every scenario within its cap.
Co-authored-by: Brenley Dueck <[email protected]>
Co-authored-by: Cursor <[email protected]>
* size: page base cap 44.03 -> 44.05 KB for #3743's fold presence diff
The port of #3744 measures 44,031 B brotli on the base server-components
page against next @ 1a3f87f's 44,029 (+2 B, 1 B over the cap) while the
same bundle is -97 B minified: brotli layout on the 150 KB bundle, not
code. Cap set at measured + 10 B rounded up to 0.01 KB; dated note in
scenarios.js beside the page-base notes.
Size-Exception: page: base server components 44,029 -> 44,031 B (cap 44.03 -> 44.05 KB) — presence diff in store folds (#3743); source −97 B minified; accepted by the maintainer (2026-10-04)
Co-authored-by: Cursor <[email protected]>
---------
Co-authored-by: Brenley Dueck <[email protected]>
Co-authored-by: Cursor <[email protected]>
A store fold's presence notification (`in` subscribers) now diffs the old and new presence of each observed key before writing the node, as the value notification already does (#3743). `setSignal` joins a held node's transaction before its equality gate (A34 (1): a write to a held node is a proposal, the same value or another), so a `reconcile()` outside an action that had deleted an observed key — the incoming snapshot leaving it absent too — made the whole tick the action's: an unrelated `a.value` stayed stale until the action settled. A real presence change still notifies and still proposes on a held node.
6
+
7
+
The adoption's diff base now materializes a nested prototype-overlay draft (a wide owned record) before it is taken: through the overlay's prototype a key the draft had deleted still read as present, so the presence skip fired on a real deletion and a reconcile restoring the key never re-proposed on the held leaf (it committed the draft's `undefined` beside a backing that had the key).
8
+
9
+
Two optimistic-store fixes the diff uncovered: a container carrying an arrangement guess is now told of an arrangement change whether or not anything subscribes to the container (for a guessed container the write is the landing that judges the guess — before, only the unconditional presence write reached the lane, so a newer question's rows landing beneath an optimistic push published beside it when the reader subscribed to leaves only); and an older truth re-based under an arrangement guess no longer re-stages a slot whose row the committed backing already shows by key, nor an unchanged `length` (a spurious frame for leaf-only readers).
Copy file name to clipboardExpand all lines: packages/signals/docs/RULES-INDEX.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ Status legend: **live** stated and standing · **ruled** carries an explicit rul
62
62
| A15 | amended | `docs/SPEC-ASYNC-SEMANTICS.md:221` | async.ts×2 constants.ts×1 core.ts×3 lanes.ts×4 scheduler.ts×13 verdict.ts×2 | async-chain-supersession.test.ts×1 first-observer-stale-reader.test.ts×1 held-restore.test.ts×1 l2-contract.test.ts×7 lane-contract.test.ts×1 lane-hold-on-observation.test.ts×1 lane-outside-view.test.ts×1 lane-pass-stamped-effect-3662.test.ts×1 mount-over-foreign-hold-3761.test.ts×2 overlapping-flights.test.ts×3 posture-born-held-and-observation.test.ts×4 posture-store-parity.test.ts×2 reveal-carve-out.test.ts×2 shared-effect-no-entangle.test.ts×1 spec-async-semantics.test.ts×2 stale-read-uninitialized-cross-transition.test.ts×1 superseded-source-blocks-3462.test.ts×2 tick-scoped-pass-transaction.test.ts×1 treeshake.test.ts×4 visibility-oracle-store.states.ts×6 visibility-oracle.states.ts×7 visibility-oracle.test.ts×1 write-proposals-3494.test.ts×1 | [ruled, amended in place 2026-07-06 (promoted from B3)] Transition entanglement is graph-driven; lanes settle as one reveal — (was B3) Transition entanglement is graph-driven: writes whose async work … |
63
63
| A16 | amended |`docs/SPEC-ASYNC-SEMANTICS.md:193`| scheduler.ts×1 | spec-async-semantics.test.ts×1 strict-read-pending-store.test.ts×2 uninitialized-visibility.test.ts×1 visibility-oracle-store.states.ts×2 visibility-oracle.states.ts×2 visibility-oracle.test.ts×1 |[ruled, amended in place 2026-07-06 (promoted from B5)]`isPending` never throws in untracked contexts — (was B5) `isPending` never throws in untracked contexts — thunks that throw real errors or read… |
64
64
| A17 | amended |`docs/SPEC-ASYNC-SEMANTICS.md:51`| async.ts×3 constants.ts×1 lanes.ts×5 scheduler.ts×2 verdict.ts×1 map.ts×1 store.ts×3 | lane-uninitialized-landing-3648.test.ts×5 optimistic-read-lane-not-transaction-3698.test.ts×2 optimistic-undefined-override.test.ts×1 posture-store-parity.test.ts×1 refresh-await.test.ts×1 reveal-gating-contract.test.ts×3 spec-async-semantics.test.ts×10 createOptimisticStore.test.ts×2 kanban-a17-fixture.test.ts×3 optimistic-list-mutation-matrix.test.ts×1 optimistic-maparray-index-frame-f1.test.ts×1 optimistic-untracked-reads-f3-f5.test.ts×1 signal-store-twins-qd.test.ts×1 treeshake.test.ts×1 until.test.ts×1 visibility-oracle-store.states.ts×24 visibility-oracle-store.test.ts×1 visibility-oracle.states.ts×20 visibility-oracle.test.ts×1 |[ruled, amended in place 2026-07-06 (promoted from C4)] An active override is the displayed value until its transaction commits, and the graph's value until its own source answers — **Statement (curre… |
65
-
| A18 | amended | `docs/SPEC-ASYNC-SEMANTICS.md:61` | action.ts×1 async.ts×2 core.ts×3 lanes.ts×8 scheduler.ts×2 types.ts×1 verdict.ts×1 map.ts×1 optimistic.ts×1 projection.ts×1 | body-end-supersession-visibility.test.ts×4 createOptimistic.test.ts×3 lane-contract.test.ts×1 lane-frame-deferred-run-3662.test.ts×1 lane-outside-view.test.ts×1 lane-uninitialized-landing-3648.test.ts×5 optimistic-move-duplicate-3548.test.ts×2 optimistic-read-lane-not-transaction-3698.test.ts×4 posture-store-parity.test.ts×5 spec-async-semantics.test.ts×3 flight-owned-transaction.test.ts×1 optimistic-list-mutation-matrix.test.ts×1 optimistic-untracked-reads-f3-f5.test.ts×1 signal-store-twins-qd.test.ts×1 superseded-before-first-commit.test.ts×4 visibility-oracle-store.states.ts×8 visibility-oracle-store.test.ts×1 visibility-oracle.states.ts×19 visibility-oracle.test.ts×1 | [ruled, amended in place 2026-07-07 (promoted from B4)] An override lives exactly as long as its own transaction; a newer truth from the source supersedes it in the graph immediately, on screen at com… |
65
+
| A18 | amended | `docs/SPEC-ASYNC-SEMANTICS.md:61` | action.ts×1 async.ts×2 core.ts×3 lanes.ts×8 scheduler.ts×2 types.ts×1 verdict.ts×1 map.ts×1 optimistic.ts×1 projection.ts×1 | body-end-supersession-visibility.test.ts×4 createOptimistic.test.ts×3 lane-contract.test.ts×1 lane-frame-deferred-run-3662.test.ts×1 lane-outside-view.test.ts×1 lane-uninitialized-landing-3648.test.ts×5 optimistic-move-duplicate-3548.test.ts×2 optimistic-read-lane-not-transaction-3698.test.ts×4 posture-store-parity.test.ts×5 spec-async-semantics.test.ts×3 flight-owned-transaction.test.ts×1 optimistic-list-mutation-matrix.test.ts×1 optimistic-untracked-reads-f3-f5.test.ts×1 signal-store-twins-qd.test.ts×1 unchanged-presence-no-hold-3743.test.ts×2 superseded-before-first-commit.test.ts×4 visibility-oracle-store.states.ts×8 visibility-oracle-store.test.ts×1 visibility-oracle.states.ts×19 visibility-oracle.test.ts×1 | [ruled, amended in place 2026-07-07 (promoted from B4)] An override lives exactly as long as its own transaction; a newer truth from the source supersedes it in the graph immediately, on screen at com… |
66
66
| A19 | amended |`docs/SPEC-ASYNC-SEMANTICS.md:121`| constants.ts×1 core.ts×6 scheduler.ts×2 types.ts×1 verdict.ts×4 store.ts×1 | lane-uninitialized-landing-3648.test.ts×2 mount-over-foreign-hold-3761.test.ts×2 spec-async-semantics.test.ts×3 derived-presence-async-3726.test.ts×2 superseded-before-first-commit.test.ts×3 uninitialized-visibility.test.ts×1 visibility-oracle-store.states.ts×8 visibility-oracle-store.test.ts×1 visibility-oracle.states.ts×14 visibility-oracle.test.ts×1 write-proposals-3494.test.ts×1 |[ruled, amended in place 2026-07-07 (promoted from C1)]`isPending(x)` ≡ the observable value is not final (three causes) — (was C1 — **partially reverses an earlier decision**) **Definition: `isPendi… |
67
67
| A20 | superseded |`docs/SPEC-ASYNC-SEMANTICS.md:380`| — | question-scoped-pending.test.ts×2 spec-async-semantics.test.ts×3 createOptimisticStore.test.ts×1 |[superseded 2026-07-13 by A24] (superseded) Optimistic writes announce a store-wide pending — (**SUPERSEDED 2026-07-13 by A24** — the mask is deleted; optimistic writes are verdict-inert. Kept for the… |
68
68
| A21 | superseded |`docs/SPEC-ASYNC-SEMANTICS.md:387`| — | question-scoped-pending.test.ts×3 spec-async-semantics.test.ts×3 |[superseded 2026-07-13 by A24] (superseded) The store-wide mask — (**SUPERSEDED 2026-07-13 by A24** — the store-wide mask is deleted with the mask model; nothing silences a new question. The effective… |
@@ -78,7 +78,7 @@ Status legend: **live** stated and standing · **ruled** carries an explicit rul
78
78
| A31 | live |`docs/SPEC-ASYNC-SEMANTICS.md:103`| boundaries.ts×1 core.ts×1 verdict.ts×1 | ispending-combined-atomic-3442.test.ts×1 |[live 2026-09-14 (#3442)] A memo computes under its own lane posture, never its puller's — A memo's value is one shared slot every reader sees, so its pass runs under the lane posture the memo itself … |
79
79
| A32 | ruled |`docs/SPEC-ASYNC-SEMANTICS.md:111`| core.ts×4 lanes.ts×1 store.ts×1 | visibility-oracle-store.states.ts×8 visibility-oracle-store.test.ts×1 visibility-oracle.states.ts×9 visibility-oracle.test.ts×1 |[ruled 2026-09-14] Children-forbidden readers see the frame, not the graph — `createTrackedEffect` and `onSettled` callbacks are effect-phase code that runs after the frame is decided. They read the f… |
80
80
| A33 | ruled |`docs/SPEC-ASYNC-SEMANTICS.md:245`| boundaries.ts×1 scheduler.ts×1 | async-chain-supersession.test.ts×2 boundary-not-born-held-3540.test.ts×2 ispending-in-boundary-on-3528.test.ts×2 loading-reset-collects-forwarded-3459.test.ts×3 |[ruled 2026-09-12 (#3375)] A fallback-caught flight holds no transaction; a Loading reset moves the hold onto the boundary — A `<Loading>` boundary showing its fallback is the display of everything un… |
81
-
| A34 | ruled |`docs/SPEC-ASYNC-SEMANTICS.md:255`| constants.ts×1 core.ts×6 lanes.ts×2 scheduler.ts×2 store.ts×3| a34-writes-then-derivations.test.ts×2 createMemo.test.ts×1 derived-write-then-derivation-3733.test.ts×1 finalize-reentry.test.ts×2 held-derivation-not-a-proposal-3612.test.ts×6 optimistic-list-mutation-matrix.test.ts×1 woken-transaction-adopts-staged-bump.test.ts×1 transition-corpse-revival.test.ts×1 treeshake.test.ts×2 visibility-oracle.states.ts×2 write-proposals-3494.test.ts×5 |[ruled 2026-09-16 (#3494)] A write is a proposal: one on a held node entangles its tick; one that nets to the committed value is none — A write proposes a value for a node. **Held, both are suggestion… |
81
+
| A34 | ruled |`docs/SPEC-ASYNC-SEMANTICS.md:255`| constants.ts×1 core.ts×6 lanes.ts×2 scheduler.ts×2 store.ts×4| a34-writes-then-derivations.test.ts×2 createMemo.test.ts×1 derived-write-then-derivation-3733.test.ts×1 finalize-reentry.test.ts×2 held-derivation-not-a-proposal-3612.test.ts×6 optimistic-list-mutation-matrix.test.ts×1 unchanged-presence-no-hold-3743.test.ts×3 woken-transaction-adopts-staged-bump.test.ts×1 transition-corpse-revival.test.ts×1 treeshake.test.ts×2 visibility-oracle.states.ts×2 write-proposals-3494.test.ts×5 |[ruled 2026-09-16 (#3494)] A write is a proposal: one on a held node entangles its tick; one that nets to the committed value is none — A write proposes a value for a node. **Held, both are suggestion… |
82
82
## V — fixed violations
83
83
84
84
| id | status | defined | cited in src | cited in tests | statement (at definition) |
@@ -390,7 +390,7 @@ Status legend: **live** stated and standing · **ruled** carries an explicit rul
390
390
| §6c | live |`docs/INTERNALS-STORE-STATE.md:334`| — | createProjection.async.test.ts×1 flight-owned-transaction.test.ts×1 | Store-wide status gating (RUL-7) |
0 commit comments