The task module (kiro_crew/task.py) provides a state machine for
tracking individual Slack messages through their lifecycle. The Slack handler
creates one Task per handled message; CLI prompt handling does not use this
state machine.
Pending → InProgress → AwaitingApproval → Completed
→ Completed
→ Failed
→ Cancelled
Terminal states: Completed, Failed, Cancelled — no further
transitions allowed.
Creates a task in PENDING state with creation timestamp.
Transition to IN_PROGRESS. Records started_at timestamp.
Transition to COMPLETED. Records finished_at timestamp.
Transition to FAILED. Records finished_at and error string.
Transition to CANCELLED. Records finished_at timestamp.
Transition to AWAITING_APPROVAL (from IN_PROGRESS).
Transition back to IN_PROGRESS (from AWAITING_APPROVAL).
True if state is COMPLETED, FAILED, or CANCELLED.
Low-level transition with validation. Raises InvalidTransition if
the transition is not in the allowed set.
| From | To |
|---|---|
| PENDING | IN_PROGRESS, CANCELLED |
| IN_PROGRESS | AWAITING_APPROVAL, COMPLETED, FAILED, CANCELLED |
| AWAITING_APPROVAL | IN_PROGRESS, COMPLETED, FAILED, CANCELLED |
Task state constants are in task.py as the TaskState enum.