Repository navigation
Have Leaf read what a page states, and take no fact from how it looks or what it says - #6255
Merged
Merged
Conversation
… 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]>
leaf-agent
approved these changes
Nov 17, 2026
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_
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.
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 aslabel. 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 withlabel(2 of 2). An earlier wording withoutlabelnamed sent them toaria-labelon the card instead, which no standard defines there. Docs only; no tests.