| 1 | package event |
| 2 | |
| 3 | // TurnStatus is the authoritative lifecycle of one top-level turn. |
| 4 | type TurnStatus string |
| 5 | |
| 6 | const ( |
| 7 | TurnQueued TurnStatus = "queued" |
| 8 | TurnInProgress TurnStatus = "in_progress" |
| 9 | TurnWaitingUser TurnStatus = "waiting_user" |
| 10 | TurnCancelling TurnStatus = "cancelling" |
| 11 | TurnCompleted TurnStatus = "completed" |
| 12 | TurnInterrupted TurnStatus = "interrupted" |
| 13 | TurnFailed TurnStatus = "failed" |
| 14 | TurnRecoveryRequired TurnStatus = "recovery_required" |
| 15 | // TurnProtocolFailed is retained for replaying ledgers written by releases |
| 16 | // that required the model-visible finish tool. New turns do not emit it. |
| 17 | TurnProtocolFailed TurnStatus = "protocol_failed" |
| 18 | ) |
| 19 | |
| 20 | func (s TurnStatus) Terminal() bool { |
| 21 | switch s { |
| 22 | case TurnCompleted, TurnInterrupted, TurnFailed, TurnProtocolFailed, TurnRecoveryRequired: |
| 23 | return true |
| 24 | default: |
| 25 | return false |
| 26 | } |
| 27 | } |
| 28 |