Skip to content

ci(diet): skip the 24-engine Kani matrix on non-code PRs (tier B) - #311

Merged
avrabe merged 3 commits into
mainfrom
ci/diet-tier-b-kani-path-filter
Jul 23, 2026
Merged

ci(diet): skip the 24-engine Kani matrix on non-code PRs (tier B)#311
avrabe merged 3 commits into
mainfrom
ci/diet-tier-b-kani-path-filter

Conversation

@avrabe

@avrabe avrabe commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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:

  • New changes job (light runner, native git diff mirroring the verification-gate ci(verify-gate): scope fast-path + 90m timeout — stop false-cancelling out-of-scope PRs #298 scope check) 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 == 'true'.
  • kani-gate (the required aggregate; already if: always()) now needs: [changes, kani] and treats a skipped matrix 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: main stays unfiltered (backstop).

Validation

  • Fire path: this PR touches kani.yml (in-glob) → its own matrix runs → validates the new structure + kani-gate-on-success.
  • Skip path (matrix skipped, Kani gate still green — the deadlock test): validated post-merge on a docs PR before this is trusted. If a docs PR's "Kani gate" ever goes pending instead of green, revert immediately.

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

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
avrabe enabled auto-merge (squash) July 23, 2026 15:54
@avrabe
avrabe merged commit 6ff6c7a into main Jul 23, 2026
55 checks passed
@avrabe
avrabe deleted the ci/diet-tier-b-kani-path-filter branch July 23, 2026 18:19
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.

1 participant