You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fe3012e
Browse filesBrowse the repository at this point in the historyBrowse files
♻️ refactor(runtime): type a compiled eval block as an Operation
EvalBlock named the generator that compilers happen to emit rather than what
callers may do with it. That leaked an implementation detail into the
contract, and eval-handler.ts paid for it twice with
`as unknown as Operation<unknown>` casts to run a block at all.
A compiled block now returns Operation<unknown>. Generated modules are still
`function*` — a generator object already satisfies Operation — but that is how
a block is built, not what the API promises. compileBlock() returns
Operation<EvalBlock> instead of restating the concrete signature, and both
casts are gone: a block runs with plain `yield*`.
The type change immediately found every place that assumed otherwise. The
compilation suites drove blocks by hand with .next() loops, which asserted
mechanism rather than behavior; they now run the operation and assert what the
block did. T17 no longer inspects an intermediate yield to prove `sleep` is in
scope — it asserts the statement after the suspension ran, which is the
observable claim. T23 covers a block's return value reaching the caller, which
nothing asserted directly before.
Enforcement is #185; this PR only avoids introducing what that rule will catch.
0 commit comments