ralph-workflow 0.7.18

PROMPT-driven multi-agent orchestrator for git repos
Documentation
//! Pipeline context types.
//!
//! This module defines the context structures used throughout the pipeline execution.

use crate::agents::AgentRegistry;
use crate::cli::Args;
use crate::config::Config;
use crate::logger::Colors;
use crate::logger::Logger;
use crate::logging::RunLogContext;
use crate::prompts::template_context::TemplateContext;
use crate::workspace::Workspace;

/// Context for running the pipeline.
///
/// Groups together the various parameters needed to run the development/review/commit
/// pipeline, reducing function parameter count and improving maintainability.
pub struct PipelineContext {
    pub args: Args,
    pub config: Config,
    pub registry: AgentRegistry,
    pub developer_agent: String,
    pub reviewer_agent: String,
    pub developer_display: String,
    pub reviewer_display: String,
    pub repo_root: std::path::PathBuf,
    /// Workspace for explicit path resolution (no CWD dependency).
    ///
    /// Uses `Arc<dyn Workspace>` for proper dependency injection:
    /// - Production code passes `Arc::new(WorkspaceFs::new(...))`
    /// - Tests can pass `Arc::new(MemoryWorkspace::new(...))`
    pub workspace: std::sync::Arc<dyn Workspace>,
    pub logger: Logger,
    pub colors: Colors,
    pub template_context: TemplateContext,
    pub executor: std::sync::Arc<dyn crate::executor::ProcessExecutor>,
    /// Run log context for per-run log path resolution.
    ///
    /// Provides paths to all log files under the per-run directory
    /// (`.agent/logs-<run_id>/`). This ensures all logs from a single
    /// pipeline invocation are grouped together for easy debugging.
    pub run_log_context: RunLogContext,
}