pub fn settle(
task: &mut Task,
verdict: Verdict,
detail: &str,
max_attempts: usize,
)Expand description
Record a finished run against the task it came from.
Kept pure and separate from the loop because this mapping is the retry policy, and a policy that can only be exercised by spawning a graph is a policy nobody checks. The table:
| run status | task becomes | attempt spent |
|---|---|---|
| parked at a boundary | Failed (requeued) | no |
Merged, Ready | Done | yes |
Stalled, quota hit | Failed (requeued) | no |
Stalled, no quota | Failed, or Held | yes |
Blocked with a PR | Held | yes |
Blocked, Failed | Failed, or Held | yes |
| anything non-terminal | Failed, or Held | yes |
The two Stalled rows are the ones worth reading twice. A quorum lost to
rate limits is a property of the machine and not of the task, so the
attempt is refunded and a reset quota picks the work up where it stopped.
A quorum lost to judges that answered with the wrong shape is ordinary
flakiness, and refunding that takes the bound off the retry loop
entirely: run e633 stalled with quota: [] after two judges wrote
unusable JSON, was refunded, and the next attempt paid for a fresh
hour-long implement wave before it could fail the same way. max_attempts
exists precisely so that cannot repeat forever.
A non-terminal status means execute returned while the graph was still
mid-flight, which is a bug rather than a verdict; it is treated as a
failure so that a task cannot loop on it either.
left_pr splits the Blocked row, and it is the difference between a run
that failed and a run that finished into a gate. See Task::handed_off.