pub enum Effect {
Show 73 variants
AgentInvocation {
role: AgentRole,
agent: String,
model: Option<String>,
prompt: String,
},
InitializeAgentChain {
drain: AgentDrain,
},
PreparePlanningPrompt {
iteration: u32,
prompt_mode: PromptMode,
},
MaterializePlanningInputs {
iteration: u32,
},
CleanupRequiredFiles {
files: Box<[String]>,
},
InvokePlanningAgent {
iteration: u32,
},
ExtractPlanningXml {
iteration: u32,
},
ValidatePlanningXml {
iteration: u32,
},
WritePlanningMarkdown {
iteration: u32,
},
ArchivePlanningXml {
iteration: u32,
},
ApplyPlanningOutcome {
iteration: u32,
valid: bool,
},
PrepareDevelopmentContext {
iteration: u32,
},
MaterializeDevelopmentInputs {
iteration: u32,
},
PrepareDevelopmentPrompt {
iteration: u32,
prompt_mode: PromptMode,
},
InvokeDevelopmentAgent {
iteration: u32,
},
InvokeAnalysisAgent {
iteration: u32,
},
ExtractDevelopmentXml {
iteration: u32,
},
ValidateDevelopmentXml {
iteration: u32,
},
ApplyDevelopmentOutcome {
iteration: u32,
},
ArchiveDevelopmentXml {
iteration: u32,
},
PrepareReviewContext {
pass: u32,
},
MaterializeReviewInputs {
pass: u32,
},
PrepareReviewPrompt {
pass: u32,
prompt_mode: PromptMode,
},
InvokeReviewAgent {
pass: u32,
},
ExtractReviewIssuesXml {
pass: u32,
},
ValidateReviewIssuesXml {
pass: u32,
},
WriteIssuesMarkdown {
pass: u32,
},
ExtractReviewIssueSnippets {
pass: u32,
},
ArchiveReviewIssuesXml {
pass: u32,
},
ApplyReviewOutcome {
pass: u32,
issues_found: bool,
clean_no_issues: bool,
},
PrepareFixPrompt {
pass: u32,
prompt_mode: PromptMode,
},
InvokeFixAgent {
pass: u32,
},
InvokeFixAnalysisAgent {
pass: u32,
},
ExtractFixResultXml {
pass: u32,
},
ValidateFixResultXml {
pass: u32,
},
ApplyFixOutcome {
pass: u32,
},
ArchiveFixResultXml {
pass: u32,
},
RunRebase {
phase: RebasePhase,
target_branch: String,
},
ResolveRebaseConflicts {
strategy: ConflictStrategy,
},
CheckCommitDiff,
PrepareCommitPrompt {
prompt_mode: PromptMode,
},
MaterializeCommitInputs {
attempt: u32,
},
InvokeCommitAgent,
ExtractCommitXml,
ValidateCommitXml,
ApplyCommitMessageOutcome,
ArchiveCommitXml,
CreateCommit {
message: String,
files: Vec<String>,
excluded_files: Vec<ExcludedFile>,
},
SkipCommit {
reason: String,
},
CheckResidualFiles {
pass: u8,
},
CheckUncommittedChangesBeforeTermination,
BackoffWait {
role: AgentRole,
cycle: u32,
duration_ms: u64,
},
ReportAgentChainExhausted {
role: AgentRole,
phase: PipelinePhase,
cycle: u32,
},
ValidateFinalState,
SaveCheckpoint {
trigger: CheckpointTrigger,
},
EnsureGitignoreEntries,
CleanupContext,
RestorePromptPermissions,
LockPromptPermissions,
WriteContinuationContext(ContinuationContextData),
CleanupContinuationContext,
WriteTimeoutContext {
role: AgentRole,
logfile_path: String,
context_path: String,
},
TriggerDevFixFlow {
failed_phase: PipelinePhase,
failed_role: AgentRole,
retry_cycle: u32,
},
EmitCompletionMarkerAndTerminate {
is_failure: bool,
reason: Option<String>,
},
TriggerLoopRecovery {
detected_loop: String,
loop_count: u32,
},
EmitRecoveryReset {
reset_type: RecoveryResetType,
target_phase: PipelinePhase,
},
AttemptRecovery {
level: u32,
attempt_count: u32,
},
EmitRecoverySuccess {
level: u32,
total_attempts: u32,
},
CheckNetworkConnectivity,
PollForConnectivity {
interval_ms: u64,
},
ConfigureGitAuth {
auth_method: String,
},
PushToRemote {
remote: String,
branch: String,
force: bool,
commit_sha: String,
},
CreatePullRequest {
base_branch: String,
head_branch: String,
title: String,
body: String,
},
}Expand description
Effects represent side-effect operations.
The reducer determines which effect to execute next based on state. Effect handlers execute effects and emit events.
Variants§
AgentInvocation
InitializeAgentChain
Resolve and materialize the concrete chain bound to a built-in runtime drain.
The reducer/orchestrator addresses drains directly so handlers never need to reconstruct chain selection from compatibility role metadata at invocation time.
Fields
drain: AgentDrainPreparePlanningPrompt
Prepare the planning prompt for an iteration (single-task).
MaterializePlanningInputs
Materialize planning inputs, handling oversize inline vs file references (single-task).
CleanupRequiredFiles
Delete specified files from the workspace to ensure fresh agent output (single-task).
XSD retry exemption: skipped on attempt > 1 so the agent can read the previous invalid XML (see XSD retry prompts for details).
InvokePlanningAgent
Invoke the planning agent for an iteration (single-task).
ExtractPlanningXml
Verify that .agent/tmp/plan.xml exists and is readable (single-task).
ValidatePlanningXml
Validate/parse the XML at .agent/tmp/plan.xml and emit a planning validation event (single-task).
WritePlanningMarkdown
Write .agent/PLAN.md from the validated planning XML (single-task).
ArchivePlanningXml
Archive .agent/tmp/plan.xml after PLAN.md is written (single-task).
ApplyPlanningOutcome
Emit the appropriate planning outcome event (single-task).
PrepareDevelopmentContext
Write context artifacts needed for the development prompt (single-task).
MaterializeDevelopmentInputs
Materialize development inputs, handling oversize inline vs file references (single-task).
PrepareDevelopmentPrompt
Prepare the development prompt for an iteration (single-task).
InvokeDevelopmentAgent
Invoke the developer agent for an iteration (single-task).
InvokeAnalysisAgent
Invoke the analysis agent to assess git diff against PLAN.md (single-task).
Produces development_result.xml. Does not parse or validate outputs.
ExtractDevelopmentXml
Verify that .agent/tmp/development_result.xml exists and is readable (single-task).
ValidateDevelopmentXml
Validate/parse the XML at .agent/tmp/development_result.xml (single-task).
ApplyDevelopmentOutcome
Emit the appropriate development outcome event (single-task).
ArchiveDevelopmentXml
Archive .agent/tmp/development_result.xml after validation (single-task).
PrepareReviewContext
Write review inputs (prompt backups, diffs, etc.) for the reviewer agent (single-task).
MaterializeReviewInputs
Materialize review inputs, handling oversize inline vs file references (single-task).
PrepareReviewPrompt
Prepare the review prompt for a pass (single-task).
InvokeReviewAgent
Invoke the reviewer agent for a review pass (single-task).
ExtractReviewIssuesXml
Verify that .agent/tmp/issues.xml exists and is readable (single-task).
ValidateReviewIssuesXml
Validate/parse the XML at .agent/tmp/issues.xml (single-task).
WriteIssuesMarkdown
Write .agent/ISSUES.md from the validated issues XML (single-task).
ExtractReviewIssueSnippets
Extract review issue snippets and emit UI output (single-task).
ArchiveReviewIssuesXml
Archive .agent/tmp/issues.xml after ISSUES.md is written (single-task).
ApplyReviewOutcome
Emit the appropriate review outcome event (single-task).
PrepareFixPrompt
Prepare the fix prompt for a review pass (single-task).
InvokeFixAgent
Invoke the fix agent for a review pass (single-task).
InvokeFixAnalysisAgent
Invoke the fix analysis agent to verify fix results (single-task).
This runs after every fix agent invocation to independently verify
whether the fix addressed the review issues. Uses the same drain
as development analysis (AgentDrain::Analysis).
ExtractFixResultXml
Verify that .agent/tmp/fix_result.xml exists and is readable (single-task).
ValidateFixResultXml
Validate/parse the XML at .agent/tmp/fix_result.xml (single-task).
ApplyFixOutcome
Emit the appropriate fix outcome event (single-task).
ArchiveFixResultXml
Archive .agent/tmp/fix_result.xml after validation (single-task).
Intentionally sequenced before ApplyFixOutcome so the reducer can
archive artifacts while still in the fix chain.
RunRebase
ResolveRebaseConflicts
Fields
strategy: ConflictStrategyCheckCommitDiff
Compute/write the commit diff and emit whether it is empty (single-task).
PrepareCommitPrompt
Render/write the commit prompt for the subsequent commit agent invocation (single-task).
Fields
prompt_mode: PromptModeMaterializeCommitInputs
Materialize commit inputs, handling model-budget truncation and inline vs reference (single-task).
InvokeCommitAgent
Invoke the commit agent (single-task).
ExtractCommitXml
Verify that .agent/tmp/commit_message.xml exists and is readable (single-task).
ValidateCommitXml
Validate/parse the XML at .agent/tmp/commit_message.xml (single-task).
ApplyCommitMessageOutcome
Emit the appropriate commit outcome event (single-task).
ArchiveCommitXml
Archive .agent/tmp/commit_message.xml after validation (single-task).
CreateCommit
Fields
excluded_files: Vec<ExcludedFile>Files excluded from this commit with their reasons.
Audit/observability only — must not change commit execution semantics. Defaults to empty for backward compatibility with old checkpoints.
SkipCommit
CheckResidualFiles
After a selective commit pass, check whether any staged/unstaged files remain.
Emits ResidualFilesFound { files, pass } if the working tree is still dirty,
or ResidualFilesNone when it is clean. pass identifies which commit pass just
completed (1 = first selective commit, 2 = second/final pass).
CheckUncommittedChangesBeforeTermination
Run git status --porcelain before termination; route to commit phase if changes exist (single-task).
User-initiated Ctrl+C (interrupted_by_user=true) skips this check.
BackoffWait
Wait for a retry-cycle backoff delay.
ReportAgentChainExhausted
Report that the agent chain has exhausted all retry attempts.
ValidateFinalState
SaveCheckpoint
Fields
trigger: CheckpointTriggerEnsureGitignoreEntries
Check .gitignore for required entries and add any missing ones (single-task).
CleanupContext
RestorePromptPermissions
Restore PROMPT.md write permissions after pipeline completion.
LockPromptPermissions
Lock PROMPT.md with read-only permissions at pipeline startup.
WriteContinuationContext(ContinuationContextData)
Write continuation context file for the next development attempt.
CleanupContinuationContext
Clean up continuation context file when iteration completes or a fresh iteration starts.
WriteTimeoutContext
Preserve prior agent context to a temp file when a timeout occurs without session IDs.
Fields
TriggerDevFixFlow
Invoke the dev agent to diagnose and fix a pipeline failure (single-task).
Fields
failed_phase: PipelinePhaseThe phase where the failure occurred.
EmitCompletionMarkerAndTerminate
Write a completion marker and transition to Interrupted.
Fields
TriggerLoopRecovery
Reset XSD retry state and loop detection counters when a tight loop is detected.
Fields
EmitRecoveryReset
Emit recovery reset events to escalate recovery strategy.
Fields
reset_type: RecoveryResetTypeType of reset to perform.
target_phase: PipelinePhaseTarget phase to reset to.
AttemptRecovery
Emit RecoveryAttempted event to transition back to the failed phase for retry.
EmitRecoverySuccess
Emit RecoverySucceeded event to clear recovery state after successful work completion.
Fields
CheckNetworkConnectivity
One-time connectivity probe triggered immediately after a Network-class agent failure.
Probes network connectivity using TCP connections to known-good hosts.
- If online: emits
AgentEvent::ConnectivityCheckSucceeded - If offline: emits
AgentEvent::ConnectivityCheckFailed
The reducer processes these events to update ConnectivityState.
PollForConnectivity
Polling effect emitted repeatedly while offline to wait for connectivity restoration.
Each execution:
- Sleeps for
interval_ms(default 5000ms) - Probes network connectivity
- If still offline: emits
AgentEvent::ConnectivityCheckFailed - If back online: emits
AgentEvent::ConnectivityCheckSucceeded
The orchestrator re-derives this effect each cycle while is_offline=true,
providing debounced polling without handler-side loops.
ConfigureGitAuth
Configure git authentication for remote operations (cloud mode only).
PushToRemote
Push commits to remote repository immediately after CreateCommit (cloud mode only).
Fields
CreatePullRequest
Create a pull request on the remote platform during Finalizing phase (cloud mode only).
Implementations§
Source§impl Effect
impl Effect
Sourcepub const fn is_same_agent_retry(&self) -> bool
pub const fn is_same_agent_retry(&self) -> bool
Check whether this effect is a same-agent retry prompt (any phase).
Returns true for any Prepare*Prompt variant whose prompt_mode is
PromptMode::SameAgentRetry. This is used by tests and diagnostics to
verify that transient failures produce the correct retry behavior.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Effect
impl<'de> Deserialize<'de> for Effect
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Effect
impl StructuralPartialEq for Effect
Auto Trait Implementations§
impl Freeze for Effect
impl RefUnwindSafe for Effect
impl Send for Effect
impl Sync for Effect
impl Unpin for Effect
impl UnsafeUnpin for Effect
impl UnwindSafe for Effect
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more