pub fn run_repair_loop(
max_attempts: usize,
attempt_failed: impl FnMut(usize) -> bool,
) -> (bool, usize)Expand description
Drive a bounded repair loop: call attempt_failed up to max_attempts times (1-indexed),
stopping at the first attempt that reports success. Mirrors conditional.ts’s runRepairLoop:
returns (recovered, attempts) and never loops past max_attempts — exhaustion is reported back
(recovered = false) for the caller to loud-fail, not swallowed here.