Repository navigation
Record the agent's plan as one outline that arranges to-dos and asks - #3106
Merged
Merged
Conversation
The user chose a plan outline on 2026-10-16 as the shape for to-dos that form a tree: a plan's steps under a goal, steps with sub-steps. `leaf task plan PAGE` writes a `plan` event whose `steps` are an outline in order. Each step has a `depth` and is either plain (`title`, `state`: open, working, done or dropped) or names an `item`, a to-do or ask id, whose title, owner and state it shows. The newest plan stands; `[]` clears it. `plans.plan_reading` serves it as a tree, with each step's running start, when a working step began, and `done` of `total` among its children, as `plan` in the browser state and in `page state`. The plan arranges to-dos and asks without owning them: a rewrite that leaves out an open to-do ends nothing, and no to-do or ask rule reads the plan. Admission refuses an outline that skips a level or names an item the page doesn't hold. Nothing draws the plan yet and the shipped instructions don't ask for one; TODO.md's "Draw the agent's plan" holds both, as one change. notes/what-needs-you/page.html is retired: its design landed, its contracts live in the asks, todos and queues headers, and its open question is answered here. Its research notes stay. The TODO entry "Model how work breaks into pieces" is replaced by the drawing entry. No existing behavior changes. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
reviewed
Oct 17, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
_count recursively visits every level, but the plan schema and plan_error admit an outline whose depth increases one step at a time without a limit. A 1,000-level outline passes those checks, then plan_reading raises RecursionError; subsequent page state and browser state reads fail for that page until another plan replaces it. Please make the counting walk handle every admitted outline, or refuse a depth the reader cannot handle at admission.
A plan nested without limit raised RecursionError when read, breaking page state and browser state for its page; the schema now refuses depth above 8. A step naming a prose ask the agent ended done elsewhere raised KeyError; it now reads done, as the On lists already read it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
previously approved these changes
Oct 17, 2026
Nothing outside the module reads it, which the unused-exports test holds. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 17, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 20, 2026
Leaf has recorded an agent's plan since #3106 (`leaf task plan`, served as `plan`), but nothing drew it and no instruction asked an agent to write one. This change does both, since a plan nobody draws shows the user nothing and a drawing no agent fills stays empty. **The Plan tab.** While the agent has a plan, the floating panel's On view shows a third tab, Plan, beside On me and On <agent>. It draws each goal with how many of its steps are done, and every step in order with its state marked in place. The current step shows what the agent is doing and how long it has run, and a step waiting on the user carries an **On me** button that turns to the user's list (`floating-panel.js`, `floating-panel.css`). On me and On <agent> are unchanged and still list planned to-dos, because the plan arranges items without owning them. The user chose the separate tab over having the plan head On <agent>. **Place on On me.** An On me item the plan names now carries a muted line above its question, such as "Ship the reconnect fix · step 3 of 5". Like the goal's own count, it leaves out dropped steps. It also stays once the item is answered, so the answer moves nothing on the card. The user chose this as well. **The instruction.** In `conversation-loop.md`, "When to write" now asks an agent to write its plan with `leaf task plan` when its work runs to several steps, some of which may wait on the user. It also gives the outline's shape: the goal at depth 0, each step one level deeper than the step it belongs to. The new case `plan-shows-multi-step-work` scores this. On Claude Code the merge base passed 0 of 2: it opened separate to-dos. This change passed 2 of 2, and 2 of 2 again after the final rewording. `work-names-its-item` passed 2 of 2 on both arms. Earlier runs of an instruction that gave no step shape invented fields such as `waits_on`, which is why the shape is named. The plan's step states come from the server's reading (`plans.plan_reading`) and are not predicted in the browser. The user acts on a planned item in On me or on the page, not in the Plan tab, so the reading arrives before they can turn to the plan. A browser test covers the tab, its steps, the On me button and the place line. `plans.py`'s header now says where the plan is drawn, and TODO.md drops the item. > _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.
The user chose a plan outline as the shape for to-dos that form a tree, on a Leaf page that laid out four options (a goal's steps, steps with sub-steps). This adds the record and its reading; nothing draws it yet.
leaf task plan PAGEreads a JSON outline and writes aplanevent. Each step has adepthand is either plain (title, plus astateof open, working, done or dropped) or names anitem, a to-do id or an ask id, and shows that item's title, owner and state. The newest plan stands, and[]clears it.plans.plan_readingserves it as a tree, with each step's running start, when a working step began, anddoneoftotalamong its children. It appears asplanin the browser state and inpage state.The outline arranges to-dos and asks without owning them. A rewrite that leaves out an open to-do ends nothing, and no to-do or ask rule reads the plan, so reshaping the breakdown can't drop owed work. The user rejected giving to-dos a parent because it needed rules wherever a to-do ends. Admission refuses an outline that skips a level, nests deeper than 8, or names an item the page doesn't hold. A step naming an ask that a later version removed reads as dropped.
Drawing the plan on the On view and telling agents to write one are a single change, held in TODO.md's new "Draw the agent's plan" entry: a plan nobody draws shows the user nothing. That entry replaces "Model how work breaks into pieces".
notes/what-needs-you/page.htmlis retired. Its design landed, its contracts live in theasks,todosandqueuesheaders, and this change answers its open question. Its research notes stay.