Repository navigation
Rewrite decision guidance around its goals, and say where instruction rules live - #3532
Merged
Merged
Conversation
A rule to label options' differing facts sat in the lf-option registry entry, where agents revising a decision never read it, and the first fix added a clause to a passage that had grown into a list. /developing-leaf now says to put a rule where the agent reads it while choosing, to rewrite a drifted passage around its goals rather than append to it, to score every case covering the passage, and to count only runs that opened the changed file. Eval prompts no longer name the file holding the rule, since such a case passes wherever the rule lives. packages.md says the same of x-instructions for package authors. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
reviewed
Oct 22, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
The absolute prompt rule would rule out the existing session replay in evals/options-label-what-sets-them-apart/case.yaml. That case names the files the agent had already read because those reads are part of the reported failure. The rule should distinguish replaying prior context from directing the agent to the rule's home during the eval.
authoring-decisions.md's paragraphs on how a widget records the answer, on retiring decisions and on widths were lists of instructions. They now lead with the goal each serves: the user answers in the form the answer takes, On me lists only what still needs the user, and the question, evidence and options stay on screen together. The width mechanics move to the lf-ask entry, which already held the obligation details the paragraph repeated. A decision now opens with a heading that asks its question. That rule lived only in the lf-ask entry, and with record-asks-hold-their-premise no longer telling the agent to read the registry entries, base opened the Ask with a paragraph in 0 of 3 runs, against 3 of 3 here; record-asks-hold-their-table went from 0 of 3 to 2 of 3. On the eleven asks cases, two runs per arm, every run read the reference except proposals-show-what-they-change's, which read none on either arm. The rest differed by one run in each direction on several checks. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The lf-ask entry keeps main's text: authoring-decisions.md points to page-layout.md, which already says how data-width widens a block inside an Ask. /developing-leaf's additions shrink to pointers into packages.md and /improving-instructions. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 22, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 22, 2026
…3621) Two follow-ups to #3532 on decision guidance and its evals. **Delete `sidebar-page-ask-grants-its-evidence-room`.** It passed only when the timing table in its timeout Ask carried `data-width`. Rendered on a 1440 px sidebar page, that five-column table takes about 390 px of the 720 px prose width and draws identically with or without `data-width="wide"`; only the option cards widen. Agents that left the attribute off judged the table correctly, so the case failed on every version (main 1/7, #3532 2/7) without measuring the instructions. **Leave label placement to the agent.** `authoring-decisions.md` told agents to label each differing fact before every option's title, in the same order, and to state shared values in the context. It now keeps only the goal: the user compares options down the group without reading their prose, as through `small.tag` labels for the facts they weigh. `options-label-what-sets-them-apart` now checks that goal rather than every-option, same-order labels. | Claude Code, 5 runs each | base | this PR | | --- | --- | --- | | `options-label-what-sets-them-apart` | 5/5 | 5/5 | | `options-draw-their-arrangement` | 5/5 | 5/5 | Under the old rubric the candidate left the reach label off the keep-today option in 2 of 5 runs, the detail this change leaves to the agent. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 24, 2026
Cuts Leaf's maintainer guidance by 31%, from 53,277 to 36,520 words over the 19 files below, as five commits, one per group (A–E). Each group was reviewed separately, side by side against main, before this branch assembled them onto main at `01a765701`. The cuts drop claims the code or another file already owns and point to that owner. Most of the remainder is catalogs the code keeps, restated module headers, history and hedges. The root `AGENTS.md` above "Repository map" is byte-identical to main. ## Groups Word counts are `wc -w` on main and on this branch. **A, session lifetime and page storage** (10,507 → 4,225, −60%): `src/leaf/session-lifetime.md` 7,638 → 2,971, `src/leaf/page-storage.md` 2,869 → 1,254. Stop policy, receipt, the Claude Code watch, nudges, reconnects, the start handshake and the `observations.jsonl` field list now live only in the module headers the text points at. Every `## Files` bullet the storage-contract test parses stays. Also corrected: the hook registration list now points at the registration files, since the old list omitted PreToolUse; SessionEnd's route through `bin/leaf` to `state.py` is stated; both writers of `messaged_ending` are named. **B, events, layer registry and validation** (10,834 → 6,879, −37%): `events.md` 6,074 → 4,123, `layer-registry.md` 2,103 → 1,417, `validation.md` 2,657 → 1,339. Obligation-record detail, thread attention, read state, the static rule catalogue, render invariants and the kernel fact list now live only in their modules. The kinds table keeps its columns, `kind-*` anchors and required fields. Also corrected: the kernel facts include `$passages`. The `$marks` registry description and `registry/kernel.py` now say that a layer declaring a different table is refused, where they used to say it is stamped over. **C, browser and build** (7,938 → 6,612, −17%): `browser/AGENTS.md` 6,211 → 5,413, the keyboard guide 1,241 → 1,002, `build/AGENTS.md` 486 → 197. Restated module headers and the "Authoritative projection" section are cut. The concern and question indexes are unchanged. The `lit-html` pin's reason moved into `litModule`'s comment. **D, area AGENTS.md files and the root from "Repository map" down** (10,953 → 7,645, −30%): root tail 2,523 → 2,214, `dev/` 1,579 → 481, `src/` 1,310 → 301, `tests/` 4,726 → 3,937, `examples/` 747 → 654, `packages/` 68 → 58. `leaf-dev --help` now prints each command's summary, read from its module docstring without importing it, and replaces `dev/AGENTS.md`'s command list. `src/AGENTS.md`'s module catalogue is deleted, and so is the test that only held it to the code. `tests/AGENTS.md` renames two headings to "Failing tests" and "Races", and running-tend's citations follow. **E, repository skills** (13,045 → 11,159, −14%): developing-leaf 4,382 → 3,543, its glossary 3,995 → 3,596, running-tend 2,467 → 2,300, ui-sweep 1,339 → 1,224, grinding-ui 862 → 496. Text that command help and module headers hold is cut. Every behavior the injecting eval cases grade is kept. Also corrected: closing a page ends the agent's side of it; it doesn't close the page in the browser. ## Scars kept Review restored or protected these: the #2481 clauses in the root ("even for a change most of the suite runs through", "on a busy host keep to focused checks"); the root sentence that `wt merge` skips the website delivery checks; developing-leaf's "Choose what the user reviews", "Prove and hand off a visible change" and "Explore an open design"; ui-sweep's "First reading" and "External review" and the pointer to it beside the `/ui-sweep` rule, which guideline-review measured; #3532's scoring rules; in events.md, the `part` exactness rule, `publication` on any reply that publishes the saved source, and a promised to-do keeping an obligation the agent's after its thread resolves; both revision manifest digests; a refused revival leaving the service enabled until `server stop`. ## Main since the cuts The groups were cut at `28b729d12`, and main had moved 166 commits since. Every group conflicted. Each resolution kept the group's text and carried in what main added to the same passages: the runtime no longer being vendored (`runtime_selection.py`, the runtime identity handshake, the protocol scope it narrows); `leaf page open`/`close`, `thread reply` and `page claim`; message obligations; the undo key's show-then-take press; the http-connections grant record; the render gate's desktop window; the "What takes turns in a place doesn't size it" rule and the "Editing in place" section; the corpus as ignored snapshots; landing through a GitHub pull request; the glossary's renames and its "Related terms" section; main's renames in the browser and keyboard guides. Main's new module entries in `src/AGENTS.md` and field names in the page-state reading were left out, because those groups had moved the lists into the code. One cut was reversed: the root keeps main's sentence that pages run the committed kernel while it matches and the source modules otherwise, because the file D pointed to for it (`build/AGENTS.md`) no longer says so after C. Pointers to sections that D removed from `dev/AGENTS.md` now target their current home. ## Checks - `pytest -n 4` on `tests/model/test_interact_layer.py`, `interact_contract/test_layer_contract.py`, `test_owner_index.py`, `test_unused_exports.py`, `test_session_lifecycle.py` and `dev/tests/model/test_response_times.py`: 252 passed, including the storage-contract, events-reference, root-directory-map and skill-file tests. - `uv run leaf-dev --help` prints every command with its summary. - `pre-commit run --from-ref 01a7657 --to-ref HEAD` passes. - A script resolved every `file`, `file, "Heading"`, `/skill, "Heading"` and `file.md#anchor` pointer in the changed prose, and grepped the tree for citations of every heading the branch removed. Its only real findings, the pointers into `dev/AGENTS.md`'s removed sections, are fixed. - `node --check build/browser/build.mjs`. `pnpm run check` was not run; the only change under `build/` is a comment. - An independent review rebuilt each file's three-way merge and checked main's change in each of the 60 conflicts against this branch. It found one lost clause (#3681's, on a bump chosen by hand) and a broken reflow, both fixed in the last commit, which also adds message and user-task obligations to the glossary's Obligation entry. - No evals were rerun on the assembled text. Group E's eval passes were run on its own branch. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
This PR does two things. It sets out in
/developing-leafwhere Leaf's instruction rules should live and how to score a rewrite of them. It then applies that to the rest ofauthoring-decisions.md.Maintainer guidance. #3441 found that the rule to label options' differing facts sat only in the
lf-optionregistry entry, which agents revising a decision never read. It also found that the first fix had added one more clause to a passage already grown into a list./developing-leafnow points to where each rule is already stated:packages.mdsays guidance a workflow shares across elements goes in the instructions that own the workflow, not in an entry'sx-instructions;/improving-instructionssays to rewrite a drifted passage around its goals and to count only runs that opened the changed file."Score an instruction change" also says to score every case whose tags cover the passage, and not to name the rule's file in an eval prompt.
authoring-decisions.md. Three paragraphs that were lists of instructions now lead with their goals:The width paragraph now points to
page-layout.md, "Bounds and widths", for thedata-widthmechanics. The answers paragraph drops the obligation details thelf-askentry already gives. The file is 75 words shorter.record-asks-hold-their-premiseno longer tells the agent to read the registry entries. Without that line, agents onmainopened the Ask with a paragraph rather than a heading, because the heading rule also lived only in thelf-askentry. The reference now says a decision opens with a heading that asks its question.Claude Code results:
record-asks-hold-their-premise0 of 3 onmain, 3 of 3 here.record-asks-hold-their-table0 of 3 against 2 of 3; the remaining failure put the table after the Ask.assessment-surfaces-pending-decisions3 of 3 on both.askscases, two runs per arm, before the heading sentence: each check scored the same on both arms or differed by one run, in both directions. Every run read the reference except those ofproposals-show-what-they-change, which read it on neither arm and so can't tell the two apart.sidebar-page-ask-grants-its-evidence-room, with the width pointer: 1 of 7 onmain, 2 of 7 here. It fails on both arms: agents rarely widen the timing table.