Skip to content

Give the page one readiness reading, and wait on it from every Python reader - #1250

Merged
max-sixty merged 1 commit into
mainfrom
readiness-one-reading
Sep 27, 2026
Merged

max-sixty merged 1 commit into
mainfrom
readiness-one-reading

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

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

… reader

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.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit ab3c7fb into main Sep 27, 2026
5 checks passed
@max-sixty
max-sixty deleted the readiness-one-reading branch September 27, 2026 00:02
max-sixty added a commit that referenced this pull request Sep 27, 2026
The concept survey's drifted duplicates now each have one owner
(#1214–#1221, #1223, #1228, #1231, #1235, #1244, #1245, #1247, #1250,
#1251, #1254, #1260), so the survey note never lands. What it found and
nobody has taken becomes `TODO.md` entries:

- **Shared definitions** (new section under Next): re-addressing
resource references in one pass instead of `http.py`'s regex scopers and
three head composers; `tests/render_harness.py` `told()` beside
`pageReadiness`'s `data` and `log` stages (#1250), which answer the same
question; Python still naming a thread's identity a root
(`thread_roots`, `FrozenThreadReading.roots`) now that the runtime keys
threads on the served `id` (#1260).
- **Requests**: the existing "Decide whether requests earn their weight"
entry now says kept requests need one owner for seat availability, which
four runtime modules restate.
- **Implementation candidates**: the unresolved-gesture ledger as one
state machine, deferred until a change has to touch it, since nothing
there has drifted and it is the hottest race path.

The survey's small undrifted items and its list of deliberate splits are
dropped: none has drifted, and the splits are intended.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty pushed a commit that referenced this pull request Sep 27, 2026
The nightly navigation test installed a browser clock at zero, let it
advance, then asked Playwright to pause at zero. The paging test now
pauses beyond the clock's current time. It uses controlled time to
inspect the brief interval before the hint map settles after native
PageDown; the resize test only needs the final visible result and now
waits for that without a clock.

The run's other failure was a demo recording timeout while waiting for a
margin thread. [PR #1250](#1250)
subsequently changed the recording to wait for complete page readiness;
the demo test passed locally on current main with the installed
Playwright browser.

Verification: the two focused navigation tests pass locally. The prior
run also passed `test_demo_recording_drives_the_browser_journey`
locally. A delayed clock setup reproduced Playwright's `Cannot
fast-forward to the past` error before this change.

---------

Co-authored-by: leaf-agent <[email protected]>
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