Skip to content

Inside the lifecycle of one task

2 min readAgentsFlower team

Abstract cover art: a stepped line of squares moving across the frame, tracing a task through its lifecycle

A Task File looks like a static Markdown document, but it behaves more like a state machine. Every task spends its life inside a small set of states, and each transition has exactly one allowed author. Understanding that lifecycle is most of understanding AgentFlow.

Step through the states

The widget below walks the lifecycle one state at a time. Step through it with the buttons — or jump to a state directly — and notice how narrow each transition is.

Task lifecycle — step through it

1 / 6 — ready

The Orchestrator has written the Task File and the ledger row. The task waits until a launcher slot opens and every dependency is done.

The happy path is short: ready means the contract is written and launchable; in progress means a live worker holds the task; review means a Result exists and waits for the gate; done means the checks passed and the merge landed. The two side exits are just as important. blocked is a question traveling back to the Orchestrator — never a silent stall — and rejected is a failed verify that produces a successor Task File instead of a quiet second attempt on the same branch.

What the states guarantee

Each transition answers a question the previous state left open. ready answers “is this allowed to start” through the ledger and preflight checks; in progress answers “who owns this right now” through the recorded attempt; review answers “what exactly was produced” through the Result and the reported commit; done answers “did it hold up” through the verify record bound to that commit’s SHA.

Because the transitions are enforced by the ledger tool rather than by convention, a task can never arrive at done by accident — it has to pass through the gate that measured it.

Where the states live

The ledger row is the state of record. It changes through one script with enforced transitions, so a task cannot drift from in progress to done without passing through review and a verify run:

# The ledger: one row per task, one owner per state
python .agentflow/tools/ledger.py show

# The gate: runs the task's own ## Checks verbatim on the artifact
python .agentflow/tools/gate.py verify T-042

Separately, the launcher records each attempt — process state, timings, stop reason — in the task’s runtime file. Ledger state and process state are deliberately different concepts: an exited attempt says nothing about whether the task succeeded; only the Result and the ledger do.

Why the ceremony pays off

Every transition leaves evidence behind: the Result below the ## Result heading, the verify record bound to a commit SHA, the ledger row’s history. When a human returns to the project after a week away, the lifecycle is what lets them reconstruct the whole story from files alone — which task ran, which attempt produced which commit, and which check proved it.

A task’s lifecycle is short on states on purpose. The discipline lives in the transitions, and the transitions live in tools that do not take a model’s word for anything.