Repository navigation
Repair nightly UI contracts after recent runtime changes - #291
Conversation
… of the key line, and pin the margin label's two spans Three nightly failures, each reproducing deterministically on 9d8b83d. Every push to main since eb8163d cancelled its own nightly run through the concurrency group, so this is the first completed nightly since they landed. The comment line lands inside lf-draft's body div. #285 replaced the `sectionOf(t.root.anchor)` fallback in the note and reaction seats with `found.place`, which for a passage anchor is `elementOver(segments[0])` — the inline run or body div the surrounding comment forbids. lf-draft seeds its editor from that div, so the runtime's "1 comment" arrived in the textarea and in the widget's own change list. Restored on both seats. A hint seated flush on the key line's right edge rounds back under it. `left` is written back in CSS pixels and lands on the layout engine's 1/64px grid, which put the face 0.015625px inside the band it had just been moved out of. The seat now clears the line by the same gap a face keeps from another face — the clearance the vertical pass already used. The margin button's label gained two spans in #282, lf-margin-button-label-word and lf-margin-button-context, both document-level for the same reason lf-margin-button-label already is: the margin item is contributed outside the chrome's scope. Widened the pinned surface.
Margin status indicators now remain flat at rest and draw a soft neutral trace to their target on hover. The trace uses the shared target-paint geometry for ordinary elements and SVG contours. The Codex delivery scanner also stamps current delivery epochs and ignores explicit records written by the previous adapter. This prevents recovery from treating a delivered event batch as pending epoch state. Tests: full local suite (837 passed), margin browser suite after review fixes (71 passed), the full pre-commit gate, and GitHub CI. > _This was written by Codex on behalf of max-sixty_
leaf-agent
left a comment
There was a problem hiding this comment.
Checked the three named failures at a1bc531a: test_a_comment_inside_a_widget_stays_out_of_what_the_widget_reads, test_the_key_line_only_hides_targets_in_the_lane_it_paints, and test_a_coined_class_cannot_reach_the_chromes_rules all pass, and test_render_anchors.py test_render_conversations.py test_render_margin.py test_render_drafts.py --run-nightly is 274 passed; the collision-probe test re-runs green at this head. The two sectionOf restorations are exactly the two places #285 changed semantics — its third found.place (the placed.set record) is an equivalent rewrite of found.element ?? elementOver(found.segments[0].node), so leaving that one alone is right. The line.right + gap seat reads correctly against overlaps, which is strict on all four edges, so the flush seat really was surviving only on exact equality.
bd777a97 duplicates work already on main. It carries #290, which merged at 05:44 as c6591607; main has since moved twice more (#294, #293). Since bd777a97 is not an ancestor of main, the merge base stays at cd5025fc and the three-dot diff still shows all of #290 — so the PR currently reads as a twelve-file change and would try to re-apply landed content. A rebase onto origin/main should drop it and bring this back to the three files it is about.
a1bc531a widens the collision probe past what the pin can record. Excluding classes another stylesheet dresses is the right call for the probe's question, but the exclusion is unbounded and unwritten, while the sibling half of the same invariant — the runtime sheet's own document-level surface — is pinned name by name a few lines below, with a comment saying why ("what the pin is for is the day one of these stops being either kind"). Instrumenting the test at this head, the set it exempts is claude, lf-edited, lf-react-open, lf-react-palette, lf-react-strip, lf-react-trigger, lf-react-word, lf-resolve — eight classes now outside both halves of the guard, and the set grows with any future theme rule that names a scoped class.
What it covers looks like a real seam rather than a probe artifact: theme.css dresses those at document level with rules the chrome's @scope block duplicates near-verbatim — .lf-react-palette { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; } and the .lf-react-strip:not(.lf-react-open) > .lf-react-palette:not(:has(> [aria-pressed="true"])) rule below it are byte-identical in skills/leaf/assets/theme.css and inside @scope (.lf-chrome) in skills/leaf/assets/runtime/chrome-style.js. Meanwhile the rest of the same two clusters is published at document level by the runtime sheet and pinned: lf-react, lf-react-el, lf-reacts, lf-react-mark, lf-conversation-msg, lf-say. So the reaction and conversation vocabulary has its document-level face split across two sheets on no stated line, and half of it is now unrecorded. Either home ends the split — move those rules into the runtime sheet's document-level block so the existing pin picks them up, or keep the exemption and pin the theme-derived set the same way — but that is a separate change from a nightly fix, per Stage in CLAUDE.md. The guard is not gutted meanwhile: lf-live is still probed and scoped still holds 171 names, so the lf-tabs/lf-live collision the test was written for would still be caught.
The description no longer covers the PR. It lists three changes; a1bc531a is a fourth and bd777a97 a fifth, and the Testing line (1889 passed) predates both and the two base merges. Worth fixing because the description's account of the third failure is only true of 9d8b83dd: on the merge base cd5025fc this test fails at the earlier moved == [] assertion (23 properties moved, display among them) rather than at the pin, which is what a1bc531a is actually for. main was red on it as of that commit.
leaf-agent
left a comment
There was a problem hiding this comment.
192c6b87 rebases onto e84dcf23 and drops the anchors.js half, which is the right call: #294 landed place: blockAt(segments[0].node) ?? itemAt(segments[0].node) in resolvedPassage, fixing the same failure at the seat rather than at the two fallbacks. Verified at the merged head — test_a_comment_inside_a_widget_stays_out_of_what_the_widget_reads passes with nothing from this PR in anchors.js. The themed pin takes the second of the two routes the last review named, and the eight names it records are exactly what the probe measures here, so that thread is closed. The line.right + gap seat still reads correctly against overlaps, which is strict on all four edges.
The title and the first third of the body describe the half that is gone. The title leads with "Seat the comment line on the element the anchor names"; the Problem section's first bullet is test_a_comment_inside_a_widget_stays_out_of_what_the_widget_reads; the Solution's first paragraph is the sectionOf(t.root.anchor) restoration. None of that is in gh pr diff 291, which is now two files — skills/leaf/assets/runtime/composing/targets.js and tests/test_render_conversations.py. Landing squashes the title into main's commit subject, so git log would carry an anchors.js claim for a change #294 made, and a reader chasing it finds nothing in this commit. The PR is two fixes now: the hint seat and the class-surface pin.
The green test check is not evidence for either of them. .github/workflows/ci.yaml runs uv run pytest tests -v on pull_request and adds --run-nightly only on push, so the nightly-marked test_render_* modules are skipped — neither test this PR is about ran in that check. The Testing line's own 1889 passed was measured at 9d8b83dd, three commits and two base merges back. I ran both at the merged head instead: test_the_key_line_only_hides_targets_in_the_lane_it_paints and test_a_coined_class_cannot_reach_the_chromes_rules pass, as does the drafts test above. Worth putting that in the Testing line, since nothing in CI will produce it before main moves.
What I ran, and 12 failures in this container that the diff does not cause
uv run pytest tests/test_render_conversations.py -q -n0 --run-nightly -k coined_class 1 passed
uv run pytest tests/test_render_semantic_selection.py -q -n0 --run-nightly -k key_line_only 1 passed
uv run pytest tests -q -n0 --run-nightly -k a_comment_inside_a_widget_stays_out 2 passed
uv run pytest tests/test_render_semantic_selection.py tests/test_render_conversations.py --run-nightly 12 failed, 81 passed
The 12 are all test_a_thread_completion_keeps_the_readers_later_destination (11 params) and test_the_fold_never_paints_a_frame_that_undoes_the_last — a panel-toggle click that times out after resolving the element, and a fold whose sampled heights never leave 202.2. They reproduce under -n0 --lf as well as under xdist, so they are not scheduling pressure, but they are the "read or press that ran before the page said it was ready" class from running-tend, not this diff: reverting both PR files to e84dcf23 and running test_the_fold_never_paints_a_frame_that_undoes_the_last and the stay-reply param in isolation passes in 57s, and restoring the PR head and running the identical selection passes in 40s. Only the long single-process pass over the whole file reddens them, and neither test presses s or reads the class surface. This container also has only chromium_headless_shell installed, not the Chrome that tests/CLAUDE.md asks for.
leaf-agent
left a comment
There was a problem hiding this comment.
c4814893 swaps one nightly failure for another. The swipe entry added to CONTROL_ARCHETYPES is needed by the coverage half, but that same tuple parametrizes test_each_control_archetype_holds_its_neighbours_still, which serves CONTROL_STABILITY_PAGE — and that fixture has no swipe deck. The new param fails deterministically at the merged head:
$ uv run pytest tests/test_render_controls.py --run-nightly -n0 -q -k each_control_archetype_holds_its_neighbours_still
1 failed, 7 passed, 71 deselected in 15.24s
> expect(control).to_be_visible()
E AssertionError: Locator expected to be visible
E Error: element(s) not found
E - waiting for locator("#session-backlog-deck .lf-swipe-pass")
#session-backlog-deck is authored in examples/corpus.html and examples/design-decision.html. CONTROL_STABILITY_PAGE declares stable-suggestion, stable-options, stable-tabs, stable-command, stable-diff — every other archetype's target names one of those, and this is the only entry that reaches outside the fixture it is measured on.
The coverage half is right and worth keeping: test_the_composed_corpus_declares_every_control_row_archetype passes with the entry (1 passed, 2:15) and, without it, the deck's Pass and Keep are controls with neighbours matching no archetype. What is missing is the causal case's own fixture — a deck inside CONTROL_STABILITY_PAGE, authored the way SWIPE_PAGE in tests/test_render_widgets.py authors one, with target naming that deck. The archetype's own comment ("a move replaces that card and updates the count without moving the other choice") is the contract the press has to prove, and it can only prove it on a page that has a footer to hold still.
Nothing in the Verification line would have caught it, for a reason worth recording beyond the --run-nightly-on-push gap the last review named: tests/test_render_controls.py carries pytestmark = pytest.mark.nightly, so uv run pytest tests skips the module whole, and --lf reruns only previously-failing ids — which a brand-new parametrization never is. A new nightly param is invisible to both halves of the stated evidence.
What I ran at the merged head, all green except the above
tests/test_render_controls.py -k composed_corpus_declares_every_control_row_archetype 1 passed
tests/test_render_controls.py -k "box_the_reader_can_hit or every_ring_the_layer_draws_is_shown_whole or stop_reading_names_a_control" 4 passed
tests/test_render_conversations.py -k coined_class_cannot_reach 1 passed
tests/test_render_pages.py -k shipped_log_opens_its_example 1 passed
tests/test_render_widgets.py -k wrapped_diff_line_names_the_line 1 passed
All under --run-nightly -n0. So the four ring/aim/ink/anchor repairs this commit is about each hold: --lf-here-ring: swipe clears the unnamed-rule half of test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus, max(2.5rem, var(--aim-floor)) clears the coarse-pointer floor in test_every_control_the_layer_offers_is_a_box_the_reader_can_hit (both pointers), and the two anchor readings pass. --aim-floor is defined unconditionally at :root in skills/leaf/assets/theme.css, so the max() cannot fall back to auto on a page that never reaches the coarse query.
leaf-agent
left a comment
There was a problem hiding this comment.
fa4c4524 closes the swipe archetype finding, and the CSS half is the real cause rather than a fixture accommodation. lf-swipe-pile[verdict="unseen"]::before/::after carried min-height: 12rem with a 1px border and no box-sizing, while lf-swipe-card in the same file is border-box — so each ghost was 2px taller than the card it stands behind, and hiding ::after when the deck drops from two cards to one shrank the grid row. Reverting only that one line at the merged head reproduces it exactly:
E AssertionError: pressing the swipe control moved its neighbours:
E button.lf-swipe-keep.lf-ui "Keep →" moved by [0, -2, 0, 0] (left, top, width, height)
With the line in place all eight archetypes pass, and the new deck is authored into CONTROL_STABILITY_PAGE rather than reaching into examples/, so the causal case now proves the contract its own comment states. CONTROL_STABILITY_PAGE has no other reader, so the fixture growth is contained.
No findings on the rest. Since .github/workflows/ci.yaml only adds --run-nightly on push, none of this appears in the green test check — what I ran at the merged head is below.
Nightly runs at 50b20eea
tests/test_render_controls.py -k each_control_archetype_holds_its_neighbours_still 8 passed
tests/test_render_controls.py -k "composed_corpus_declares_every_control_row_archetype
or box_the_reader_can_hit
or every_ring_the_layer_draws_is_shown_whole" 4 passed
tests/test_render_widgets.py -k swipe 10 passed
tests/test_render_reactions.py -k selected_reactions_keep_neutral_button_furniture 2 passed
tests/test_render_pages.py -k shipped_log_opens_its_example 1 passed
All under --run-nightly, against Chrome. The reactions pair is the one this PR's color: var(--ink-2) on .lf-margin-button.lf-react[aria-pressed="true"] serves, and it holds in both schemes: the margin is contributed outside the chrome's @scope, so the palette rules that would repaint a pressed reaction never reach it, and .lf-margin-button's own resting ink is already --ink-2. There is no .lf-margin-button.lf-react rule in skills/leaf/assets/theme.css, so the two document-level sheets cannot drift apart on this one. max(2.5rem, var(--aim-floor)) reads a :root value defined unconditionally and raised to 44px only under @media (pointer: coarse), matching the min-height: max(40px, var(--aim-floor)) idiom already in chrome-style.js, and --lf-here-ring: swipe needs no registration because RING_NAMES walks the sheets themselves. min-height: 12rem appears only in the package source, so nothing derived needed regenerating.
# Conflicts: # skills/leaf/packages/swipe/theme.css # tests/test_render_conversations.py # tests/test_render_pages.py
|
resolve conflicts |
|
The conflict resolution is right in all three files git flagged — #297 drops both back to their |
…landed (#297) ## Problem #291's last commit was a base merge, and it stacked the PR's swipe work on top of equivalent content main had landed independently. Two files merged textually without a conflict, so both copies survived and landed on `main` as `7ffb4d4`. Eleven nightly tests are red there now, deterministically. `CONTROL_STABILITY_PAGE` gained a second `stable-swipe-decision` deck beside main's. The page declares seven ids twice, so every parametrization of `test_each_control_archetype_holds_its_neighbours_still` fails before the browser opens: ``` $ uv run pytest tests/test_render_controls.py --run-nightly -n0 -q -k each_control_archetype_holds_its_neighbours_still 9 failed, 71 deselected in 3.31s E AssertionError: duplicate ids (anchors need unique targets): ['stable-swipe', E 'stable-swipe-a', 'stable-swipe-b', 'stable-swipe-decision', 'stable-swipe-keep', E 'stable-swipe-pass', 'stable-swipe-queue'] ``` `.lf-margin-button.lf-react[aria-pressed="true"]` gained `color: var(--ink-2)`. Main had already fixed that problem one level down, by excluding `.lf-margin-button` from the `.lf-react-palette > .lf-react:not(…)` repaint rules in both `skills/leaf/assets/theme.css` and the chrome's `@scope` block, so a margin reaction keeps its own furniture without an override. Layered on top, the override is what now moves the ink between resting and pressed — the thing the test forbids. Dark reads `rgb(201, 195, 182)` pressed against `rgb(232, 228, 219)` resting; light reads `rgb(60, 57, 52)` against `rgb(28, 27, 24)`. ## Solution Drop both, since main carries the working form of each. The archetype entry goes with the fixture rather than being re-seated: main's `swipe-verdict` covers `.lf-swipe-controls > button`, a superset of the `:is(.lf-swipe-pass, .lf-swipe-keep)` the second entry declares, so the coverage half needs nothing. Both files return to their `f37fc167` content, which is the only thing #291 changed in either. ## Verification - `uv run pytest tests` — 864 passed, 6 skipped - `uv run pytest tests/test_render_controls.py tests/test_render_reactions.py --run-nightly -n0 -k "each_control_archetype_holds_its_neighbours_still or selected_reactions_keep_neutral_button_furniture"` — 10 passed (the 11 that are red on `main`) - `uv run pytest tests/test_render_controls.py --run-nightly -n0 -k composed_corpus_declares_every_control_row_archetype` — 1 passed, so dropping the archetype entry leaves the corpus fully declared The two repairs #291 was actually about survive the merge and are untouched here: `composing/targets.js`'s `line.right + gap` seat and the `themed` class-surface pin both pass at `7ffb4d4`. Co-authored-by: leaf-agent <[email protected]>
…action (#298) ## Problem Main's nightly run [33950527888](https://github.com/max-sixty/leaf/actions/runs/33950527888) failed 13 tests. Ten are already repaired on main by #286, #291 and #297; the three that remain are all on the feature gallery, and they share one cause: that page never stops rendering its margin, so its main thread runs back-to-back ~350ms tasks forever and every Playwright read of it waits on one. The cycle is a layout hook that restates content. `syncLayout` ends in the anchor runtime's `dockSeats`, which called `record.margin.update()` on every reaction seat; `update()` restates the offer, so it ran a full margin render; a margin render ends in `paintKeys`, which ends in `paintHere`, whose animation frame ends in `syncLayout`. Any page carrying a standing reaction closed that loop and ran a whole margin render every frame with nothing dispatched and nothing on the page moving. #289 measured the same thing from the other side and named it as a finding it did not fix. ## Solution `dockSeats` asks the margin to repack its rows — `scheduleMarginLayout()` — rather than to restate what the seats offer. That is what the hook is for: the chrome moved, so the rows a seat hangs in have to be packed again. The end state is the same pass the render was scheduling anyway, minus the render. `test_a_settled_page_with_a_standing_reaction_stops_rendering_its_margin` counts `lf-margin-layout` over 30 frames on a settled gallery and asserts at most one, which is the two-second heartbeat's share. It asserts the reaction seat first, because a page with no seat visits nothing in `dockSeats` and would pass saying nothing. <details><summary>How the cause was found, and the numbers</summary> `told()` failed with `waiting for X, the page last applied X` — the two readings equal. They were equal: the page had taken in what the server held, but `page.wait_for_function` could not complete inside its 500ms round, because on that page a trivially true `wait_for_function` took ~700ms and a bare `page.evaluate("() => true")` took ~370ms. A `longtask` observer on the same page reported ten consecutive tasks of 325–394ms over three seconds, with nothing dispatched. A CDP sampling profile named the loop: ``` (anon)@living-margin.js:836 <- [email protected]:818 <- [email protected]:2164 <- [email protected]:26 <- [email protected]:128 <- [email protected]:375 <- [email protected]:1190 <- [email protected]:233 <- leaf.js:533 (the paintHere frame) ``` and a stack capture on `paintHere` closed it: 42 of 48 calls over two seconds arrived from `paintKeys` reached from that same margin render, i.e. one per frame. Bug-back on the new test with the one-line fix reverted: 30 margin layouts over 30 frames, against `<= 1`. The suite is also faster where it touched the gallery — the seven tests #291 covers ran in 329s on main and 243s with this change. </details> ## Testing - The three failures this fixes, on this branch: `test_the_feature_gallery_exercises_core_reader_workflows`, `test_the_feature_gallery_exercises_live_and_snapshotted_external_data`, `test_r_immediately_opens_the_gallery_reactions_and_digit_chooses` — passed. The first was reproducing on main before the change (121s, failing) and now passes in 18s. - `uv run pytest tests` — 864 passed, 6 skipped. - `--run-nightly` on `test_render_margin.py`, `test_render_anchors.py`, `test_render_navigation.py`, `test_render_reactions.py` — 279 passed; `test_render_aim.py`, `test_render_semantic_selection.py` — 74 passed; `test_render_controls.py`, `test_render_conversations.py`, `test_render_pages.py` — 196 passed. - The new test, three consecutive runs — passed. - `pre-commit run --all-files` — passed. --- Automated fix for [failed run](https://github.com/max-sixty/leaf/actions/runs/33950527888) Co-authored-by: leaf-agent <[email protected]>
Problem
Main's complete nightly run 33933960271 found three concrete regressions. While validating those fixes against newer main commits, the complete local suite exposed seven more failures from recently merged UI and data-anchor changes; one preview failure was already repaired by #295.
Solution
Verification
uv run pytest tests— 863 passeduv run pytest --lf --run-nightly -n0 -vv— 7 passed after integrating Isolate automation previews from task delivery #295uv run pre-commit run --all-filesc4814893.