Skip to content

Gate potency (#319): a mutation shard that tested nothing fails, the pin fuzzer reaches its deep branch, and no PR gate is switched by a repo variable - #327

Merged
avrabe merged 3 commits into
mainfrom
fix/gate-potency-319
Nov 6, 2026
Merged

avrabe merged 3 commits into
mainfrom
fix/gate-potency-319

Conversation

@avrabe

@avrabe avrabe commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Fixes #319: the three weaker gates the pre-v0.45.0 gate-potency audit found. Each fix was written test-first, and each is shown red on the old behaviour before green on the new.

1. The mutation verdict refuses a shard that tested nothing (REQ-MUTATE-001)

The inline ci.yml check looked only for N missed. So 5 mutants tested in 1s: 5 unviable and 0 mutants tested in 0s both passed with nothing caught.

The verdict is now tools/mutants-verdict.py, tested by tools/test_mutants_verdict.py, which runs in the existing unittest discover -s tools step. A shard fails when:

  • there is no summary, or only the last one counts and it is missing;
  • a mutant was missed;
  • a count in the summary cannot be read (it fails closed, never reads as 0 missed);
  • 0 mutants were tested;
  • 0 were caught or timed out.

Two read details: ANSI colour codes are stripped before parsing, and the singular 1 mutant tested is read.

2. The pin fuzz target reaches its deep branch (REQ-PIN-001)

None of the 3,126 corpus files was a valid pin; none contains manifest-version or [toolchain]. With a panic! planted inside if let Ok(pin) = Pin::parse(..), CI's PR duration of 60 s gave:

corpus result
current, 3,126 files 177,462 runs in 61 s, exit 0, panic never reached
plus 4 seed-*.toml exit 1: panicked at fuzz_targets/pin.rs:10

The seeds are valid pins taken from pin.rs's own tests:

  • qualified with a digest and tools;
  • a realm on rolling;
  • realm-qualified tool selectors;
  • [[export]] with [export.env].

crates/varve-core/tests/fuzz_pin_seeds_parse.rs checks that every seed still parses. Turning one seed's layer into 2026.08 makes that test fail. The seeds are force-added, because fuzz/corpus/ is gitignored to keep the fuzzer's own growth out of git; the existing corpus went in the same way in v0.13.0 (#33).

3. No PR gate can be switched off by a repository variable (REQ-SYSTEST-001)

selfhost-cargo is a required check, and it ran only while vars.VARVE_SYSTEST_EXPORT_CARGO == '1'. On GitHub a skipped required check counts as passed, so deleting the variable would have turned the check green without running it.

The condition is removed. crates/varve-producer/tests/pr_gates_cannot_be_switched_off.rs now refuses any job-level or step-level if: that reads vars. in ci.yml, systest.yml or fuzz.yml.

  • On main it fails on systest.yml:95.
  • A second test shows the scanner finds a vars. switch at both the job and the step level.

Release and publish workflows keep their switches, because they are not merge gates.

Not in this PR

Local, on CI's own gates

  • cargo fmt --check is clean, and clippy --workspace --all-targets -D warnings is clean.
  • cargo test --workspace --no-fail-fast gives 1957 passed, 0 failed.
  • rivet validate and rivet check verification-evidence pass, as do trace-gate, claim-check, review-check and tracepack-check.
  • unittest discover -s tools passes 35 tests.
  • shellcheck 0.11.0 at -S warning is clean.

A trap worth knowing: a stale tools/__pycache__ from a hand mutation once made the suite fail on correct source. That mutation changed one digit, so the file size was unchanged, and the restore happened within the same second. CI checks out clean and cannot hit this.

🤖 Generated with Claude Code

https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu

avrabe and others added 3 commits November 6, 2026 14:39
, item 1)

The verdict moves from inline ci.yml shell to tools/mutants-verdict.py, tested
by tools/test_mutants_verdict.py: no summary, a survivor, an unreadable count,
zero mutants tested, and zero caught-or-timed-out each fail. The inline version
looked only for 'N missed'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
#319, item 3)

A skipped required check counts as passed, so deleting
VARVE_SYSTEST_EXPORT_CARGO would have turned the export-cargo self-host gate
green without running it. pr_gates_cannot_be_switched_off.rs now refuses any
job- or step-level if: in a PR workflow that reads vars.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
… reached (#319, item 2)

None of the 3,126 corpus files was a valid pin. With a panic planted inside
the Ok(pin) branch, 60 s (CI's PR duration) ran 177,462 inputs and exit 0;
with these four seeds the same run reaches the panic. A test keeps every
seed parsing. The seeds are force-added: fuzz/corpus/ is ignored so the
fuzzer's own growth stays out of git, as in v0.13.0 (#33).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
@avrabe
avrabe merged commit 02a8133 into main Nov 6, 2026
47 checks passed
@avrabe
avrabe deleted the fix/gate-potency-319 branch November 6, 2026 16:18
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.

Gate potency: a vacuous mutation shard passes, the pin fuzz target's deep branch is unreached, a variable can skip a required systest

1 participant