Repository navigation
Cut the guidance Leaf ships to agents to what they act on - #3778
Merged
Merged
Conversation
Group F of the guidance cut. It removes claims from skills/leaf/SKILL.md and the conversation-loop, threads, event-batch, harness, serving, checkpoint and revision references where another home already holds them or no reader acts on them: - Command help: body input and stdout/stderr conventions, what a reply or stamp ends, what --completes leaves open, the 80-character title limit, the summary label default and overlap rule, the record order of page interactions, page state <page> <id>, and what page claim stops. - What delivered handling already says: pasted images and capture areas, and an edited user message owed an answer. - Mechanism no reader acts on: the surfaces table and Sent/Queued/Delivered marks, the progress fold's author and streaming details, the desktop wake, Codex's queue check and one slice per turn, the render check's JSON fields, detached_from, the browser's attempt key, parent/responds on an answer, and prompt-hook and tool-batch handover details. - Duplicates and justification: the ack step, the sample envelope, two of three anchor-move examples, the route-list pointers, and sentences that only justified a rule. - Another reader's content: the checkout launcher, leaf-dev response-times and Workers Observability. It keeps the eval-backed passages: answering a question you can already settle before revising the page (parent-keeps-leaf-responsive/known-answer), the leaf task plan paragraph and example (0ae092c), the second thread summarize example (thread-fold-without-summary-prose), and that progress and failure replies publish nothing. It corrects SKILL.md step 1: running page init again with --package replaces the page's packages. Conflicts with main, which since the cut renamed response reply to thread reply, replaced status waiting/idle with page open/close and codex start with page claim, added source.digest, and pointed pointer deliveries at event-batches.md "Handle the input": - SKILL.md: kept main's PATH launcher wording, playground sentence and "Reading cost" pointer; applied the cut of the checkout launcher and the "Show the subject" justification, and the page init correction. - authoring-revisions.md: kept main's source.digest workflow and its sentence that a successful stamp preserves history and external data; dropped the refusal semantics, which page stamp --help now states. - codex-setup.md: kept main's page claim paragraph whole. - conversation-loop.md: dropped the surfaces table (main had only renamed commands in it) and the on_user gloss (main had only reworded it); kept main's "Page availability and handoff" heading, its page close paragraph and the render check's viewport clause. - event-batches.md, threads.md: took main's thread reply in the kept text. - harness-claude-code.md, harness-codex.md: kept main's pointer to event-batches.md "Handle the input" in the cut sentences. The group's cut in harness-codex.md had left "Input that arrives" dangling; the whole sentence goes. - page-checkpoints.md: kept main's desktop-size sentence, dropped the JSON field list. - serving-pages.md: kept main's claim that page claim prepares delivery and leaves the server alone; dropped "stops another session's watcher" (page claim --help). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Group G of the guidance cut, over page-authoring.md, page-layout.md, page-behavior.md, authoring-evidence.md, live-samples.md and the x-instructions in packages/default/registry.json and browser/registry.json. It drops: - Route restatements: each file's "Read this before…" opener, which repeats its SKILL.md route. - Copies of another reference: the subject rule for decision pages (authoring-decisions.md), the page-tabs-versus-parts choice (now only in page-authoring "Composing a page"), page/registry.json replacement rules (page-behavior.md), user-added options and "write new content directly" (authoring-revisions.md), and lf-options' "when to use multiple". - Copies of a registry entry: lf-text-document, lf-diff, lf-num, lf-code, svg.drawing, aside placement, section.panel and .callout, label.choice, lf-parts' shared history and lf-chart's Plot body. - Rules page check already reports: parser-blocking and async scripts, whole-document declarations, private layer imports, reserved lf- names and eight-hex ids, the render check's table-wrap widths. - Narration that asks nothing of the author: how the contents outline moves, a comment opening its disclosure, parts on a phone, a sample's height and Full view, motion playback mechanics, the cross-origin iframe refusal's reason. - Hedges with no failure behind them. It moves the side-list tab summary rules and "state the tally's count nowhere else" from lf-tab and lf-tally into page-layout.md, "A workspace", since agents revising a page re-read the reference (queue-is-a-side-list went 0/2 to 2/2). It keeps the eval-backed passages the review restored: a bounded pre or table clips what runs past it, with the data-bound and details routes (#3347); the touch route for hiding markers, the leaf's menu → Annotations → Hide annotations (pin-takes-no-page-room); and the route to a package's other audiences such as a contract's producer. Conflicts with main, which since the cut moved approval into lf-approval, dropped page sign-off, added interactive samples, rewrote "Reading cost" and the workspace bullet, and added "Space for changing text": - page-authoring.md: kept main's lf-motion claim that it plays authored animations or video recordings and that its instructions cover both, dropping the playback narration; kept main's "Reading cost" collapse guidance, dropping "Leaf opens a disclosure when a comment lands inside it"; took main's workspace bullet whole, since main had removed the sentence the group had replaced with its own guardrail. - page-behavior.md: kept main's instruction to operate gesture and timer paths to their final result and compare geometry across states; dropped the first-paint and no-browser sentences. - live-samples.md: kept main's two sentences on the child-page API and interactive mode in place of the cut static-sample sentence. - page-layout.md: kept main's new "Space for changing text" section; dropped the On lists pointer paragraph before it. - packages/default/registry.json: lf-parts drops "and sign-off" as main did; lf-draft takes main's lf-approval pointer; lf-sample takes main's description and interactive sentence, dropping "Keep invented content visibly fictional" (authoring-evidence.md keeps it). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Group H of the guidance cut, over the six module-*.md references. These document every authoring export of runtime/widget-api.js, so the cut keeps each export's signature, return and usage rule, and drops: - Each file's list of its own sections. - Mechanism the author doesn't act on: why a move within the page isn't a departure, --lf-views-flow's prepaint publication, the margin folding a two-control pin, a track's sticking geometry and 480px fallback, what Leaf does on a traversal it doesn't own, the theme's .choice ring inset. - Refusals the runtime already throws into a page error: a malformed command row, a second registerVisualParts, threadBox without an id, naming a later reaction as a message part, publishOutput without x-output or an id. - Restatements of module-authoring.md "Drawing what a widget reads" and of package-data.md "User state" and "Widget outputs". - Maintainer content: how the build gives bundled x-initial sources Lit (build/lit.mjs owns it). - Justifications beyond the one reason, and small facts with no decision attached. It keeps what review H restored: a widget output's value must fit its contract, since nothing checks it; wireInput's keys; which wrappers pass --lf-full-height; failSoft's source; indicate's one mark per attribute; navigateToDatum updating the fragment; a start that throws not running again; and a quoted widget's presentation still working. module-authoring's route to module-reading.md names "Markdown, code, images and icons" (widget-interface-serves-the-task went 1/4 to 4/4). Conflicts with main, which since the cut removed readingPaint and the approval obligation kind, renamed onStanding to onCurrentLocation and --lf-track-posture to --lf-track-scroll-behavior, made focus rings follow :focus-visible on reading destinations too, and added connections, LLM generation, placesFailure, generatedElement, cycledRow and data-room: - module-authoring.md: kept main's x-exhibit `when` clause, placesFailure, generatedElement, the updated()/this.drawing guidance and its pointer to page-layout.md "Space for changing text"; dropped the readingPaint paragraph main removed, so the group's correction of it is moot. - module-annotations.md: kept main's sentence on the 12px scroller padding a message rewrite needs. - module-input.md: kept main's cycledRow sentence and onCurrentLocation; the focus-ring sentence states main's rule (controls and reading destinations follow :focus-visible, keyboard routes request it), which replaces the group's reading of the older focus.js. - module-reading.md: dropped sign-off and the approval kind as main did. - module-scroll-and-motion.md: took main's --lf-track-scroll-behavior. - module-state.md: kept main's "Authenticated HTTP connections" and "LLM generation" sections whole. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Group I of the guidance cut, over packages.md, package-data.md, package-themes.md, the bundled packages' instructions files and their registry instruction strings. It keeps every contract a package author codes against (record kinds, x-awaits, x-refers, outputs, cascade layers, @scope) and drops: - Restatements of package init, install and check --help. - Refusals a check already reports: an existing tag or module, kernel imports, a repeated playground control name, binding both inputs, a producer that writes nothing. - Duplication between a package's instructions file and its registry entries, which page instructions --use appends into one author text. The registry now keeps markup and API facts and the instructions file keeps choice rules, for playground, playwright, motion, file-editor, file-tree and visual-review. - Content another file owns: live-sample fixture history (live-samples.md), page instructions output (page-authoring.md), the theme and widget cascade split (packages.md). - Narration of widget behavior the author doesn't act on, and playground's "Task-shaped recipes", whose shared rules now sit in one paragraph under "Stateful previews" and in the handoff check. - Examples the shipped registries hold, playwright-trace format details, and reasons beyond the one needed. It corrects lf-playground-preset: a control the preset has no setting for keeps its current value, matching author.md's eval-backed rule that a preset sets every control its look depends on. Conflicts with main, which since the cut composed playground previews with motion playback and video, opened playgrounds to candidate comparison, and documented which Leaf runs a vendored package: - packages/motion/instructions/author.md: kept main's transport sentences (one icon button, Play restarting at the end, no second clock, starts paused), dropping the speeds, seeking and reduced-motion narration the cut removed; kept main's sizing, illustration and playground paragraphs. - packages/motion/registry.json: took main's rewritten x-instructions whole, since main replaced the text the cut had trimmed. - packages/playground/instructions/author.md: kept main's opening and its space and premise paragraphs; dropped "A playground holds exactly one preview and one output" (lf-playground's x-instructions now says it); removed "Task-shaped recipes" and joined the group's folded checks to main's handoff paragraph. - packages/playground/registry.json: lf-playground takes main's description; lf-playground-control keeps main's sentence on selecting among visible candidates. - packages.md: took main's motion row and its paragraph on the serving Leaf supplying the runtime, dropping the kernel-import refusal. - package-data.md: kept main's account of when lf-diff loads each patch, with the group's one-line schema in place of the full JSON Schema; kept main's corrected pointer to module-state.md "Bound data and projections". Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Group J of the guidance cut, over the delivered handling and answering clauses in browser/registry.json, command help in cli.py, findings text, the hook restart line, the render check's next note, ANSWER_INSTRUCTION and the leaf wait acknowledge text. A one-comment delivery at the Claude Code prompt hook drops from about 409 to 285 words. It drops: - Narration of what Leaf does by itself: the update reading Working, Sent rather than Delivered, the panel naming who resolved a thread, the watcher waking. - Restatements of the skill or of the same delivery, and help restating its own options or refusals. - Justifications: why a title matters, why a reaction owes no answer, the reasons an action owes no answer, the protocol mechanics of newer-layer. - The invalid-registry finding, which nothing produces. It moves the anchor-move rule from every reply clause to the relocated-anchor finding, which now ends "to place it yourself, reply in it with --section or --quote, or --detach". It corrects page check --help: a plain check also runs the page's scripts and browser-judged widgets in the host's browser. It keeps the progress-line-first rule with "before any other command, even a read" (first-command-says-what-comes), the reply's own check of the saved edit, --todo, the drawing clause's field facts and the markup clause's "An option the user added needs no writing in" (#2632). Conflicts with main, which since the cut renamed response reply to thread reply, replaced status with page open/close, and added --obligation to thread messages: - browser/registry.json, the reply answering clause: took thread reply, and main's --obligation sentences replace the group's lf-ask sentence. - cli.py: kept main's page open command whole (the status docstring the group cut is gone); in thread reply kept main's paragraph on suppressing the final message, --attempt and --obligation, dropping the option-list restatement; thread resolve drops both main's removed sentence and the panel narration. - event-batches.md: kept group F's removal of the sample envelope. - test_stop_guard.py: thread reply in the assertions, with the group's "predates this turn" wording. - The six snapshots were regenerated from the resolved code with --regtest-reset. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…egistry Main renamed conversation-loop.md's "Status and handoff" to "Page availability and handoff" without updating the four references that cite it (SKILL.md and the three harness contracts). packages.md cited the layer registry at its pre-#3593 path, `../scripts/leaf/layer-registry.md`; it lives at `src/leaf/layer-registry.md`. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Group J's review cut the --attempt retry sentence from thread reply's help, and group I's review cut package-data.md's second pointer to module-state.md; main's rewordings around both had brought them back. The lf-motion registry string, which main rewrote after group I's base, now keeps only the API facts, leaving the choice rules to instructions/author.md as group I did for the other packages. An eval comment names the renamed handoff section. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
previously approved these changes
Oct 24, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 24, 2026
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.
Cuts the guidance Leaf ships to agents — the skill, its references, package instructions, registry instruction strings and the text Leaf's code prints — to the claims an agent acts on. This is the agent half of the guidance cut; the maintainer half (groups A–E) lands separately. Each group was cut on its own branch, reviewed side by side against main, and is one commit here, merged onto current main with main's later changes kept. Each commit message lists what its group cut, what it kept and how each conflict with main was resolved.
Groups
Word counts are
wc -won main (79af4eb2f) and on this branch.F — SKILL.md and the conversation loop (11 files, 12,418 → 11,115, −10%). Drops what command
--helpalready says, what deliveredhandlingalready says, mechanism no reader acts on (the surfaces table, Sent/Queued/Delivered, the desktop wake, Codex's queue check, the render check's JSON fields), duplicates and justification. Corrects SKILL.md step 1: runningpage initagain with--packagereplaces the page's packages rather than adding one.G — page authoring and layout (5 references, 8,120 → 6,868, −15%; default registry x-instructions 1,810 → 1,533; kernel 116 → 104). Drops each file's route restatement, copies of other references and of registry entries, rules
page checkalready reports, narration that asks nothing of the author, and hedges with no failure behind them. Moves the side-list tab summary rules and the tally rule fromlf-tab/lf-tallyintopage-layout.md, "A workspace", which agents re-read when revising (queue-is-a-side-list went 0/2 → 2/2).H — module references (6 files, 14,420 → 12,871, −11%). Keeps every
widget-api.jsexport's signature, return and usage rule; drops section lists, runtime mechanism, refusals the runtime already throws into a page error, restatements and maintainer-only build detail. module-authoring's route to module-reading.md now names icons (widget-interface-serves-the-task 1/4 → 4/4).I — packages (3 references and the 10 instructions files, 10,324 → 9,572, −7%; package registry instruction strings 1,444 → 875). Removes duplication between each package's instructions file and its registry entries, which
page instructions --useconcatenates, so the registry keeps markup and API facts and the instructions file keeps choice rules. Drops--helprestatements, refusals a check reports, and playground's "Task-shaped recipes", whose shared rules now sit under "Stateful previews" and in the handoff check. Correctslf-playground-preset: a control the preset doesn't set keeps its current value.J — text Leaf's code hands agents (delivered handling/answering clauses 1,490 → 1,237; every event case's delivery, per the snapshot, 9,076 → 7,317 words). Drops narration of what Leaf does by itself, restatements, justifications and the
invalid-registryfinding, which nothing produces. Moves the anchor-move rule from every reply clause to therelocated-anchorfinding, and correctspage check --help: a plain check also runs the page's scripts and browser-judged widgets.A sixth commit repoints four references at conversation-loop.md's "Page availability and handoff", which main renamed from "Status and handoff" without updating them, and fixes packages.md's pre-#3593 path to
src/leaf/layer-registry.md.Eval-backed passages kept
parent-keeps-leaf-responsive/known-answer, Deliver Leaf comments between tools and simplify responsiveness evals #3169).leaf task planparagraph and example (0ae092c32, 1/5 → 4/4 on Claude Code).thread summarizeexample (thread-fold-without-summary-prose).<pre>or table clips what runs past it, with thedata-boundand<details>routes (Scroll prose tables and code blocks sideways only #3347).pin-takes-no-page-room).producer.wireInput's keys;failSoft'ssource; astartthat throws not running again.first-command-says-what-comes), and the reply's own check of the saved edit.Checks
pytest -n 3over test_hooks, test_stop_guard, test_wait, test_receipts, test_thread_reading, test_interact_layer, interact_contract/, test_delivery, test_interact_product, test_interact_anchors, test_activity and test_product_page: 848 passed, 1 failed. The failure,test_hooks.py::test_a_prompt_re_vendors_a_page_an_older_leaf_vendored_and_hands_over_its_input, received a pointer instead of an inline delivery on a host at load average 30; it passes when run alone.The six snapshots group J's strings reach were regenerated with
--regtest-resetfrom the resolved code;tests/process/website_server/test_app_server.pypasses with its snapshot unchanged.node --test tests/runtime/widget-api.test.mjs, which requires every authoring export to be named in a module reference: 4 passed.leaf package checkon all eleven bundled packages: no findings.pre-commit run --filesover the 53 changed files: passed.Every
file.md, "Heading"andfile.md#anchorpointer in the changed prose resolves on this tree, and pointers into files groups A–E change resolve on those branches. No removed heading is cited anywhere.An independent review redid each group's merge file by file and checked every conflict by hand against main's additions and the group's reviewed diff. It found no lost claim; three reviewed cuts that main's rewordings had brought back (a
--attemptsentence inthread reply --help, a secondmodule-state.mdpointer inpackage-data.md, and thelf-motionregistry string repeatinginstructions/author.md) are reapplied in the last commit, with the command-help snapshot regenerated.Not run: the browser and journey tiers, and no evals were rerun after assembly; each group's evals ran on its own branch against its merge base.