Skip to main content

Module recover

Module recover 

Source
Expand description

State recovery and stale-state detection.

devflow recover reads the existing state file, determines if the agent process is still running, and either reports status or offers to clean up / restart.

Structs§

RecoveryStatus
Result of inspecting an existing workflow state.

Enums§

RecoverError
Errors produced by recover operations.

Constants§

STALE_THRESHOLD
Maximum age before a state is considered stale (>24h).

Functions§

clean
Clean up stale or abandoned workflow state.
clean_phase
Explicitly clean ONE phase, regardless of staleness — the operator’s escape hatch for a wedged-but-fresh run. Clears its state and cron record; warns (but proceeds) when the recorded agent still looks alive.
format_age
Format a unix-seconds timestamp’s age as a human-readable string (“5m ago”). Public since 14c: devflow status reuses it for elapsed time and event recency.
inspect_all
Inspect every active phase state, producing one recovery status per phase (sorted by phase number). Errors with RecoverError::NothingToRecover when no phase has persisted state.
is_stale_state
Check whether a state is stale: >24h old with no running agent.