Repository navigation
Keep hand-run broad test selections off the shared host, and score maintainer-guidance changes in scratch - #2481
Merged
Merged
Conversation
…s-loaded instructions Two sessions on 2026-10-11 ran `uv run pytest tests -n 8` by hand before handing over, while other sessions were testing. Neither had the prohibition in context: it lived in tests/AGENTS.md, which loads only when a session reads a file under tests/ (one never did; the other's copy was compacted away). Root AGENTS.md, which every session reads, instead asked agents to check the host's load and "weigh the extra evidence against the cost", and said the broad selection "runs at landing". Each agent checked `uptime`, judged the load tolerable, and ran the suite. Of 20 transcripts with a hand-run broad selection since 2026-10-04, 16 lacked the tests/AGENTS.md text; all four after the weigh sentence landed checked load first. Root AGENTS.md now owns the rule: the landing gate runs the broad selection; don't run it, a whole browser file, or the whole nightly tier by hand before landing, however idle the host looks; a change most of the suite runs through still hands over on the tests of what it changed. The load check now governs widening the change's own selection. tests/AGENTS.md points at it. The TypeScript-gate sentence names `pnpm run check:bundles` and `pnpm run check` instead of `wt hook pre-merge`, which also runs the broad selection and which sessions ran by hand. Evals: AGENTS.md joins the arm payload so an internal instruction case can inject it, and an instruction case's provider is now keyed by its source, so cases injecting different files selected together no longer share one provider's context. New case handover-leaves-the-broad-selection-to-landing: main 9/10 against 0/10, guards (land with wt merge; run the callers' tests) 3/3 on both arms. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…-selection eval case The previous commit added an internal eval case for its AGENTS.md change, and widened the arm payload to carry AGENTS.md so the case could run. /developing-leaf already called internal cases exceptional, "justified only for a Leaf-specific development contract that neither can exercise", but every rule in Leaf's own guidance is Leaf-specific, and the personal suite does not load Leaf's files, so the exception read as covering any maintainer-guidance change. The section now sends those changes to a temporary scratch A/B with no committed case, keeps an internal case for a contract that needs the suite's own staging (a served page, an installed arm), and says a rule being Leaf's own is not that exception. Scratch A/B (each arm given its version of the section, claude -p, no tools): for the broad-selection change, the old text led to a committed case plus a PAYLOAD change 3/3, the new text to a scratch A/B with nothing committed 3/3. For a served-preview workflow change that regressed three times, both texts kept an internal case 3/3. The case and the PAYLOAD entry are removed; the AGENTS.md change was measured by them (9/10 against 0/10). The provider fix stays: an instruction case's variants with a different source, such as review-shows-the-change's ui-sweep variants, shared the main case's provider and received its file. The test now uses those variants. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # AGENTS.md # tests/AGENTS.md
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 12, 2026
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.
Two sessions on 2026-10-11 ran
uv run pytest tests -n 8by hand on the shared Mac before handing over, while other sessions were testing. Neither had the rule against it in context. It lived intests/AGENTS.md, which loads only when a session reads a file undertests/: one session never used the Read tool, and the other's copy had been compacted away. The always-loaded rootAGENTS.mdinstead asked agents to check the host's load and "weigh the extra evidence against the cost", and said the broad selection "runs at landing". Both checkeduptime, judged the load acceptable, and ran the suite. Of 20 transcripts with a hand-run broad selection since 2026-10-04, 16 lacked thetests/AGENTS.mdtext, and all four runs after the "weigh" sentence landed checked load first.Changes
AGENTS.md, "Working on the repository", now owns the rule. The landing gate runs the broad selection. Don't run it, a whole browser test file, or a whole later tier by hand before landing, however idle the host looks. A change to code most of the suite runs through still hands over on the tests of what it changed. The load check now applies to widening the change's own selection.tests/AGENTS.mdpoints to it instead of restating it./developing-leaf, "Score an instruction change": a change to maintainer guidance is scored with a temporary scratch A/B and commits no case. An internal case is kept only for a contract that needs the suite's own staging, such as a served page or an installed arm. The old wording ("a Leaf-specific development contract that neither can exercise") read as covering any change to Leaf's own guidance.leaf-dev eval: an instruction case's provider is now keyed by the file it injects. Before this,review-shows-the-change's ui-sweep variants shared the main case's provider and received the developing-leaf skill instead. The new test intests/test_eval.pyfails without the fix.Validation
AGENTS.mdparagraph was scored with a temporary internal case, since removed: the recreated handover passed 9/10 against 0/10, and guards for landing withwt mergeand for running the changed code's own browser tests passed 3/3 on both arms./developing-leafsentence was scored with a scratch A/B. For this change, the old text led to a committed case and a widened eval payload 3/3; the new text led to a scratch A/B with nothing committed 3/3. For a served-preview workflow that keeps regressing, both texts kept an internal case 3/3.tests/test_eval.pyandpnpm run test:evalspass.