Skip to content

Put each guidance rule in one home, and the loop's rules in the batch - #304

Merged
max-sixty merged 17 commits into
mainfrom
guidance-one-home
Sep 5, 2026
Merged

max-sixty merged 17 commits into
mainfrom
guidance-one-home

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A survey of the repository's skills and guidance against what the project is for (a page the agent hands over, a loop that carries anchored comments and actions back, a page directory as the durable record) found the same rules stated in two to four places, the references that govern the reply loop unread by sessions running the loop, and the developer files carrying their contracts inside the history of each rule's discovery. This branch puts each rule in one home at the level where its reader acts on it.

The authoring skill. SKILL.md is routing plus the page contract's intent; the Ask rules, package guidance, and Codex payload live in the references that own them (authoring-decisions.md, page-authoring.md, host-codex.md). conversation-loop.md keeps the two facts an author acts on about a work claim. The lf-num rule is a three-step procedure, and leaf data set and leaf data capture now print the updated instant it tells the author to pin. The lf-tabs rule moved from anchors to authoring-revisions.md, which owns keeping a page current.

The loop's rules travel in the batch. In the local session corpus, no session that ran leaf ack had read event-batches.md and none that ran leaf reply had read conversation-threads.md. The kernel registry now declares $events.handling, one sentence per event kind, and every batch's first line carries the sentences for the kinds it holds beside threads; the Codex epoch entry carries the same. A project layer restates one kind merge-patch style, as it does a reaction token; the registry door refuses an undeclared kind or anything but a non-empty sentence; a page vendored before the member existed gets the installed kernel's sentences. event-batches.md keeps the delivery and acknowledgement mechanism and drops the per-kind list.

Developer files. The runtime contract lives at skills/leaf/assets/CLAUDE.md, since Claude Code includes a subdirectory's CLAUDE.md whenever a file there is read and the old location loaded it into every checkout session that read the skill. #301 landed its own cut of that file while this ran; the merge takes main's version, moved, with the preamble pointing at the root's cross-runtime headings, and keeps this branch's headers for the 19 runtime modules main left bare. tests/CLAUDE.md and examples/CLAUDE.md are rules under their old headings (other guidance points at them by heading). internals/events.md and internals/session-lifetime.md lead with tables of fact, writer, and expiry. developing-with-leaf keeps its Codex steps under their own heading, and ui-sweep names the sections it judges against.

Two review passes ran over the rewrites: an audit for rules dropped rather than condensed (seven found, all restored in the last commits) and a code review of the batch change (validation at the registry door, the reading moved beside the other declaration readings, restate and refusal tests). Not built: a render-gate check for a Mermaid statement that renders as a node, since the bundled renderer exports no parser to compare against; the reference names what the widget refuses and leaves the rest to one look at the drawing.

Sizes before and after, in words
File Before After
skills/leaf/SKILL.md 1,446 1,161
references/conversation-loop.md 672 390
references/event-batches.md 1,216 480
references/internals/session-lifetime.md 2,199 1,500
tests/CLAUDE.md 8,380 5,660
examples/CLAUDE.md 3,555 2,023
runtime contract (main's cut, moved) 34,195 6,472

The full-loop reading path for an authoring agent is 7,036 words, from 8,348.

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

🤖 Generated with Claude Code

https://claude.ai/code/session_01NsZewB4eky9zXSkeDmLR7w

max-sixty and others added 16 commits September 5, 2026 08:42
Claude Code includes a subdirectory's CLAUDE.md when a file in that
directory is read, so skills/leaf/CLAUDE.md loaded into every checkout
session that read the skill or a reference, including sessions authoring
a page. The file states the contract for leaf.js, the runtime modules,
and the theme, so it now lives at skills/leaf/assets/CLAUDE.md and loads
for sessions that edit what it constrains. A short packages/CLAUDE.md
points widget modules at the module contract. ui-sweep now names the
sections it judges against rather than treating the whole contract as a
checklist.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsZewB4eky9zXSkeDmLR7w
The root instructions require major modules to carry their contract;
47 of the 86 runtime modules had no header, and the browser contract
kept a hand-maintained list of what each one owns instead. Every module
now opens with a comment naming what it owns, and seven modules that
restated the same fact after their imports keep it once.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsZewB4eky9zXSkeDmLR7w
The contract's own preamble forbids recording how the current
implementation was reached, and long passages did exactly that. Each
passage now states the invariant, names the function or property that
owns it, and names the test that pins it; the discovery stories go. The
hand-maintained module ownership list is replaced by the rule that each
module's header names what it owns, and the cross-runtime rules point at
the root instructions' own headings. Four names the file cited that no
longer exist in the runtime are corrected, and one cited test is renamed
to the one that holds the rule.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsZewB4eky9zXSkeDmLR7w
Both files were addressed by heading from other guidance and written as
the history of each rule's discovery. Each section now states the rule,
the helper that carries it, and the test that pins it, under the same
headings, so a pointer to a heading lands on the rule.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsZewB4eky9zXSkeDmLR7w
The checkout skill kept Codex-only steps inline for every host and
carried a rule about writing shipped guidance; the Codex steps sit under
their own heading and the rule moves to the root instructions' feature
checklist. ui-sweep already names the sections it judges against.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsZewB4eky9zXSkeDmLR7w
The events reference opened with one paragraph enumerating every kind
inside nested parentheses, and the lifetime reference argued each
mechanism in prose. Both now lead with a table of fact, writer, and
expiry, the shape the browser contract already uses, with the prose kept
for the rules a table cannot state.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsZewB4eky9zXSkeDmLR7w
The rules for answering a comment, carrying an action into markup,
receipting a request, or reading an undo lived in a reference that
sessions running the loop did not open. The kernel registry now declares
them under $events.handling, one sentence per kind, and every batch's
first line carries the sentences for the kinds it holds, beside the
threads those events land in. A project layer restates a kind
merge-patch style, as it does a reaction token. The reference keeps the
delivery and acknowledgement mechanism and drops the per-kind list.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsZewB4eky9zXSkeDmLR7w
SKILL.md loads on every /leaf, and it restated what its references own:
the Ask rules from authoring-decisions.md, the reading-cost rules from
page-authoring.md, the package-guidance lookup, and the Codex delivery
payload and retry rule that host-codex.md, event-batches.md, and
codex-watcher.md also carried. The body now routes and states the page
contract's intent; host-codex.md owns the payload and its retry rule.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsZewB4eky9zXSkeDmLR7w
Half of it described the Target Button's phases and paint, which the
runtime contract and the lifetime reference own. What the author acts on
is that status --on places the claim beside its subject and that a claim
stops being believed shortly after its turn ends, so a delegate renews it.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsZewB4eky9zXSkeDmLR7w
The lf-num rule packed its steps into one sentence about an instant being
"already behind the write". It is three steps: measure, record with data
set, and copy the printed updated instant into at. data set and data
capture now print that instant, so the author does not read it back out
of data.json. The Mermaid warning names what the widget already refuses
and what it cannot.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsZewB4eky9zXSkeDmLR7w
The lf-tabs paragraph sat under Stable anchors in page-authoring.md while
authoring-revisions.md owned keeping a page current; it now lives there.
The pre-handover review no longer restates the skill's handoff ceremony
and says which gate it is.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsZewB4eky9zXSkeDmLR7w
main's #301 fanned the runtime contract out to module headers and cut it
to 44KB, which is the deeper form of this branch's #8 and #9. The merge
takes main's contract, moved beside the runtime as this branch had it,
with its preamble pointing at the root's cross-runtime headings; keeps
main's module headers where main wrote one and this branch's for the 21
modules main left bare; and ports main's delivery-ledger wording into the
rewritten test rules.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsZewB4eky9zXSkeDmLR7w
The batch's first line reads the vendored handling map directly, so the
registry door now refuses a layer that names an undeclared kind or gives
one anything but a non-empty sentence; absent stays fine for a page
vendored before the member existed. The reading moves beside the other
declaration readings in registry/contract.py, the direct-loop reference
shows the first line's current shape, and two tests pin the restate and
the refusal.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsZewB4eky9zXSkeDmLR7w
An audit of the rewritten files against their originals found rules
that had gone rather than shortened: the readiness obligation on
open_page's escape, the stale-state route pattern, the bounded frame poll
the diff renders keep, the test that holds the corpus to its sources,
the state rail's band above a drawn shot, the per-audience guidance
command for a non-author role, and the clause that a reaction never
gates activation or stamping.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsZewB4eky9zXSkeDmLR7w
A page whose vendored layer states no $events.handling would deliver an
empty map, and the reference no longer lists the per-kind rules, so such
a page's batches carried no guidance at all. The batch now falls back to
the installed kernel's sentences, which instruct the installed CLI either
way; a layer that states the member still wins.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsZewB4eky9zXSkeDmLR7w

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The $events.handling design holds: the member merges by kind the way $reactions.tokens does, the registry door refuses what a batch could not carry, a pre-member page still gets instructed off the installed kernel, and handling() only ever sees a registry load_registry already validated. Two small things, both from the file move rather than the batch change.

The moved skills/leaf/assets/CLAUDE.md still addresses its siblings from its old directory. Besides the inline suggestion, the theme paragraph opens `assets/theme.css` is the default theme — from skills/leaf/assets/ that is now just theme.css. The sibling skills/leaf/packages/CLAUDE.md writes ../references/packages.md, which is the form that survives the move.

In skills/leaf/scripts/leaf/data.py, _write_source still declares -> int while it now returns (revision, updated); both call sites unpack it, so nothing is broken today.

Comment thread skills/leaf/assets/CLAUDE.md Resolved
The runtime contract addressed its references from skills/leaf/; from
assets/ those paths need ../, and the theme is a sibling. _write_source
declares the pair it returns.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsZewB4eky9zXSkeDmLR7w
@max-sixty
max-sixty merged commit d806818 into main Sep 5, 2026
12 checks passed
@max-sixty
max-sixty deleted the guidance-one-home branch September 5, 2026 17:32
max-sixty added a commit that referenced this pull request Sep 5, 2026
The everyday suite never asked whether a reader can see a key. A key
line with no rows in it is silent — the chrome paints, the console stays
clean, and every other everyday assertion holds — so the whole boot
cutover ran against a gate that would not have noticed. One assertion
closes that: at rest a page shows `c` and `r`, and a planted `lineRows`
returning nothing fails it while `errors` stays empty. The boot's own
failure to register a painter is loud and already covered.

This branch started much larger. It was fanning `tests/CLAUDE.md` out
into the helpers each rule describes, written before #304 rewrote that
document keeping the rules in place and its headings as addresses. Both
were the same job done opposite ways, and #304 landed first, so every
paragraph this branch added — the probe timeout, the traffic ledger,
`data-lf-applied`, the `aborted` refusal, autouse ordering,
`HOLD_MOTION`'s release, the ring reading — became a second copy of a
rule that now has a home. Those files are back at main's version.

`ring_faults` is also spelled here the way the code spells it.
`RING_FAULTS` appeared in the document and in a comment in
`test_render_conversations.py`, and is not a name in the tree.

Three citations named something that is not there. `## Layout and
motion` opens "The page must hold still under the reader's aim", and
#301 quoted a paraphrase of that sentence as though it were a heading,
from `chrome.css` and from `docs/site.css`. main has since deleted
`docs/site.css` outright, so that one is gone with the file.
`chrome.css` and `skills/leaf/assets/theme.css` now name the heading,
which is the address. Every quoted citation in the tree resolves against
a heading in the document it names, and the phrase itself appears
nowhere.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
max-sixty added a commit that referenced this pull request Sep 5, 2026
The everyday suite never asked whether a reader can see a key. A key
line with no rows in it is silent — the chrome paints, the console stays
clean, and every other everyday assertion holds — so the whole boot
cutover ran against a gate that would not have noticed. One assertion
closes that: at rest a page shows `c` and `r`, and a planted `lineRows`
returning nothing fails it while `errors` stays empty. The boot's own
failure to register a painter is loud and already covered.

This branch started much larger. It was fanning `tests/CLAUDE.md` out
into the helpers each rule describes, written before #304 rewrote that
document keeping the rules in place and its headings as addresses. Both
were the same job done opposite ways, and #304 landed first, so every
paragraph this branch added — the probe timeout, the traffic ledger,
`data-lf-applied`, the `aborted` refusal, autouse ordering,
`HOLD_MOTION`'s release, the ring reading — became a second copy of a
rule that now has a home. Those files are back at main's version.

`ring_faults` is also spelled here the way the code spells it.
`RING_FAULTS` appeared in the document and in a comment in
`test_render_conversations.py`, and is not a name in the tree.

Three citations named something that is not there. `## Layout and
motion` opens "The page must hold still under the reader's aim", and
#301 quoted a paraphrase of that sentence as though it were a heading,
from `chrome.css` and from `docs/site.css`. main has since deleted
`docs/site.css` outright, so that one is gone with the file.
`chrome.css` and `skills/leaf/assets/theme.css` now name the heading,
which is the address. Every quoted citation in the tree resolves against
a heading in the document it names, and the phrase itself appears
nowhere.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
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