Skip to content

Have leaf-dev stills report the edge and ring faults a change adds - #7366

Merged
max-sixty merged 13 commits into
mainfrom
agent-a74cda9609acf5293
Nov 27, 2026
Merged

max-sixty merged 13 commits into
mainfrom
agent-a74cda9609acf5293

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

leaf-dev stills now reads two kinds of geometry fault on both versions of each state it compares, and lists each fault the change adds. Faults both versions share stay out of the report. Max asked for this after a thread card's unread dot came back touching the card's edge: browser/AGENTS.md already forbids that, but until now nothing checked it, and each break was found by eye.

  • Edges (dev/leaf_dev/geometry.js), in any engine: a box Leaf draws that nearly touches its frame's edge, crosses it, or is cut by it, and a round mark closer to the edge than --lf-clear (4px). The floating panel and the margin card draw their outline and rounded corners on a separate layer behind them (.lf-box-ground), so the reading takes their edge from that layer. A box's corner is read against every clip around it, the frame and any box between, so a rounded clip nearer than the frame rounds it too. It reads three cases from what the page itself declares, with no rule written for any one widget, and leaves them out:
    • parts of a Web Awesome component, which keep the library's look;
    • thumbs: anything inside a slider or scrollbar role, or moved by a scroll timeline;
    • marks inside a drawing (--lf-drawing).
  • Rings (dev/leaf_dev/rings.py), in Chromium only: a focus ring that a clip cuts or another box covers. This is the reading the ring tests already use. It moves out of tests/render_cases_layout.py and tests/page_scripts/ into leaf_dev, so the tests and stills call one implementation. In Firefox, its pixel check reported 4 rings on main as unpainted along one edge, and a Firefox screenshot of one of them shows that edge painted. So stills reads rings in Chromium only.

Caught at the commit before each fix, gone at the fix:

Not caught: #6672 (an alignment pass), and a reading of Leaf's boxes overlapping each other, which I built, measured and left out:

Findings on main, all 334 states:

  • Edges: 13 findings from 4 causes, the same in Chromium and Firefox. Chromium adds 2 more from a 5th cause, in a state that holds the runtime back, which Firefox can't open. All are real breaks of the rule; there were no false alarms.
  • Rings: 2 findings in Chromium, both false. In each, an overlay scrollbar covers the ring's edge; the stills browser keeps scrollbars visible on purpose.
  • Since stills reports only faults a change adds, none of these show in an ordinary run.
  • Cost: the reading adds a median of 0.1 s per side of each state (0.3 s at p90, 1.3 s at most), next to about 5 s to open that side.

The live edge breaches, and whether Max chose them (from git log -S/-L; this PR fixes none of them):

Guidance:

  • browser/AGENTS.md now says a round mark stands clear by --lf-clear and never touches an edge. The old wording said a dot keeps its corners "wherever it stands". Scored with Opus, 3 runs per arm: the old wording called a dot touching the edge a break 0 of 3 times, the new wording 3 of 3. A thumb, and a field meeting its frame's edge, scored the same under both.
  • /developing-leaf now says stills lists the faults a change adds, and that a change hands over none it can fix. Both versions led the model to fix the dot before handing over, 3 of 3. Without the sentence it misread the fault lines as style changes.

Catalogue states: a separate commit repairs 11 states that failed on main, most after a 2-minute timeout, which cost every stills run that time. plan-panel-dictating and table-scrolled-sideways now fail in Firefox within 5 s and say why, because Firefox has no surface for them.

Size:

  • tooling: +922 / −7, about 280 of it moved from the tests
  • tests: +48 / −354
  • catalogue states: +80 / −39
  • docs: +8 / −4
  • lint config: +11 / −5

Tests: these ring-helper tests pass, run by node id:

  • test_panes::test_a_pane_bodys_ring_is_drawn_whole_against_the_workspace_edges
  • test_rings::test_the_focus_sweep_distinguishes_stops_inside_a_live_frame
  • test_threads::test_the_thread_walk_stops_at_each_unsent_comment
  • test_card_reply::test_next_on_me_rings_the_options_a_card_message_asks_with_whole
  • test_focus::test_the_keys_into_and_out_of_a_panel_thread_land_where_keys_act

All 5,721 browser and journey tests collect. ruff, ty, eslint, oxfmt, vulture, typos and knip pass.

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

…neither meet their frame's edge nor stand clear of it

A prototype of a standing check for browser/AGENTS.md's "A box inside a
frame either meets its edge or stands clear of it", built to measure
whether such a check would end reports like the unread dot touching a
thread card's border (#7138), and at what cost.

`leaf-dev edges` visits each state of `leaf_dev.states` through the loop
stills and probe share, and `edges.js` reads the settled tab: each box
Leaf draws (chrome, a widget's controls and shadow parts, or an `lf-`
name no idiom gives an author) whose own edge shows, the nearest box
around it, and the clearance on each side both show, around the arc at a
rounded corner. It reports a box nearly meeting the edge (under
`--lf-clear`), a round mark closer than `--lf-clear`, a box crossing the
edge, a box a clip cuts by a pixel or more, and a box meeting a straight
run of the edge with a rounded corner; a mark centred on the edge, such
as a count on a control's corner, is kept apart. A floating box's outline
is the one its surface draws (dom/box-motion.js). With `--base`, it lists
what each state gains and loses on the head.

Run at 343d060, before #7138, it flags the dot in both Chromium and
Firefox: 0px from the card's border and cut 1px by the transcript. Run on
the trees before and at #6773, the dot's two findings are the only
difference, so a base-and-head run would have named the regression before
it landed.

> _This was written by Claude Code on behalf of max-sixty_
…s, rings and overlaps

Each arm's tab of a state is now read for three kinds of fault beside its
stills and styles (`leaf_dev.geometry`), and a state whose head adds a
fault the base lacks counts as changed, with each added fault listed:

- edges (`geometry.js`): a box Leaf draws that nearly meets its frame's
  edge, crosses it or is cut by it, and a round mark closer than
  `--lf-clear`, the rule browser/AGENTS.md states. A floating box's
  outline and rounding are read from the surface that draws them
  (`.lf-box-ground`), a library component's own parts and what it places
  through its slots keep the library's look, and a thumb (inside a slider
  or scrollbar, or moved by a scroll timeline) and a drawing's marks are
  not read.
- rings (`rings.py`): a focus ring a clip cuts or a box covers. The
  reading the ring tests use moves from tests/render_cases_layout.py and
  tests/page_scripts into leaf_dev, with `focus_rings.js` and
  `control_name.js`, so the tests and stills call one implementation; the
  page-function loader moves into `leaf_dev.browser.page_function`, which
  tests/browser_sources.py calls. Outside Chromium no rule is named and a
  ring on a pseudo-element goes unmeasured.
- overlaps (`geometry.js`): two of Leaf's innermost boxes on one surface
  whose shown parts cross by two pixels or more each way.

The separate `leaf-dev edges` prototype goes, since stills now carries
its reading. browser/AGENTS.md now says a round mark stands clear by
`--lf-clear` and never touches an edge, and /developing-leaf says stills
lists the faults a change adds and that a change hands over none it can
fix.

> _This was written by Claude Code on behalf of max-sixty_
…t once that Firefox has none

Each state below failed on main, most after Playwright's 120 s wait, so a
`leaf-dev stills` run spent minutes on them and compared none of their
surfaces. In each, the product had changed under the driver, or the
surface doesn't exist in one engine. Every state now opens in Chromium
and Firefox as its docstring describes, except two that Firefox has no
surface for, which now fail there within seconds and say why.

- summary-card, summary-card-opened, summary-panel: a summary event
  must carry the agent's voice, and a checkout's launcher acts for an
  agent session only where that session's hooks run it
  (`state.runs_session`). `LEAF_SESSION_ID` alone no longer gave the
  summary a voice, so the log refused it ("'agent' is a required
  property"). `ServedPage.leaf(session=...)` now records that the
  session's hooks run the arm, as its first hook would
  (`leases.mark_root`), and runs the command as that session;
  `as_agent(..., voiced=True)` is the drivers' way in.
- floating-thread-retitled: the seeded thread now carries a title of its
  own (#7241), so rewriting its opening message no longer renames it.
  The agent now renames it short with `thread edit --title`, voiced,
  since a title carries the agent's voice too, before the thread opens.
- dial-keyboard, dial-press: each depth now also shows its reading time
  ("Skim 1 min", #6612), so no element's text is the bare word.
  `dial_depth` finds a depth by its radio role and name.
- walkthrough-path-keyboard: a diff row no longer marks a cut path with
  `data-lf-path-cut` (#5629), and a row's preview shows only where a Tab
  moves focus to it. The driver names a path a phone's row cuts, reaches
  its row by Shift+Tab then Tab, and waits for the preview to say the
  whole path.
- triage-moved-touch: the Move to buttons show only under a coarse
  pointer, and a mouse click there left Chromium's hover off the element
  now under the pointer, so `settle` timed out waiting for it to catch
  up. The driver taps the button, as a phone's user does, which leaves
  no mouse resting on the page.
- triage-composer-send-focused (Firefox): Firefox draws focus a script
  places after a Tab without the keyboard's ring, so Send never matched
  `:focus-visible`. The driver focuses Send with `focusVisible: true`,
  as dial-keyboard already does.
- plan-panel-dictating (Firefox): Firefox has no speech recognition, so
  its fields offer no Dictate. The state now says so at once there, as a
  hover state does under a finger.
- table-scrolled-sideways (Firefox): Firefox wraps the vendor table's
  last column at 94 px where Chromium needs 193 px, so at a phone's
  width the table overflows by 2 px, which the runtime reads as nothing
  to scroll. The driver now waits for the table's scroll to settle and
  reads the runtime's `data-lf-more-before` once, failing with that
  reason where it is absent rather than waiting 120 s for it.

Each state ran alone under `leaf-dev probe --state NAME` in Chromium and
Firefox: all pass in Chromium; in Firefox all pass but
plan-panel-dictating and table-scrolled-sideways, which fail in about
5 s with the reasons above.

> _This was written by Claude Code on behalf of max-sixty_
…s on main is deliberate

Run over the whole catalogue on main, the reading of two of Leaf's boxes
crossing found no defect and ten or more pairs that cross on purpose: a
picture's removal mark and a drawing's undo on their corners, Copy over its
code block, a trace's input badge over its frame, a timeline's marks over
its gridlines and playhead. At the parents of the fixes it was built for,
it flagged #6336's count over the folded leaf's error dot only on a page
built as #6336's test builds it, saw the fold mark over a draft's picture
(#6830) cross by a single pixel, which a seam also does, and can't see
#6615's list markers, which have no box. So stills reads edges and rings
only, and geometry.py's header records the rejected reading.

The reading also drops its fallbacks for runtimes that export no
`inChrome`, `uiInside` or `shownBand`, which only the historical runs
needed.

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

> _This was written by Claude Code on behalf of max-sixty_
…s entry module still compares its edges

A state that holds the runtime's entry module (`State.activated`) has no rendering reading to wait for, so reading its rings failed the state; it now reads its edges alone. screenshot-startup and worktree-startup open again.

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

Run over the whole catalogue on main in Firefox, the ring reading reported
four rings unpainted at an edge (trace-timeline-keyboard,
walkthrough-diff-comment, release-draft-long, ideas-ask), and a Firefox
screenshot of ideas-ask shows that ring's bottom edge painted where the
reading said it wasn't. The reading's pixel check was built on Chromium,
so stills now reads rings there only, and rings.py loses the branch that
read them without the protocol.

> _This was written by Claude Code on behalf of max-sixty_
leaf-agent
leaf-agent previously approved these changes Nov 27, 2026
A box whose corner centre stood within the 0.5px slack of the frame's corner centre, but on the edge's side of it, was read as standing in the arc and measured from the circle point on the far side, so a count 4.0px clear of both edges read as 2.8px. Such a box is now measured from the straight edge beside the arc, which is its nearest edge.
leaf-agent
leaf-agent previously approved these changes Nov 27, 2026
…he frame rounds it too

The edge reading credited a rounding clip only on the frame or a box around
the frame, so a box whose corner a clip between it and its frame rounds read
as overhanging the frame's arc. On #7373's 0b856aa055, where the panel card
no longer clips and its open view clips itself with rounded top corners, a
list's heading band inside the view read "overhang TopLeft/TopRight -5px" in
six states (on-me-question, on-me-thread-choice, plan-panel,
plan-panel-keyboard, ship-threads, threads-drafts), though the view rounds
the band and it looks as it did.

A box now shows at a corner only inside every box that clips it, from its
containing block out past its frame to the first box placed against the
window, each a rectangle rounded at its corners. Its clearance at the frame's
arc is the most any of those shapes leaves, the box itself included, so a
clip that rounds the corner takes it for the box wherever the clip stands.
The cut reading keeps to the clips from the box to its frame.

After the change, on 0b856aa055 the six heading findings are gone and the
count's "overhang right -5px" stays in the view-open states and the tall
draft (plan-page-comment-long); on main's CSS the touching count (round
TopRight 0px) and the margin dot (round TopLeft -0.4px) stay; on #7373's
06b5fb3, gallery-comparison and accepted-page-search read nothing.

> _This was written by Claude Code on behalf of max-sixty_
@max-sixty
max-sixty merged commit cc5c9f8 into main Nov 27, 2026
6 checks passed
@max-sixty
max-sixty deleted the agent-a74cda9609acf5293 branch November 27, 2026 17:55
max-sixty added a commit that referenced this pull request Nov 27, 2026
…frame's edge or clear of it (#7373)

Four marks Leaf draws nearly met the edge of the frame they sit in, as
the geometry reading in #7366 lists on main: the panel leaf's count (1px
inside the panel's corner in the row, crossing the folded tile's corner)
and its news dot; a margin entry's unread dot (inside its corner, 0.4px
over the border); a 1px strip of ground between the slider comparison's
ring and the picture, and the same strip in the pixel view; and, before
the runtime loads, a joined option list's last option taking the group's
foot corners above the reserve for Add and Done.

Badges now follow one rule in `.lf-badges` (controls.css): a badge at an
end of the row is centred on its box's corner, halfway round the
corner's curve, derived from the box's rounding and each badge's size. A
margin entry's dot moves 3.2px out and its count 1.7px out; a pin's dot
1.2px out. The folded tile's badges straddle its corners again, as
before #3650. In the row the panel's card clips anything crossing its
edge (an open view's corners rely on that clip), so the leaf's badges
stand `--lf-clear` inside the panel's corner, and the count moves 3px
down and left. In the row the count now covers about a third of the
leaf's mark, up from a sliver. Max chose this over seating the count on
the panel's corner, which would need the card to stop clipping and an
open view to clip itself, and which hangs the count over the panel's
side with a view open or a draft of several lines. Folding or unfolding
also shifts the count 8px against the leaf in the motion's first frame,
since the motion carries the leaf whole.

The slider and the pixel view are now the picture's size, their ring in
the 1px the canvas keeps for it. An option above the reserve no longer
takes the foot's corners. Two stills states join: `leaf-folded` and
`options-startup`.

Three defects review found beside these are fixed too: on a
right-to-left page, badges wider than the row's leaf now run into the
panel instead of past its edge, where the card cut the error dot; with
an error and news on the folded tile, the second dot stands centred on
the top edge instead of crossing it by half a pixel; and a group nested
in an option no longer inherits its holder's reserve before loading
(64px for a 32px Done row).

Asked for by Max. After the change, #7366's reading of the affected
states finds none of these faults in Chromium or Firefox. Tests: the
badge and shot browser tests by node id, the theme-token and rounded-box
model tests, and the stills model tests.

> _This was written by Claude Code on behalf of max-sixty_
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