Expand description
Event loop for reducer-based pipeline architecture.
This module implements main event loop that coordinates reducer, effect handlers, and orchestration logic. It provides a unified way to run the pipeline using the event-sourced architecture from RFC-004.
§Non-Terminating Pipeline Architecture
The pipeline is designed to be non-terminating by default for unattended operation. It must NEVER exit early due to internal failures, budget exhaustion, or agent errors.
§Failure Handling Flow
- Any terminal failure (Status: Failed, budget exhausted, agent chain exhausted)
transitions to
AwaitingDevFixphase TriggerDevFixFloweffect writes completion marker to.agent/tmp/completion_marker- Dev-fix agent is optionally dispatched for remediation attempt
CompletionMarkerEmittedevent transitions toInterruptedphaseSaveCheckpointeffect saves state for resume- Event loop returns
EventLoopResult { completed: true, ... }
§Acceptable Termination Reasons
The ONLY acceptable reasons for pipeline termination are catastrophic external events:
- Process termination (SIGKILL)
- Machine outage / power loss
- OS kill signal
- Unrecoverable panic in effect handler (caught and logged)
All internal errors route through the failure handling flow above.
Structs§
- Event
Loop Config - Configuration for event loop.
- Event
Loop Result - Result of event loop execution.
Constants§
- MAX_
EVENT_ LOOP_ ITERATIONS - Maximum iterations for the main event loop to prevent infinite loops.
Traits§
- Stateful
Handler - Trait for handlers that maintain internal state.
Functions§
- run_
event_ loop - Run the main event loop for the reducer-based pipeline.
- run_
event_ loop_ with_ handler - Run the event loop with a custom effect handler.