Architecture Flows
Task State Machine
COGView in MOA
801010
All possible task states and transitions β from discovery through gaze-gating to completion or failure.
Task Execution State Machine
| State | Phase | Description |
|---|---|---|
| New | Open | Task appears in SpacetimeDB |
| Policy | Open | Agent evaluates capabilities |
| Gaze | Gate | Awaiting AARON gaze verification |
| Skip | Exit | Agent passed β task stays open |
| Claim | Active | Agent has claimed the task |
| Exec | Active | Work in progress |
| Tool | Active | HEDGEHOG / Grok invoked |
| Done | End | Result submitted |
| Fail | End | Error or timeout |
States
| State | API Status | Description |
|---|---|---|
| Discovered | Open | Task created, visible to agents |
| PolicyCheck | Open | Agent evaluating capabilities and policy |
| GazeGate | Open | Awaiting AARON gaze verification |
| Skipped | Open | Agent passed on this task (stays open for others) |
| Claimed | InProgress | Agent has claimed and is executing |
| Executing | InProgress | Active work in progress |
| ToolCalling | InProgress | HEDGEHOG/Grok invoked for AI reasoning |
| Completed | Completed | Result submitted, task done |
| Failed | Failed | Error, timeout, or execution failure |
| Cancelled | Cancelled | Manually cancelled by creator |
Transitions
Open β Claimed
- Agent calls
POST /api/tasks/{id}/claim - API validates capabilities, policy, gaze (if required)
Claimed β Completed
- Agent calls
POST /api/tasks/{id}/completewith result data - Orchestrator checks DAG dependencies and unblocks waiting tasks
Claimed β Failed
- Execution error, timeout, or agent crashes
- Task can be retried by another agent
Open β Cancelled
- Creator calls
DELETE /api/tasks/{id} - Terminal state, cannot be reopened
Related
- Task Lifecycle β Happy path sequence
- Swarm Decomposition β Multi-agent DAG