Skip to content

Let an Ask's title and option layout ask only what their readers read, and seat captions on their images - #2876

Merged
max-sixty merged 4 commits into
mainfrom
ask-readability
Oct 14, 2026
Merged

max-sixty merged 4 commits into
mainfrom
ask-readability

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

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 check refused an lf-ask whose heading sat in an <hgroup> with its eyebrow, which page-authoring.md tells 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.

  • The two heading findings become one, ask-context-title. It asks the shared name rule which element titles the frame (leading_title_node, which leading_title now 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).
  • An Ask lays its option cards across when a figure comes before its option list (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-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.

Captions sit with their images. A figure's img, plain svg or canvas sat on its line's baseline, so the line kept 7px of descender room under it, on top of figcaption's 8px margin. img, svg, video, canvas now centre on the line (theme.css); svg.drawing was already a block.

Behavior changes: an Ask with an <hgroup> heading, an eyebrow or context before its heading, or a second heading now passes page check, and one whose leading title is not a heading, or that has none, fails as ask-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 in test_render_widgets.py now holds an <hgroup> heading and a trailing paragraph (it stacks the cards on main).

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

max-sixty and others added 3 commits October 14, 2026 09:47
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 leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]>
@max-sixty
max-sixty merged commit e03d4e2 into main Oct 14, 2026
6 checks passed
@max-sixty
max-sixty deleted the ask-readability branch October 14, 2026 19:17
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]>
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