pub enum PipelinePhase {
Planning,
Development,
Review,
CommitMessage,
FinalValidation,
Finalizing,
Complete,
AwaitingDevFix,
Interrupted,
}Expand description
Pipeline phases for checkpoint tracking.
These phases represent the major stages of the Ralph pipeline. Reducers transition between phases based on events.
§Phase Transitions
Planning → Development → Review → CommitMessage → FinalValidation → Finalizing → Complete
↓ ↓ ↓
AwaitingDevFix → Interrupted§Phase Descriptions
- Planning: Generate implementation plan for the iteration
- Development: Execute plan, write code
- Review: Review code changes, identify issues
CommitMessage: Generate commit messageFinalValidation: Final checks before completion- Finalizing: Cleanup operations (restore permissions, etc.)
- Complete: Pipeline completed successfully
AwaitingDevFix: Terminal failure occurred, dev agent diagnosing- Interrupted: Pipeline terminated (success or failure)
Variants§
Planning
Development
Review
CommitMessage
FinalValidation
Finalizing
Finalizing phase for cleanup operations before completion.
This phase handles:
- Restoring PROMPT.md write permissions
- Any other cleanup that must go through the effect system
Complete
AwaitingDevFix
Awaiting development agent to fix pipeline failure.
This phase occurs when the pipeline encounters a terminal failure condition (e.g., agent chain exhausted) but before transitioning to Interrupted. It signals that the development agent should be invoked to diagnose and fix the failure root cause.
§Failure Handling Flow
ErrorEvent::AgentChainExhaustedoccurs in any phase- Reducer transitions state to
AwaitingDevFix - Orchestration determines
Effect::TriggerDevFixFlow - Handler executes
TriggerDevFixFlow: a. Writes completion marker to .agent/tmp/completion_marker(failure status) b. EmitsDevFixTriggeredevent c. Dispatches dev-fix agent d. EmitsDevFixCompletedevent e. EmitsCompletionMarkerEmittedevent - DevFixTriggered/DevFixCompleted events: no state change (stays in
AwaitingDevFix) CompletionMarkerEmittedevent: transitions to Interrupted- Orchestration determines
Effect::SaveCheckpointfor Interrupted - Handler saves checkpoint, increments
checkpoint_saved_count - Event loop recognizes
is_complete()== true and exits successfully
§Event Loop Termination Guarantees
The event loop MUST NOT exit with completed=false when in AwaitingDevFix phase.
The failure handling flow is designed to always complete with:
- Completion marker written to filesystem
- State transitioned to Interrupted
- Checkpoint saved (
checkpoint_saved_count> 0) - Event loop returning completed=true
If the event loop exits with completed=false from AwaitingDevFix, this indicates
a critical bug (e.g., max iterations reached before checkpoint saved).
§Completion Marker Requirement
The completion marker MUST be written before transitioning to Interrupted. This ensures external orchestration systems (CI, monitoring) can detect pipeline termination even if the event loop exits unexpectedly.
§Agent Chain Exhaustion Handling
When in AwaitingDevFix phase with an exhausted agent chain, orchestration
falls through to phase-specific logic (TriggerDevFixFlow) instead of reporting
exhaustion again. This prevents infinite loops where exhaustion is reported
repeatedly.
Transitions:
- From: Any phase where
AgentChainExhaustederror occurs - To: Interrupted (after dev-fix attempt completes or fails)
Interrupted
Trait Implementations§
Source§impl Clone for PipelinePhase
impl Clone for PipelinePhase
Source§fn clone(&self) -> PipelinePhase
fn clone(&self) -> PipelinePhase
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PipelinePhase
impl Debug for PipelinePhase
Source§impl<'de> Deserialize<'de> for PipelinePhase
impl<'de> Deserialize<'de> for PipelinePhase
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for PipelinePhase
impl Display for PipelinePhase
Source§impl PartialEq for PipelinePhase
impl PartialEq for PipelinePhase
Source§impl Serialize for PipelinePhase
impl Serialize for PipelinePhase
impl Copy for PipelinePhase
impl Eq for PipelinePhase
impl StructuralPartialEq for PipelinePhase
Auto Trait Implementations§
impl Freeze for PipelinePhase
impl RefUnwindSafe for PipelinePhase
impl Send for PipelinePhase
impl Sync for PipelinePhase
impl Unpin for PipelinePhase
impl UnsafeUnpin for PipelinePhase
impl UnwindSafe for PipelinePhase
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.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