pub enum TerminationReason {
CompletionPromise,
MaxIterations,
MaxRuntime,
MaxCost,
ConsecutiveFailures,
LoopThrashing,
ValidationFailure,
Stopped,
Interrupted,
ChaosModeComplete,
ChaosModeMaxIterations,
}Expand description
Reason the event loop terminated.
Variants§
CompletionPromise
Completion promise was detected in output.
MaxIterations
Maximum iterations reached.
MaxRuntime
Maximum runtime exceeded.
MaxCost
Maximum cost exceeded.
ConsecutiveFailures
Too many consecutive failures.
LoopThrashing
Loop thrashing detected (repeated blocked events).
ValidationFailure
Too many consecutive malformed JSONL lines in events file.
Stopped
Manually stopped.
Interrupted
Interrupted by signal (SIGINT/SIGTERM).
ChaosModeComplete
Chaos mode completion promise detected.
ChaosModeMaxIterations
Chaos mode max iterations reached.
Implementations§
Source§impl TerminationReason
impl TerminationReason
Sourcepub fn exit_code(&self) -> i32
pub fn exit_code(&self) -> i32
Returns the exit code for this termination reason per spec.
Per spec “Loop Termination” section:
- 0: Completion promise detected (success)
- 1: Consecutive failures or unrecoverable error (failure)
- 2: Max iterations, max runtime, or max cost exceeded (limit)
- 130: User interrupt (SIGINT = 128 + 2)
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Returns the reason string for use in loop.terminate event payload.
Per spec event payload format:
completed | max_iterations | max_runtime | consecutive_failures | interrupted | error
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Returns true if this is a successful completion (not an error or limit).
Sourcepub fn triggers_chaos_mode(&self) -> bool
pub fn triggers_chaos_mode(&self) -> bool
Returns true if this termination triggers chaos mode.
Chaos mode ONLY activates after LOOP_COMPLETE - not on other termination reasons.
Trait Implementations§
Source§impl Clone for TerminationReason
impl Clone for TerminationReason
Source§fn clone(&self) -> TerminationReason
fn clone(&self) -> TerminationReason
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TerminationReason
impl Debug for TerminationReason
Source§impl PartialEq for TerminationReason
impl PartialEq for TerminationReason
impl Eq for TerminationReason
impl StructuralPartialEq for TerminationReason
Auto Trait Implementations§
impl Freeze for TerminationReason
impl RefUnwindSafe for TerminationReason
impl Send for TerminationReason
impl Sync for TerminationReason
impl Unpin for TerminationReason
impl UnwindSafe for TerminationReason
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§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.