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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// Pipeline Execution
//
// This module coordinates pipeline execution through three main phases:
// 1. Initialization (initialization.rs): Context preparation and early-exit handling
// 2. Execution (execution_core.rs): Main reducer-based event loop
// 3. Completion (completion.rs): Defensive completion marker writing
//
// Architecture:
//
// The pipeline follows a reducer-based architecture:
// State → Orchestrator → Effect → Handler → Event → Reducer → State
//
// The reducer pattern ensures:
// - Reproducibility: Given same state + events = same result
// - Testability: Pure reducers and orchestrators can be tested without I/O
// - Resumability: State can be checkpointed and restored at any point
// - Observability: Event stream provides audit trail of execution
//
// Module Organization:
//
// - initialization.rs - Pipeline context preparation, checkpoint restoration, early-exit modes
// - execution_core.rs - Main event loop execution with MainEffectHandler
// - completion.rs - Defensive completion marker for abnormal terminations
// - testing.rs - Test entry points with custom effect handlers
//
// Entry Points:
//
// Production:
// - run_pipeline() - Standard entry point, uses MainEffectHandler
// - run_pipeline_with_default_handler() - Direct event loop execution
//
// Testing:
// - run_pipeline_with_effect_handler() - Custom effect handler injection (see testing.rs)
//
// See Also:
//
// - Event loop implementation: app/event_loop/
// - Reducer architecture: docs/architecture/event-loop-and-reducers.md
// - Effect system: docs/architecture/effect-system.md
use Context;
// Include sub-modules
include!;
include!;
include!;
/// Runs the full development/review/commit pipeline using reducer-based event loop.
///
/// This is the standard production entry point. It:
/// 1. Prepares the pipeline context (via `prepare_pipeline_or_exit`)
/// 2. Runs the event loop (via `run_pipeline_with_default_handler`)
///
/// # Early Exit Conditions
///
/// Returns `Ok(())` without running the pipeline if:
/// - `--dry-run`: Displays configuration only
/// - `--rebase-only`: Runs rebase operation only
/// - `--generate-commit-msg`: Generates commit message only
///
/// # Errors
///
/// Returns error if:
/// - Pipeline initialization fails
/// - Event loop execution fails
/// - Finalization operations fail