Skip to content

Have Leaf read what a page states, and take no fact from how it looks or what it says - #6255

Merged
max-sixty merged 2 commits into
mainfrom
read-what-the-page-states
Nov 17, 2026
Merged

max-sixty merged 2 commits into
mainfrom
read-what-the-page-states

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Adds "Read what the page states" to root AGENTS.md's cross-runtime invariants. Leaf takes each fact about a page from the structure HTML defines or from a declaration in an attribute, a registry entry or the log. A declaration on a plain element uses a standard attribute that means the same to every reader; one on Leaf's own element uses Leaf's attribute, such as label. It takes no fact from how content looks or what it says: restyling a page changes no fact Leaf holds, and rewording changes only its words. Any other reading of markup is an exception the maintainer agrees to. "What it puts between the author and HTML" now points at it rather than restating the clause.

Max asked for it, in a shorter form than a Fable review proposed, on his design page for how Leaf takes names and On Me questions from markup. Existing code that reads markup, such as the leading-title and first-heading rules, is brought in line as it is touched; #6248 removed the bold-line rule.

Scored with a scratch A/B: asked where a board card's name should come from, agents reading main's guidance read the card's <strong> (2 of 2); with this text they declared it with label (2 of 2). An earlier wording without label named sent them to aria-label on the card instead, which no standard defines there. Docs only; no tests.

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

max-sixty and others added 2 commits November 16, 2026 21:30
… or what it says

Max ruled on 16 November 2026 that Leaf should basically never parse an author's
HTML for meaning, that data and presentation stay apart, and that a name Leaf uses
is data on the element. A Fable review of Leaf's strategy for data and HTML
proposed one principle covering those rulings, and Max adopted it in a shorter form.

"Read what the page states" joins the cross-runtime invariants: a fact comes from
the structure HTML defines or from a declaration in an attribute, a registry entry
or the log; standard attributes only where they mean the same to every reader,
Leaf's own attributes only on Leaf's elements; no fact from how content looks or
what it says, so restyling a page changes no fact and rewording changes only words.
Any other reading of markup is an exception the maintainer agrees to. "What it puts
between the author and HTML" points at it rather than restating it.

Co-Authored-By: Claude <[email protected]>
…plain ones

Asked where a board card's name should come from, maintainer agents reading the first
wording rejected the <strong> but chose aria-labelledby or aria-label on the card (4 of
4), which no standard defines on lf-card. Naming Leaf's attribute, such as label, for
Leaf's own elements steered both runs to label (2 of 2), matching Max's pick for option
titles.

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit fe402e3 into main Nov 17, 2026
5 checks passed
@max-sixty
max-sixty deleted the read-what-the-page-states branch November 17, 2026 05:49
max-sixty added a commit that referenced this pull request Nov 17, 2026
…ading inside it (#6264)

Leaf now names plain markup by the caption HTML gives it: a disclosure
by its `<summary>`, an `<hgroup>` by its heading, and a `section` or
`article` by the heading it opens with, alone or in an opening
`<hgroup>`. No other plain element is named by a heading inside it.
`titledElement`, the package API that says which element a heading
titles for the contents' stretches, a heading's link address and its
preview's thread count, follows the same rule, plus a widget the heading
leads unless the widget's `label` names it. Both replace longer rules
that let any element take a leading heading found inside a `<header>`,
past an eyebrow, or wherever every other heading inside ranked lower;
the outline walk behind them goes. Registered widgets keep their
leading-title rule until their titles move to `label`. A section's
`aria-labelledby` or `aria-label` doesn't yet win over its heading: that
follows #6256, whose `group_name` already reads `aria-labelledby` in
Python, so the two runtimes share one reader rather than gaining a
second.

Max picked this rule on his design page for where Leaf takes facts about
a page, as the one reading of position "Read what the page states"
(#6255) allows.

What to weigh: on 274 real pages, 2,373 of 2,852 sections and articles
open with a heading and keep their names. 109 lose theirs: 54 open with
a paragraph such as an eyebrow, which page-authoring.md already teaches
to put in an `<hgroup>`, 28 have their heading later, 22 open with a
`div`, and 5 wrap another section. Another 232 wrap an `lf-ask` and lose
the question's name; #6256 makes the question itself the section. In the
examples, `alert-thresholds.html`'s six evidence articles opened with a
`<header>`; their heading and threshold now stand in an `<hgroup>`,
which keeps them named and measures the same.

Tests: runtime suite, `test_obligations.py`, a heading-link and a
contents browser test. Codex reviewed it; its two findings, widget
titling and chrome inside an `<hgroup>`, are fixed with tests, as is the
auto-review's note on that example.

> _This was written by Claude Code on behalf of max-sixty_
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