pub fn derive_outcome(evidence: &RunEvidence) -> OutcomeExpand description
Maps complete evidence to the run’s terminal outcome.
Constraints fixed by the design documents:
- Cancellation always wins: the outcome is
Cancelledregardless of other evidence, so racing exit and cancel events stay idempotent. - A run may only be
Mergedwhen the merge itself succeeded (Some(MergeOutcome::Merged)).
Policy decisions taken here:
- A successful exit whose walk halted after the first stage is
NeedsReviewwhen its run branch has commits, otherwiseFailed. - 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.