Repository navigation
feat(metrics): add Recovery Step Ratio (RSR) for post-error recovery effort - #6
Merged
Merged
Conversation
This was referenced Aug 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the Recovery Step Ratio (RSR) metric (roadmap B2): how many successful steps a run spends recovering after ERROR/RETRY/ABANDONED clusters, candidate vs baseline.
DiffReportgainsbaseline_recovery_steps,candidate_recovery_steps,recovery_step_ratio; the gate is opt-in via--max-recovery-ratio/max_recovery_step_ratio.Why
Roadmap item B2 —
context/ROADMAP.mdWS-B: "Recovery Step Ratio (steps to recover from error vs baseline)". WEI says a run failed; RSR says how expensive getting back on track was — a run can fail cheaply and recover fast, or burn many steps limping back to the golden path.How
cand/basewhen baseline needed recovery; raw candidate count when the baseline is clean (nothing to be relative to); 0.0 when both clean.summary(), terminal panel, PR markdown (gate row only when threshold provided → default output unchanged), and a new--explainfinding categoryrecovery.Nonedefault) inassert_no_regressions, CLI flag,[cli] max_recovery_ratio,[assertions] max_recovery_step_ratio— zero behavior change for existing users.Testing
tests/test_recovery_steps.py: metric edge cases (no errors, immediate retry, added-steps-then-rematch, trailing unrecovered, multi-cluster, both sides), ratio cases, comparator integration, JSON round-trip with new fields, summary block, opt-in gate behavior, explanations, config plumbing.make lint+ format clean.Recovery Steps (base/cand): 0 / 2 (RSR 2.00), explanation finding, gate FAILED at--max-recovery-ratio 1.0.Checklist
make lintpassesuv run python -m pytestis green (227 passed)CHANGELOG.mdentry added under[Unreleased]