Skip to content

feat(signals): OPTIMISTIC_REVERTED — an optimistic value the screen showed was replaced - #3607

Merged
ryansolid merged 4 commits into
nextfrom
feat/optimistic-reverted
Sep 24, 2026
Merged

ryansolid merged 4 commits into
nextfrom
feat/optimistic-reverted

Conversation

@ryansolid

@ryansolid ryansolid commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Item 3 of documentation/plans/responsiveness-findings-plan.md; item 2 marked satisfied by #3580 in the same plan edit.

What it says

An optimistic value (createOptimistic) the screen displayed was replaced by a different one. data.how names the road: reverted — nothing new landed and the override lifted back to the committed value it covered (the action failed, or never wrote what it promised); superseded — an authoritative value landed that differs from the guess. Both are correct by construction — the revert is the feature — so this is info, structured channel only, on whenever the engine is enabled: a count that grows for one source is what says the guess or the failure rate is wrong. Judged by the node's own equals, so a structurally equal correction is silent. data: source, shown, truth (40-char previews), how; subject is the node.

The seam

AttributionHooks.optimisticReverted(el, shown, truth, how), fired from supersedeOverride (how derived from whether a landing is staged in _pendingValue) and from the non-superseded differing drop in resolveOptimisticNodes. Both sites sit outside any try, __OBSERVE__-gated.

Not covered, on purpose

  • Optimistic stores: the overlay folds off per path in _clearOptimisticStores; a per-path comparison is its own change.
  • The interaction that wrote the guess: optimistic writes go through optimisticWrite, which bypasses the write hook, so the node carries no origin stamp. Stamping them touches the interaction accounting (writes, hold membership) and should be decided separately.

Public API

  • AttributionHooks gains optimisticReverted(...).
  • DiagnosticCode gains "OPTIMISTIC_REVERTED".
  • AttributionOptions gains optimisticReverts?: boolean (default true; false disables the finding, like the other verdict options).

Never judged: the runtime's own optimistic nodes

The first cut fired on every acknowledged hold: isPending()'s companion is an optimistic signal that goes true while pending and back to false at commit by design — the acknowledgement SILENT_HOLD asks for — so the repair for one finding produced another (two @solidjs/diagnostics harness tests caught it). checkOptimisticRevert now skips companions (_parentSource set: isPending/latest) and derived overrides (CONFIG_DERIVED_OVERRIDE: a lane pass's result, not a written guess) by the same isCompanion predicate the hold census already uses. User createOptimistic values are unaffected — a written guess is never a companion, and optimisticWrite clears the derived bit. Regression test: an acknowledged hold with isPending and latest readers is silent; without the guard it produces one false finding per held write.

Size (re-measured at landing over #3604/#3623/#3613/#3619/#3608): engine 31,625 B against next's 31,368 (+257 B: +222 for the finding, +35 for the companion guard), cap 31.45 → 31.65 KB with note; tier unchanged at 17,618. Tests: 7 new (reverted, superseded, confirmed-silent, custom-equality-silent, acknowledged-hold-silent, optimisticReverts: false, no-engine inert); signals 3684 / diagnostics 34 / solid 780 / web 944+1150+248 (native and babel) green.

@changeset-bot

changeset-bot Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: db043d4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@solidjs/signals Patch
test-integration Patch
@solidjs/web Patch
@solidjs/babel-plugin Patch
@solidjs/compiler Patch
@solidjs/diagnostics Patch
@solidjs/element Patch
@solidjs/h Patch
@solidjs/html Patch
solid-js Patch
@solidjs/universal Patch

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

@codspeed

codspeed Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 176 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing feat/optimistic-reverted (db043d4) with next (873187b)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

ryansolid and others added 2 commits September 23, 2026 23:20
…he correction

An optimistic override the screen displayed is replaced by a different
value on two roads: the guess lifts at settle back to the committed value
it covered (the action failed, or never wrote what it promised), or an
authoritative value lands that differs from it. Both are the runtime doing
what optimistic UI promises, so the finding is `info` and structured-channel
only — a count that grows for one source is what says the guess, or the
failure rate, is wrong. Judged by the node's own equality.

`AttributionHooks.optimisticReverted(el, shown, truth, how)` is the seam,
fired from supersedeOverride (how derived from whether a landing is staged)
and from the non-superseded drop in resolveOptimisticNodes. Not covered
yet, and said so: optimistic stores, and the interaction that wrote the
guess (optimistic writes bypass the write hook, so the node carries no
origin). The plan marks item 2 satisfied by #3580 — `at` equals the Event
Timing entry's `startTime`; `interactionId` is not readable at dispatch.

Size: engine +266 B, tier +38 B; the engine cap moved with a note.

Co-Authored-By: Claude via Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
….45 -> 31.65 KB

Co-authored-by: Claude via Cursor <noreply@cursor.com>
@ryansolid
ryansolid force-pushed the feat/optimistic-reverted branch from cab9f3f to 0b69a7f Compare September 24, 2026 06:20
ryansolid and others added 2 commits September 24, 2026 00:21
…mistic nodes

The finding fired on every acknowledged hold: isPending()'s companion is an
optimistic signal that goes true while pending and back to false at commit
by design — the acknowledgement SILENT_HOLD asks for — so the repair for one
finding produced another. The check now skips companions and derived
overrides by the predicate the hold census already uses (`isCompanion`),
and `optimisticReverts: false` disables it like the other verdicts. The
regression test is the acknowledged hold itself (isPending and latest
readers over a held write): silent with the guard, one false finding
without it.

Co-Authored-By: Claude via Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ne 31,625 B under the 31.65 KB cap

The `optimisticReverts` option and the `isCompanion` skip in
checkOptimisticRevert are +35 B on the engine scenario (31,590 -> 31,625 B).
The cap holds; the note records the new measurement. Tier unchanged at 17,618.

Co-authored-by: Claude via Cursor <cursoragent@cursor.com>
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 35970793844

Coverage remained the same at 73.134%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1142
Covered Lines: 883
Line Coverage: 77.32%
Relevant Branches: 894
Covered Branches: 606
Branch Coverage: 67.79%
Branches in Coverage %: Yes
Coverage Strength: 25.22 hits per line

💛 - Coveralls

@ryansolid
ryansolid merged commit 5351a3e into next Sep 24, 2026
7 checks passed
@ryansolid
ryansolid deleted the feat/optimistic-reverted branch September 24, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants