Repository navigation
Allow a guess over an equation (Solid's createOptimistic(fn)) - #48
Merged
Merged
Conversation
`guess x := e` replaces `optimistic x := e` (07 decision 18, ruled 2026-11-11). Semantics and lowering are unchanged (createOptimistic / createOptimisticStore); only the surface word moves. - Parsers (ref/src/parse.ts, compiler/src/parse.rs): `guess` is the keyword; `optimistic` stays reserved and is a parse error coded OPTIMISTIC whose hint names `guess` (guide/diagnostics.md, S-parse-hints). - Codes: OPTIMISTIC_OUTSIDE_HOLD -> GUESS_OUTSIDE_HOLD, OPTIMISTIC_NO_QUESTION -> GUESS_NO_QUESTION, OPTIMISTIC_REVERTED -> GUESS_REVERTED; HELD_WRITE / STALE_WRITE_BACK / AC-1b messages say `guess`. - Spec, guide, scenarios, examples, eval reference apps and the editor grammar use `guess`. eval/results and preregistrations are left as historical records. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWP7LmQhib6M9zGnmBH
Drops the OPTIMISTIC parse hint, its guide section, spec row and S-parse-hints variant; 07 decision 18 says why. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWP7LmQhib6M9zGnmBH
An error clear is a reset that lands now (EF-8), not a guess at the
server's answer: `guess saveError := ""` worked only because the source
was given a constant question to revert to. The guide's action example,
the examples and the eval reference apps now write
`onFlush(() => { saveError := "" })`, and those error sources are
declared with `:=`. S-ai2-settings gains the flush instant.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWP7LmQhib6M9zGnmBH
`x = e` then `guess x := v` in an action is legal (06 ST-5c, 07 decision 19): a guess is not a write of the truth, and Solid's derived createOptimistic(fn) has a setter that only guesses. A plain `x := v` on an equation stays WRITE_TO_NON_SOURCE; `props.x` and parameters stay refused (O-4). New code GUESS_ON_DEFERRED: a deferred equation lags its truth (V-16). Lowering: a guessed equation is createOptimistic(fn), or createOptimisticStore(fn, seed) when keyed or guessed by path, on the client, the server (matching owner trees for hydration) and in the oracle. Both checkers and both emitters agree (crate parity, lowered alike). Scenario S-guess-equation covers an equation of a source and a child's equation of a prop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWP7LmQhib6M9zGnmBH
…-2sdg89 # Conflicts: # ref/oracle/lower.ts
…d-2sdg89-equation-guess
# Conflicts: # guide/async.md # guide/diagnostics.md # guide/reference.md # ref/src/runtime.ts # spec/06-stores.md # spec/07-surface.md # spec/99-diagnostics.md
…e(fn, seed)) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWP7LmQhib6M9zGnmBH
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.
Requested by Ryan · project thread
This PR is stacked on #47 (it uses
guess), so merge #47 first and GitHub will retarget this one tomain.x = efollowed byguess x := vin an action is now legal. Solid's derivedcreateOptimistic(fn)has a setter that can only guess, and requiringsource x = ebefore you could guess was stricter than Solid while guarding nothing. A plainx := von an equation is stillWRITE_TO_NON_SOURCE. Recorded as 07 decision 19 and 06 ST-5c, ruled 2026-11-11.What's legal
guess x := von an equation, including a child's own equation of a prop:shown = props.titlethenguess shown := t. The guess shows only where the child readsshown.guess props.xand guesses on parameters (O-4)deferredequation, under the new codeGUESS_ON_DEFERRED(V-16: its value lags the truth that would confirm the guess)Lowering
createOptimistic(fn), or tocreateOptimisticStore(fn, seed)when it's keyed or guessed by path. This applies in the client runtime, the server runtime (so the owner trees and hydration keys match) and the Solid oracle.source x = ekeeps itscreateSignal(fn)truth under acreateOptimisticlayer, because it is also written plainly.Tests
New scenario:
S-guess-equation(a guess over an equation of a source, a guess over a prop through the child's equation, a failing variant, and three rejected forms).--lower: 203/203 lowered alikecargo test --release: passes, includingdiagnostics_pagewith the newGUESS_ON_DEFERREDsectionGenerated by Claude Code