Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ADR 0081: The plan tool, a recorded and tracked tree of tasks

Date: 2026-10-24. Status: accepted by the operator, decisions 1 to 4 on 2026-10-24, 5 to 11, how it is built, on 2026-10-25, 12 on 2026-10-26, and 13 and 14 on 2026-10-28; built for 0.32.0. The first part of ADR 0079 (the conversation as a spine, with task trees at its turns), which stays proposed for the rest; nothing here runs a task, grants anything, or touches ADR 0078 or ADR 0080.

Context

ADRs 0078 to 0080 propose how wisp would compose its primitives into plans that run: trees of tasks, grants, skills, a runner. An adversarial review on 2026-10-24 (the proposal, “Review”) found that the parts that run are not ready: statuses that gate execution, values flowing into commands, stored plans before the protection track, a gate with no provenance. The operator chose to build the plan tool first, and to think about skills further.

What a plan tool is useful for without running anything: the model writes down the steps of work that spans several calls or turns, tracks them, and reads back what is left, in a form the person and an MCP caller can read too. The probe of 2026-10-23 (measurements.md, “Planning a task tree and its grant”) had models write whole plans at once as JSON; whether they build one call at a time through a tool is not yet measured.

Decision

The operator’s answers on 2026-10-24:

  1. The tool is plan, /plan in chat, wisp://threads/{thread_id}/plan. (task is the thread’s task fact; ADR 0079 called the tool tasks.)
  2. It records and tracks: the model adds tasks and dependencies, reads and searches the tree, and marks its own progress (running, done, failed, skipped) as it works in ordinary turns, like a checklist. No runner, no typed outputs, no grants, no briefs. ADR 0079 decision 12’s rule that only a runner sets the status of steps, questions, and notices comes with a runner, since here no status gates anything.
  3. The person sees it in every face: chat and wisp-tui (/plan), a terminal (wisp threads plan ID), MCP (the resources, and respond’s plan when a turn changed it), and later turns of the conversation (a line a tree in the request’s now block).
  4. 0.32.0, off by default: tools.plan, or a tool list naming plan, as ask and memory are added, until it is measured on local models.

How it is built (tools/plan.md), proposed with the build and agreed by the operator on 2026-10-25:

  1. Trees are rooted at turns. The first task a turn adds without a parent roots that turn’s tree; the agent records the store id of the turn’s prompt on the tree when the turn ends. Trees are numbered t1, t2, … and tasks t1.1, …, never reused. ADR 0079 decision 2 proposed the prompt’s store id as the tree’s id; that id is not known until the turn ends, and a number reads better, so the id is a number and the prompt is recorded beside it.
  2. Dependencies cross trees; a cycle is refused when added, with the path. Starting or finishing a task whose dependencies are not done is refused; failing or skipping one is not, and what depends on a failed or skipped task is not ready.
  3. Bounded: 64 tasks a tree, 256 a plan, 6 deep, 8 dependencies a task, a goal of 200 characters and a note of 300; a result pages at 40 lines and is fitted to the tool-output budget.
  4. Saved with the record (ThreadRecord.plan, in record.store), not in a file of its own: it is written with the rest of the thread under the thread’s lock, and resumed with it. A PlanBook holds the live plan for the tool, which the framework calls from its own task; the agent saves it into the store when each turn ends.
  5. Later turns see a line a tree, not the tree: up to four open trees, newest first, and a count of the rest, in the now block, marked as a record and not instructions. Trees the turn under way rooted are left out.
  6. Audited as plan.add, plan.depend, and plan.update.
  7. add takes the calls a small model makes. A first run with ollama:granite4.1:8b on 2026-10-25 made every add fail: it named the tree it expected (parent: "t1") before the tree existed, gave its own ids, and called for all three tasks at once, so a dependency arrived before the task it named. So a parent naming the turn’s own tree counts as none, a model’s id is kept when it fits the tree and is unused, and a dependency may name a task of the same tree not yet added (not ready until it is added and done; a cycle through it refused when it would close). Run again, the same prompt built the tree, marked the first task done, and freed the next.

Agreed by the operator on 2026-10-26, after the plan probe (measurements.md, “Keeping the plan while working”):

  1. Every other tool’s result reminds the model to mark its task. While a task is running or ready and the turn has marked none, AuditedTool ends each result of every tool but plan with one line naming the task and the call that marks it ([plan: t1.2 List the largest folders is next; if this result finishes it, mark it: plan update t1.2 done]), and the audit records the result as the model sees it. A mark quiets it until the next turn. In the probe, granite4.1:8b finished no conversation without it (0/6, not one update) and five of six with it; gemma4:12b and granite4.2:8b not thinking kept their plans either way (6/6 and 4/6 with it, 5/6 and 5/6 without). The line naming the next task in later turns (PlanText.reference’s next) stays in the probe only: alone it took granite4.1:8b to 1/6.

Agreed by the operator on 2026-10-28, after the planning probe through the tool (measurements.md, “Planning a task tree through the plan tool”):

  1. Each request names the ids the turn’s tasks take. granite4.2:8b and gemma4:26b gave the first task the tree’s name (id: "t1"), got t1.1, and then named t1 as its parent, dependency, and the task to mark, which failed or put tasks in the wrong place; gemma4:26b looped on it. While the conversation has the tool, the now block ends with [plan: this turn's tasks are t3.1, t3.2, …], and the id guide no longer invites a name for a new task. A tree’s name where a task is needed is refused as a tree (t1 is a tree, not a task; name one of its tasks, such as t1.1), so a model that still names it is corrected on its next call; a parent naming a tree still puts a task at the top of that tree, as granite4.1:8b’s calls of 2026-10-25 need. The operator chose this over keeping the name as the first task’s alias, built first the same day: it addresses why models guess, and a tree’s name never quietly means a task. Rerun on 2026-10-28, the first task was still given the tree’s name in 2 of 4 (granite4.2:8b) and 1 of 4 (qwen3.8:27b), and no run then used t1 as a task. With it, as build fixes: a repeated add of the same goal under the same parent is refused rather than added again, and a parent of none or null is none.
  2. A model’s own id is kept or refused, never replaced. In the rerun both models asked for ids a level deeper (t1.1.1), with a parent and without, and models gave ids already taken; the tool numbered each the next free number and said so only in its result, which the models did not read, so later calls named their own ids and failed, and a taken id once fulfilled another task’s dependency by chance. Every such call in the probes meant a child of the task the prefix names, or a new sibling. So a deeper id is kept as a child of that task, with parent left out or naming it; it is refused when that task is not in the plan or parent names another. A tree’s name, an id taken, and one of another tree are refused, each naming the id to give, the tree’s next number past any a task waits for. A refusal is the message the models acted on: qwen3.8:27b corrected after each. Agreed by the operator on 2026-10-28. Run again the same day, both models took the id offered after a tree’s name on the next call, but granite4.2:8b turned to names written as ids (t1.find, t1.1a), which were numbered without a word and every later call naming them failed; so an id that begins t<n>. and is not one is refused too, also agreed that day. With it, as a build fix: update with a note and no status keeps the status, where qwen3.8:27b sent notes alone twice.

Consequences

  • A model can keep the steps of long work outside its context and pick them up in a later turn or after a resume, and the person can see the plan it is following.
  • The plan carries no authority: a status set by the model gates nothing, and nothing in the plan runs. When a runner arrives (ADR 0079, proposed), statuses that gate execution move to the runner and the person, as the review asked.
  • Whether local models use the tool well is unmeasured; it stays off by default until an evaluation shows it, and the probe of ADR 0078 is to be rerun through the tool.
  • A chat by the operator on 2026-10-25 (granite4.1:8b, 18 turns) found the model adding tasks but never marking one: it ran all three, said so in its replies, and left them ready, and in most turns it restated the plan instead of working until it was prompted again. The plan probe, scripts/check eval plan (PlanEvalTests), measures that: three problems, each driven with “go on” for up to six turns, scored from the plan and the audit (every task settled, updates made, turns with no call, tasks marked done ahead of the work, conversations that never planned), under four variants: no help, a line naming the tree’s next task and how to mark it (PlanText.reference’s next, PlanBook(namesNext:)), the reminder (PlanBook(reminds:)), and both. Decision 12 adopted the reminder.
  • granite4.2:8b’s failure in the probe is another one: it often did the work without adding a task, so the plan stayed empty and nothing reminded it. A nudge for a turn that was asked for a plan and added none would need its own variant in the probe first.
  • The plan is stored in ~/.wisp with the rest of the thread, under the same protection, or lack of it, as the thread’s record; it holds no grant and no instructions that run.