Skip to content

Add a catalog example that checks a fix against two recordings - #2929

Merged
max-sixty merged 3 commits into
mainfrom
agent-a9dc9ab5073a71051
Oct 15, 2026
Merged

max-sixty merged 3 commits into
mainfrom
agent-a9dc9ab5073a71051

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The new review-a-fix example puts lf-trace-compare to 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 playwright theme.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_place fails 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 to max-sixty/leaf-assets under examples/traces/, beside their archives and the trace media. A $captures entry now accepts asset in place of file to 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-previews added the catalog still and moved the pin.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits October 14, 2026 19:17
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
leaf-agent previously approved these changes Oct 15, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 7ff67d0 into main Oct 15, 2026
3 checks passed
@max-sixty
max-sixty deleted the agent-a9dc9ab5073a71051 branch October 15, 2026 02:46
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]>
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