Repository navigation
Let an Ask's title and option layout ask only what their readers read, and seat captions on their images - #2876
Merged
Merged
Conversation
A figure's img, plain svg or canvas sat on its line's baseline, so the line kept its descender room under it: 7px on top of figcaption's 8px margin, and the same strip between stacked captures and under a linked capture in a table cell. A user reading a decision page found the captions floating off their captures. Centring media on the line ends the box at the media's own bottom edge; svg.drawing was already a block. Behavior change: every inline img, svg, video and canvas in light-DOM content sits 7px tighter below and centres on the text line when it shares one. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
An agent writing an Ask hit two rules that demanded more structure than anything in Leaf reads. `page check` refused an `lf-ask` whose heading sat in an <hgroup> with its eyebrow, as `page-authoring.md` tells authors to write it, and an eyebrow, subheading or paragraph before the heading. The ask's title comes from the shared name rule (`element_name`), which reads all of those. The check dated from when the title was the direct heading and kept that shape after the reader moved on. - The two heading findings become one, `ask-context-title`, which calls `element_name` on the frame, so the check and the On me title can't disagree. Source records now carry their element node for it. - An Ask lays its option cards across when a figure comes before its option list. The selector no longer requires the heading first or the list last, so a paragraph after the options no longer silently stacks the cards. - `lf-options` no longer declares `choose` → `id` beside `needs-id`, which reported the same missing id a second time. - `authoring-asks.md` and the `lf-ask` instructions leave the order of heading, evidence and answer to the author. Behavior changes: an Ask with an <hgroup> heading, an eyebrow or context before its heading, or a second heading now passes `page check`; one with no leading title fails as `ask-context-title`. An Ask with content after its options lays them across. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
reviewed
Oct 14, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
The new Ask title check admits frames with no heading, despite the Ask’s heading contract.
Review found that the title check accepted a leading <strong>, which the name rule reads as a title but which leaves the question out of the outline and heading navigation. `leading_title_node` now returns the element the name rule picks, `leading_title` reads its text, and the Ask check requires that element to be h1–h6. An eyebrow, <hgroup> or context before the heading still passes. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 14, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 14, 2026
`/developing-leaf`'s "Be a helpful linter" covered a check that second-guesses a component that already refuses, but not when Leaf should pass guidance back at all. The `lf-ask` heading check refused an `<hgroup>` for weeks after the ask's title moved to a name rule that reads one (fixed in #2876), and an audit found the same drift in other widgets' refusals and in layout selectors keyed on child order. The section, renamed "When to pass guidance back to the authoring agent", now starts from one question: is involving the author worth the interruption and the upkeep? It asks, in order, whether Leaf should provide the behavior itself, refuse because a necessary guarantee fails, report evidence the author must weigh, or put reusable knowledge in the instructions, and says nothing otherwise. A reader's current limits don't by themselves justify a restriction, and a contract's reader, validation, dependent layout rules and instructions change together. The wording comes from an independent review (gpt-6-astra); an earlier draft on this branch sorted demands into three kinds, which mixed channels with mechanisms. The precision and recall paragraph from #2888 now says the rates inform the call rather than gate it, weighed with what a missed failure costs and whether agents improve the page after the message. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[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.
An agent writing an Ask hit two rules that demanded more structure than anything in Leaf reads. A review of one hard-to-read Ask also found captions floating off their images. Both are fixed here.
An Ask asks only what its readers read.
page checkrefused anlf-askwhose heading sat in an<hgroup>with its eyebrow, whichpage-authoring.mdtells authors to write. It also refused an eyebrow, subheading or paragraph before the heading. The ask's title comes from the shared name rule (element_name), which reads all of those. The check dated from when the title was the Ask's direct heading, and it kept that shape after the reader moved on.ask-context-title. It asks the shared name rule which element titles the frame (leading_title_node, whichleading_titlenow reads its text from) and requires that element to be a heading, so the check and the On me title can't disagree and the question stays in the outline. Source records now carry their element node for it (structure.py).ask.css). The selector no longer requires the heading first or the list last, so a paragraph after the options no longer silently stacks the cards.lf-optionsno longer declareschoose→idbesideneeds-id, which reported the same missing id a second time.authoring-asks.mdand thelf-askinstructions leave the order of heading, evidence and answer to the author.Captions sit with their images. A figure's
img, plainsvgorcanvassat on its line's baseline, so the line kept 7px of descender room under it, on top offigcaption's 8px margin.img, svg, video, canvasnow centre on the line (theme.css);svg.drawingwas already a block.Behavior changes: an Ask with an
<hgroup>heading, an eyebrow or context before its heading, or a second heading now passespage check, and one whose leading title is not a heading, or that has none, fails asask-context-title. An Ask with content after its options lays them across. Inline media in light-DOM content sits 7px tighter below and centres on a shared text line.Tests: the ask-context and choose-id cases in
test_interact_product.py, and the across-layout fixture intest_render_widgets.pynow holds an<hgroup>heading and a trailing paragraph (it stacks the cards onmain).