ci(aprender): diff-scoped blocking mutation gate (coverage ratchet deferred — root facade)#2239
Open
noahgift wants to merge 3 commits into
Open
ci(aprender): diff-scoped blocking mutation gate (coverage ratchet deferred — root facade)#2239noahgift wants to merge 3 commits into
noahgift wants to merge 3 commits into
Conversation
…audit gap #1) The two strongest quality signals were advisory, so a regression merged silently despite the 95%-coverage / 80%-mutation / ZERO-tolerance rule: - coverage: measured but never gated (codecov upload is continue-on-error) - mutants: full-tree, push-to-main only, continue-on-error at job AND step level — a surviving mutant blocked nothing This closes both on aprender (the PILOT), without breaking the green build: 1. Coverage ratchet (opt-in input from sovereign-ci.yml): coverage_min: "90.0" — a deliberately conservative RATCHET floor, well below the documented achieved 96.94% line coverage. The CI coverage job is --lib-scoped (its % is not identical to the certeza full-suite number), so we floor conservatively and tighten via the committed baseline (.pmat/coverage-baseline.txt, seeded to 90.0 so the effective floor max(coverage_min, baseline) cannot break the first gated run). The coverage job is already wired into `ci / gate`, so a drop now blocks merge. 2. Diff-scoped mutation gate: The `mutants` job is rewritten from full-tree/push-only/continue-on-error to `cargo mutants --in-diff <pr.diff>` on pull_request events, BLOCKING (no continue-on-error; wired into the top-level `gate` via needs + result check). Diff-scoping gates only the lines a PR touches — fast (minutes, proportional to diff) and prevents NEW under-tested code from landing, instead of an hours-long full-tree run that choked the queue. A diff with no mutable code is a clean no-op pass. Threshold is MUTANTS_MAX_MISSED (default 0, tunable via repo var). On push-to-main the job is skipped (no PR diff); `gate` treats skipped as pass. Requires paiml/.github PR #37 (the coverage_min input) to merge first. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
aprender gitignores .pmat/, so the ratchet baseline file cannot live at the sovereign-ci default path (.pmat/coverage-baseline.txt). Move it to .github/coverage-baseline.txt and wire it via the coverage_baseline_file input. Seeded to 90.0 = coverage_min, so the effective floor max(coverage_min, baseline) is unchanged and the first gated run is safe. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…diff-scoped mutation gate The coverage ratchet pilot exposed that aprender's root crate is a facade — the sovereign-ci coverage job runs --lib on the root and exercises 0 tests, so there is no lcov data to gate on. Enabling coverage_min meaningfully needs test_workspace: true + GPU-member test_args exclusions (PMAT-159 blind-spot), tracked as a follow-up. The coverage ratchet MECHANISM stays live fleet-wide via sovereign-ci #37. aprender keeps the diff-scoped blocking mutation gate. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Gap
PMAT build-system audit gap #1: the two strongest quality signals were advisory, so a regression merged silently despite the "95% coverage / 80% mutation / ZERO tolerance" rule:
cargo llvm-covbut never gated (codecov upload iscontinue-on-error).continue-on-errorat both job and step level → a surviving mutant blocked nothing.aprender is the pilot for closing both. This is NOT enabled fleet-wide.
Change
1. Coverage ratchet (opt-in input added in paiml/.github#37):
coverage_min: "90.0"— a deliberately conservative ratchet floor, well below the documented achieved 96.94% line coverage (.pmat-gates.toml,.pmat-metrics.toml). The CI coverage job is--lib-scoped, so its measured % differs from the certeza full-suite number; we floor conservatively and tighten via the committed baseline.coverage_baseline_file: ".github/coverage-baseline.txt"— committed baseline, seeded to90.0. (Not.pmat/...because aprender gitignores.pmat/.) Effective floor =max(coverage_min, baseline), so the first gated run cannot break green.coveragejob result is already wired intoci / gate, so a drop now blocks merge.2. Diff-scoped mutation gate — the
mutantsjob is rewritten:-- --lib)--in-diff pr.diff)pull_requestcontinue-on-errorx2gateA diff with no mutable code is a clean no-op pass. Threshold is
MUTANTS_MAX_MISSED(default0, tunable via repo var). On push-to-main the job is skipped (no PR diff);gatetreatsskippedas pass so main pushes are never blocked.Safety — does not break the currently-green build
90.0≪ achieved96.94%, and the baseline equals the floor, somax()is90.0— the first gated run passes by a wide margin. The enforcement step parses the already-producedlcov.info(no extra compile/test cost).mutantsnowneeds: [ci, workspace-test]andgateneeds: [..., mutants](previouslymutants needs: [gate]).Ordering
Requires paiml/.github#37 (the
coverage_min/coverage_baseline_fileinputs) to merge first — this PR references@mainof the reusable workflow.🤖 Generated with Claude Code