fix(signals): one unflushed — a staging adopted before any flush answers the committed value on every channel (spec O4) - #3510
Merged
Conversation
🦋 Changeset detectedLatest commit: e739c0b The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 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 |
…swers the committed value on every channel (spec O4) Same-tick adoption is by design (O1): an action started after an ambient write owns it. A28 still governs what is VISIBLE before the flush: nothing. The store's leaves answered latest 0 / isPending false inside the adopting action's body — through the foreign-hold rule, by coincidence — while the signal answered 1 / true: adoption had stamped it and `unflushedValue` read a stamped node with no stash as "flushed, held". One rule, two implementations, two answers (posture matrix S1). One definition now: a node staged outside a flush and adopted before any flush has carried it is unflushed whatever its stamp. initTransition's adoption loop sets CONFIG_ADOPTED_UNFLUSHED when it runs outside a flush; unflushedValue serves the committed value for it and flushedStaged answers NOT_PENDING; reassignPendingTransition — the carrying flush re-stamping the transaction's pending nodes — clears the bit. Signal and store leaves take the same arm. (A first cut keyed on the transaction's `_time === clock` — re-entry re-stamps `_time`, so a genuinely held value read from another action read as unflushed; four pins caught it. A second used a sentinel in the stash and a helper: +179 B; the config bit is +56 B.) S1 pin flipped. The matrix's only changed cells are the `staged, ambient` state's: latest/isPending under the adopting posture now 0/false, and a memo/effect created there publishes the committed 0 and holds its 1 with the action instead of publishing the held write. 2,742 signals tests, no expected fails remaining. Co-authored-by: Claude via Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
…(+18…+50 B) Co-authored-by: Cursor <cursoragent@cursor.com>
ryansolid
force-pushed
the
fix/adopted-unflushed
branch
from
September 17, 2026 06:52
c74b86b to
e739c0b
Compare
Coverage Report for CI Build 35191800471Warning No base build found for commit Coverage: 71.46%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #3505 (its commit is included; merges cleanly after it). Closes spec O4 — the last pinned violation; the signals suite has no expected fails for the first time.
Bug (posture matrix S1)
Same-tick adoption is by design (O1):
set(x, 1); action(...)in one tick makes the action own the write. A28 still governs what is visible before the flush: nothing. Inside the adopting action's body:latest(x)isPending(x)The store answered correctly by coincidence (its foreign-hold rule), the signal wrongly: adoption stamped it with the transaction, and
unflushedValueread a stamped node with no stash as "flushed, held". One rule, two implementations, two answers — the first concrete target of the consolidation's "oneunflushed".Fix
One definition: a node staged outside a flush and adopted before any flush has carried it is unflushed whatever its stamp.
initTransition's adoption loop setsCONFIG_ADOPTED_UNFLUSHEDwhen it runs outside a flush (one masked|=in the existing loop).unflushedValueserves the committed value for it →latest()answers the pre-write value;flushedStagedanswersNOT_PENDING→ the verdict sees nothing staged.reassignPendingTransition— the carrying flush re-stamping the transaction's pending nodes — clears the bit (one&=in the existing loop); the hold takes over.Signal and store leaves now answer through the same arm. +56 B minified (25,193 → 25,249).
Two earlier shapes were rejected by the gate: keying on the transaction's
_time === clock(re-entry re-stamps_time, so a genuinely held value read from another action read as unflushed — four pins caught it), and a sentinel in the stash plus a helper (+179 B).Gate
staged, ambientstate's under the adopting postures —latest/isPendingnow 0/false, and a memo/effect created there publishes the committed 0 and holds its 1 with the action instead of publishing the held write. 0 invariant violations across 621 cells.