Expand description
Effectful app operations that use AppEffect handlers.
This module provides functions that execute CLI operations via an
AppEffectHandler, enabling testing without real side effects.
§Architecture
Each function in this module:
- Takes an
AppEffectHandlerreference - Executes effects through the handler
- Returns strongly-typed results
In production, use [RealAppEffectHandler] for actual I/O.
In tests, use [MockAppEffectHandler] to verify behavior without side effects.
§Example
ⓘ
use ralph_workflow::app::effectful::handle_reset_start_commit;
use ralph_workflow::app::mock_effect_handler::MockAppEffectHandler;
// Test without real git or filesystem
let mut handler = MockAppEffectHandler::new()
.with_head_oid("abc123");
let result = handle_reset_start_commit(&mut handler, None);
assert!(result.is_ok());Functions§
- check_
prompt_ exists_ effectful - Check if PROMPT.md exists using effects.
- ensure_
files_ effectful - Ensure required files and directories exist using effects.
- get_
head_ oid - Get the current HEAD OID using effects.
- get_
repo_ root - Get the repository root path using effects.
- handle_
reset_ start_ commit - Handle the
--reset-start-commitcommand using effects. - is_
on_ main_ branch - Check if the current branch is main/master using effects.
- require_
repo - Validate that we’re in a git repository using effects.
- reset_
context_ for_ isolation_ effectful - Reset context for isolation mode by deleting STATUS.md, NOTES.md, ISSUES.md.
- save_
start_ commit - Save the starting commit at pipeline start using effects.