Skip to main content

Plan first, then execute

bravebot --mode manifest "collect every TODO comment into notes/todos.md"

--mode manifest decides everything first. The planner emits a step list, that list is refused or frozen, and a driver walks it with no model anywhere in the control path. The default, --mode turn, is what an unqualified bravebot "task" has always been: observe, decide, act, and decide again after each thing it reads.

The gates are the same ones in both modes. What changes is the scope of the precommitment, from one turn to a whole run.

The two planning calls run on the run's model. Each processing step runs on the model --processor-model or the processorModel setting names, so a plan can be made on a stronger model and carried out on a cheaper one.

A plan that fails validation fails the run whole: nothing is half adopted, no step is patched to make a plan usable, and nothing re-plans once a step has read something. Where every effect will land is fixed before the first byte is read, and the driver cannot insert, skip, reorder or invent a step. A destination has to be text, so a plan that filled one with a number or a list is refused whole rather than reaching the step that would have used it. The same holds for the contents of a write_file step and the instruction of a processor step: a number or a list there is refused with "'contents' must be text" or "'instruction' must be text", where it used to be written as an empty file. An unknown mode name is refused rather than guessed, since guessing would run the mode you did not ask for.

A session can start one of these runs too, with /manifest. See Starting a plan-then-execute run.

A plan is put to you first​

Between freezing the plan and walking it, the frozen plan is put to you: the task in your own words, then every step in order, each naming its tier, what it would do, and every destination the step fixed. The routing is part of what you are answering for, so the line carries the directory a search runs in and the glob it filters by, not the pattern alone.

Declining stops the run, and the declined plan comes back with the error so you can still read it. Nothing has been read or written by then, so a declined run leaves the workspace exactly as it was.

The question is asked once, and has no standing form: nothing between the plan and the run can reshape the plan, and a plan is written afresh for each run, so remembering an answer would be approving steps nobody has seen.

Approving a plan is not approving its writes. This mode widens the scope of what you commit to in advance and does not replace the gates inside it, so each write is still put to you as its step reaches it. Approving the plan answers the calls to a server's tools its lines show, unless a rule, the server's declaration, plan mode or private data in the call asks about one at its step.

Where nobody can be asked the answer is no, as it is everywhere else. A command typed at a terminal is somebody: the plan goes out beside the progress and the answer is read back, which is the one question a one-shot run answers. Piped or redirected there is nobody, so the run stops before its first step unless permissions were skipped outright. --dangerously-skip-permissions approves the plan, and that is not a standing answer: it covers this run, is recorded nowhere, and the next run asks again unless the flag is given again.

note

At a terminal the plan is printed and a line is read, so a plan longer than the window is scrolled to in your terminal's own scrollback, and there is no going back to re-read a step once the answer is typed. A run started from a session does not have this cost: that prompt is drawn and scrolled.

What a plan cannot use​

  • edit_file, because locating a passage means having read the file, and the planner has read nothing.
  • todo_write, because the manifest is already the task list.
  • run, and any shell. A command string is destination and payload at once.
  • Piped stdin, which is refused rather than dropped: a pipe is observed context, and this mode does not observe before it plans. Name a workspace file with --file instead.

Calling a server's tool​

A step can call one tool of an MCP server you vouched for, with arguments the plan wrote out. The step names the server by the alias you gave it and the tool by its word on the list you read, and the plan you are asked to approve shows the server, the tool and the arguments in full, as the server will receive them.

  • Before the plan is made, you are asked about the list of each server in the session that nobody has asked you about yet, as the first turn of a session asks. A yes stands for the rest of the session, and a no, or a run with nobody to ask, leaves the plan with no call to that server. In the desktop application a run started before any turn also starts the session's servers first, asking you about each as the first turn would, and a turn after it finds them started.
  • The planner is shown the names on a list you vouched for, each tool's argument names and types, whether the server marks the tool read-only, and none of the server's descriptions.
  • A tool its server marks read-only, which the list you read says, can also be read: the step comes before every action, is decided as a call is, and fills a slot a processing step can read and the answer can show. Any reply that arrives fills it, a failure's words included.
  • A call is an action, so it comes after every read and transform. It has no way to name what an earlier step produced, so every argument is fixed by the plan, and what a tool answers is shown to you in the margin as it comes and goes to no model and to no later step.
  • Approving the plan answers each call its lines show. A deny rule about the tool still refuses it, and an ask rule, plan mode, private data in the call, or a server declared with --ask-every-call still asks at its step, the last in every mode, bypassing included. A plan bypassing approved was read by nobody, so its calls are decided as a turn's are.
  • A call that is refused, declined, cannot be made or gets no reply ends the run: the steps after it do not run, and the steps before it are not undone. A reply that arrived ends nothing, whatever it holds. A tool that answers that it failed has still answered: its account is shown in the margin and the steps after it run, since a server's reply does not change a plan. A reply bravebot cannot use, such as an error from the server or one it cannot read, is shown as a line saying the call failed, and the steps after it run too.

Everything a step produces is quarantined, whatever its label. There is no planner left to show it to. The ways out are a later processor, a write back into the workspace, and a release the plan named in advance.

Making many calls from a list​

Some tasks, such as grouping tabs or renaming bookmarks, need a number of calls that is known only after reading. A plan can hold an apply step for these. The plan fixes the server, the tools and each argument's source before anything is read. After a read returns a list, an isolated processor proposes the calls as rows, and only rows the plan allows are kept. A row cannot hold an address, alias or path of its own: every target is copied from an entry of a list the read returned, or is short new text.

A server's declaration says which arguments a row may fill, since that is your decision about each tool:

bravebot mcp add tabs --apply group_tabs:urls=entries -- /path/to/server

--apply <tool>:<argument>=<kind> takes the kinds entry, entries, new and row, joined with commas where an argument may take more than one. Only a local server that does not ask every call can declare one, and mcp get, mcp list and the approval question show it.

The resolved calls are put to you as one list that shows every value and where it came from, and no mode, rule or earlier answer answers it, bypassing included. Only the terminal interface puts it. A plan whose step would put a list in the desktop app or a one-shot run is refused with the plan, before anything is read. Each call you keep is made in order, a call that fails skips the calls that depend on it, and what each call returned is shown behind the margin and goes to no model.

--plan-covers <tool> marks a tool with such an argument as one your approval of the plan may cover. When every tool of an apply step is marked and you answered the plan yourself, the step makes its calls without putting the list, and its plan line says so and names the server each list was read from. The list is still put when permissions were bypassed, in plan mode, where an ask or deny rule names one of the step's tools, or where a literal of the step holds a character the question writes out. Mark only tools that act on your own machine, delete nothing and overwrite nothing their reply does not record.

What comes back​

The goal in plain words, the proposed plan verbatim, the frozen steps, and what each one did, on success and on failure, never behind a flag. A failed plan is printed on stderr even without --trace, and never shares stdout with the reply.

In the terminal, the answer of a run started with /manifest is drawn as the assistant's reply only when it is trusted, such as the answer over a file you vouched for. An answer built from a file or page nobody vouched for is drawn behind the quarantine bar, under a heading that names it as the run's result and gives its label. It is shown as plain text, /copy and /open do not take it, and an export holds the heading's note and none of its words.

Starting a plan-then-execute run​

/manifest collect every TODO comment into notes/todos.md

starts one plan-then-execute run and hands the session back afterwards. It is a run, not a mode the session holds: a session is several turns over one conversation, each deciding what to do next after the last one read something, so nothing about the session could stay in that mode.

The session is blocked for the duration. There is no planner inside a manifest run to hand a line to, so you can read, scroll and stop, but not send.

The conversation is neither read nor written. It does not go in, because the planner that reads the task may hold the task and nothing else. Nothing comes back out either, because every step's result is quarantined and there is no planner left to show it to. What the transcript shows is the goal as the planner understood it, the frozen plan, each step as it runs, and the reply, none of it in the exchange a later turn resumes. The run leaves the conversation exactly as declining a plan leaves the workspace.

The run is written down as its own record and the session records its name, so the session still resumes as a conversation while the run stays a run the Sessions screen refuses. A run you stopped is not written at all, since there is nothing in it to read. A run that fails or is stopped after it wrote a file keeps what it learned about that file: the file stays untrusted, and the saved session resumes with the same trust.

The plan is put to you before it runs, drawn and scrolled here rather than printed on one line. In plan mode a plan with a write in it does not run at all, decided before the plan is put to anybody.

From the desktop app​

Type the same line in a chat's composer and press Enter:

/manifest collect every TODO comment into notes/todos.md

The task appears as the run's task row, not as a message from you, so it cannot be forked from and is not exported. The plan card follows, and the run starts when you choose Run this plan. While it runs you can read, edit and stop, but not send. The chat's record shows as a Plan run in the session list.

Typed while a turn is running, the line waits in the queue and the run starts once the turn ends. /manifest with no task sends nothing and says that a manifest run needs a task to plan. A run takes no attached files: a line with a file on the paperclip or dropped onto it is refused and put back in the composer, so name the file in the task instead.

A manifest run is recorded, but cannot be continued​

A plan-then-execute run cannot be resumed. Its conversation is empty, because a session is turns over one conversation and a manifest run has none. The Sessions screen marks the row and refuses Enter. Naming one on the command line prints what it produced, and still does not continue it. That print is a report rather than a refusal: it goes to stdout and exits successfully, because reading a run back is what naming one is for.

The record holds its goal, its proposed plan, its frozen steps and what each one did, finished or not.