Repository navigation
Keep protocol references to what other code relies on - #3727
Merged
Merged
Conversation
Since 2026-09-30 the maintainer guidance grew from about 33k to 48k words, most of it in the five protocol references. A sample of 28 commits found that about 40% of the added words change nothing a reader does, and nearly all of those came from feature and fix PRs mirroring how their code now works into a reference, often one clause per race fixed. The rules in the author's path said where a fact goes, never whether a sentence belongs. - src/AGENTS.md, "Protocol references": a reference states what code on the other side of a boundary may rely on; how one module provides it goes in its header, and the failure that taught it in the commit. - /developing-leaf, "Land a change": the reader test now covers every guidance file, the references included, not only area AGENTS.md files. - running-tend's review threshold: a sentence narrating how the diff's code works, in maintainer guidance, is a prose defect the reviewer flags. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… crash The cut's eval runs showed each of these failing for a reason the cut didn't cause: - widget-list-keeps-focus forbade performUpdate(), which module-authoring.md names for drawing at once on a LeafElement and the bundled widgets call; it now accepts either route that draws before the handler returns. - surface-page-takes-the-window required a workspace or page tabs, while the playground instructions have prescribed a page of parts since #3198; it now accepts a page of parts whose first part is the workspace. - browser-geometry's verdict regex missed a bold **REVISE**. - pin-takes-no-page-room accepted the `o` key alone for a user writing from a phone; it now requires the menu route a phone has. A cut that dropped that route went from 4/4 to 0/4 on replies while the old rubric passed both. Main's guidance passes the three Leaf cases 6/6 (Claude Code, 2 each). `leaf-dev eval` crashed with FileExistsError when a run mixed a case that injects instructions with one that doesn't, since the first provider's work directory (claude-code/base/instructions:...) created the second's (claude-code/base) as its parent. Work directories are now flat; the smoke test selects that order. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A paired replay of #3591 (8 pairs, plus a 4-pair guardrail) found that the widened "Land a change" check was in context in every rules-arm run and changed nothing those runs wrote: it loads at session start, 70 to 100 turns before the reference edit. The protocol-reference rule in src/AGENTS.md never reached the agent either, since agents read code through git diff, sed and rg, and a nested AGENTS.md loads only when the Read tool opens a file under it. The guardrail held in both arms. That rule stays as the standard the tend reviewer enforces: the review gate is the one place that sees every reference diff. The skill's paragraph returns to main's text, saving its cost in every session. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # evals/surface-page-takes-the-window/case.yaml
The user's direction in the root AGENTS.md told every change to update its contract prose with the code, which contract-sync PRs read as describing each mechanism change in a protocol reference. "Stage" now says a change that keeps every guarantee changes no contract prose, and "Where instructions live" says a shared contract's reference states what each side relies on, not how one side provides it. Added at the user's pick on the guidance-cut review page. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The commit-message rule and the keeps-every-guarantee rule are stated in the root AGENTS.md; the review threshold lists its prose defects without counting them. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 23, 2026
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.
A diagnosis of 28 commits that grew Leaf's maintainer guidance found that about 40% of the added words change nothing for a reader. Most came from feature and fix PRs copying their mechanism into the protocol references, one clause per race closed. This PR states where that text belongs and adds the check at review, which is where the replay showed a rule can reach the edit.
AGENTS.md, in the sentences the maintainer chose: "Stage" says a change that keeps every guarantee changes no contract prose, and "Where instructions live" says a shared contract goes in its boundary's protocol reference, which says what each side relies on rather than how one side provides it.src/AGENTS.md, "Protocol references": what a reference holds (shared records and events, who writes them, when a reader stops believing them, the orderings a change must keep) and where a module's mechanism goes instead (its header).running-tend, review threshold: a maintainer-guidance sentence that narrates how the diff's code works, or which failure it fixed, joins the prose defects a review flags. Moving that text to the module header or the commit message is the fix.An A/B replay of #3591 (8 pairs) tested rules placed at session start. The
src/AGENTS.mdrule never entered any run's context, and a/developing-leaflanding rule loaded 70–100 turns before the edit and changed nothing, so that rule was dropped. The review gate is untested.The same pass fixed four eval cases that were stale against current main, plus a harness crash:
widget-list-keeps-focusnow acceptsperformUpdate()on aLeafElement, whichmodule-authoring.mdnames for drawing at once.pin-takes-no-page-roomrequires a route a phone user has: the menu, not theokey.browser-geometry/code-copy-reserves-roommatches a verdict that has leading markup.leaf-dev evalgave each provider label a nested work directory, soclaude-code/base/instructions:…landed insideclaude-code/baseand raisedFileExistsError. Each label now gets one flat directory, and the smoke test covers a case with instructions next to one without.