merge_run_terminal
Function
This function is defined in the run_outcome module.Fold a newly-observed terminal into the current one (refine-only). Pure, deterministic, and order-independent: folding the same set of observations always yields the same authoritative outcome regardless of the sequence in which they arrive. Rules, in order:
- No current outcome — the observation becomes authoritative.
- Current is sticky — it can never be downgraded; keep it.
- Observation has strictly stronger attribution
(
aborted>timeout>failed>ok) — refine to it. - Equal attribution strength but the observation is sticky while the
current writer is not — promote to the sticky observation so a later
run_budget/external/supersededof the same kind can no longer be silently downgraded by a subsequent weaker signal. Without this,timeout/idlethentimeout/run_budgetwould keep the non-sticky idle result and stay downgradeable, so identical signals in the opposite order produced a different final outcome. - Otherwise keep
currentso the first writer of a given strength wins.
Signature
Parameters
Optional[RunTerminal]
required
No description available.
RunTerminal
required
No description available.
Returns
RunTerminal
The result of the operation.
Uses
is_sticky
Source
View on GitHub
praisonaiagents/run_outcome.py at line 408
