Skip to content

feat(autopilot): pass on another autopilot's lessons; edit plan sections - #538

Merged
kalaspuff merged 3 commits into
mainfrom
fctl/1242-autopilot-briefing
Nov 14, 2026
Merged

kalaspuff merged 3 commits into
mainfrom
fctl/1242-autopilot-briefing

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Carl Oscar asked the spaghetti autopilot what it would tell any fctl autopilot. Its own sessions now start with the lessons the briefing didn't already cover:

  • Where sessions merge their own pull requests, each task says what may merge without the autopilot's look. A session that doesn't know ends its turn to ask, which costs a wake.
  • Sessions changing the same screen get one shared layout, and the second waits for the first to merge.
  • Big or uncertain work starts with a spike that reports real numbers, then carries on unless something blocks it.
  • Once the project's memory grows long, a session tidies it.
  • A subagent reviews screenshots while the autopilot looks at a crop or two. Right after a ship, people check what no sandbox can ("Live now: X. Does it work?").
  • Work that drives hardware needs a person watching its first run. Licenses that bind the project go to people before merging.
  • Background waits use plain HTTP APIs. Ships wait while people are away. Lighter models do mechanical work. Each ask covers one topic.
  • The plan reads as if a stranger took over at the next wake, and lists what was promised and which scripts the work relies on.

The autopilot also lost a session's state from its plan once: a scripted replacement in a stale local copy failed silently. Its "plan --get" already existed (fctl autopilot plan prints the plan), but the briefing never mentioned it, and redirected output wasn't exact: tabs became spaces, and an empty plan printed "No plan yet." to stdout. Redirected, it now prints the plan exactly, or nothing, and the briefing says to start from it. fctl autopilot plan --section HEADING --file part.md is new. It replaces one section, up to the next heading of its level, and when the plan has no such section it fails and names the sections it does have.

I checked it with an autopilot in cargo xtask dev, steered to run the commands in its own sandbox. It wrote a plan, replaced its "In flight" section (subsection included) and got the error for a missing one. Its briefing showed the new lines. Unit tests cover the section edit and the briefing.

Worth confirming

  • Decision: --section fails rather than appending when the section is missing, so a typo in a heading can't add a second copy. Adding a section means writing the plan whole.

Related:

fctl session


Note

Low risk. It adds prompt text to the autopilot briefing, a new --section option on fctl autopilot plan, and changes what that command prints when redirected; only autopilots use it, and the worst case is a wrongly edited plan.

What it does. Adds more lessons from the spaghetti autopilot to the briefing every autopilot starts with, such as what may merge unseen, shared layouts, spikes, screenshot review and shipping habits. It also adds fctl autopilot plan --section HEADING --file part.md, which replaces one section of the plan up to the next heading of its level and fails with the list of sections when none matches. When stdout is not a terminal, fctl autopilot plan now prints the stored plan exactly, so plan > plan.md can be edited and written back.

Plan section parsing. plan_section in fctl-domain does its own Markdown heading and code-fence parsing and rewrites the stored plan with a read-then-write from the CLI.

fctl review's first look at a9db3eb · 5 files, +340 −30 · Review agent settings

An autopilot that ran a project (spaghetti) said what it would tell every autopilot. The briefing now passes on what it didn't already say: what may merge without the autopilot's look goes in each task where sessions merge (a session that doesn't know ends its turn to ask, costing a wake); sessions that change the same screen get one shared layout and go one after the other; a spike with real numbers comes before big, uncertain work; a session tidies the memory once it grows long; screenshots go to a subagent while the autopilot looks at a crop or two, and people check right after a ship what no sandbox can; work that drives hardware needs a person at its first run; licenses that bind the project go to people; background waits use plain HTTP APIs; ships wait while people are away; a lighter model does mechanical work; one topic to an ask; and the plan reads as if a stranger took over at the next wake, with the scripts it relies on.

The autopilot's plan updates once lost a session's state when a scripted replacement in a stale local copy failed silently. The briefing now says that fctl autopilot plan prints the plan as fctl has it, and fctl autopilot plan --section HEADING --file part.md replaces one section, up to the next heading of its level, failing with the plan's sections named when it has no such one.
@fctl-sh
fctl-sh Bot requested a review from kalaspuff as a code owner November 13, 2026 22:28
@fctl-review

This comment has been minimized.

Comment thread crates/fctl-domain/src/autopilot.rs Resolved
Comment thread crates/fctl-domain/src/autopilot.rs Resolved
Comment thread crates/fctl-domain/src/autopilot.rs Resolved
Comment thread crates/fctl-domain/src/autopilot.rs Resolved
Comment thread crates/fctl-domain/src/autopilot.rs Resolved
… exactly

Code indented four spaces and fences closed only by one at least as long
hold no headings, and only #s after a space close one (Learn C#). A
redirected fctl autopilot plan prints the plan as fctl has it, and
nothing when there is none, so that writing it back changes nothing.
The merge example for lighter models shows only where sessions merge.
@fctl-review

This comment has been minimized.

Comment thread crates/fctl-domain/src/autopilot.rs Resolved
@kalaspuff
kalaspuff merged commit ae2a0f3 into main Nov 14, 2026
13 checks passed
@kalaspuff
kalaspuff deleted the fctl/1242-autopilot-briefing branch November 14, 2026 06:58
kalaspuff pushed a commit that referenced this pull request Nov 14, 2026
)

## Summary

Carl Oscar asked the spaghetti autopilot (on fctl 0.34.1) what it would
tell any fctl autopilot. Most of its advice already reached the briefing
through #538–#543. This adds what hadn't:

- **Which sessions count toward the limit.** The autopilot had to guess,
and guessed wrong about queued ones. The briefing, the limit's error and
the docs now say: those queued, starting, working, paused on a usage
limit or still stopping count, as does one just messaged; one that ended
its turn, stopped or failed doesn't. With all of them at work, the
autopilot keeps the next tasks in its plan and starts one when fctl
wakes it for a session that ended its turn.
- **Lessons.** Name sessions as the brief and wakes do, never with a
placeholder or a guessed number (it sent one `fctl send` to a made-up
ID). Keep the scripts the work relies on in the plan whole, and lead the
plan with what a stranger must act on first. Send long output to a file
and grep it. Ask for screenshots of the case that matters (a person's
narrow window, their real file), not only the default. Have watchers
follow the base branch's newest run when a newer merge cancels one (a
cancelled run stopped its watcher, and a ship sat waiting). Look at what
people send before publishing it or passing it on (one screenshot showed
a `/Users/<name>/…` path), and unpack archives in an empty directory.
- **`fctl autopilot brief --only sessions,people,asks`** (`?only=`)
shows only the named parts: direction, notes, asks, sessions, people,
plan, log. The whole brief had grown to about 32 KB, which every wake
read again, though its plan and log are already in the autopilot's
conversation. The briefing and wake message point to `--only`. Notes and
answers in parts it leaves out stay new, so the next whole brief or wake
still marks them.

I verified it with unit tests (the briefing's lines, parsing and
ordering the parts, a brief with two of them, the CLI's flag) and end to
end in `cargo xtask dev`. An autopilot's own session ran `fctl autopilot
brief --only sessions,asks` through the relay and got only those parts,
and the CLI and the API refuse an unknown part, naming the parts there
are. The dev stack can't show that a note left out stays new, because
fake-claude reads the whole brief at every wake; that part is a filter
on what the brief showed.

## Related pull requests

The other gaps the autopilot named, each in its own pull request:

- #546
- #545

## Not done here

- Watchers that survive a handover, for what fctl doesn't wake
autopilots for (the base branch's checks, a deploy). The merge wake in
the pull request above removes the most common one.
- `fctl send --attach` from an autopilot (#517). Since #543, an ask that
names a session sends people's files to it directly.
- `fctl run --when-free`: the briefing now says the limit's rule, and a
session ending its turn already wakes the autopilot.
- A standard place for a pull request's screenshots, and a check in
`fctl send` against IDs of other projects' sessions. An autopilot can
already message only the sessions it started.

## Worth confirming

- **Decision:** `--only` names parts rather than headings: `sessions` is
the autopilot's own, `people` is people's sessions. The lines on where
it runs (time, limit, next wake, powers) always show.

[fctl session](https://app.fctl.sh/s/ses_01M7DQEXFV9KNC4CY8ZZZ2KHZH)

<!-- FCTL_REVIEW_SUMMARY -->
---

> [!NOTE]
> **Low risk.** It adds an optional `only` filter to the autopilot brief
and extends briefing text and docs; without the filter the brief is
unchanged, and an older control plane ignores the parameter.
>
> **What it does.** Adds more lessons and a rule on which sessions count
toward an autopilot's session limit (queued, starting, working, paused
or still stopping) to its briefing, the limit's error and the docs. The
autopilot can now read its brief in parts with `fctl autopilot brief
--only sessions,asks` (and `?only=` on the API), so each wake reads
less. Unknown or empty part names are refused with an error that lists
the parts.
>
> **Partial brief and notes.** Notes and answers in parts left out by
`--only` stay new, so the next whole brief or wake still marks them.
>
> <sub>[fctl
review](https://app.fctl.sh/s/ses_01M7DTRWZ9Y28496BEBENG90M5)'s first
look at
[`0f6bff4`](0f6bff4)
· 11 files, +357 −44 · [Review agent
settings](https://app.fctl.sh/p/fctl?tab=reviews)</sub>

<!-- /FCTL_REVIEW_SUMMARY -->

---------

Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant