Repository navigation
CI: list every gate with a failure proof; first negative controls (Part of #7155) - #7159
Merged
Merged
Conversation
…rt of #7155) A green gate means something only if it can go red. gate_controls.py lists each check that can hold a PR and the test proving it can fail; the unproven count may only go down. Adds controls for ruff-audit (real ruff on a planted finding, format alone) and mypy-audit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
No description provided. |
Contributor
|
No description provided. |
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.
Part of #7155
Problem
A green gate only means something if it can go red. CodeQL read "No new alerts" on every PR while its analysis held no results (#7153), and nothing noticed, because no test ever asked it to fail. We had no list of what each gate claims to catch, or which gates have ever been shown to fail.
What this does
tests/tools/gate_controls.pylists every check that can hold a PR: what it claims to catch, the test that proves it can fail, and what it can still miss. That's 35 checks across the PR workflows. Run it to print the unproven ones.tests/tools/test_gate_controls.pykeeps the list honest. It fails if a PR workflow is missing from the list, a required check is missing, a named proof no longer exists, or the unproven count changes. The count (21) may only go down, and lowering it is forced when a gate gets a proof.ruff-auditon a planted unused import, using realruff, so a broken runner or parser can't pass unnoticedruff-auditfailing on format alone, which had no testmypy-auditfailing on a new error, and passing the same error once baselined, which had no testdocs/ci.md: it saidci-gatewasn't in the ruleset yet. It is.Do the controls fail when a gate is broken?
Yes. I temporarily made both
run_ci_check()functionsreturn 0: all 3 controls went red. With the code restored, all 8 tests pass. That sabotage isn't in this PR.What this doesn't prove
proofentries come from a read-only audit. The test checks that each named test exists, not that it's a good control. That audit gotruff-auditwrong (it missedtest_ci_check_end_to_end), so treat the rest as a starting point.full-suite, whose aggregator shell has no test.Cost
No new workflow or job. The tests run in
full-suitein under a second, and the real-ruffcontrol skips ifruffisn't installed.Checks
tests/tools/test_gate_controls.py: 8 passed.-k 'workflow or classifier or docs or planner or gate or audit or baseline or suite'): 846 passed, 11 skipped. Not the full suite locally.🤖 Generated with Claude Code