Repository navigation
Inferred actions (AC-1b), HELD_WRITE (AC-1c), STALE_OWN_READ (AC-1d) - #17
Merged
Merged
Conversation
An arrow in imperative scope is an action when its own statements guess,
declare `affects`, or both write a source and await. The compiler sees
every suspension (await is a statement), so it lowers such an arrow to
Solid's action() exactly as `action { … }` lowers; nothing is added at
run time. An effect's apply block is never inferred (its return is the
cleanup, EF-5).
Two static checks keep the hold visible, stricter than Solid, which
cannot see a body:
- HELD_WRITE: in an inferred action, a plain write that reaches an await
would be held; make it optimistic (ephemeral), onFlush (a reset), or
declare the action to hold it on purpose.
- STALE_OWN_READ: in any run, reading a source the run's own change wrote
gets the committed value (W-4); Solid rc.19 agrees inside action().
Both follow calls into local closures. Shared analysis in ref/src/infer.ts,
ported to compiler/src/infer.rs. Scenarios S-infer-1..5; S-check-1's row
handler had a stale read; S-solid-32's handler guess is now a variant.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWKaPajtqtwB6YqA277
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
Ruled 2026-10-28 in the thread. Design doc: https://claude.ai/artifact/8Lv3dy6NY3cwwgy7U2B2Fj
What changes
optimistic,affects, or both a write to a source and a statement-levelawait. It lowers to Solid'saction()the same wayaction { … }does, so nothing is added at run time. Aneffect's apply block is never inferred, because its return value is the cleanup (EF-5). A guess there staysOPTIMISTIC_OUTSIDE_HOLD, and the message now says to declare an action.HELD_WRITE. Only for inferred actions: a plain write that reaches anawaitis an error. The fix depends on the write's purpose:optimisticfor ephemeral state,onFlushfor a reset, or a declaredactionto hold the write on purpose. Declared actions are not checked, because holding a write is what a transition is for (S-solid-20).STALE_OWN_READ. In every imperative run, reading a source the same change has already written is an error, matched key by key. The read would get the committed value (W-4). I confirmed in Solid 2.0.0-rc.19 thataction()behaves the same way after ayield.let f = () => { … }; f()).ref/src/infer.ts, ported tocompiler/src/infer.rs. Wired into the checker, interpreter, ref lowering, oracle, and crate check and emit.hitsright after writing it, which was stale, so it now uses a local. S-solid-32's rejected handler guess now compiles, since the handler is inferred as an action, so it is a frames variant instead.Checks (Solid next @ d2323b0, rc.19)
RX_CRATE=1): 104/104--lower175/175cargo test: passNot done: the language server doesn't show "inferred action" on hover yet, because hover comes from TypeScript over the projection.
Generated by Claude Code