The complete task state machine
Status: Ready
Article ID: 032
Truth label: Current
Audience: API integrator
Reader outcome: Predict the valid path from pending work through assignment, execution, checkpoints, retry, and terminal outcomes.
Related articles: 005, 031, 039
Target week: 13
Last verified: 2026-09-13
Technical reviewer: Codex source audit
Editorial reviewer: Codex editorial audit
Start from pending
A new ordinary task begins pending. It is eligible for routing only when its
project, parent dependency, worker pin, engine, and required capabilities allow
the polling worker to take it. Eligibility is not the same as ownership.
An accepted claim changes the task to assigned, creates the run identity and
lease, and marks the worker busy. A worker result can then move the attempt to
in_progress while execution continues.
Separate active and held work
The active states are assigned and in_progress. A task at checkpoint is
held for an operator. Its execution lease is cleared because no worker owns a
live run while the human reviews it.
Checkpoint meaning depends on stage:
- a plan checkpoint waits before supervised execution, and can also close the task outright when the plan was itself the deliverable
- a final checkpoint waits before completion
- a failure checkpoint waits for retry, deliberate failure, or a narrow gate override
The stage explains the next valid decision. The status alone does not.
Know the terminal states
completed, failed, and cancelled are terminal outcomes for an ordinary
attempt path. Completion can happen immediately for autonomous work or after a
final approval. Failure can come from the worker, verification, lease expiry,
or deliberate operator rejection. Cancellation can happen before execution or
after the worker honors a cancellation request.
Terminal transitions clear the lease and release the worker. They also feed run history and analytics when the result path has enough evidence.
Understand the return paths
Some controls move work back to pending:
- approving a supervised plan releases the execution stage
- requesting checkpoint revision requeues with bounded feedback
- an opted-in machine failure can consume retry budget and requeue
- approving a pipeline failure checkpoint retries that stage
These are new attempts, not a rewind of history. The run attempt and fence advance when the task is claimed again.
Predict a supervised task
A normal supervised path is:
pending -> assigned -> in_progress -> checkpoint(plan)
checkpoint(plan) -> pending -> assigned -> in_progress -> checkpoint(final)
checkpoint(final) -> completed
A revision replaces the last arrow with a return to pending. A deliberate
fail moves from checkpoint to failed. Approve plan, mark as done moves
checkpoint(plan) straight to completed, recorded as approve-complete,
with no second run. A cancellation request during active work remains a
request until the worker reports cancelled.
Current limits
Status proves a recorded transition, not code correctness or filesystem isolation. Pipeline stages add gate-specific behavior to the same states. A paused or archived project rejects new tasks and keeps its pending tasks out of polling, but work already assigned or running finishes unless cancelled. Always inspect checkpoint stage, attempt, and decision history with the status.
Next lesson
Continue with Atomic task claims.
Derivative map
- Weekly package: WEEK-13
- Long video: VIDEO-W13-LONG
- Shorts: SHORT-W13-PROBLEM, SHORT-W13-MECHANISM, SHORT-W13-WARNING
- Email: EMAIL-W13
- LinkedIn: LI-W13-A, LI-W13-B
- X: X-W13-A, X-W13-B
- Visual: VISUAL-W13
Review record
- Pending, active, checkpoint, retry, and terminal transitions checked against current source.
- Pipeline, project-state, cancellation, and correctness limits reviewed.
- State diagram distinguishes held work from a live lease.
- Internal links and repository voice reviewed.
Review completed: 2026-08-27
Re-audited against the running product: 2026-09-13