Skip to main content

Module effect

Module effect 

Source
Expand description

App-level effects for pre-pipeline operations.

This module defines effects that represent side effects in the CLI layer before the pipeline reducer takes over. Effects are data describing what should happen, not the execution itself.

§Architecture

Effects follow the functional core / imperative shell pattern:

  • Pure functions produce AppEffect values describing desired operations
  • An AppEffectHandler executes the effects, performing actual I/O
  • This separation enables testing without real filesystem or git operations

§Example

// Pure function returns effects (testable)
fn setup_workspace() -> Vec<AppEffect> {
    vec![
        AppEffect::CreateDir { path: PathBuf::from(".agent") },
        AppEffect::WriteFile {
            path: PathBuf::from(".agent/config.toml"),
            content: "key = value".to_string(),
        },
    ]
}

// Handler executes effects (I/O boundary)
for effect in setup_workspace() {
    handler.execute(effect);
}

Enums§

AppEffect
App-level effects for CLI operations.
AppEffectResult
Result of executing an AppEffect.
CommitResult
Result of a git commit operation.
RebaseResult
Result of a rebase operation.

Traits§

AppEffectHandler
Trait for executing app-level effects.