Skip to content

Add a stills script that screenshots UI states on base and HEAD - #1341

Merged
max-sixty merged 2 commits into
mainfrom
bug-origin
Sep 27, 2026
Merged

max-sixty merged 2 commits into
mainfrom
bug-origin

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Agents proving a visible change wrote their own Playwright screenshot script each time: 140 throwaway scripts across 43 Leaf sessions and subagents in two weeks. The session behind #1303 took none, and a padding change there covered the focus ring of a keyboard-opened margin card until #1329 fixed it. uv run scripts/stills.py [BASE_REF] replaces those scripts with one opt-in command, about three minutes unattended. Nothing gates on it.

It screenshots a fixed catalogue of 15 states on the merge base's runtime and HEAD's, each built by that arm's launcher from this checkout's example source and served by that arm's leaf server run --temporary. The catalogue covers states a user reaches by acting as well as pages at rest: a margin card opened by pointer and by keyboard, a reply being drafted, the Threads panel, a comment being composed, a board card grabbed, a focused code block, with some repeated at 900px and in dark mode. Each state that changed is cropped to a before/after pair plus a diff under .tmp/stills/, with an index.html listing changed and failed states first.

A state counts as changed when any pixel differs: with the same runtime on both arms every state captures pixel-identically, so no noise threshold is needed. Run against the commit before #1329, it flags exactly the two ring regressions that PR fixed, plus the Threads panel's "Generating title" placeholder from #1330.

  • scripts/stills.py: the catalogue (STATES), the input that reaches each state, and the pixel diff.
  • scripts/eval_harness.py: serving (start an arm's temporary server and yield its address) and merge_base, moved out of bench_page_latency.py so both scripts share them.
  • /developing-leaf "Prove and hand off a visible change" and skills/leaf/assets/AGENTS.md "Render gates" name the script as the way to get the before/after pair, and say to add a missing state to STATES rather than drive it by hand.

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

🤖 Generated with Claude Code

max-sixty and others added 2 commits September 27, 2026 12:40
`scripts/stills.py [BASE_REF]` builds base and HEAD arms the way the benchmarks
do, serves three examples on each, drives a catalogue of states from a fresh
tab, and screenshots the viewport. A state that differs by any pixel is cropped
to the changed region, with the changed pixels marked, under `.tmp/stills/`.
The catalogue has 15 states, including ones reached by input: a margin card
opened by pointer or by keyboard, a reply being drafted, the Threads panel, a
comment composer, a board card grabbed, and a focused code block. Some are
repeated at 900px wide or in dark mode.

Run against 64186bc, the commit before #1329, it flags exactly the two ring
defects #1329 fixed, plus the Threads panel's new "Generating title"
placeholder from main. Run against the merge base, where only scripts differ,
all 15 states are identical pixel for pixel, so the script counts any differing
pixel with no noise threshold. A run takes about three minutes.

The benchmark's server start and its merge-base default move into
`eval_harness` (`serving`, `merge_base`), which the new script and
`bench_page_latency.py` share. `profile_page.py`, which serves through the
benchmark, still runs.

`/developing-leaf`'s proof section and `skills/leaf/assets/AGENTS.md` name the
script as the way to take the before/after pair, and say to add a state to
`STATES` rather than driving one by hand.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 58838ca into main Sep 27, 2026
5 checks passed
@max-sixty
max-sixty deleted the bug-origin branch September 27, 2026 20:33
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