Skip to content

Allow a guess over an equation (Solid's createOptimistic(fn)) - #48

Merged
ryansolid merged 8 commits into
mainfrom
claude/project-thread-2sdg89-equation-guess
Nov 11, 2026
Merged

ryansolid merged 8 commits into
mainfrom
claude/project-thread-2sdg89-equation-guess

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Requested by Ryan · project thread

This PR is stacked on #47 (it uses guess), so merge #47 first and GitHub will retarget this one to main.

x = e followed by guess x := v in an action is now legal. Solid's derived createOptimistic(fn) has a setter that can only guess, and requiring source x = e before you could guess was stricter than Solid while guarding nothing. A plain x := v on an equation is still WRITE_TO_NON_SOURCE. Recorded as 07 decision 19 and 06 ST-5c, ruled 2026-11-11.

What's legal

  • guess x := v on an equation, including a child's own equation of a prop: shown = props.title then guess shown := t. The guess shows only where the child reads shown.
  • Still refused:
    • guess props.x and guesses on parameters (O-4)
    • a plain write to an equation (W-1)
    • a guess on a deferred equation, under the new code GUESS_ON_DEFERRED (V-16: its value lags the truth that would confirm the guess)

Lowering

  • A guessed equation lowers to createOptimistic(fn), or to createOptimisticStore(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.
  • A guessed source x = e keeps its createSignal(fn) truth under a createOptimistic layer, 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).

  • interpreter: 123 pass
  • oracle: 123 pass, 0 fail, 14 recorded divergences
  • compiled: 123 pass, 0 fail, 14 recorded divergences
  • ssr: 116 pass, 0 fail, 7 skip
  • types: 169 pass
  • crate: 346/346 programs agree; --lower: 203/203 lowered alike
  • cargo test --release: passes, including diagnostics_page with the new GUESS_ON_DEFERRED section

Generated by Claude Code

`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
@ryansolid ryansolid self-assigned this Nov 11, 2026
@ryansolid
ryansolid changed the base branch from claude/project-thread-2sdg89 to main November 11, 2026 06:06
# 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
@ryansolid
ryansolid merged commit 0140638 into main Nov 11, 2026
17 checks passed
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