ci(diet): skip the 24-engine Kani matrix on non-code PRs (tier B) - #311
Merged
Conversation
The real load win. Kani model-checks Rust harnesses under crates/**, so a PR touching only docs, rivet artifacts, wit, or proofs cannot change any harness — yet every such PR was running all ~38 engine jobs (CBMC model-checking, the heaviest gate on the fleet). This skips the matrix when nothing Kani-relevant changed. Deadlock-safe (Kani gate is a REQUIRED check, so this is done carefully): - New `changes` job (light runner, native git-diff mirroring verification-gate #298) outputs run=true/false. FAILS SAFE to true on push:main (no PR base) and on any diff error — the required gate never silently no-ops on real code. - The `kani` matrix gains `needs: changes` + `if: needs.changes.outputs.run`. - `kani-gate` (the required aggregate, always runs) now `needs: [changes, kani]` and treats a `skipped` matrix as PASS — so a skip reports the required check green instead of leaving it pending (the deadlock). Fails closed if the scope job itself didn't succeed. Glob is generous (all 38 harnesses live under crates/): crates/**, Cargo.toml, Cargo.lock, kani.yml. push:main stays unfiltered as the backstop. Net: a docs/artifact PR goes from ~38 Kani jobs to zero. Validation: this PR touches kani.yml (in-glob) so its own matrix RUNS (fire path + kani-gate-on-success). The SKIP path (matrix skipped, Kani gate still green) is validated post-merge on a docs PR before trusting it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvusAXYbHLyv3uTzfBcMbG
avrabe
enabled auto-merge (squash)
July 23, 2026 15:54
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.
The real load win
Kani (CBMC model-checking ~38 engine harnesses) is the heaviest gate on the fleet, and it ran on every PR — including docs- and artifact-only ones that can't possibly change a harness. This skips the matrix when nothing Kani-relevant changed. A docs/artifact PR goes from ~38 Kani jobs to zero.
Deadlock-safe (Kani gate is a required check)
This is the careful part — a naïve path filter on a required check deadlocks all merges. Instead:
changesjob (light runner, nativegit diffmirroring the verification-gate ci(verify-gate): scope fast-path + 90m timeout — stop false-cancelling out-of-scope PRs #298 scope check) outputsrun=true/false. Fails safe totrueonpush: main(no PR base) and on any diff error — the required gate never silently no-ops on real code.kanimatrix gainsneeds: changes+if: needs.changes.outputs.run == 'true'.kani-gate(the required aggregate; alreadyif: always()) nowneeds: [changes, kani]and treats askippedmatrix as PASS — so a skip reports the required "Kani gate" check green instead of leaving it pending forever. Fails closed if the scope job itself didn't succeed.Only the non-required per-engine
Kani (<engine>)checks skip; the required Kani gate always runs and reports.Glob (generous — required gate)
All 38 harnesses live under
crates/, so:crates/**,Cargo.toml,Cargo.lock,.github/workflows/kani.yml.push: mainstays unfiltered (backstop).Validation
kani.yml(in-glob) → its own matrix runs → validates the new structure +kani-gate-on-success.Tier A (non-required gates) shipped in #310 and validated bidirectionally (#305 docs → all 5 skip; #309 wasm.toml → coverage+bazel fire, rocq/lean/spar skip).
🤖 Generated with Claude Code