Skip to content

docs(signals): executable rulings, derived rules collapsed, seat table re-derived - #4695

Merged
ryansolid merged 1 commit into
nextfrom
tembo/optimism-seam-spike-brief
Nov 6, 2026
Merged

ryansolid merged 1 commit into
nextfrom
tembo/optimism-seam-spike-brief

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Summary

The async rules were written as prose for agents to work from, and a week of fixes showed they do not survive that: the rule table and the code disagreed in 80 places (the seat shadow), and the rules themselves tripped a reader four times in one afternoon, each time on a sentence whose status or vocabulary could not be told from its neighbours. This PR makes rulings executable and collapses the prose around them. It is the M0 step of documentation/plans/optimism-seam-spike-brief.md (new here; §8 records the four rulings made on 2026-11-05, §9–§12 the work below).

  • Executable rulings. packages/web/test/async-gen/rulings/S-<n>.ts: a scenario in the generator's grammar, the expected screen after each step, the ✗ screens, a status. rulings.spec.ts runs them in pnpm test; scenarios-md.ts generates each ruling's block in packages/signals/docs/SCENARIOS.md between <!-- ruling:S-n --> markers, and the spec fails when a block is stale (RULINGS_WRITE=1 pnpm exec vitest run test/async-gen/rulings in packages/web regenerates). Fifteen rows are executable: S-3, S-6, S-21, S-25, S-26, S-27, S-29, S-31, S-33, S-44, S-45, S-46, and the new S-48, S-49, S-50. Six cases are ruled-not-built (it.fails at the ruled screen; the block records today's screen beside it): S-44, S-45 leaf and memo, S-46 plain, S-49, S-50. Three of those were documented as standing or fixed: S-45's through-a-memo form shows the fallback today; S-46's plain content attaches with its hole empty (the ✗ row the doc records as fixed by [2.0 / next] A display-ahead <Show> opened under a plain write's hold attaches its branch with an empty text hole until the landing (S-46, F-2) #4574); S-44's owned isPending probe reads false after the outside change where the pin's imperative probe reads true.
  • Generator grammar, rulings only (the random generator is untouched; a 100-case survey still reports zero findings): Loading on, actions with several writes, guesses and refreshes ({ t: "action", before, after, refresh }), optimistic memos and signals, memo inputs pending and when (a gated probe), the read kind pendingLatest (isPending(() => latest(x))), branch-owned memos (show.owns, born held). Result.settles records which flight each settle step landed. The hydration campaign's step driver throws on the ruling-only steps rather than diverging silently; emitApp does the same.
  • Rules. The seven rules the spike touches (D-1/D-2, D-17, D-22, D-23, D-25, D-27, D-34) rewritten as one or two sentences in screen vocabulary naming their rows; then sixteen derived rules folded into nine absorbers (stubs keep every ID, rows and pins moved, text archived verbatim in INTERNALS-ASYNC-STATE.md §7). RULES-DERIVED.md: 40 rules / 14,335 words → 24 live rules / ~7,600 words. Glossary entries in RULES-FUNDAMENTALS.md: display-ahead read, answer, produced, the hold's work, guess. D-25's "a verdict posture outlives the pass that asked" (2026-10-28) is withdrawn; its ruled screen is D-17's. scripts/rules-index.mjs indexes D-/F-/S- ids (every one of the ~360 hyphenated citations in src/ resolves) and checks that every ruling block has its file.
  • Seat table re-derived (core/seat.ts, __TEST__ only; dist unchanged). Posture is the pass's own reads with the same-node clause; isPending-window reads compare side effects only; the verdict-seat and Fl-rank comparisons go (the join stays); rows corrected per the triage in the brief §10–§11. Shadow over the 275 scalar pin files: 80 classes → 6 classes (8 reads), with 538 reads under three labelled allow-list predicates that are the mechanism the spike's M3 replaces (the sticky verdict bit, the verdict lane, the carry-over), not issues to file.

No changeset: docs, tests and test-only code; no package behaviour changes.

Reviewer pointers: the brief §8 for the four rulings (each walked through with code), §10–§11 for the seat triage and what was tried and reverted, §12 for the collapse table; SCENARIOS.md for the generated blocks; one ruling file (S-27.ts) for the shape.

How did you test this change?

# rulings + generated blocks (packages/web)
pnpm exec vitest run test/async-gen          # 18 files: 75 passed, 6 expected fail, 1 skipped
ASYNC_GEN=1 ASYNC_GEN_CASES=100 pnpm exec vitest run test/async-gen/campaign.spec.ts   # 0 findings
pnpm exec tsc --project tsconfig.test.json   # clean

# rules index (packages/signals)
node scripts/rules-index.mjs --check         # every src/ citation resolves (127 ids); every live A-rule cited; every ruling block has a ruling file (15); RULES-INDEX.md current
pnpm exec vitest run                         # 481 files: 6745 passed, 14 expected fail, 2 skipped

# seat shadow over the scalar pins (packages/signals)
SEAT_SHADOW_REPORT=/tmp/seat.jsonl pnpm exec vitest run <275 scalar pin files>
node scripts/seat-shadow-summary.mjs /tmp/seat.jsonl   # 6 mismatch classes; known: pass-wide posture ×368, verdict-lane membership ×159, carry-over ×11

# whole repo
pnpm exec turbo run test --continue --filter='!test-integration' --filter='!@solidjs/compiler' --filter='!./examples/*'
# 20/21 tasks; the one failure is a pre-existing web server-functions test that failed identically before this change

Row-move check after the collapse: every S- id a folded rule listed is listed by its absorber (scripted; zero missing).


Want tembo to make any changes? Add a comment with @tembo and i'll get back to work!

View on Tembo  Review in Tembo  View Agent Settings

Co-authored-by: tembo[bot] <208362400+tembo-io[bot]@users.noreply.github.com>
@tembo tembo Bot added tembo Pull request created by Tembo labels Nov 6, 2026
@changeset-bot

changeset-bot Bot commented Nov 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 40898a9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Size (brotli, eager entry chunk)

scenario head vs base minified vs base minified vs recorded cap lazy chunks (not counted)
signals: core floor (createSignal/Memo/Effect/Root/flush) 7.42 KB 0 B 0 B −98 B 7.43 KB ✅
signals: + createStore 15.09 KB 0 B 0 B 0 B 15.10 KB ✅
signals: + isPending/latest 12.24 KB 0 B 0 B 0 B 12.25 KB ✅
signals: + until/refresh (truth readers, no optimism) 8.04 KB 0 B 0 B −91 B 8.06 KB ✅
app: render + one signal (the simple-app floor) 9.80 KB 0 B 0 B −157 B 9.80 KB ✅
app: hydrating (no stores) with Show/For/Loading/Errored/lazy 19.01 KB 0 B 0 B −7 B 19.05 KB ✅ lazy-page.js 0.04 KB
app: hydrating + every store primitive family 33.40 KB 0 B 0 B 0 B 33.41 KB ✅ lazy-page.js 0.04 KB
app: CSR with Show/For/Loading/Errored/lazy 13.71 KB 0 B 0 B −7 B 13.73 KB ✅ lazy-page.js 0.04 KB
app: CSR, observe tier (same app on the observe artifacts) 15.45 KB 0 B 0 B −7 B 15.50 KB ✅ lazy-page.js 0.04 KB
app: CSR, observe tier + attribution engine enabled 30.08 KB 0 B 0 B −7 B 30.12 KB ✅ lazy-page.js 0.04 KB
app: compiled floor (one template, one text hole, one delegated click) 9.98 KB 0 B 0 B −194 B 9.98 KB ✅
app: compiled CSR (JSX todo app: spread/merge/omit, events, class/style, keyed For, Show, Loading + lazy, store) 26.65 KB 0 B 0 B 0 B 26.67 KB ✅ stats.js 0.18 KB
app: compiled hydrating (the same JSX todo app through hydrate(), compiled hydratable) 32.93 KB 0 B 0 B 0 B 32.95 KB ✅ stats.js 0.20 KB
frames: eager client consumer (frames client + transport, lazy codec) 11.75 KB 0 B 0 B 0 B 11.77 KB ✅
page: base server components (hydrating + dynamic + frames + sf reference) 34.05 KB 0 B 0 B −7 B 34.11 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.06 KB, trace.js 9.30 KB, wire.js 3.47 KB
page: live server components (base + live/GET + action + isPending/latest) 40.29 KB 0 B 0 B 0 B 40.30 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.06 KB, trace.js 9.27 KB, wire.js 3.47 KB
page: compiled base server components (the base page as JSX: templates with class/style/attributes/events, For/Show; no spread) 35.98 KB 0 B 0 B −7 B 36.00 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, regions.js 1.06 KB, sc-comments.js 0.20 KB, trace.js 9.26 KB, wire.js 3.47 KB
page: compiled live server components (the compiled base page + live/GET + action + isPending/latest) 44.32 KB 0 B 0 B 0 B 44.34 KB ✅ eager (counted): web.js 23.54 KB; assets.js 0.78 KB, decode.js 7.09 KB, regions.js 1.07 KB, sc-comments.js 0.19 KB, trace.js 9.28 KB, wire.js 3.47 KB
page: base + router (base page + @solidjs/router: createRouter, two routes, preload, useNavigate) 41.59 KB 0 B 0 B 0 B 41.60 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.07 KB, server.js 1.03 KB, serverForms.js 3.58 KB, trace.js 9.24 KB, wire.js 3.48 KB
page: live + router (live page + @solidjs/router: createRouter, two routes, preload, useNavigate) 50.08 KB 0 B 0 B 0 B 50.10 KB ✅ eager (counted): client.js 28.75 KB; assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.07 KB, server.js 1.03 KB, serverForms.js 3.30 KB, trace.js 9.27 KB, wire.js 3.49 KB
server: floor (getRequestEvent + isServer) 1.27 KB 0 B 0 B 0 B 1.29 KB ✅
server: renderToString (the server-render floor) 22.86 KB 0 B 0 B 0 B 22.87 KB ✅

Bundled with Rolldown (what Vite ships), brotli q11, decimal KB. A scenario fails only when it is over its brotli cap and its minified size is more than 20 B over the minified recorded with the cap; over the cap within that allowance is brotli layout noise and passes with a warning. Caps and their recorded minified in scripts/size/scenarios.js; the floor and page caps in floor-caps.json are frozen (lower only, or Size-Exception: in the PR body). npm run ratchet lowers caps per RC; it never raises one (scripts/size/README.md).

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 42166703395

Coverage remained the same at 78.249%

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: 1370
Covered Lines: 1132
Line Coverage: 82.63%
Relevant Branches: 1108
Covered Branches: 807
Branch Coverage: 72.83%
Branches in Coverage %: Yes
Coverage Strength: 30.14 hits per line

💛 - Coveralls

@ryansolid
ryansolid merged commit 45648f7 into next Nov 6, 2026
8 checks passed
ryansolid pushed a commit to ryansolid/reactivescript that referenced this pull request Nov 6, 2026
…he commit; DV-19 is Solid's

- H-11: an answer is compared with the guess and corrects the graph now, but the screen, the
  guess's effects and `latest x` of a guess the screen shows keep it until the hold commits
  (Solid D-22, D-34, decision 3). H-7's "after a correction, the truth" narrowed to a guess the
  screen never showed.
- Interpreter: `latest` of a shown, answer-corrected guess answers the guess until the commit.
- S-latest-reask back to `2 / 2`, with the changed-truth variant; DV-19 recorded at four
  instants (#4689 ruled, not built).
- CN-3e message, spec/08 and guide/reference.md back to what holds: both fixes show the guess.
- References keep the count under the list's region (right by the spec either way, and not
  dependent on #4689).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWMbSPnht6GSU1vp8Pe
@codspeed

codspeed Bot commented Nov 6, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 201 untouched benchmarks
⏩ 5 skipped benchmarks1


Comparing tembo/optimism-seam-spike-brief (40898a9) with next (4fe7532)

Open in CodSpeed

Footnotes

  1. 5 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. ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tembo Pull request created by Tembo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants