Repository navigation
feat(rules): WH014 — detect the masked-scanner shape that DELETES code-scanning alerts - #784
Merged
Merged
Conversation
…e-scanning alerts
Measured 2026-09-14 on hyperpolymath/academic-workflow-suite: 84 real
Hypatia code-scanning alerts were auto-closed while every workflow run
reported success.
The mechanism is GitHub's own reconciliation. Each SARIF upload is
reconciled against the previous analysis carrying the same tool.name +
category; any alert absent from the new analysis is AUTO-CLOSED. So this
combination is not merely permissive, it is alert-deleting:
hypatia scan . --exit-zero > hypatia-findings.json || true
COUNT=$(jq '. | length' hypatia-findings.json 2>/dev/null || echo 0)
... unconditional github/codeql-action/upload-sarif
When the scanner crashes, `|| true` swallows the failure, `|| echo 0`
manufactures a zero count, a valid SARIF with zero results is uploaded,
and GitHub closes every previously-open alert for that category. The job
is green at every step and the only trace is `results_count` in the
code-scanning/analyses API.
WH014 fires when all three hold:
1. the workflow uploads SARIF to code scanning, AND
2. it masks the scanner's failure (`|| true`) or its count (`|| echo 0`), AND
3. it never asserts the findings artefact is a non-empty array.
Condition 3 is what exempts the correct shape. standards'
hypatia-scan-reusable.yml already performs that assertion
(`jq -e 'type == "array" and length > 0'`), so it does not fire; the ~40
repos carrying forked pre-2026-06-21 copies of its body do.
Four-arm planted-positive control, run against REAL files rather than
synthetic fixtures:
A standards/hypatia-scan-reusable.yml (has the assertion) 0 findings PASS
B academic-workflow-suite@cd00a580 (deleted the 84 alerts) 1x WH014 FIRES
C arm B with the mask removed and assertion added 0 findings PASS
D arms A-C against the version being replaced no WH014 PASS
Arm D confirms this is new coverage: the prior module emits 5 findings on
the arm B fixture and none of them is WH014.
Five regression tests added. They build their fixtures under
System.tmp_dir!() rather than test/, because @training_corpus_paths
path-suppresses findings under test/ and a fixture placed there would
fake every arm.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011YTttTxnPc1V2sATvzBDN7
Contributor
|
Warning Review limit reachedNext included review available in 9 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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 defect this detects
Measured 2026-09-14 on
hyperpolymath/academic-workflow-suite: 84 real Hypatia code-scanning alerts were auto-closed while every workflow run reportedconclusion=success.results_countWhy it is alert-deleting, not merely permissive
GitHub reconciles each SARIF upload against the previous analysis carrying the same
tool.name+category. Any alert absent from the new analysis is auto-closed. So this combination deletes findings:Scanner crashes →
|| trueswallows it → empty/invalid JSON →|| echo 0manufactures a count of zero → a valid SARIF with zero results is uploaded → GitHub closes every previously-open alert for that category. Green at every step. The only trace isresults_countin thecode-scanning/analysesAPI — it is invisible in every status-based view.What WH014 does
Fires when all three hold:
|| true) or its count (|| echo 0), andCondition 3 is the exemption for the correct shape.
standards/.github/workflows/hypatia-scan-reusable.ymlalready performs that assertion (jq -e 'type == "array" and length > 0'), so it does not fire. The repos carrying forked copies of its pre-2026-06-21 body do —|| truewas removed from the reusable on 2026-06-21 (5a93d9d5), a repair that never reached the forks.Four-arm control — run against REAL files, not synthetic fixtures
standards/hypatia-scan-reusable.yml(has the assertion)academic-workflow-suite@cd00a580— the file that deleted the 84 alertsArm D is the one that proves this is new coverage rather than a re-label: the prior module emits 5 findings on the arm B fixture and none of them is WH014.
Tests
Five regression tests,
mix test test/workflow_hardening_test.exs→ 37 tests, 0 failures.They build fixtures under
System.tmp_dir!()rather thantest/, because@training_corpus_pathsinscanner_suppression.expath-suppresses findings undertest/— a fixture placed there would fake every arm.Blast radius
Lower bound of ~40 repos carry the bespoke shape (
hypatia-sarif.cjs= 43 file hits;HYPATIA_FORMATin workflows = 33). GitHub code search caps at 100 results and lags its index, so treat these as floors.🤖 Generated with Claude Code
https://claude.ai/code/session_011YTttTxnPc1V2sATvzBDN7