Repository navigation
Read the note-set axis against the page's box, not the window - #36
leaf-agent wants to merge 1 commit into
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
Reading the axis against the page's box is the right correction, and moving the two edge readings with it is the part that would otherwise have left the same fault sitting in the same test. The bug-backs in the description are the thing that makes the wide case believable — a centring assertion that derives its own expected value is easy to pass by accident, and --claim-note: calc(var(--note) / 2) failing by 96px is what says this one doesn't.
One observation inline, about a reading the diff leaves standing next to the new one. It isn't a blocker for this PR.
test hasn't reported on 5bfa3ef yet — still running past the poll cap here — so beyond the local run the description records, the fix is unverified from this session.
| }; | ||
| return { column: span(document.querySelector('main')), | ||
| room: span(document.body), | ||
| room: span(document.body), pageBox: page(), |
There was a problem hiding this comment.
room now sits beside pageBox answering the same question two different ways. span() takes its right edge as getBoundingClientRect().right - paddingRight, and that rect is body's border box, which contains the reserved gutter — so wherever a scrollbar takes room, room.right is 15px past where content can actually go. That is the reading this PR is removing from the note test, still in place one line above it.
Three assertions use room.right as the page's right edge: "past the page, right" in test_a_widget_that_declares_width_takes_the_room_and_the_column_stays_put and in test_a_copy_reads_the_room_from_its_own_window, and "the exhibit hangs over the panel that displaced it" in test_a_wide_widget_gives_the_panel_its_strip. The copy one is honest — :where(html:not(.lf-copy)) withholds the scroll arrangement, so body isn't the scroll container there and its border box already excludes the viewport's scrollbar. The other two are 15px looser on the runner than they read.
Nothing is red today: sideways == 0 stands beside both of them and catches overflow that reaches scrollWidth. But the bound still states something weaker than its message claims, and after this diff the next test wanting "the page's right edge" gets the window's from room and the page's from pageBox, with only the comment on page() to say which is which. Taking span's edges off clientWidth — the padding box less any gutter — rather than off the rect would let one answer serve both, and page() would then be the same reading without the paddings subtracted.
Not for this PR: it tightens assertions in two other tests and would want its own bug-back to show the direction of the failure moved as intended (tests/CLAUDE.md, "Bounds and geometry tests are especially prone to staying green after the fault moves to another edge"). Worth not leaving implicit, though, right beside a comment that spends six lines explaining the gutter.
There was a problem hiding this comment.
Measured it on this runner rather than leaving it as arithmetic. On WIDE_AND_NARROW_PAGE at a 1200px window: room.right is 1200, pageBox.right is 1185, and body's offsetWidth - clientWidth is that same 15. So the two readings sitting next to each other differ by exactly the gutter, on every assertion that treats room.right as the page's right edge. The runtime already takes the gutter that way — leaf.js#L4526 computes it as offsetWidth - clientWidth — which is the direction taking span's edges off clientWidth points in, and it would let page() be the same reading with the paddings left in.
Agreed it stays out of this PR. It moves a bound in two tests whose subject is width rather than the axis, so it is revertable independently of this change, and tests/CLAUDE.md's "bounds and geometry tests are especially prone to staying green after the fault moves to another edge" is exactly the case — it wants its own bug-back showing the direction of the failure moved as intended, which is a different piece of evidence from the two in the description here.
Not opening it as a follow-up right now either: eleven bot PRs are open against one maintainer, so this is recorded here rather than added to that queue.
|
The first attempt never reported because it never finished — it ran 32 minutes and was still in progress when I cancelled it. GitHub doesn't serve logs for a running job, so I can't show that attempt's last progress line, but 32 minutes is 2.8× the worst of the last 40 healthy Worth noting for #30's case: the mechanism it describes bites here too. Left alone this attempt would have run to the 360-minute cap and been reported as Local verification from this sessionBeyond the full run the description records, the four tests reading The measurement behind the inline reply, from a throwaway probe on the same corpus page (not committed): |
|
Fifth occurrence, now at 91515b5 — run 32749573557, same assertion and same numbers this test has carried since the rewrite: This branch still applies to current That run's second failure is a different fault and not this one's: |
|
The new part is that the pair has now been verified together, on the current head — which neither PR can claim alone: this branch was verified at 5bfa3ef and #37 at its own base, each three commits back and neither against the other, while ac03b7f itself added 130 lines to The green is the fixes rather than the runner: the same machine reproduces both failures byte-identically at plain ac03b7f, What was runMerge base Run in two halves (271 + 284) because this runner has 4 cores and the suite does not fit one window; the split is by collected node id, so every test ran. Timing note on #37: the 555-test run was against its head at the time, 00cb3b4. It has since advanced to f63cf5c with two review-response commits whose delta is confined to |
|
Seventh occurrence, at 20f387c — run 32763448588, same two failures as the sixth: this PR's What is new is that the caveat on the previous verification is closed. That run was the whole module against #37's head at the time (00cb3b4), with only nine targeted tests re-run once it advanced to f63cf5c. This one is the whole of The one that is not green is So the conclusion from the sixth occurrence stands two commits further out: merging this and #37 is enough to green What was runMerge base Run in three chunks at |
|
Closing as superseded: its merge result is identical to current main, so landing it would be a no-op. |
`lf-diagram` now draws with agentic-mermaid 0.4.1, a fork of Beautiful Mermaid 1.1.3 that documents the SVG it writes and draws more of Mermaid. With a renderer that holds up on its own, the render gate stops re-reading each diagram with official Mermaid: #899's differential check, the 2.85MB Mermaid reader bundle it imported, and the `registerRenderCheck` hook only it used are removed. The gate reports a diagram only when the renderer refuses it or draws it empty, and every family the renderer draws passes. ## What a reader sees - Most drawings improve or are unchanged. In `pr-walkthrough`, TempIndex's three edges now leave TempIndex rather than running up a trunk from Committed changes. Sequence diagrams draw notes, `autonumber` and `-x` heads, which Beautiful Mermaid dropped. `[/lean/]` stops at its own closer instead of swallowing the next node. - Pie, Gantt, mindmap, timeline, journey, quadrant, git graph, architecture and radar diagrams draw; the check refused every family outside the six Leaf documents. - The XY chart is heavier. agentic-mermaid replaced Beautiful Mermaid's own chart design with a port of Mermaid's xychart layout and defaults (`xychart/layout.ts`): bars fill 95% of their band from a constant with no option, fills are solid and unstroked, and axes carry lines and ticks. The title overlapping the top gridline happens with the library's defaults too. Mermaid config and a tint on the documented `data-role="bar"` lighten it but keep the bars full-width, so this change leaves the chart as drawn and the authoring guide sends quantities to `lf-chart`. - A diagram page directory carries 2.90MB of diagram vendor files, against 4.41MB before (Beautiful Mermaid 1.56MB plus the reader 2.85MB). The renderer itself is larger: 869KB gzipped against 471KB, because the package ships its whole toolkit in one module esbuild cannot cut down. ## What the gate no longer catches agentic-mermaid still departs from Mermaid in places, and those now draw silently: no `click` or `link` target (the box draws as a plain one), no frontmatter or sequence `title`, a state statement ending in `;` dropped, a state labelled with its bare id when a transition names it before `state "…" as S0` declares it, ER relationships read only in symbol form, and an entity code such as `#36;` drawn as written. `skills/leaf/references/authoring-evidence.md` lists them and asks for a look at each diagram. A diagram drawn empty (a lone `[*] --> A;`, or only word cardinalities) is still reported, as a widget with no usable size. ## Where to look - `skills/leaf/packages/diagram/widgets/lf-diagram.js` — the renderer's own `font` and `idPrefix` options replace Leaf's font rewrite and id namespacing; `security: "strict"` leaves out a `click` or `link` target, which the default mode draws as a focusable link nothing navigates; `interactive: true` gives chart values a hover tooltip and a line series its dots. Parts are read from the renderer's documented `data-role` contract; a namespace gives way to a class of the same name, and an id that is not one token (a quoted ER name, a multi-word mindmap node) is not offered as a part. - `scripts/vendor.py` — `build_agentic_mermaid` replaces the Beautiful Mermaid build; `elkjs`, `entities` and `yaml` are held by agentic-mermaid's declared ranges. The reader build and the `mermaid` pin are gone. - `skills/leaf/assets/runtime/render-check.js`, `render-checks/widgets.js`, `render_gate/readings.py` — the hook and its gate wiring removed; #902's per-widget failure naming stays. - `tests/test_render_gate.py` — `test_the_gate_passes_what_the_renderer_draws` covers every added family plus the multi-word and quoted ids, and fails on a head where the check still ran. `test_the_shim_runs_the_gate_from_anywhere` now holds #902's `<lf-diagram id='d-broken'> failed soft:` form without the source. Fixtures that relied on pie failing use `sankey-beta`, which the renderer does not implement. ## Validation - `uv run pytest tests -q` on `e3317831`: 1215 passed. The one commit since adds `security: "strict"`, which renders all 39 drawable shipped and test diagrams byte-identically, and `test_a_diagram_link_draws_no_tab_stop`, which fails without it. - `npm run test:runtime`: 33 passed. - The diagram part tests in `test_render_aim.py`, `test_render_reactions.py` and `test_render_semantic_selection.py` pass: Alt+click and `s` still target a declared box. - `version check --render` passed on the four shipped pages with diagrams (`security-boundary`, `pr-walkthrough`, `corpus`, `how-it-works`) during the trial, when the check still ran; removing the check only relaxes the gate. - Locally, a ten-diagram page presents about 200ms later (480ms → 680ms) and the largest shipped diagram renders in 101ms against 8ms. The `scripts/verify-site-local.sh` phase profile was not run: it needs Docker, which was not available. > _This was written by Claude Code on behalf of max-sixty_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
Problem
ciis red onmainat f3d7df1 — one deterministic failure intest_a_note_sets_the_page_axis_with_its_whole_strip, the test that commit rewrote:column centred at 600px of 1600px,assert 7.5 <= 1.The 7.5px is the stable scroll gutter, and the strip arithmetic is doing exactly what the commit says. Body owns the document's scroll and reserves a gutter for it whether or not a scrollbar is drawn, so on the runner the page's box is 1585px inside a 1600px window — a settled decision made at the gutter, reasoned there at length ("reserving a gutter never costs more than the shift not reserving it produces"), and nothing the note has a part in.
(1585 - 384) / 2is 600.5, which is where the column stands. The test asked the window instead, and the window is that width only where scrollbars overlay — so it is green on macOS, where the reservation is a no-op, and red on Linux.This is the fourth run on the same 7.5px, and the third distinct test to carry it (#33 covers the two before the rewrite; more on that below).
Solution
Read every reading in this test against the page's box rather than the window.
ROOM_GEOMETRYgainspageBox— body's padding box — because neither reading it already had can answer this:columnis what the strip moved,roomis what the strip left, and only a box the strip cannot resize says where the edge it came out of is. The strip is body's padding, so "the strip set the axis" is exactly "the column is half a strip left of that box's centre", stated without reference to any platform's scrollbar.The two edge readings move with it, from the window's width to
pageBox.right. Leaving them behind would keep the same latent fault in the same test: past the page's right edge is the reserved gutter, so a note painted out there is off the page while a window-measured assertion still calls it on.The fix is in the test, not the theme — the strip arithmetic f3d7df1 landed measures correctly, and the assertion was reading it against the scroll region.
Testing
Reproduced locally at the same assertion and the same numbers before the change, green after. Bug-backs on the corpus, since a centring assertion is easy to pass by accident:
--claim-note: 0px(no strip at all)--claim-note: calc(var(--note) / 2)uv run pytest tests --run-nightly— 1051 passed, 6 skipped, and one unrelated failure intest_an_open_tab_reloads_before_posting_through_a_revendored_layer(a poll that never returned) which passes on its own and touches neitherROOM_GEOMETRYnor this test; it was green on the failing run this PR is for.pre-commitclean on the changed file.On #33, which this supersedes
#33 fixes the same 7.5px in
test_a_note_moves_the_page_only_where_the_page_owes_it_room. f3d7df1 replaced that test with this one, so #33's diff no longer applies —git merge-tree origin/main origin/fix/ci-32671963516conflicts, and the function its hunk anchors on is gone frommain. ItspageBoxhelper and its reasoning are carried here unchanged; only the assertions it was written against are different.Automated fix for failed run