pub fn aggregate_terminal_status<I>(statuses: I) -> Option<Status>where
I: IntoIterator<Item = Status>,Expand description
Aggregate a set of node statuses into the run’s rolled-up terminal status,
or None when the run is not yet complete.
The single, shared roll-up rule — used both by the supervisor’s per-tick
rollup_status and by cancel_node’s in-lock
self-roll-up (so the two can never diverge). A three-way classification
(design §2.5, “rollup terminalizes the run cancelled/done/failed once every
node is terminal”):
Noneif the set is empty (a freshly-created run must not vacuously complete) or if ANY node is still live (Pending/Running/Blocked);Some(Status::Failed)if any node genuinelyFailed(a real failure dominates the batch outcome);Some(Status::Cancelled)if no node failed but at least one wasCancelled(a deliberate per-node/whole-run cancel — nothing failed, but the batch did not fully complete; branch-preserving work is untouched);Some(Status::Done)when every node isDone.