Expand description
AI Task Definition
A Task is a unit of work to be performed by an AI agent. It is
step ④ in the end-to-end flow described in mod.rs — the
stable identity for a piece of work, independent of how many times
it is attempted (Runs) or how the strategy evolves (Plan revisions).
§Position in Lifecycle
③ Plan ──steps──▶ [PlanStep₀, PlanStep₁, ...]
│
├─ inline (no task)
└─ task ──▶ ④ Task
│
├──▶ Run₀ ──plan──▶ Plan_v1
├──▶ Run₁ ──plan──▶ Plan_v2
│
▼
⑤ Run (execution)§Status Transitions
Draft ──▶ Running ──▶ Done
│ │
├──────────┴──▶ Failed
└──────────────▶ Cancelled§Relationships
| Field | Target | Cardinality | Notes |
|---|---|---|---|
parent | Task | 0..1 | Back-reference to parent Task for sub-Tasks |
intent | Intent | 0..1 | Originating user request |
runs | Run | 0..N | Chronological execution history |
dependencies | Task | 0..N | Must complete before this Task starts |
Reverse references:
PlanStep.task→ this Task (forward link from Plan)Run.task→ this Task (each Run knows its owner)
§Replanning
When a Run fails or the agent determines the plan needs revision,
a new Plan revision is created. The Task
stays the same — it is the stable identity for the work. Only
the strategy (Plan) evolves:
Task (constant) Intent (constant, plan updated)
│ └─ plan ──▶ Plan_v2 (latest)
└─ runs:
Run₀ ──plan──▶ Plan_v1 (snapshot: original plan)
Run₁ ──plan──▶ Plan_v2 (snapshot: revised plan)§Purpose
- Stable Identity: The Task persists across retries and replanning. All Runs, regardless of which Plan version they executed, belong to the same Task.
- Scope Definition:
constraintsandacceptance_criteriadefine what the agent must and must not do, and how success is measured. - Hierarchy:
parentenables recursive decomposition — a PlanStep can spawn a sub-Task, which in turn has its own Plan and Runs. - Dependency Management:
dependenciesenables ordering between sibling Tasks (e.g. “implement API before writing tests”).
Structs§
- Task
- A unit of work with constraints and success criteria.
Enums§
- Goal
Type - Classification of the work a
Taskaims to accomplish. - Task
Status - Lifecycle status of a
Task.