You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The ratchet is blind to a regression smaller than a file's unbanked improvement #881
The ratchet judges each file against its own recorded count and fails if the file passes fewer. That is the right shape, and it has one blind spot that is invisible from the inside: a file whose baseline sits below its current value carries slack, and the gate cannot see a regression smaller than that slack.
Found on a real case
Re-recording the baseline for the Ruby 4.0 move (#799), the lane reported:
reported as an improvement. But language/variables_spec.rb has passed 119 since #871 closed the last defect of #799. The version move genuinely costs one example there — Multiple assignment with a single splatted RHS value | converts nil to empty array without calling a method, measured directly with cmd/specdelta between two engines built from one commit minus the version string.
So a real regression of −1 was reported as a gain of +3, because the baseline was 4 below the truth. The same file shows it twice:
cmd/ratchet prints N file(s) improved -- rerun with UPDATE_BASELINE=1 to lock it in. Until #877 there was no correct way to do that: the gate runs on a pinned ubuntu-24.04 and UPDATE_BASELINE=1 was a local command, so every re-record was made in the wrong environment. Improvements therefore accumulated unbanked, and each one is a blind spot of its own size.
This is the exact complement of #876. That one stops a re-record from banking a loss; this one is the cost of not banking a win.
What would close it
The slack is computable and currently not reported. Options, roughly in order of how much they change:
cmd/ratchet reports total slack — N file(s) are above their baseline by M examples in total; the gate is blind to a regression of up to M in those files — so the blind spot is at least visible in every run.
CI warns, or fails, when slack passes a threshold.
Activity
BASELINE re-recorded at 4.0.9, on the machine that enforces it
Ruby 4.0.9: the version rbgo reports (#882)