Repository navigation
Explain Leaf's architecture and runtime in How it works - #2288
Merged
Merged
Conversation
How it works now opens with Leaf's architecture: the harness, the leaf commands and page server, and the browser runtime, and what each owns (the page directory, one validated path into the log, one reading of the page, delivery to the agent, the registry, the state home). The channel table and the transport disclosure (App Server wire parameters, private child invocations, hook stdin) leave the Loop tab; session-lifetime.md and the harness references own them, and Owning contracts links there. The Typical flows now say what the agent reads: the Leaf skill routing to one reference per workflow, package instructions by audience, the handling clauses each delivery assembles from the registry, the check and the Stop hook as feedback to the agent, and evals scoring instruction changes. What the Stop hook checks becomes a disclosure in that flow's Wait for feedback or finish step rather than a section of its own. Every heading on the page now names its topic (Progress updates, Banner readings, Current state, Data lifetime, ...) rather than stating a thesis. Stages of a move moves from Loop to Updates, so Loop covers how a move travels and Updates covers what the user reads about the agent's work. Harness differences gains an experimental Pi row. A new Runtime tab takes the Serving tab's server lifetime and addresses, then explains the browser runtime: its three inputs, freshness checks and state reads, moves awaiting an answer, presentation proof, browser-owned state, live revisions and startup phases; the Loop, Revisions and Data paragraphs that overlapped it now link to it. A short Phone tab says Leaf is desktop-first and lists what works by touch and the known gaps; the Layout tab's touch sentences move there. The Threads page explains anchors: the kinds of anchor, how a passage is found (segments in the browser, quote and context in the log, says vs wrote), what a revision does to a thread (stay, move to its element, or a refused revision until the agent moves or detaches it), drawings, widgets in messages, titles, summaries and resolving. A new page, /website/, explains how leaf.page serves Leaf: published pages at the edge, per-visitor per-release containers running the canonical server, the hosted Codex agent, release addressing and why a mixed-release response is refused, and how long private state lives. how-it-works, threads and event-log carry a source TODO to move their prose to the third person, a pass planned after this lands. docs/layer.json now names the docs pages' package selection (the examples' packages plus ./docs/package). The site build reads it instead of appending the site package itself, and `leaf-dev preview --source docs/...` picks it up like any layer.json beside a source, so a docs preview styles its site nav as leaf.page does rather than falling back to the examples' selection. worker/README.md points at wrangler.toml's max_instances rather than repeating a count that had gone stale (5,990 vs 5,900). TODO.md drops "give touch users visible passage threads": pins show on phones and tapping one opens its thread (checked with leaf-dev probe --touch at 390x844). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # docs/how-it-works.html # tests/test_site.py
main's diagram-width test now waits for the rendered diagram, and the left-to-right layout measured 1308px in a 1152px content box. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # docs/how-it-works.html # worker/README.md
Main's Questions cutover (#2240) renamed Asks across the sections it already held; this carries the rename into the Architecture and Runtime sections this branch added. It follows the shipped split: the server decides which widget Questions are open, the panel shows an answer at once, and the presentation order is marks, threads, Question view, then Questions panel (semantic-state.js PRESENTATION_ORDER). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # docs/how-it-works.html
leaf-agent
approved these changes
Oct 10, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 10, 2026
How it works, Threads and The event log explain how Leaf behaves rather than instructing the reader, so their prose now names the user and the page instead of addressing "you". Interface strings quoted verbatim, such as "picked up your comment" and "On you to answer", keep their wording, and the event log's live sample keeps its imperative steps. This drops the TODO comments that asked for the pass after #2288. > _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.
"How it works" becomes the place that explains Leaf's high-level design: how the harness, the
leafCLI and page server, the page directory and the browser runtime fit together, and how a move travels between them.How it works (
docs/how-it-works.html)Other pages
docs/threads.htmlgains anchoring, revisions, drawings, widgets in messages, titles, summaries and resolving.docs/website.htmlis a new short page at/website/on how leaf.page serves Leaf;dev/leaf_dev/site.pyroutes it andtests/test_product_page.pylists it.worker/README.mdpoints atmax_instancesinstead of a hardcoded container count;TODO.mddrops a stale clause asking for visible passage threads on touch.how-it-works,threadsandevent-logcarry a TODO comment for a third-person pass, which follows in the next change.