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_with_workspace, load_checkpoint_with_workspace,
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, ®istry, "claude", "codex", &logger)
24//! .build()
25//! .expect("checkpoint should build");
26//!
27//! save_checkpoint_with_workspace(&workspace, &checkpoint)?;
28//!
29//! // Load and resume
30//! if let Some(checkpoint) = load_checkpoint_with_workspace(&workspace)? {
31//! println!("Resuming from: {}", checkpoint.description());
32//! }
33//! ```
34
35pub mod builder;
36pub mod current_dir;
37pub mod env_capture;
38pub mod environment;
39pub mod execution_history;
40pub mod file_capture;
41pub mod file_state;
42pub mod git_capture;
43pub mod io;
44pub mod recovery;
45pub mod restore;
46pub mod run_context;
47pub mod size_monitor;
48pub mod state;
49pub mod string_pool;
50pub mod validation;
51
52pub use builder::CheckpointBuilder;
53pub use execution_history::ExecutionHistory;
54pub use file_state::FileSystemState;
55pub use restore::apply_checkpoint_to_config;
56pub use run_context::RunContext;
57pub use size_monitor::{CheckpointSizeMonitor, SizeAlert, SizeThresholds};
58pub use string_pool::StringPool;
59pub use validation::validate_checkpoint;
60
61// Re-export commonly used items from state module
62pub use state::{
63 checkpoint_exists_with_workspace, clear_checkpoint_with_workspace,
64 load_checkpoint_with_workspace, save_checkpoint_with_workspace, timestamp, AgentConfigSnapshot,
65 CheckpointParams, CliArgsSnapshot, CliArgsSnapshotBuilder, CloudCheckpointState,
66 EnvironmentSnapshot, PipelineCheckpoint, PipelinePhase, RebaseState,
67};