pub fn classify_run_saga_result(
result: &Result<Value, String>,
) -> SagaTerminal<'_>Expand description
Convenience: classify the standard run_saga Result<Value, String>
outcome into a SagaTerminal.
Ok(_)→Completed.Err(_)→Failed.
(codex P1 PR #631 round 2.) The earlier round mapped non-timeout
Err to Compensated on the assumption that “our sagas drive
compensation in their inner future before returning Err.”
That’s true for the forward dispatch failures, but
SagaCtx::compensate is best-effort — if a compensating
dispatch is itself rejected by the reducer, compensate logs a
warning and returns without signaling failure. Marking those as
Compensated would hide partially-applied state from PR 2’s
restart recovery (which scans for running/failed to know what
to compensate).
Conservative default: classify all errors as Failed. Sagas that
can prove compensation succeeded (e.g. a future per-step
compensation-success log) construct SagaTerminal::Compensated
directly without going through this helper.