Skip to main content

ralph_workflow/checkpoint/
mod.rs

1//! Pipeline checkpoint system for resume functionality.
2//!
3//! This module provides checkpoint management for Ralph's pipeline:
4//! - Save and load pipeline state
5//! - Resume interrupted pipelines
6//! - Track pipeline phase progress
7//! - Validate checkpoints before resuming
8//! - Restore configuration from checkpoints
9//!
10//! # Example
11//!
12//! ```ignore
13//! use ralph::checkpoint::{
14//!     CheckpointBuilder, PipelineCheckpoint, PipelinePhase,
15//!     save_checkpoint, load_checkpoint,
16//! };
17//!
18//! // Create a checkpoint using the builder
19//! let checkpoint = CheckpointBuilder::new()
20//!     .phase(PipelinePhase::Development, 2, 5)
21//!     .reviewer_pass(0, 2)
22//!     .agents("claude", "codex")
23//!     .capture_from_context(&config, &registry, "claude", "codex", &logger)
24//!     .build()
25//!     .expect("checkpoint should build");
26//!
27//! save_checkpoint(&checkpoint)?;
28//!
29//! // Load and resume
30//! if let Some(checkpoint) = load_checkpoint()? {
31//!     println!("Resuming from: {}", checkpoint.description());
32//! }
33//! ```
34
35pub mod builder;
36pub mod execution_history;
37pub mod file_state;
38pub mod recovery;
39pub mod restore;
40pub mod run_context;
41pub mod state;
42pub mod validation;
43
44pub use builder::CheckpointBuilder;
45pub use execution_history::ExecutionHistory;
46pub use file_state::FileSystemState;
47pub use restore::apply_checkpoint_to_config;
48pub use run_context::RunContext;
49pub use state::{
50    calculate_file_checksum_with_workspace, checkpoint_exists, checkpoint_exists_with_workspace,
51    clear_checkpoint, clear_checkpoint_with_workspace, load_checkpoint,
52    load_checkpoint_with_workspace, save_checkpoint, save_checkpoint_with_workspace, timestamp,
53    PipelineCheckpoint, PipelinePhase, RebaseState,
54};
55pub use validation::validate_checkpoint;