Repository navigation
Repair the staged-control test #903 overwrote, and state when deferred widgets have landed - #913
Merged
Merged
Conversation
…d widgets have landed #903 merged without the revision asked for on its thread. Git combined e291a95's rename of the staged-control test with the branch's older rewrite of the same case silently, so `main` now holds the Web Awesome bundle from outside the page and then drives the component that bundle defines. This restores 49952af's `tests/test_render_anchors.py` and `tests/render_cases_navigation.py`. It also replaces that branch's `lf-shot wa-comparison` wait, and the two older waits on `[data-interaction-frame][data-interaction-ready]`, with a page-level fact. A widget that keeps work off the presentation path runs it through `afterPresentation`, which is the wait and the declaration in one call; `pageArrived` answers whether any such arrival is outstanding, and `open_page` waits through it.
This was referenced Sep 22, 2026
max-sixty
added a commit
that referenced
this pull request
Sep 27, 2026
… reader (#1250) Four Python readers waited on different subsets of the runtime's readiness facts. The suite's `BOTH_STAMPS` required upgrade, an applied stamp, presentation, the coordinator's current reading, settled rendering and deferred arrivals (#913 and #1145 added the last two, but only there). The render gate's `wait_for_presentation` waited on data version, log coverage and current presentation, with neither arrival nor rendering. `scripts/example-previews.py` and `record-demo.py` checked the three body stamps alone, and `record-demo.py`'s stills waited on upgrade and a count of `action` lines in `events.jsonl`, with no presentation, where the gate counts the reading's served coverage (#1235). `pageReadiness` in `runtime/presentation.js` now names the first fact a page has yet to state, in the order a page reaches them: `upgraded`, then `data` and `log` against an `/api/state` reading the caller holds, then `presented`, `arrived` and `rendering`. It returns null once the page is ready. The entry script exposes it as `lfReadiness`, replacing `lfCurrentPresentationReady` and `lfPageArrived`; `lfRenderingSettled` stays for waits after input. `leaf.render_checks.wait_until_ready(page, state=None)` is the one Python wait. It raises `PageNotReady` naming the stage, and every reader uses it: the suite (`open_page`, `navigate`, `restarting`, the arrivals case and each direct wait), the gate's scheme pass and page-code run, the catalog stills, and the demo recording. The stills now wait against the server's reading, so they count served coverage. Behaviour that moved: - `leaf version check` now also waits for deferred arrivals and settled rendering before it reads a page, and reports either stage by name. A failure at either still keeps the projection findings, as `pageSettled` did. - The gate requires the applied stamp even when the reading covers no records; before, it skipped the log stage then. - The page-code run reads `/api/state` straight after navigation, not after the upgrade stamp, since the readiness wait includes upgrade. - The catalog stills and demo frames are shot after deferred arrivals land and rendering settles, not at first presentation. - A timed-out wait names its stage in the runtime's own words, and reports a page that cannot answer within 5s as `answering`. The render-check probes `initiallyPresented`, `currentPresented`, `dataApplied` and `logApplied` are gone, along with `validationPresentationReady` and `pageArrived`. The tests that read them now assert the readiness stage, or the coordinator's `applicationPresented` directly. A new gate test holds a page's first state answer and checks that the wait fails at `log` with that wording, then passes once the answer lands. The scheme pass keeps its `upgraded` probe as a barrier before the visual-provider check, which must run before presentation can hang on an invalid inventory. `scripts/verify_site.py` and the MCP app still wait on `data-lf-presented` alone. That is the interaction boundary a host shows the frame at, and it stays their fact. > _This was written by Claude Code on behalf of max-sixty_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
#903 merged at 57b00cd without the revision asked for on its thread, and left two things behind. This is both of them.
test_staged_widget_controls_name_the_presses_their_owners_makenow contradicts itself onmain.mainhad repaired that case in e291a95 by driving the upgradedwa-comparisonhandle; #903 still carried the older rewrite of the same case under its previous name, which holds**/vendor/webawesome.esm.jsfrom outside the page so the fallback checkbox never gets hidden. Git combined the rename with the body silently — no conflict, and GitHub reported the branch mergeable — somainnow holds the bundle and then waits for the component that bundle defines. It cannot appear, and the case fails on its first read of it. This restores 49952af's version oftests/test_render_anchors.pyandtests/render_cases_navigation.py, which is e291a95's test and theNATIVE_CONTROL_PAGEfixture it reaches through. No other part of #903 is touched.A page can now say when it has stopped arriving. Presentation says the reader may interact; it does not say the page has finished.
lf-shotputs Web Awesome's comparison after presentation on purpose (#892), and the interaction gallery's contained documents arrive later still — each moves boxes when it lands. Nothing outside the page could see that, so three tests named a widget of their own fixture by hand and waited for it: two on[data-interaction-frame][data-interaction-ready], and #903 added a third,lf-shot wa-comparison, to stoptest_a_settled_page_with_a_standing_reaction_stops_rendering_its_margincounting the comparison's two margin layouts as the render cycle it denies. A widget that wants the reader to have the page first now runs that work throughafterPresentation(() => …), which is the wait and the declaration in one call, so there is no way to defer without the page counting it.pageArrivedanswers whether anything is still outstanding, andopen_pagewaits through it. All three hand-written waits are gone, and the next widget to defer settles every fixture without a fourth.Verification
tests/test_render_anchors.py,tests/test_render_gate.py,tests/test_render_margin.pyandtests/test_render_startup.pyran whole under--run-nightly: 425 passed, covering the restored staged-control case and all three tests whose hand-written waits this removes. The everyday suite is 1,213 passed,npm run test:runtimeis 33 passed, pre-commit passes on the changed files, and the shot and Web Awesome cases intests/test_render_widgets.pyandtests/test_render_commands.pypass.Six cases fail in this CI sandbox on a clean
maincheckout as well, and were confirmed against one: five everyday cases that needAF_UNIXor a umask the sandbox does not keep, andtest_a_shot_still_flips_with_every_script_removed, whose export subprocess cannot launch a browser here.Why a page-level fact rather than a fourth wait, and what this leaves
What the settled-page case was measuring. Moving the shot's two frames into
wa-comparisonlays the margin out twice a few milliseconds apart, at whatever moment the module happens to resolve, and the test allows one layout across thirty frames. Measured on #903's branch: without any wait it went red on 2 of 12 local runs, with both layouts landing 6–13ms apart inside the first 700ms of the window; holding**/vendor/webawesome.esm.jsfrom outside the page instead, changing nothing else, was 8 of 8 with no layouts counted at all — which is what identified the upgrade rather than the two-second heartbeat the test's docstring had assumed. On CI it was red in 35650845868 and 35683511692 and green in 35670525383 and 35677461023.The doubled layout itself is not fixed here. One document change producing two margin layouts on adjacent frames is a doubled render in the thing that test exists to bound; whether the upgrade should lay out once is #892's question. That is unchanged by this PR, and easier to reach now that the page states when the upgrade has landed.
What the new fact does not change.
afterPresentationdoes not move work onto the presentation path — the arrival runs exactly when it ran before, andtest_a_shot_compares_its_frames_with_a_direct_dividerstill holds the bundle'sstartTimeat or afterdata-lf-presented. What changed is only that the page can be asked whether the arrival has landed.The other readers of the same fact.
leaf version check's probes stop atcurrentPresented(skills/leaf/scripts/leaf/render-checks/runtime.js), andscripts/example-previews.py,scripts/record-demo.pyandscripts/verify_site.pyshoot ondata-lf-presentedalone, so each can still read or photograph a page whose deferred widget has not landed. That is the same missing wait at other readers, now one stage away from each; a gate change alters what a public command waits for and a preview change rewrites generated output, so neither is folded in here. The gate's ownpageSettledis a different fact — no finite animation still running — which is why the new one ispageArrived.