Skip to content

Keep developing-leaf whole after a compaction, and have leaf-dev search for a mechanism before writing one - #5967

Merged
max-sixty merged 5 commits into
mainfrom
duplicate-dev-code-cause
Nov 14, 2026
Merged

max-sixty merged 5 commits into
mainfrom
duplicate-dev-code-cause

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

Sessions keep re-implementing leaf-dev mechanisms that already exist; leaf-dev placements (#5846) rewrote leaf-dev pins' report page. Two causes are fixed here. First, Claude Code re-attaches only the first 20,000 characters of a loaded skill after a compaction, and developing-leaf (29,913 bytes) lost its tail, including "Weigh what a change adds" with its "What it repeats" search, in 66 of the 78 compacted sessions that loaded it since 1 November. The skill now moves the procedures one occasion needs into references/ behind stub headings, which keep every citation working, and drops to 17,095 bytes. A pre-commit hook holds it, and the shipped leaf skill, under 19,500 bytes; the skill has grown about 1,500 characters a week, so the hook fires again within a couple of weeks, asking for the next move. Second, dev/AGENTS.md sent an author to three module headers, while the code they needed lived inside other commands. It now asks for a search by the calls a mechanism makes.

Replaying the placements session from the user's request: on the old guidance, both runs wrote their own media writer, page shell and outline without opening pins.py. On this branch, both grepped for ImageDraw and media_name, read pins' report code, and moved its media writer into page_fixtures.py for both commands to import. Neither shared the page shell or the lf-shot pair; #5965 consolidates those.

Moved text is byte-identical to the sections it came from. Pre-commit passes; no suite run, since nothing here is code.

Asked for by Max. Codex reviewed the diff; its one finding (the search stopped at dev/) is folded in.

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

…ch for a mechanism before writing one

Claude Code re-attaches only the first 20,000 characters of a loaded skill
after a compaction. developing-leaf has been longer than that since
6 October and is now 29,913 bytes, so a session loses its last third at its
first compaction. That third holds "Weigh what a change adds", including its
"What it repeats" search for existing code, "Regular maintenance" and "Land
a change". Since 1 November, 99 Leaf sessions on this machine loaded the
skill and 78 of them compacted. In 66 the skill came back cut off, 237
times in all, and only one of those sessions read the file again. The
session that wrote `leaf-dev placements` (#5846) lost the tail at a
compaction an hour before it re-implemented `leaf-dev pins`' report page.

- developing-leaf moves the procedures one occasion needs into
  `references/`: external UI skills, the agent journey, changing and
  scoring instructions, checks and guidance for the authoring agent, and
  exploring an open design. A stub keeps each cited heading and says when
  to open its page. Catalog-still refreshes move to `examples/AGENTS.md`,
  where changes to examples are made. The skill drops to 18,652 bytes, and
  the text of its other sections is unchanged.
- A pre-commit hook fails when developing-leaf's or the shipped leaf
  skill's SKILL.md passes 19,500 bytes. developing-leaf has gained about
  1,500 characters a week, including after the cut in #3777, so a one-time
  split would not stay under the limit.
- `dev/AGENTS.md` told an agent to read three module headers (`arms.py`,
  `page_fixtures.py`, `browser.py`) before writing a mechanism. The
  placements session read exactly those, plus probe, visits, states and
  stills. It saw `pins.py` in a listing and never opened it, because
  pins' report page lives inside the command and the command is named for
  its subject. The sentence now says that a mechanism one tool uses stays
  in that tool's file, and asks for a search of all of `dev/` by the calls
  the mechanism makes, including when turning a script of one's own into a
  command.
A review found that the passage's search stopped at dev/ while dev/AGENTS.md
keeps a single experiment's mechanisms in evals/, and the duplicate sweep
found copies across evals/*/provider.mjs and src/leaf/.
leaf-agent
leaf-agent previously approved these changes Nov 14, 2026
After merging main, developing-leaf stood at 18,930 bytes, 570 under the
skill-size hook, and main had added 278 bytes to it that day. Moving the
preview procedures out leaves it at 17,095 bytes, about 2,400 under the
hook.
max-sixty added a commit that referenced this pull request Nov 14, 2026
The skill-size test fails on main too (30,189 characters against its 30,000
cap); this branch now leaves the file 135 characters shorter than main's, and
PR #5967 moves the journey section out of it.
max-sixty added a commit that referenced this pull request Nov 14, 2026
`page check --render` now refuses a page with `under-panel` when a word
stays under the floating panel's row however far the page scrolls. Leaf
keeps the panel's room as body's bottom padding (`--lf-foot-room`), and
a page could lose it with no check saying so: a reset that zeroes body's
padding, a body held to the window's height that its content runs past,
a `main` or `body` that scrolls itself, or a fixed bar at the window's
foot. Until now the covered-words reading compared the page's words only
with each other.

No CSS keeps the room against all of those, since the page can end its
content past any box Leaf pads, and an `!important` padding would
override spacing the author set on body. So the gate reads the outcome.
`paintedRuns` gives each run a second box, where it would stand with
every scroller at its end, by lifting the run by the scroll each
scroller above it has left, so the reading scrolls nothing.
`coveredWords` reports a run whose end box overlaps a box the panel
covers (`coverBoxes`, now exported through `check-api.js`). The
examples' render suite now holds Leaf's own Layouts to the room too.

What the diff doesn't show: words in a bar the page sticks to the
window's foot go unreported, since the reading lifts that bar from where
it sticks (the header says so). The commit was written on 2026-11-03
against `windowChromeBoxes`, which #5361 replaced. It now reads
`coverBoxes()`, which the gate takes before it opens a thread, when the
panel's box is its row, and runs beside the covered-words sweep #5769
added.

Evidence: when written, it fired on none of 198 real pages the markup
check accepts, the 45-page example corpus or the plain pages, agreeing
with an independent reading that scrolls each scroller to its end, and
it fired on each of seven hand-made pages that lose the room, at the
desktop and phone windows. On this branch it fires on none of the 48
authored pages at 1280, 540 or 360px, and the full gate refuses a page
that zeroes body's padding at every width from 360 to 1920px.

Max asked for this during a stale-work sweep; a subagent had committed
it locally and never opened a PR.

Tests: `test_words_the_panel_covers_at_the_page_s_end_are_reported`
(room kept, reset, `main` scrolls, `body` scrolls) and the covered-words
and `paintedWords` neighbours pass, as do `pnpm run check:browser` and
pre-commit. CI's `test` job fails one test, inherited from main:
`test_every_skill_file_reads_in_one_command` finds
`.claude/skills/developing-leaf/SKILL.md` at 30,189 bytes since #5820;
this branch leaves that file alone, and #5967 shrinks it.

> _This was written by Claude Code on behalf of max-sixty_
@max-sixty
max-sixty merged commit 917a3cf into main Nov 14, 2026
5 checks passed
@max-sixty
max-sixty deleted the duplicate-dev-code-cause branch November 14, 2026 22:06
max-sixty added a commit that referenced this pull request Nov 14, 2026
…tice

"Regular maintenance" asks who would notice a mechanism gone, and the command
answers from the pages on this machine. The sentence waited for #5967, which
split the skill and brought it back under its 30,000-character cap.
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