#[repr(i32)]pub enum ExitCode {
Success = 0,
ConfigError = 2,
RunFailure = 3,
NoChanges = 4,
DeadlineExceeded = 5,
Partial = 6,
}Expand description
Distinct process exit codes for a run-task invocation.
Why: A caller (CI, the PM smoke-test, a wrapper script) needs to distinguish
outcomes without parsing output. The ladder separates a clean success, a
successful run that changed nothing, a configuration error (bad agent, bad
project), a runtime failure (the loop or LLM errored), (#2207) the
wall-clock deadline firing before the PM reached finish_task — a run that
may have made real, useful progress and must not be conflated with a
genuine RunFailure (the bug that blocked the M3 bake-off L1 pilot: a
deadline hit at turn 13 on an otherwise fully-passing solution reported the
same run_failure a real crash would) — and (#2265) a PM turn-cap or
re-delegation-cap hit that STILL produced a deliverable, the same class of
bug as #2207’s but triggered by exhausting turns/re-delegation attempts
rather than wall-clock time.
What: repr(i32) so the values are stable and documented; Success = 0.
Test: run_task::tests::exit_codes_are_distinct.
Variants§
Success = 0
The run completed and produced a diff. 0.
ConfigError = 2
Configuration error: missing/invalid agent, bad project path, missing key. 2.
RunFailure = 3
Runtime failure: the agent loop or LLM call errored (excludes the
deadline and partial paths — see DeadlineExceeded and Partial). 3.
NoChanges = 4
The run completed but changed nothing (empty diff). 4.
DeadlineExceeded = 5
The configured wall-clock deadline elapsed before the PM loop reached
a terminal state (#2207). Distinct from RunFailure so a caller (e.g.
the M3 bake-off runner) can tell “timed out, possibly close to done”
from “genuinely errored”. 5.
Partial = 6
The PM’s own turn cap, or the (#2265) engineer re-delegation cap, was
exhausted, but a non-empty diff shows a deliverable was actually
produced. Distinct from RunFailure so a caller does not discard a
working, on-disk solution as an opaque crash purely because the PM ran
out of turns/retries absorbing engineer failures — trusty-code cannot
generically verify correctness, so this status only claims “work was
produced”, leaving scoring to the downstream harness. 6.
Implementations§
Trait Implementations§
impl Copy for ExitCode
impl Eq for ExitCode
impl StructuralPartialEq for ExitCode
Auto Trait Implementations§
impl Freeze for ExitCode
impl RefUnwindSafe for ExitCode
impl Send for ExitCode
impl Sync for ExitCode
impl Unpin for ExitCode
impl UnsafeUnpin for ExitCode
impl UnwindSafe for ExitCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more