Skip to content

Cut Leaf's maintainer guidance by 31% - #3777

Merged
max-sixty merged 8 commits into
mainfrom
guidance-cut/maintainer
Oct 24, 2026
Merged

max-sixty merged 8 commits into
mainfrom
guidance-cut/maintainer

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

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 01a765701 --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 (Clarify when additive changes keep the page protocol #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

max-sixty and others added 8 commits October 23, 2026 16:49
session-lifetime.md drops what the module headers it now points at already
hold: Stop policy and handover (hook_transport.py), receipt and re-delivery
after Escape (delivery.py), the Claude Code watch (session.watch_between_turns),
the Pi run boundaries (hooks/pi.ts), workflow settlement (workflows.py), nudge
mechanics (presence.nudge_*), reconnect detail (reconnect.py), the start
handshake (hosting.claim_and_start, service.publishing_claim), version
measurements, and the observations.jsonl field catalogue
(interaction-batch.schema.json). page-storage.md keeps every `## Files` bullet
the storage-contract test parses, each with its owner and the one rule a
maintainer needs.

Kept: the fact table, the activity kinds, the workflow conditions (no module
header states them), the Stop rule as hook_transport.stop_continues applies
it, both manifest digests (executable decides patch versus replace; widgets
decides which widgets a patch keeps), a refused revival leaving the service
enabled until `server stop`, and the headings other files cite ("Watchers",
"Lifetime", "A session's files", "Files", "Revision delivery").

Corrected: the hook registrations now point at hooks/hooks.json,
hooks/codex.json and hooks/pi.ts (the old list omitted PreToolUse), SessionEnd
routes through bin/leaf to state.py, and `messaged_ending` names both writers.
serving-pages.md points at interaction-batch.schema.json for a browser row's
fields.

Carried from main since the cut: `leaf page open`/`page close` and
`thread reply` replace `leaf status` and `response reply`; `page claim`
replaces `codex start` and takes `--manual-delivery`; session-start hooks
replace resume hooks; Harness.fits_hook_context decides inline handover; the
revision bundle omits the browser runtime the serving Leaf supplies; the
leaf.js file is gone, and runtime/ and vendor/ hold only what packages add;
the http-connections grant record.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…e contract

events.md drops the obligation inventory's record detail (obligations.py,
`$keys["x-awaits"]`, the `Obligation` schema), thread-attention mechanics
(obligations.thread_obligation_readings, anchors_with_agent, settle_by_words),
read state (read_state.py), to-do and start mechanics (todos.py, plans.py),
publication staging (revisioning.py), drawing detail (render_gate/picture.py)
and summary and progress folds (events.py). The kinds table keeps its five
columns, every `kind-*` anchor and every required field, which the events
reference test and the site's Data structures page read.

layer-registry.md drops prepaint and bootstrap supervision (bootstrap.js,
prepaint.js), the transition lock (leases.py), identical-init behaviour
(vendoring.cmd_init), refusal names (layer.incompatible_layer,
incompatible_revision) and the kernel fact list (registry.layer.KERNEL_FACTS).
validation.md drops the static rule catalogue (validation/source.py, markup.py),
render invariants and sweep widths (render_version's docstring, readings.py),
screens, page-code, browser selection and driver detail (their render_gate
modules), and the file-side passage reading (passages.py).

Kept: the `part` exactness rule, `publication` on any reply that publishes the
saved source, a promised to-do keeping an obligation the agent's after the
thread resolves, every heading other files cite ("Admission", "Undo",
"Following the log", "Page protocol", "Browser validation").

Corrected: the kernel facts include `$passages`; whitespace collapse in both
runtimes is generated from `$passages`; the `receipt` row says what a receipt
confirms; `thread_title`'s writer is the server's title request; `$marks`'
registry description and registry/kernel.py now say a layer declaring a
different table is refused (merge_layer_declarations), not stamped over.

Carried from main since the cut: the `done` kind and sign-off approval are
gone; `thread reply` and `page open`/`page close` replace `response reply`
and `leaf status`; message obligations (`--obligation`, `message:<event-id>`);
the undo key's show-then-take press and `picked_up`; admission fills an
unvoiced agent event's voice and a writer for another session names its own;
the browser runtime is no longer vendored, so the protocol covers what
vendored modules send, vendored declarations and the public package API, the
served state needs no bump, and `--accept-served` is gone; the runtime
identity handshake (`data-lf-runtime-identity`, `Leaf-Runtime`); the render
gate's desktop window and probes served with their runtime.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…r rules

browser/AGENTS.md drops restatements of the module headers it now points at
(`data-lf-reflow` crediting in tests/shift_watch.js, fitAnswer, sendLanding,
held news, margin placement, keeps.js, rendering.js, presentation.js,
page-sheets.js, bootstrap.js), the "Authoritative projection" section, which
restated root AGENTS.md and obligations/model.js, the layout token list, the
`:has()` profiler's columns, and second and third examples per rule. It
merges "Generated interface appears in its final position" and "What may
appear fits into what is already there" into one rule. The concern index and
the question index, which tests/model/test_owner_index.py holds to the code,
are unchanged.

The keyboard guide drops scope resolution's full precedence list
(dispatch.js), touch-row mechanics (bindings.js, touch-controls.js,
target-picker.js) and the per-file module list. build/AGENTS.md drops the
per-script bullets, which browser/build.mjs's header lists, and moves the
lit-html 3.3.0 pin's reason and lift condition into litModule's comment.

Kept: every heading other files cite, the "A control takes only its own
room" rule floating-panel.js cites, the boot order, the field/native-control
priority, the register's refusals as policy, and the framework/ TypeScript
location.

Corrected: reading the whole root inside a paint subscribes it to every
publication rather than throwing (a scratch runtime test drew with no error).
The concern table's one_through_seq-per-answer and no-recorded-refusal facts
moved in from the deleted section.

Carried from main since the cut: the "What takes turns in a place doesn't
size it" rule and the "Editing in place" section, both as main wrote them;
`--lf-motion-*` curves and per-surface sheets; `data-room`,
`--lf-margin-content`/`marginContentLayout`, current-target.js,
`currentLocationIn`, `currentLocationOrigin`, `retainCurrentLocation` and
PRESENTATION_DOM in place of the old names; approval is gone from page
status; the Other responses picker replaces the comment field's no-ellipsis
rule.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The root above "Repository map" is byte-identical to main's.

Catalogs the code keeps move out of prose: `leaf-dev --help` now prints each
command's summary, read from the first paragraph of its module docstring
without importing it (so root help stays lazy), and replaces dev/AGENTS.md's
command list; src/AGENTS.md's module owner list gives way to the module
headers (`head -n 3 leaf/*.py leaf/*/*.py`), so
test_the_python_instructions_name_every_module_they_own, which only held that
list to the code, is deleted. Also dropped: restatements of build/AGENTS.md,
journey.py's header and /developing-leaf; rules the suite or build already
enforces (catalog titles, seeded messages, wait deadlines); dates,
attributions and measurements; plumbing no reader acts on (fonts.conf, the CI
setup action, fixture naming); and hedges. tests/AGENTS.md merges "Completion
comes from the operation" into "Functional results do not depend on execution
speed" and renames two headings ("Failing tests", "Races"), whose citations in
running-tend follow. compare.py's first docstring line now says what the
command does, since it is its summary.

Kept: the #2481 clauses ("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; reading the startup comparison by phase;
the reason a case consuming a watch's finding needs its own page; the
journey's state-home log and that publish-site runs it; every heading code
cites.

Carried from main since the cut: a contract several modules share goes in
its boundary's protocol reference, and src/AGENTS.md's paragraph on what a
reference states; pages run the serving install's runtime, the kernel while
it matches and the source modules otherwise (runtime_selection.read_runtime),
kept in the root because build/AGENTS.md no longer states it; PRESENTATION_DOM
replaces PRESENTATION_ORDER; approval is gone from the browser's own
additions; corpus files are ignored snapshots consumers generate on demand
(root, dev/ and examples/); landing goes through a GitHub pull request, with
`wt merge` only when the user asks; current location replaces logical
standing in tests/AGENTS.md's focus rule; the swap watch.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…d, ui-sweep, grinding-ui

developing-leaf drops what command help and module headers hold: journey
targets, transports and steps (`leaf-dev journey --help`, journey_*.py),
preview detach, slots and restarts (preview.py), stills and compare flags,
playground baseline mechanics (playground's author.md), the eval case format
(evals/README.md), landing gates (tests/AGENTS.md, "Selecting checks") and the
catalog pin mechanics (dev/AGENTS.md). The External UI skills table becomes a
list. The glossary keeps every term's definition and drops placement order,
row grouping, value lists and mechanism (seatRows, groupFor, obligations.py,
`$keys`, page-layout.md). running-tend, ui-sweep and grinding-ui lose
restated reasons and duplicate sentences; every step and variation dimension
stays.

Kept: every behavior the injecting eval cases grade
(interaction-proof-follows-the-reader, review-shows-the-change,
visible-outcome-before-handoff, trace-review, guideline-review): "Choose what
the user reviews", "Prove and hand off a visible change", "Explore an open
design", ui-sweep's "First reading" and "External review", and the pointer to
"External review" beside the /ui-sweep rule; #3532's scoring rules; every
cited heading.

Corrected: closing a page ends the agent's side of it, which the panel shows
as Page closed; it doesn't close the page in the browser.

Carried from main since the cut: the Mblode UI skills entry; `page close`
replaces `idle`; reply benchmarks attribute the whole reply's time by phase
(reply_phases.py) and compare across enough runs; the agent-eval input rule
(normal-use context, no grading or bookkeeping in the input, no steering to
the rule, a diagnostic that supplies a rule names that limit); the glossary's
renames (Page directory, Scroll behavior, Margin content, rowPlacement,
Navigation step and group, Current location, Element/Widget/Component) and
its "Related terms" section, which drops the Standing, Trip/Journey and
Reading posture bullets; running-tend's maintainer-guidance prose defect;
ui-sweep's empty-mode comparison and "layout" for "posture". Pointers follow
the D cut: the probe's `--base` points at `leaf-dev probe --help`,
response-times at its module, the catalog pins at dev/AGENTS.md "Commands with
consequences outside `.tmp/`", and running-tend at "Failing tests" and
"Races".

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Prettier's table padding after the group A and B resolutions changed cell
text; no words change.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…sk obligations

The review of the merge resolution found the layer registry had kept only half of #3681's rule, and packages/AGENTS.md had a broken reflow. The glossary's Obligation entry predated message obligations and user to-dos in the inventory.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 2715471 into main Oct 24, 2026
3 checks passed
@max-sixty
max-sixty deleted the guidance-cut/maintainer branch October 24, 2026 00:39
max-sixty added a commit that referenced this pull request Oct 27, 2026
browser/AGENTS.md's "Leaf's interface" mixed four levels: goals, Leaf-wide
specs, how one module meets them, and exceptions the user chose for one
surface. Each incident added its exception to the shared rule, so the section
grew from 1,873 to 2,372 words in four days after #3777's cut.

The section now has the seven goals of interface-goals.md as its headings.
Each opens with the goal and its reason from SOUL.md, and Leaf's specs follow
with one check and one owner each. Module mechanism and per-surface exceptions
are cut where the owning module or test header already states them
(floating-panel.js's fitAnswer, reply-continuity.js's refused-send growth,
shift_watch.js's credits, comment-placement.js's opening scroll); the intro
says they belong there. The four code-structure rules move to "Layouts,
styles and controls" under "Runtime ownership". Every citation of the old
subsection names follows.
max-sixty added a commit that referenced this pull request Oct 31, 2026
…s exact specs (#4498)

A survey of Leaf's principle layers (SOUL.md, root `AGENTS.md`,
`browser/AGENTS.md`, `developing-leaf`, the shipped references) found
that maintainer sessions rarely read `SOUL.md`, and that the interface
rules mixed Leaf's own exact specs with goals every page author should
meet. This change puts SOUL.md in every session's context, and splits
the interface rules into Leaf's own specs and broad goals for other
authors.

### SOUL.md in every session

- The root `AGENTS.md` now opens with `@SOUL.md`, which Claude Code
expands inline, replacing the pointer paragraph. "Where instructions
live" names the imported `SOUL.md` as maintainer direction, and the
repository map gains `README.md`.
- Responsiveness and "Pages across Leaf updates" become `##` sections,
since they stood under "Stage" only by position. The cross-runtime
section drops a restatement of Responsiveness.
- `SOUL.md`'s foundation principle gains the common-path rule: a
guarantee is owed to the paths users take often, and a rare path the
user takes in at a glance may move or redraw rather than carry a
mechanism of its own. `browser/AGENTS.md`'s "The page holds still under
the user's aim" applies it.

### Leaf's interface vs. other authors' pages

- `browser/AGENTS.md`'s "Layout and motion" becomes "Leaf's interface",
binding Leaf's runtime, chrome and bundled packages. Its sections are
now the seven goals of `interface-goals.md`, each opening with the goal
and its reason from `SOUL.md`, followed by Leaf's exact specs with one
check and one owner each.
- The section had mixed four levels, and each incident added its
exception to the shared rule (1,873 words after #3777's cut, 2,372 four
days later, and 2,533 on `main` now). How one module meets a spec, and
exceptions the user chose for one surface, are cut where the owning
module or test header already states them (`fitAnswer` in
`floating-panel.js`, `reply-continuity.js`, `shift_watch.js`'s credits,
`comment-placement.js`); the intro says they belong there. The four
code-structure rules move to "Layouts, styles and controls" under
"Runtime ownership". The section is about 2,400 words, about 350 of them
the new goal paragraphs. Specs main added since are ported into it.
- Every comment, docstring and skill citing the old subsection names
(Stability, Space and scrolling, Visual grammar, Words stay where they
were typed, Editing in place, Motion) follows; the kernel's source
digests move with those comments.
- New shipped reference `skills/leaf/references/interface-goals.md`
gives other authors seven goals for how a page should feel, with no
formatting specs. `SKILL.md`, `module-authoring.md` and
`packages/AGENTS.md` route to it. Both files say which rules bind
outside authors is still being settled.
- `page-authoring.md` drops a CSS and card paragraph the theme and
registry guidance already cover.

### Instruction evals

The shipped edits were scored with `evals/` on Claude Code, this branch
against its merge base with `main`, one sample per arm. Each candidate
run opened the changed file named beside its case:

| Case | Changed file the candidate read | Base | Candidate |
| --- | --- | --- | --- |
| `brief-document-needs-no-outline` | `page-authoring.md`, with the card
paragraph cut | 2/2 | 2/2 |
| `changing-feedback-keeps-place` | `interface-goals.md`, reached
through the new `SKILL.md` route | pass | pass |
| `controls-repay-their-cost` | `interface-goals.md` | 1/3 | 2/3 |
| `widget-checked-before-handoff` | `module-authoring.md`, with its new
pointer | 2/2 | 2/2 |

In `controls-repay-their-cost` both arms kept playback at real speed
only, which the case fails; only the candidate showed the short method
note inline rather than behind a disclosure. One sample per arm shows no
regression and can't establish an improvement.

The `test` job's only failure,
`tests/journeys/test_thread_response_continuity.py::test_refused_reply_retains_its_live_foot`,
is inherited: main's [scheduled run
41194441570](https://github.com/max-sixty/leaf/actions/runs/41194441570)
fails it too, and #4225 tracks main's scheduled failures. This branch
changes only comments there.

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