1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! 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,
}