Expand description
Diagnostic-driven fix loop driver.
The flow:
- Run baseline diagnostics.
- If everything passes, exit cleanly.
- 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
stabilizationwindow. e. Re-run diagnostics; if all pass, exit; else continue. - Bounded by iteration count, wall clock, and per-action attempt caps.
Functions§
- run
- Runs the full triage loop, populating the caller-owned
sessionso the report stays rich even if the run is interrupted or panics. Returns theFinalOutcome. Destructive actions register inverse ops onrestore; 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 theFinalOutcome.