Skip to content

ci(metrics): --fail-on-regression ratchet gate + baseline (ADR-0002) - #187

Merged
tina4stack merged 1 commit into
v3from
chore/metrics-regression-gate
Sep 30, 2026
Merged

tina4stack merged 1 commit into
v3from
chore/metrics-regression-gate

Conversation

@tina4stack

Copy link
Copy Markdown
Owner

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 to v3.

Why regression, not --fail-on error

--fail-on error fires 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

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]>
@tina4stack
tina4stack merged commit 70d54d1 into v3 Sep 30, 2026
15 checks passed
@tina4stack
tina4stack deleted the chore/metrics-regression-gate branch September 30, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants