Repository navigation
Read a chart's two labels on each other as two labels - #62
Merged
Merged
Conversation
999f933 holds a label's own lines out of the pass hunting words drawn on other words: an SVG <text> spells a line break as an element, so two lines of one tick are two nodes where a wrapped paragraph's are one, and the pair overlapped by construction on a drawing where no glyph comes near another. The exemption has one leg. `test_the_gate_passes_a_chart_whose_tick_names_its_month_on_a_second_line` proves the hold fires, and nothing proves it is narrow: widen `el.closest('text')` to `closest('g')` or `closest('svg')` and every word of a chart stops being read against every other word of that chart, with the whole suite still green. The corpus sweeps and the copy assert this pass returns nothing, which a wider hold only makes more true; the chart's own collision test reads CHART_COLLISIONS, which compares whole <text> boxes and cannot see this pass; and the exemption test defeats the predicate wholesale, so its reported leg is the same either way. The only standing bug-back on this pass reporting is the float's, and that is an HTML page whose runs never get an SVG label at all. So the other half, put back as a bug, the way the float's two halves are already written: one whole <text> stood on another, where the labels stay whole and what lands is two of them rather than two lines of one. It fails under both widenings above and passes with the fix as it stands; the exemption test is the complement and fails with the hold removed while this one still passes.
leaf-agent
commented
Aug 26, 2026
leaf-agent
left a comment
Collaborator
Author
There was a problem hiding this comment.
Test-only, and it pins the leg #58's exemption left unheld. I reran the widening bug-back independently on this branch rather than taking the description's word for it: with const label = el.closest('text') in render_checks.py changed to closest('g'), this test fails on two of a chart's labels stood on each other unreported: [] while test_the_gate_passes_a_chart_whose_tick_names_its_month_on_a_second_line stays green. So the pair does hold the predicate where it is, from both sides.
One robustness point inline on how the two ticks are picked.
max-sixty
added a commit
that referenced
this pull request
Aug 27, 2026
## Problem This came out of reviewing #58, which landed as [999f933](999f933) while the review was running. The fix itself is right and this does not touch it — what it leaves behind is an exemption with one leg. `999f933c` holds a label's own lines out of `COVERED_WORDS`: an SVG `<text>` spells a line break as an element, so two lines of one tick are two nodes where a wrapped paragraph's are one, and the pair overlapped by construction on a drawing where no glyph comes near another. `test_the_gate_passes_a_chart_whose_tick_names_its_month_on_a_second_line` proves the hold fires. Nothing proves it is narrow. Widen `el.closest('text')` to `closest('g')` or `closest('svg')` — every tick of an axis sits inside both — and every word of a chart stops being read against every other word of that chart. The whole suite stays green. I ran it rather than reasoning about it: with the predicate widened, `tests/test_render_gate.py`, `tests/test_render_widgets.py` and `tests/test_render_export.py` give 18 passed over every case naming this pass, the new exemption test among them. Nothing else in the suite can see it, for four separate reasons: - The corpus sweeps and the copy assert this pass returns nothing, which a wider hold only makes more true. - `test_no_two_of_a_chart_s_words_land_in_the_same_place` reads `CHART_COLLISIONS`, which compares whole `<text>` boxes and never reaches this pass. - The exemption test defeats the predicate wholesale (`.replace("a.label && a.label === b.label", "false")`), so its `reported` leg is identical however `label` was computed. - The only standing bug-back on `COVERED_WORDS` *reporting* is `test_the_covered_words_gate_still_reads_a_control_in_the_flow`, and that is an HTML page whose runs never get an SVG label at all. That test's docstring is the precedent this is written from: "a gate that has only ever passed has been tested for nothing, and this one is one predicate away from exempting every control there is." The same sentence is true of the new predicate one element up. `tests/CLAUDE.md` states the general shape under **Make a green test non-vacuous** — "A reading blind to one mechanism does not report that it is blind — it returns the same clean result it returns when nothing is wrong." ## Solution The other half, put back as a bug, the way the float's two halves are already written. One whole `<text>` stood on another by copying its `transform`, so the labels stay whole and what lands is two of them rather than two lines of one. Arranged that way rather than by spreading a label's lines, because the hold asks which `<text>` drew a line and not how far a line was moved — and because it depends on neither the axis's leading nor a neighbouring chart's layout. Test-only. `render_checks.py` is untouched. ## Testing Every run below at `-n0` on this branch, based on `999f933c`. - `uv run pytest tests/test_render_widgets.py` — 58 passed. - Bug-back, `closest('text')` → `closest('svg')`: the new test fails on `two of a chart's labels stood on each other unreported: []`; the exemption test still passes. - Bug-back, `closest('text')` → `closest('g')`: same failure, same complement. - The complement, with `if (a.label && a.label === b.label) continue;` removed entirely: the exemption test fails on `held` with `<lf-chart id=c-line> draws "1" in the same place as <lf-chart id=c-line>'s "Jun"`, and the new test still passes. The two are about different halves and neither stands in for the other. - Repeated 5× at `-n0`: passed each time. - `pre-commit run --files tests/test_render_widgets.py` — passed. <details><summary>What the arrangement produces</summary> The two ticks and the finding, printed from the reading during development: ``` MOVED: ['20', '22'] FOUND: ['<lf-chart id=c-line> draws "20" in the same place as <lf-chart id=c-line>\'s "22"'] ``` The assertion matches on both labels in their quoted form rather than on the chart id, so a finding about some other pair in the same chart cannot satisfy it. </details> --------- Co-authored-by: leaf-agent <[email protected]> Co-authored-by: Maximilian Roos <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
This came out of reviewing #58, which landed as 999f933c while the review was running. The fix itself is right and this does not touch it — what it leaves behind is an exemption with one leg.
999f933cholds a label's own lines out ofCOVERED_WORDS: an SVG<text>spells a line break as an element, so two lines of one tick are two nodes where a wrapped paragraph's are one, and the pair overlapped by construction on a drawing where no glyph comes near another.test_the_gate_passes_a_chart_whose_tick_names_its_month_on_a_second_lineproves the hold fires. Nothing proves it is narrow.Widen
el.closest('text')toclosest('g')orclosest('svg')— every tick of an axis sits inside both — and every word of a chart stops being read against every other word of that chart. The whole suite stays green. I ran it rather than reasoning about it: with the predicate widened,tests/test_render_gate.py,tests/test_render_widgets.pyandtests/test_render_export.pygive 18 passed over every case naming this pass, the new exemption test among them.Nothing else in the suite can see it, for four separate reasons:
test_no_two_of_a_chart_s_words_land_in_the_same_placereadsCHART_COLLISIONS, which compares whole<text>boxes and never reaches this pass..replace("a.label && a.label === b.label", "false")), so itsreportedleg is identical howeverlabelwas computed.COVERED_WORDSreporting istest_the_covered_words_gate_still_reads_a_control_in_the_flow, and that is an HTML page whose runs never get an SVG label at all.That test's docstring is the precedent this is written from: "a gate that has only ever passed has been tested for nothing, and this one is one predicate away from exempting every control there is." The same sentence is true of the new predicate one element up.
tests/CLAUDE.mdstates the general shape under Make a green test non-vacuous — "A reading blind to one mechanism does not report that it is blind — it returns the same clean result it returns when nothing is wrong."Solution
The other half, put back as a bug, the way the float's two halves are already written. One whole
<text>stood on another by copying itstransform, so the labels stay whole and what lands is two of them rather than two lines of one. Arranged that way rather than by spreading a label's lines, because the hold asks which<text>drew a line and not how far a line was moved — and because it depends on neither the axis's leading nor a neighbouring chart's layout.Test-only.
render_checks.pyis untouched.Testing
Every run below at
-n0on this branch, based on999f933c.uv run pytest tests/test_render_widgets.py— 58 passed.closest('text')→closest('svg'): the new test fails ontwo of a chart's labels stood on each other unreported: []; the exemption test still passes.closest('text')→closest('g'): same failure, same complement.if (a.label && a.label === b.label) continue;removed entirely: the exemption test fails onheldwith<lf-chart id=c-line> draws "1" in the same place as <lf-chart id=c-line>'s "Jun", and the new test still passes. The two are about different halves and neither stands in for the other.-n0: passed each time.pre-commit run --files tests/test_render_widgets.py— passed.What the arrangement produces
The two ticks and the finding, printed from the reading during development:
The assertion matches on both labels in their quoted form rather than on the chart id, so a finding about some other pair in the same chart cannot satisfy it.