Story-1000: Align terminal run statuses
PR #22 ยท pramaan-io/pramaan-agents ยท merged 2026-06-03
How it flows
sequenceDiagram
autonumber
participant guard as Guardrail
participant reducer as Reducer
participant state as agent_run.status
guard->>reducer: terminal failure event
reducer->>reducer: _run_failed_status classifies
reducer->>state: aborted_cost / circuit_open
state-->>reducer: replay
reducer->>reducer: terminal flag โ same final state
src/pramaan_agents/db/reducer.py
| Method | in โ out | what it does |
|---|
_run_failed_status | (payload) โ str | classifies a failure payload as aborted_cost or circuit_open |
What changed, file by file
Reducer that turns failure events into agent run state โ adds the _run_failed_status helper plus aborted_cost and circuit_open terminal constants so a terminal flag sticks on replay.
| new method | signature |
|---|
_run_failed_status | (payload) โ str |
What does NOT happen
- replay reopens a terminal run
- double charge on circuit_open
- cost-cap retried as fresh
- audit vs runtime drift
- silent re-classification
Replay is idempotent
Terminal stays terminal
Audit log matches runtime
aborted_cost is first-class
circuit_open is first-class
No silent re-classification
Files changed (3)