Repository navigation
Conversation
Behavior change: a page no longer holds presentation (and the keys pressed before it) until every embedded live sample's child page has presented. Each sample still starts loading as it mounts, but only a block sample whose frame resize on arrival would move what the reader sees (`growthIsSeen`) stays on the presentation path; a `window` sample, or a block sample below the window or scrolled past, is a counted deferred arrival, so `pageReadiness` reads `arrived` (and `wait_until_ready` waits) until it lands. `ready`, `showThread` and `lf-sample-ready` keep their per-sample meaning. The feature gallery, whose 13 samples all sit below the first screen, presented at 11.7-14.3 s on main under the shared host's load (past the bootstrap's 10 s key hold) and at 2.3-2.4 s with this change in the same runs; its samples finished at about the same time either way. The widget API now exports `deferredArrival`, the declaration alone for work already running, beside `afterPresentation`, so no widget route defers work without the page counting it, and `growthIsSeen` for the stability test. The contracts in assets/AGENTS.md, module-authoring.md, page-authoring.md, presentation.js and lf-sample.js say so. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/assets/runtime/widget-api.js # skills/leaf/references/module-authoring.md
…whole arrival Three behaviors change, each covered by a new test in test_render_startup.py that fails on the previous commit: - A block sample the reader scrolls to while it loads keeps its loading height when its child arrives, so what follows it stays put; the frame takes the child's height once that growth would move nothing seen. `heldGrowth` (thread/held-news.js, beside `HeldReading`) is the hold: it applies a size change at once before presentation, while reading is interrupted, or while the box's growth is unseen (`growthIsSeen`), and otherwise waits on `whenNone`. Resizes after Reset or Return to page are the reader's own and apply at once. - A sample's status line keeps one line's room through loading, ready and failure (flex basis rather than its words places it; a long failure ends in an ellipsis, its title holding it whole), so a narrow window sample's frame and what follows no longer jump when "Loading sample…" clears. - A sample's counted arrival is now its child's arrival, not its presentation: the child reports `arrived` once its own `whenArrived()` settles, so a page holding a sample whose child holds a delayed sample reads as arriving until the inner child arrives. `ready`, `showThread` and `lf-sample-ready` keep meaning the child presented. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/references/module-authoring.md
# Conflicts: # skills/leaf/assets/runtime/sample-child.js
# Conflicts: # skills/leaf/packages/default/widgets/lf-sample.js
# Conflicts: # skills/leaf/assets/AGENTS.md # skills/leaf/assets/runtime/sample-child.js # skills/leaf/packages/default/widgets/lf-sample.js # skills/leaf/references/page-authoring.md
… browser check each Two rules that kept drawing repair PRs were tested only in a browser, which runs on pushes to main rather than on the PR that breaks them. Both now run under `pnpm run test:runtime` on every PR, and the browser keeps one check that each is wired into the page. Key hints. `tests/runtime/hint-session.test.mjs` (14 tests) drives `createHintSession` over a scene of links the test states: narrowing, a missed letter, completing a code, Escape giving letters back, the Tab walk with its wrap and Enter, a stale code after the scene changes, a member leaving the document, a scroll holding the map and its end reading it again, arming while the page is in flight, resize, and character routes turned off. A scroll is the `scroll` and `scrollend` events arrivals.js hears, so no case waits on a clock; the session reads no clock itself, so its seam is unchanged. Removed from tests/browser/test_render_navigation.py: - test_generated_hints_refresh_to_the_visible_scene_after_scroll - test_inflight_native_paging_hides_hints_until_the_scene_settles (the `page.clock` test behind the recent flakes) - test_armed_hints_settle_after_resize Cut: test_generated_hints_branch_after_the_single_letter_alphabet keeps the go-to alphabet and the key line's progress faces, dropping the narrowing announcement, Escape and two-letter completion; and test_generated_hints_are_browsable_without_entering_the_paint_layer, now the session's one browser check (chips paint, Tab speaks, Enter acts), drops the second announcement and the Shift+Tab reversal. Banner sentences. The wording moves out of banner.js into activity-words.js, which reads and writes no document: `activityFacts`, `pageStatus` (the status for a served state, an unreachable server, a refused key or a broken reading), `statusModel` (that status beside the queues) and `leafRow` (the leaves drawer's row, from live-leaves.js). banner.js and live-leaves.js paint what it returns. `tests/runtime/activity-words.test.mjs` (14 tests) holds the sentence for every activity kind, observed step, pickup, silence, queue and publication, built from an activity record the server folds (`served_records.py`, `servedActivity`). Which activity a claim, its turn and their silence come to is the server's, now in tests/model/test_activity.py: - test_the_activity_a_claim_its_turn_and_their_silence_come_to replaces the nightly journey test_banner_reports_whether_anyone_is_attending (tests/journeys/test_render_startup.py), which asserted the same walk through sentences. - test_an_ended_pickup_keeps_the_invitation_the_agent_declared replaces tests/browser/test_render_startup.py's test_ended_pickup_preserves_the_declared_invitation_in_banner_and_leaves. test_a_workflow_and_the_banner_share_agent_activity becomes test_the_banner_and_the_leaves_row_say_the_served_activity, the one browser check that the served activity reaches the banner's row, disclosure and dot and the leaves row; test_a_thread_says_what_the_agent_is_doing_about_it keeps its workflow assertions and drops its five banner and leaves sentences. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…w found uncovered A hint walk begun with Shift+Tab heard the middle target of three rather than the last: `walk` stepped from -1, its "nothing heard" index, as though it were a position. Nothing heard, the walk now starts at whichever end it walks from. This fixes both callers, the Go-to sequence and the target picker. The new Node test `a walk begun with Shift+Tab starts at the last target and walks back` fails on the old step. The review of the previous commit found three gaps it had left: - `tests/runtime/go-to-keys.test.mjs` (2 tests) dispatches keys through the real Go-to sequence and dispatch.js. Unarmed, `e` reaches a page command on that letter. Armed, a letter no hint names is reported as a miss, the page command does not run, and the sequence stands. This holds the routing that the deleted browser test_generated_hints_refresh_to_the_visible_scene_after_scroll protected. The hint map is empty, since a hint's exposure check needs `elementFromPoint`, which the Node DOM cannot answer, but a stale letter takes the same claimed-alphabet route. - tests/model/test_activity.py: fresh page work keeps its own sentence beside a comment its turn has picked up, and test_newer_page_work_takes_the_activity_from_an_older_thread_start holds that a later start on the page's own task replaces a thread start in the page's activity while the thread keeps its workflow. These replace the banner assertions cut from test_a_workflow_and_the_banner_share_agent_activity and test_a_thread_says_what_the_agent_is_doing_about_it. - test_generated_hints_are_browsable_without_entering_the_paint_layer now asserts that every chip is visible, so a hidden hint layer fails it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…F_SHIFT_LEDGER The shift watch now runs a gate by default. It fails each source of Chrome's layout-shift entries unless the watch's own record of input owns the frame (a gesture's counted rendering, a typing session, a preparation's landing) or the runtime declares the move: first presentation, a hidden-tab return, a source inside a runtime `data-lf-reflow` text or controls region, or one carried down below an `append` region in its scrollport. Ownership never comes from Chrome's hadRecentInput, so typing through `fill` stays owned and a script's move inside the half-second window still fails. Typing reads only the field and its control, region, media and painted ancestors. A source Chrome leaves unnamed, as it leaves every shadow-tree node, is named by the shadow node whose box matches. A gate failure says to rerun with LEAF_SHIFT_LEDGER=1, which runs the full ledger as before; the watch's own test modules run the ledger through the `shift_ledger` marker, and `test_render_shift_gate.py` covers the gate. Behavior changes: the presentation exemption now covers the paint of the second frame after `data-lf-presented`, judged by that frame's start, which the ledger already exempted through its callback order. The two mirrored-draft cases of `test_native_reply_edits_after_semantic_paint_keep_the_first_line` run the ledger: CodeMirror keeps the last line's box and moves the first line's words into it, which Chrome reports as an 84px move although no words move. Measured on 13 interaction-heavy browser tests, run serially three times per mode on a loaded host: 24.5s with the ledger, 21.5s with the gate (12% wall). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…put, and open a long sample failure Three behaviors change, each covered by a new test in test_render_startup.py that fails on the previous commit: - A sample counts each document its frame loads, not only the first. Reset and a child's reload now begin a counted arrival (`#arrive` in lf-sample.js, called from `#track`), so `pageReadiness` reads `arrived` while the replacement document or the samples inside it are still on their way, where it read ready. A departure lands the departed document's arrival, so leaving for a page outside Leaf before an inner sample arrives no longer leaves readiness stuck at `arrived`. A reload's document is counted from when it connects: the parent cannot tell its departure from one to a page outside Leaf, whose load can land before the departure's notice (test_a_sample_counts_each_document_its_frame_loads). - A block frame held at its loading height while the reader looks at it takes its child's height once the reader presses, types or wheels inside the child, which now reports that input to the containing page (`input`, sample-child.js), or once the tab is hidden: `heldGrowth` (thread/held-news.js) applies a waiting change when the reading breaks (`onReadingInterrupted`, reading-continuity.js). Input inside the child also ends the hold for the rest of that load, so a disclosure the reader opens in a still-arriving child grows the frame at once. Before, the frame kept 512 px over a 1,250 px child through presses, scrolls and a hidden tab, clipping its foot (test_a_held_sample_takes_its_height_on_input_or_a_hidden_tab). `heldGrowth`'s stop is now idempotent; a second call after its watch fired could throw in `whenNone`'s teardown. - A failure stands in a native disclosure in the status line: its summary keeps the row's size, ending in an ellipsis where the words run past it, and the reader opens it by Tab and Enter or by a tap to read it whole. It replaces a `title` only a mouse could reach. The status reserves the pressable floor (`--aim-floor`) from loading on, so a failure's control moves nothing, and wears the status's face rather than the page's details (test_a_long_sample_failure_keeps_its_row_and_opens_by_key_or_tap). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…en a failure over the frame Three behaviors change, from Codex's review of the previous commit; each case of test_render_startup.py named below fails on that commit: - A sample's child that has arrived and begins arriving again, as when one of its own samples is Reset, now tells its containing page (`arriving`, sample-child.js, on `whenArriving` in presentation.js), which counts it as arriving until the child reports arrival again. Before, the child sent `arrived` once per document, so the top page read ready while the inner sample's replacement loaded (test_a_sample_counts_each_document_its_frame_loads[inner-reset]). - Input inside a sample releases the resize held at that moment and no longer ends the hold for the rest of the load: growth the child makes later while still arriving waits as before, since nothing tells the page whether the reader's input caused it. Before, one press let later passive growth move what followed by 200 px. - An opened failure disclosure wraps its words over the top of the frame, out of the row's flow, so the row keeps its size open or shut. Before, opening it at a desktop pointer grew the row by 8 px and moved the frame; the touch floor hid that, so the test now runs with each pointer and checks the frame after opening (test_a_long_sample_failure_keeps_its_row_and_opens_by_key_or_tap[mouse]). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…s in both modes Review found the gate's exemptions read only where a source is now. Each frame now keeps the declared regions' boxes, a `text` region's controls and an `append` region's scrollport and children, and every exemption compares the source's place before and after with them: - a `text` or `controls` region exempts a source only when the region stands and holds the source at both places (a label moved 400px into a region now fails); every `text` region's controls must stand, whether or not Chrome names them; - an `append` region exempts what follows it only when it grew, by at least the move, with its start, earlier children and scrollport standing (a reply whose margin grew under an unchanged transcript now fails); - a source whose words, controls or media arrived since the previous paint carried nothing the reader saw, so a box an editor reuses for words it moves in no longer fails; the two mirrored-draft cases run the gate again; - typing credits its holders' native placement as the ledger does: an anchored holder's anchor travel, a sticky holder's scroll, an effect already moving one (a fixed field following its anchor while typing no longer fails). The first-presentation exemption, in both modes, now ends when the second frame's callbacks run rather than at that frame's timestamp. Long tasks had delayed the presenting frame's paint past the next frame's timestamp, which is why a reply row the page painted while presenting read as moving after it. The earlier inclusive frame-start exemption is gone, so a move in the frame after presentation fails again. The watch's region, append, sticky, anchor and typing cases run in both modes, with Codex's probes added. Seventeen gate cases fail strictly as known gaps, each with its reason: what Chrome does not name (a box moving further than the container it names, a control past its five sources outside any `text` region, a reparented control) and an effect a press began outliving its rendering. The animation and floating-surface families stay ledger-only, since the gate does not model those credits. Measured on the same 13 interaction-heavy browser tests, serially, three runs per mode: 23.6s with the ledger, 21.2s with the gate (10% wall). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Behavior change: while a sample's child is still arriving, growth the reader's own input causes in it, such as a disclosure they open by a press or a key, now grows the frame at once. Before, the input released only the resize held at that moment, and the disclosure's growth, which the child reports after the input notice, waited clipped until the sample left view or the reader gave input again. Growth the child makes of its own accord in the same load still waits while the reader would see it. The child marks each height its gesture's rendering produced: each trusted press, activation, key or wheel opens a gesture that lasts until the rendering it set going settles (`afterSettling`, a waiter on rendering.js's settled reading: a counted update after the input, then a quiet one), and `measure` sends `gesture: true` meanwhile. lf-sample.js applies a height so marked as one the reader asked for. Activation (`click`, `keyup`) is input of its own, since a click lands after the press that began it has settled. Test: test_a_held_sample_grows_for_what_the_readers_gesture_opens[click|key], which fails on the previous commit. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Behavior change: `afterSettling` (rendering.js) now waits for the whole settled reading, no finite preparation waiting as well as a quiet update, so a sample's child keeps marking the heights its reader's gesture caused until a widget preparation that gesture began has landed, as when a disclosure opens a diff whose grammar loads later. Before, the gesture ended at the first quiet update and the frame held the prepared content clipped. A preparation's release unsettles the reading, so the check after it drains the waiters. Test: tests/runtime/rendering.test.mjs, "work waiting on settling waits for an update after it and every preparation", which fails on the previous commit. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…owe a release its update
Two behaviors change in rendering.js, each covered by a new case in
tests/runtime/rendering.test.mjs that fails on the previous commit:
- `afterSettling` waits only for the finite preparations begun since it was asked, not
for every one pending: a preparation already waiting, such as a diff's grammar
loading before the reader pressed anything, is someone else's. Before, it kept a
sample's gesture open, so passive growth in the child grew the frame for as long
as that preparation took ("a preparation waiting before the ask is not the
asker's").
- A preparation released after an update ran but before that update's settled check
now owes another update, as the module header already promised ("release requires
a final quiet update"). Before, that check read the page settled at once, before
the preparation's commit was laid out or observed, for `renderingState` readers and
`afterSettling` alike ("a preparation released between an update and its check owes
another update").
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The banner's wording lives in activity-words.js on this branch, so main's cutover from Questions/Tasks to On me/On <agent> (#2783) lands there: the queues read `on_user`/`on_agent`, the row's count reads "On <agent>: N" with a long name cut to fit, and a lone pickup reads "the comment"/"the answer". The Node test and the model test follow, and the Node test now holds the cut name. banner.js keeps this branch's painter with main's other edits. The browser and journey banner assertions main reworded stay deleted; their wording is the Node test's, and the agent name main changed is test_claims.py's. The harness keeps the shift watch's mode with main's compiled-kernel entries. Main stopped exporting presentation.js's `deferredArrival`, which had no caller there; this branch's widget-api.js re-exports it for lf-sample.js, so it is exported again. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
banner.js: main (#2798) replaced watchSemantic with applicationState and readPart, and the branch had moved itemNoun's use into activity-words.js, so the import takes main's semantic-state names and drops queues.js. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
cf01889 and dbf291d made Chrome's layout-shift entries the default judge of the Stability rule and moved the ledger behind LEAF_SHIFT_LEDGER. Measured, the gate saved 27-39% on watched typing-heavy and multi-frame tests and 11% on ordinary ones, but only the ~785 watched tests outside the watch's own run it, so CI barely saw it. It also missed moves the ledger catches (a box moving further than the container Chrome names, a control beyond Chrome's five sources) and failed moves the ledger allows (input-started animations, floating surfaces, translate slides). The watched tests are the suite's one place Stability is enforced, so they keep the ledger. Every file the gate touched returns to main's version. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…visiting The Chrome-entries gate was built, measured and dropped on this branch, so the measurements, the reasons it was dropped, the conditions for revisiting it, and two open findings (the watch can't judge the feature gallery; most browser tests run unwatched) go in a note, linked from TODO's test-burden theme. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The branch's new tests repeated mechanisms across cases and opened the same page several times. The sample browser selection (`-k "sample or banner"`) goes from 16 in-scope cases to 5: the in-scope call time from 26.1s to 8.2s, and the whole selection from 20.8s wall / 29.0s user CPU to 8.6s / 10.8s on two workers. Each surviving test was mutation-checked against the fix it holds. Browser (tests/browser/test_render_startup.py): - test_a_sample_the_reader_would_see_arrive_holds_presentation keeps the [on-screen] case of test_a_sample_holds_presentation_only_where_its_arrival_ would_be_seen. Its [below] case is folded into the next test, which already presents with a held sample below the window and now also reads `arrived`. - test_a_sample_reached_while_loading_holds_growth_the_reader_did_not_cause folds test_a_sample_reached_while_loading_resizes_once_it_is_out_of_sight, test_a_held_sample_takes_its_height_on_input_or_a_hidden_tab[press|hidden] and test_a_held_sample_grows_for_what_the_readers_gesture_opens[click] into one opening, with the inner sample held so the child is arriving throughout: the frame keeps its loading height and what follows stays put; a disclosure the reader opens grows it at once; passive growth waits until a press inside the child, the frame leaving sight, or a hidden tab, each released in turn. Cut [key]: Enter on a summary takes the same trusted keydown/click listener as the press. - test_a_narrow_window_samples_status_keeps_its_row_as_it_arrives_or_fails folds test_a_window_samples_controls_keep_their_room_as_it_arrives and test_a_long_sample_failure_keeps_its_row_and_opens_by_key_or_tap[mouse] (Codex's open-failure-in-flow case) into one page with one sample that arrives and one that fails: neither row moves its frame or what follows, and the failure opens by Tab and Enter and by a press. Cut [touch]: the coarse pointer only raises the same min-height to the touch floor, which hides the growth the mouse case catches, and a tap opens a native summary as a click does. `held_sample_page` now fails a named sample through its allocation rather than failing every held document. - test_a_sample_counts_each_document_its_frame_loads walks one page through what its four cases and test_a_page_arrives_only_once_the_samples_inside_ its_samples_have each opened a page for: a nested sample's inner arrival, a departure landing its count, Reset, and Codex's Reset inside the child. Cut [reload]: it reaches the same `#track` count as Reset. Node and model: - activity-words: cut the dot-tone table test, the observed-kind word loop, and the queued and Codex variants of the working sentence, which restate string tables other cases already read through. - hint-session: arming, narrowing and a missed letter are one test, since each started from the same armed map. The Shift+Tab-first walk stays. - go-to-keys: the unarmed control and the armed miss are one test. - rendering: the two `afterSettling` preparation cases are one, holding both sides of the since-the-ask boundary; the settled-reading race stays. - test_activity: cut the observed-kind loop; the server passes the kind through unread. The coexistence cases stay. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The listener destructured `detail` from a plain Event, which the runtime typecheck (tsconfig.runtime.json) refuses. The module's own readingIsContinuous() already holds the answer the event carried. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
reviewed
Oct 14, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
The renewed nested-sample arrival path can move content while the reader is looking at it.
…'s inputs from focus.js A Reset inside an arrived sample's child began a new arrival count but left the frame's resize hold off, so growth the reader didn't cause moved what follows the frame by 300 px while the new document waited (tend review). The renewed arrival now holds it as the first did; the new test_a_sample_arriving_again_holds_growth_the_reader_did_not_cause fails without the fix. The child counted the reader's inputs with its own keydown listener, beside the document's one reading of them (focus.js onUserInput), which test_the_register_is_the_only_way_a_key_enters_the_runtime refuses. It now observes onUserInput, plus click for activation. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 14, 2026
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.
This lands two outcomes of a survey of Leaf's test cost.
Two often-repaired rules get Node tests. Browser tests run only on pushes to main, so a rule tested only in a browser breaks main instead of failing the PR that broke it.
banner.jsintoactivity-words.js, which never touches the DOM.banner.jsandlive-leaves.jspaint what it returns. Node tests cover the sentences, and model tests cover which activity the server derives.createHintSessiongets Node tests, plus a test through the real key dispatch. Writing them found a bug, fixed here: on a three-target map, the first Shift+Tab chose the middle target instead of the last.page.clockhint test behind three flakes, one nightly journey and several browser assertions go.A page presents without waiting for samples the reader wouldn't see arrive.
lf-sampleheld its page's presentation until the child page started. The feature gallery accepted keys at 6–28 s, and keys pressed in the first 10 s were dropped. Now it accepts keys at about 2 s.growthIsSeen). Other samples count throughdeferredArrival, sopageReadinessstill waits for them.heldGrowth). It takes its real height on the reader's input inside it, when rendering their gesture started lands (afterSettlinginrendering.js), or when the tab is hidden.<details>over the frame, by keyboard or pointer, so the row keeps its size.rendering.jsfixes a race: a preparation released between an update and its settle check let the page read as settled too early. That affects every reader of the settled reading.Also:
notes/shift-watch-cost.mdrecords what the Stability sensor costs, and why a cheaper gate built from Chrome's layout-shift entries was measured and not landed.One known gap is left: content a script deferred before the reader's click, and which that click reveals, stays held until the reader scrolls away or gives input again. Closing it needs tracking which work an input caused.