Skip to main content

Module loop_runner

Module loop_runner 

Source
Expand description

Diagnostic-driven fix loop driver.

The flow:

  1. Run baseline diagnostics.
  2. If everything passes, exit cleanly.
  3. Otherwise, in a bounded loop: a. Detect hard blocks (captive portal / ISP outage / no link / enterprise VPN) — exit cleanly with guidance. b. Compute the actionable failure set, group by root cause, and build a plan. c. Apply the plan’s actions one by one, prompting Y/N for any High-risk action. d. After each action, sleep its stabilization window. e. Re-run diagnostics; if all pass, exit; else continue.
  4. Bounded by iteration count, wall clock, and per-action attempt caps.

Functions§

run
Runs the full triage loop, populating the caller-owned session so the report stays rich even if the run is interrupted or panics. Returns the FinalOutcome. Destructive actions register inverse ops on restore; the caller drains it on every terminal path.
run_and_finalize
Convenience wrapper used by actions::fix::run. Persists the Markdown report and returns the exit code derived from the FinalOutcome.