Skip to main content

CheckpointBuilder

Struct CheckpointBuilder 

Source
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, &registry, "claude", "codex")
    .build();

Implementations§

Source§

impl CheckpointBuilder

Source

pub fn new() -> Self

Create a new checkpoint builder with default values.

Source

pub fn phase( self, phase: PipelinePhase, iteration: u32, total_iterations: u32, ) -> Self

Set the phase and iteration information.

Source

pub fn reviewer_pass(self, pass: u32, total: u32) -> Self

Set the reviewer pass information.

Source

pub fn agents(self, developer: &str, reviewer: &str) -> Self

Set the agent names.

Source

pub fn cli_args(self, args: CliArgsSnapshot) -> Self

Set the CLI arguments snapshot.

Source

pub fn developer_config(self, config: AgentConfigSnapshot) -> Self

Set the developer agent configuration snapshot.

Source

pub fn reviewer_config(self, config: AgentConfigSnapshot) -> Self

Set the reviewer agent configuration snapshot.

Source

pub fn rebase_state(self, state: RebaseState) -> Self

Set the rebase state.

Source

pub fn config_path(self, path: Option<PathBuf>) -> Self

Set the config path.

Source

pub fn git_identity(self, name: Option<&str>, email: Option<&str>) -> Self

Set the git user name and email.

Source

pub fn skip_rebase(self, value: bool) -> Self

Set the skip_rebase flag for CLI args capture.

Source

pub fn with_executor(self, executor: Arc<dyn ProcessExecutor>) -> Self

Set the process executor for external process execution.

Source

pub fn capture_cli_args(self, config: &Config) -> Self

Capture CLI arguments from a Config.

Source

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.

Source

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.

Source

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.

Source

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
Source

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().

Source

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 MemoryWorkspace in tests

Trait Implementations§

Source§

impl Default for CheckpointBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.