Skip to content

Rewrite the root AGENTS.md for a reader who has only the file - #6576

Merged
max-sixty merged 8 commits into
mainfrom
core-prose-clarity
Nov 20, 2026
Merged

max-sixty merged 8 commits into
mainfrom
core-prose-clarity

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

Rewrites the root AGENTS.md so a reader who has only the file can parse each sentence on the first read. Below "Repository map" no rule changes: pronouns give way to their nouns, a rule is split from its mechanism and its reason, and Tend and the server's "reading" are defined where they first appear. "Keep the layer open" now defines a content widget, says what core code may not do, and limits the rule against naming widgets to Leaf's own instructions (SKILL.md, its references, and the entries in browser/registry.json and the kernel registry), leaving a package's guidance free to name any widget, as the maintainer decided. The defects a review reports in instruction text become a list, with a new item for a sentence its reader can parse only on a second read, and Tend's review threshold names that list instead of the label "public surface traps". In the maintainer's sections above "Repository map", only the three readings the maintainer picked change: when Leaf adds code to prevent a failure ("Leaf's role"), that contract prose may be edited for clarity ("Stage"), and that the code making a change records it ("Responsiveness").

To weigh: Fresh readers given only the file flagged 60 and 72 of about 250 sentences as needing a second read on main; on this branch two readers of the draft flagged 31 each and a reader of the final text 28, none unsettled. Below "Repository map" that is 41 and 53 down to 13, 13 and 8. Most of what remains sits in the maintainer's sections, whose proposed rewrite (9 flags in one read) waits on the maintainer. Asked ten questions about rules the rewrite touched, fresh agents given only the old file said it left the question open in 6 of 30 answers, and given the new file in none; every new-file answer matched the code. Codex compared old and new for changed rules and false claims, and its eight findings on the first draft are fixed. The file grows from 5,538 to about 6,270 words, since a sentence that names its noun and splits off its reason is longer. A full-file rewrite conflicts with the open drafts that edit this file (#6023, #6024, #5979, #5970); it leaves the hooks/ line that #6574 edits alone.

Asked by max-sixty, who picked the three readings on the survey page; he hasn't read this diff. Prose only; pre-commit passes.

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

…that needs a second read as a public surface trap

"Keep the layer open" said "No code outside a content widget's module names
it": "it" pointed back at a possessive inside a prepositional phrase, and
read literally the rule forbade every test that renders a widget. It now
says what holds in the tree: a content widget is one a package ships, as
against Leaf's own elements in `browser/registry.json`, which core code
names. Leaf's runtime, server and stylesheets never branch on a content
widget's tag name or keep a list of them; a package's modules may name the
widgets they compose, a test or a `leaf-dev` command the widgets it
exercises, and a test covering every widget with a property finds them in
the registry. "Registry entry" becomes the glossary's "element
declaration", and a new widget's files are said to sit in its own package.
The section's second paragraph is split into one sentence per rule. No rule changes.

"Where instructions live" listed the public surface traps in one sentence
whose "in maintainer guidance" could scope one item or two. The list is now
a list, and its legibility item names the class the survey below found
everywhere: a sentence its reader parses only on a second read, with the
coined-term trap folded into it. History stays a trap in all such text, as
the paragraph on history above it already said. "Read that file's 'Leaf's
interface'" now names `browser/AGENTS.md`, the file that has it.

Evidence, from a cold-reader audit of the core instruction files (every
AGENTS.md, SOUL.md, both SKILL.md entries, two shipped references): a fresh
agent with only the file flagged 366 of about 1,440 sentences (25%; 19-33%
per file) as needing a second read, and 37 as unsettleable; SOUL.md came in
at 9%. Two independent readers of the root file flagged the same 55 of the
first reader's 60 sentences. The rate is the same for lines last written by the
prose campaigns (#1230, #2905, #2915, #3777, #3778, #6003, #6093, #6466:
13.0 findings per 100 prose lines) as for every other commit (13.8).

Scored with fresh `claude -p` readers given only the passage:
- Comprehension, five questions on the layer rule, the "Leaf's interface"
  pointer and a keyboard bullet: 8 of 20 answers on the old text said the
  passage doesn't settle the question, against 3 of 20 on a first rewrite
  (4 runs each); on the final layer wording the three layer questions drew
  one hedge in 9 answers, and every answer was correct (3 runs). No arm acted wrongly.
- Cold reread of the rewritten passages: the layer paragraphs drew 3-4 slows
  in 12 sentences against 5 in 7 before; the trap list 1 in 7 against a block
  on its one sentence before (2 runs each; clean control paragraphs draw
  about 1 in 3 out of context).
- Reviewer probe (Tend's review threshold, root AGENTS.md per arm, a small
  prose diff with an ambiguous sentence): 3/3 reviewers flagged it on both
  arms, so the new trap item changed nothing measurable there; nor did it
  change a writer's paragraph composed from clear notes (3 per arm). It is
  kept because Tend's threshold omits prose polish that no trap names, and 0
  of 16 sampled Tend reviews of November PRs touching these files mentioned
  clarity.
leaf-agent
leaf-agent previously approved these changes Nov 20, 2026
…and the list needs no preamble about its reader
…nly the file, and apply the maintainer's three readings above it

Below "Repository map", every sentence a fresh reader needed to read twice
is rewritten in plain words, and no rule changes. The rewrite names the
noun a pronoun pointed at, splits a rule from its mechanism and its
reason, defines Tend and the server's reading where they first appear,
and states what "bounded by the document version" and "DOM completion is
separate from ..." meant: a page widget's state draws on actions up to
the version shown, a thread message's widget on its whole thread, and
whenDocumentPresented() waits for DOM writes but not for a widget's
asynchronous preparation or a gesture's hold.

Above it, the maintainer picked three readings of sentences two readers
could take two ways:
- Leaf's role: Leaf adds code to prevent a failure only where nothing in
  the agent's path would report it and it would pass silently into
  something the user relies on.
- Stage: a change that keeps every guarantee needs no edit to contract
  prose, and an edit for clarity is still welcome.
- Responsiveness: the code that makes each change records it, and a
  whole-page pass never searches the page for changes.

Evidence:
- Cold read with the survey's brief, two fresh readers per version:
  60 and 72 flagged sentences before, 31 and 31 after, with no reader
  left unable to settle a sentence below "Repository map". Below it, flags
  fell from 41 and 53 to 13 each; the 18 that remain above it are the
  maintainer's to rewrite. The last fixes below address 12 of those 13.
- Ten questions about the rewritten rules, three fresh agents per version
  given only the file: answers that said the file left the question open
  fell from 6 of 30 to 0 of 30 (the old file's "thread's window" and
  "the message as it now reads"); every new-file answer matched the code.
- Codex compared old and new for changed rules and false claims and
  found eight faults in the first draft, all fixed: among them a
  withdrawal made mandatory, an overbroad widget-state rule, and
  pre-commit's TypeScript coverage understated.
@max-sixty max-sixty changed the title Say plainly what "Keep the layer open" forbids, and count a sentence that needs a second read as a public surface trap Rewrite the root AGENTS.md for a reader who has only the file Nov 20, 2026
leaf-agent
leaf-agent previously approved these changes Nov 20, 2026
leaf-agent
leaf-agent previously approved these changes Nov 20, 2026
…tructions

A package's own guidance, in its registry entries and author.md, is that
package's advice rather than Leaf's, so it may name any widget. The rule
covers skills/leaf/SKILL.md, its references and the kernel registry's entries.

@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 scope for the widget-name rule in "Keep the layer open" omits the kernel registry that the PR body says it covers; see the inline suggestion.

Comment thread AGENTS.md Resolved
The scope named browser/registry.json, Leaf's own elements, but not
browser/runtime/kernel-registry.json, whose $events text every agent
reads at delivery and which the commit before this one meant by "the
kernel registry". That text names lf-options only inside a markup
example, so the rule as written already holds for it.
@max-sixty
max-sixty merged commit 15a028b into main Nov 20, 2026
7 checks passed
@max-sixty
max-sixty deleted the core-prose-clarity branch November 20, 2026 06:41
max-sixty added a commit that referenced this pull request Nov 20, 2026
… only the file (#6589)

Rewrites the five sections of the root `AGENTS.md` above "Repository
map" (Leaf's role, Stage, Responsiveness, Pages across Leaf updates, Fix
the underlying issue) so a reader who has only the file can parse each
sentence on the first read, as #6576 did for the rest of the file. No
rule changes: pronouns give way to their nouns, packed sentences are
split, and coined phrases such as "cross between Leaf versions" and
"buys nothing" are stated plainly.

**To weigh:** one fresh reader with the survey's brief flagged 9
sentences in these sections, against 18 to 20 for the current text.
Codex and Tend compared old and new for changed rules and found three
meaning changes, all fixed: "remove one that buys nothing" had narrowed
to checks that catch errors, "report each module an update breaks"
promised that every broken module is reported, and the test rule had let
a test change only where its behavior moves. Codex also noted an
exclusive claim that exists in both versions: the event log and the
records outside a page are called the only data that passes between Leaf
versions, though Leaf also keeps records inside the page directory (the
layer selection, stored drafts). This PR leaves that claim as the
maintainer wrote it.

Asked by max-sixty, who picked this rewrite after reading its diff on
the survey page. Prose only; pre-commit passes.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty added a commit that referenced this pull request Nov 27, 2026
…6577)

Four shipped sentences still told an author to use a named
default-package widget, which root `AGENTS.md`, "Keep the layer open",
rules out: an instruction names the form, and a package's widget only as
an example or in markup. They are the kernel registry's `table` entry
(`lf-options` for alternatives the user picks between), its code-block
entry (`lf-code` for a walkthrough with numbered lines),
`live-samples.md` (`lf-sample` for an isolated live page) and
`module-state.md` (`lf-code` for a snapshot that travels with the page).
Each now names the form, and the page's vocabulary says which widget
provides it. A Codex review of #6576 found the two references, and a
sweep of the kernel registry found the other two.

Bundled packages' own guidance still names other packages' widgets in
about a dozen places, such as timeline's "use `lf-trace` for a recorded
browser journey", and stays as it is: a package's guidance is one
author's advice, not the central authority the rule is about.

Not scored: #6549 scored this same rewording across 12 cases with no
regression, and these four sentences are the last clauses of their
entries. Tests: pre-commit, and the model tests that read the vocabulary
and page instructions (186 passed).

> _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