Skip to main content

derive_outcome

Function derive_outcome 

Source
pub fn derive_outcome(evidence: &RunEvidence) -> Outcome
Expand description

Maps complete evidence to the run’s terminal outcome.

Constraints fixed by the design documents:

  • Cancellation always wins: the outcome is Cancelled regardless of other evidence, so racing exit and cancel events stay idempotent.
  • A run may only be Merged when the merge itself succeeded (Some(MergeOutcome::Merged)).

Policy decisions taken here:

  • A successful exit whose walk halted after the first stage is NeedsReview when its run branch has commits, otherwise Failed.
  • A nonzero or killed exit is Failed; Git history does not upgrade or downgrade the verdict.
  • A merge attempt that conflicted is NeedsReview: the work passed its preceding stages, only integration needs a human.