pub struct CheckpointBuilder { /* private fields */ }Expand description
Builder for creating pipeline checkpoints.
Provides a convenient interface for capturing all necessary state when creating checkpoints during pipeline execution.
§Example
let checkpoint = CheckpointBuilder::new()
.phase(PipelinePhase::Development, 3, 5)
.reviewer_pass(1, 2)
.capture_from_config(&ctx, ®istry, "claude", "codex")
.build();Implementations§
Source§impl CheckpointBuilder
impl CheckpointBuilder
Sourcepub fn phase(
self,
phase: PipelinePhase,
iteration: u32,
total_iterations: u32,
) -> Self
pub fn phase( self, phase: PipelinePhase, iteration: u32, total_iterations: u32, ) -> Self
Set the phase and iteration information.
Sourcepub fn reviewer_pass(self, pass: u32, total: u32) -> Self
pub fn reviewer_pass(self, pass: u32, total: u32) -> Self
Set the reviewer pass information.
Sourcepub fn cli_args(self, args: CliArgsSnapshot) -> Self
pub fn cli_args(self, args: CliArgsSnapshot) -> Self
Set the CLI arguments snapshot.
Sourcepub fn developer_config(self, config: AgentConfigSnapshot) -> Self
pub fn developer_config(self, config: AgentConfigSnapshot) -> Self
Set the developer agent configuration snapshot.
Sourcepub fn reviewer_config(self, config: AgentConfigSnapshot) -> Self
pub fn reviewer_config(self, config: AgentConfigSnapshot) -> Self
Set the reviewer agent configuration snapshot.
Sourcepub fn rebase_state(self, state: RebaseState) -> Self
pub fn rebase_state(self, state: RebaseState) -> Self
Set the rebase state.
Sourcepub fn config_path(self, path: Option<PathBuf>) -> Self
pub fn config_path(self, path: Option<PathBuf>) -> Self
Set the config path.
Sourcepub fn git_identity(self, name: Option<&str>, email: Option<&str>) -> Self
pub fn git_identity(self, name: Option<&str>, email: Option<&str>) -> Self
Set the git user name and email.
Sourcepub fn skip_rebase(self, value: bool) -> Self
pub fn skip_rebase(self, value: bool) -> Self
Set the skip_rebase flag for CLI args capture.
Sourcepub fn with_executor(self, executor: Arc<dyn ProcessExecutor>) -> Self
pub fn with_executor(self, executor: Arc<dyn ProcessExecutor>) -> Self
Set the process executor for external process execution.
Sourcepub fn capture_cli_args(self, config: &Config) -> Self
pub fn capture_cli_args(self, config: &Config) -> Self
Capture CLI arguments from a Config.
Sourcepub fn capture_from_context(
self,
config: &Config,
registry: &AgentRegistry,
developer_name: &str,
reviewer_name: &str,
logger: &Logger,
run_context: &RunContext,
) -> Self
pub fn capture_from_context( self, config: &Config, registry: &AgentRegistry, developer_name: &str, reviewer_name: &str, logger: &Logger, run_context: &RunContext, ) -> Self
Capture all configuration from a PhaseContext and AgentRegistry.
This is a convenience method that captures CLI args and both agent configs. It takes a PhaseContext which provides access to config, registry, and agents.
Sourcepub fn with_executor_from_context(
self,
executor_arc: Arc<dyn ProcessExecutor>,
) -> Self
pub fn with_executor_from_context( self, executor_arc: Arc<dyn ProcessExecutor>, ) -> Self
Set the executor from a PhaseContext.
This is a convenience method that extracts the executor_arc from PhaseContext and sets it for the checkpoint builder.
Sourcepub fn with_execution_history(self, history: ExecutionHistory) -> Self
pub fn with_execution_history(self, history: ExecutionHistory) -> Self
Attach execution history from a PhaseContext.
This method captures the execution history from the phase context and attaches it to the checkpoint.
Sourcepub fn with_prompt_history(self, history: HashMap<String, String>) -> Self
pub fn with_prompt_history(self, history: HashMap<String, String>) -> Self
Set the entire prompt history from a HashMap.
This is useful when transferring prompts from a PhaseContext.
§Arguments
history- HashMap of prompt keys to prompt text
Sourcepub fn build(self) -> Option<PipelineCheckpoint>
pub fn build(self) -> Option<PipelineCheckpoint>
Build the checkpoint without workspace.
Returns None if required fields (phase, agent configs) are missing. Generates a new RunContext if not set.
This method uses CWD-relative file operations for file state capture.
For pipeline code where a workspace is available, prefer build_with_workspace().
Sourcepub fn build_with_workspace(
self,
workspace: &dyn Workspace,
) -> Option<PipelineCheckpoint>
pub fn build_with_workspace( self, workspace: &dyn Workspace, ) -> Option<PipelineCheckpoint>
Build the checkpoint with workspace-aware file capture.
Returns None if required fields (phase, agent configs) are missing. Generates a new RunContext if not set.
This method uses the workspace abstraction for file state capture, which is the preferred approach for pipeline code. The workspace provides:
- Explicit path resolution relative to repo root
- Testability via
MemoryWorkspacein tests
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CheckpointBuilder
impl !RefUnwindSafe for CheckpointBuilder
impl Send for CheckpointBuilder
impl Sync for CheckpointBuilder
impl Unpin for CheckpointBuilder
impl !UnwindSafe for CheckpointBuilder
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> 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