Skip to main content

Module mode

Module mode 

Source
Expand description

Execution mode and the mode-driven gate decision.

Mode is a per-session CLI flag on devflow start — there is no config file and no per-phase toggling.

  • Auto: Define and Plan run once. Code ↔ Validate auto-loop until clean. Then Ship. The only human gate is at Ship — unless Validate fails MAX_CONSECUTIVE_FAILURES times in a row, which forces a gate.
  • Supervise: Same pipeline, but Validate always fires a gate to Hermes → Human before advancing to Ship.

Structs§

ModeParseError
Error returned when parsing an unsupported mode name.

Enums§

Mode
How DevFlow drives the pipeline for a session.

Constants§

MAX_CHECKPOINT_RESUMES
Ceiling for crate::state::State::checkpoint_resumes before a checkpoint auto-decide relaunch (D-03/D-04, 28-03) stops resuming and falls through to the never-silent gate instead, its context naming the exhaustion. Bounds consecutive claude --resume relaunches for one stage’s agent run against a checkpoint that keeps re-firing.
MAX_CONSECUTIVE_FAILURES
Number of consecutive Validate failures in Auto mode before a gate is forced.
MAX_INFRA_FAILURES
Ceiling for crate::state::State::infra_failures before an infrastructure-class fault chain (OOM/ResourceKilled, missing agent binary/AgentUnavailable) forces a terminal gate (D-08, 17-01).
MAX_PHASE_VALIDATE_FAILURES
Ceiling for crate::state::State::phase_validate_failures — the total number of Validate failures recorded for one PHASE, accumulated without regard to forward progress (999.78/WR-01, D-07).
MAX_PREFLIGHT_RETRIES
Ceiling for crate::state::State::preflight_retries before a preflight gate’s GateAction::LoopBack recursion aborts rather than polling another 7-day gate timeout (18f, D-18f backstop). A failing preflight is a readiness problem the operator is actively being asked about right now, not a transient infrastructure blip, so this takes the tighter MAX_CONSECUTIVE_FAILURES-style ceiling rather than the more lenient MAX_INFRA_FAILURES. Unlike those two counters, this one is NOT reset by transition() — it is reset by preflight success and by human approval (GateAction::Advance), both inside run_preflight (devflow-cli/src/main.rs).

Functions§

consecutive_failures_made_progress
Whether a Validate failure represents forward progress since the last recorded failure (999.66, D-03) — i.e. whether Code produced new commits on the phase’s feature branch since crate::state::State::last_validate_failure_commit_count was last observed.
phase_failure_ceiling_reached
Whether the per-phase Validate-failure total has reached MAX_PHASE_VALIDATE_FAILURES (999.78, F-6).
transition_resets_consecutive_failures
Whether transition() should zero crate::state::State::consecutive_failures when moving from from to to.