ci(metrics): --fail-on-regression ratchet gate + baseline (ADR-0002) - #187
Merged
Merged
Conversation
Commits the clean-v3 baseline tina4_python/.tina4-metrics.json and a Metrics workflow that installs the checksum-verified pinned tina4 CLI 3.8.95 and runs `tina4 metrics --path tina4_python --fail-on-regression` on push/PR to v3. The ratchet fails a PR only when a metric is measurably worse than the baseline (new offender file, more offenders, worse worst-CC on an offending file, or more duplicated lines) - never on the inherent structure the baseline already records, so it locks in the metrics-cleanup wins (CC>=40 eliminated) without forcing blind refactoring. Re-baseline with a plain `tina4 metrics --path tina4_python` + commit. Verified: gate passes against this baseline on a clean checkout (exit 0). Signed-off-by: Andre van Zuydam <[email protected]> Co-Authored-By: Claude Opus 4.8 <[email protected]> Co-Authored-By: Tina4 <[email protected]>
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.
Wires the structural metrics gate for the metrics-cleanup (ADR-0002):
tina4 metrics --path <src> --fail-on-regression, the ratchet gate shipped in tina4 CLI 3.8.95.What
<src>/.tina4-metrics.json— the committed clean-v3 baseline (schema 2)..github/workflows/metrics.yml— installs the checksum-verified pinned 3.8.95 linux binary and runs the gate on push/PR tov3.Why regression, not
--fail-on error--fail-on errorfires on inherent file-size low-maintainability (large files score MI<40 from size alone) and pre-existing sub-40 complexity — it would go red on exactly the code we deliberately left uncut. The ratchet fails only when a PR is measurably worse than the baseline (a new offender file, more offenders, a worse worst-CC on an offending file, or more duplicated lines), reusing the engine's own "Since last run" classification.Re-baselining
After a deliberate change, run
tina4 metrics --path <src>locally and commit the updated baseline.Verified: the gate passes against this baseline on a clean checkout (exit 0, "no regression").
🤖 Generated with Claude Code