Repository navigation
Add a catalog example that checks a fix against two recordings - #2929
Merged
Merged
Conversation
The new review-a-fix example puts lf-trace-compare on a real task: the same Playwright journey (write a page comment, paste a screenshot, open its preview, press Escape) recorded on Leaf with #2882's fix reverted and on Leaf with it. Three keyed moments pair the recordings, so choosing one in either moves the other to its own capture of that step; at "Back from the preview" the before recording shows the comment gone and the after recording shows it back with focus on its thumbnail. A ship-or-hold ask and the cause follow. Exercising lf-trace-compare by pointer, keyboard and touch confirmed the pairing works as its registry entry says. One defect: a recording wrapped in a figure kept its margins while hidden, so choosing After moved the shown recording down by them and left a blank band below the workspace for the sticky chooser to hang over. Every view, and a recording inside one, now takes no block margin in the workspace; test_trace_comparison_shows_each_wrapped_recording_in_one_place fails without it. The two imported trace manifests are about 600 KB each, mostly saved accessibility trees, which is too large for the tree and for the generated corpus data. They are published to leaf-assets beside their archives under examples/traces/, and a `$captures` entry now takes `asset` in place of `file` to read a pinned file, with `"format": "json"` to parse it. The corpus keeps the capture as a reference. Recorded with `leaf-dev probe release-notes --base=<HEAD plus a revert of 4e74362> --viewport 960x600 --record DIR --checkpoint-images --journey <journey>`, imported with the playwright package's import_trace.py. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
previously approved these changes
Oct 15, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 15, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 15, 2026
…on (#3009) Every `/api/state` read and every `/api/event` answer carried each data source's whole value, though data moves only when an agent sets it. Since #2929 added two Playwright trace manifests (~650 KB each, mostly saved accessibility trees) to the corpus example, a comment there carried 1.4 MB back in its event answer, and again in the state read that often follows: 1.5–3 MB per comment. A state request or event POST now names the data version the tab holds in `Leaf-Data-Version`. When the answer's data is still that version, `page_state` (`http.py`) sends `data: {version}` without sources, and the reader restores them from the reading its request named (`completeData` in `layer-client.js`, used by `state-feed.js` and `delivery.js`), so the reading stays exact if another answer moved the tab's data meanwhile. A request naming no version (the first read, website publications, exports, older vendored pages) still gets every source, so no protocol bump. **Why this is for your review:** it adds a wire mechanism, and it didn't move local timings: bytes per corpus comment fell from ~2.2 MB to ~140 KB, but painted and Sent stayed within noise, since the main-thread cost is applying the state, not transferring it. Its gain is on leaf.page, where the bytes cross a network. The alternative is to defer the trace manifests' `phases` through the existing `records.deferred` mechanism (as the diff package defers `patch`), which would also take ~1.2 MB off the corpus's first state read, but changes `lf-trace` to fetch accessibility trees on demand. Codex's review found no correctness defects (every answer reader restores or gets full data; state answers are `no-store`), and noted the server still reads and hashes the sources each answer. Also: `bench-latency`'s `results.json` now records each request a benched transition caused (URL, initiator, bytes), which is how the bytes were found. Checks: `pnpm run test:runtime`, `pnpm run check:framework`, a new runtime test ("a read keeps the data it named…") and a server assertion, each failing with its half of the fix removed. > _This was written by Claude Code on behalf of max-sixty_ --------- 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.
The new
review-a-fixexample putslf-trace-compareto work on a real task. It holds one Playwright journey recorded twice: write a page comment, paste a screenshot, open its preview, press Escape. The first recording runs on Leaf with #2882's fix reverted, the second on Leaf with it. Three keyed moments pair the two recordings, so choosing a moment in either moves the other to its own capture of that step. At "Back from the preview" they differ: before the fix the comment is gone, and after it the comment is back with focus on its thumbnail. A ship-or-hold ask and the cause follow.lf-trace-compare check
I exercised the fixture by pointer, keyboard (arrow keys on the chooser, Enter on a moment) and touch. Pairing works as the registry describes, including a peer that is hidden or was moved by hand. I found one defect: a recording wrapped in a
<figure>kept its margins while hidden. Choosing After then moved the shown recording down by those margins, and the sticky chooser hung over a blank band below the workspace. The fix is in the playwrighttheme.css: every view, and a recording inside one, now takes no block margin in the workspace.test_trace_comparison_shows_each_wrapped_recording_in_one_placefails without it.Large trace manifests live in leaf-assets
Each imported manifest is about 600 KB, mostly saved accessibility trees, which is too large for the tree and for
examples/corpus.data.json. Both manifests are published tomax-sixty/leaf-assetsunderexamples/traces/, beside their archives and the trace media. A$capturesentry now acceptsassetin place offileto read a pinned file, and"format": "json"to parse it (dev/leaf_dev/example_data.py,capture_file). The corpus keeps the capture as a reference.wt refresh-previewsadded the catalog still and moved the pin.