fix(rules): eliminate four code-scanning false-positives (closes #524) - #527
Merged
Merged
Conversation
Verified by building the escript and scanning rsr-template-repo (48 open alerts -> 0; the repo genuinely satisfied every intent — these were rule bugs, not repo defects). - cicd_rules `has_file?`: recognise community-health files (SECURITY.md, …) in `.github/` and `docs/`, not just repo root — GitHub treats all three as canonical. Was a false-positive when SECURITY.md lives under `.github/`. - root_hygiene `scan_required_missing`: drop SECURITY.md from the root-only required list. It is owned (location-aware) by cicd_rules; listing it here too caused a double-report and a `.github/`-location false-positive. - scorecard_ingestor `check_sast`: aggregate across ALL workflows that mention CodeQL, not just the first. `Enum.find` could return workflow-linter.yml (mentions "codeql" in a comment, no language matrix) and miss codeql.yml's `language: actions`, yielding a spurious "nominal-only SAST". - workflow_audit WF017: accept the valid env+output cross-step secret gate (`if: steps.<id>.outputs.<name>` + a step emitting $GITHUB_OUTPUT). The `secrets` context is unavailable in step-level `if:`, so the previously required `if: secrets.X != ''` form is itself unusable. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🔍 Hypatia Security ScanFindings: 42 issues detected
View findings[
{
"reason": "Repository has 5 non-main remote branch(es). Policy: single main branch only.",
"type": "GS007",
"file": ".",
"action": "delete_remote_branches",
"rule_module": "git_state",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD022 -- Hypatia structural_drift: SD022 -- 20 day(s) old",
"type": "CSA001",
"file": "src/ui/gossamer/README.adoc",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD022 -- Hypatia structural_drift: SD022 -- 20 day(s) old",
"type": "CSA001",
"file": "scripts/ci-tools/Cargo.toml",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD022 -- Hypatia structural_drift: SD022 -- 20 day(s) old",
"type": "CSA001",
"file": "scripts/bench-tools/Cargo.toml",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD022 -- Hypatia structural_drift: SD022 -- 20 day(s) old",
"type": "CSA001",
"file": "ffi/zig/README.adoc",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD022 -- Hypatia structural_drift: SD022 -- 20 day(s) old",
"type": "CSA001",
"file": "docs/reports/audit/audit-2026-04-15-post.md",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD022 -- Hypatia structural_drift: SD022 -- 20 day(s) old",
"type": "CSA001",
"file": "docs/integration/github-registry.adoc",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD022 -- Hypatia structural_drift: SD022 -- 20 day(s) old",
"type": "CSA001",
"file": "docs/integration/github-registry.adoc",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD022 -- Hypatia structural_drift: SD022 -- 20 day(s) old",
"type": "CSA001",
"file": "docs/integration/a2ml-k9.md",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD022 -- Hypatia structural_drift: SD022 -- 20 day(s) old",
"type": "CSA001",
"file": "docs/architecture/system-integration.md",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
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.
Fixes the four code-scanning rule false-positives documented in #524, verified end-to-end: built the escript, scanned
rsr-template-repomain, and drove its open Hypatia code-scanning alerts from 48 → 0 (a clean 0-result analysis was uploaded under thehypatiacategory, auto-closing the stale alerts). Every one was a rule bug — the repo already satisfied the intent.Fixes
cicd_rules.has_file?— recognise community-health files (SECURITY.md, …) in.github/anddocs/, not just root (GitHub treats all three as canonical). Killed themissing_requirementFP.root_hygiene.scan_required_missing— removeSECURITY.mdfrom the root-only required list; it's owned location-aware bycicd_rules. Removes a double-report +.github/-location FP.scorecard_ingestor.check_sast— aggregate across all CodeQL-mentioning workflows instead ofEnum.find-ing the first (e.g.workflow-linter.ymlmentions "codeql" in a comment but has no matrix, maskingcodeql.yml'slanguage: actions). Killed the spurious "nominal-only SAST".workflow_auditWF017 — accept the valid env+output cross-step secret gate (if: steps.<id>.outputs.<name>+ a step writing$GITHUB_OUTPUT). Thesecretscontext isn't available in step-levelif:, so the previously-requiredif: secrets.X != ''form is itself unusable.Not changed (already resolved on
main)The
.hypatia-ignore-not-wired-into-scanstructural gap from #524 is already fixed onmain(ScannerSuppression is applied in the scan path). The SD013 / DependencyPinning / shell_download_then_run / scorecard_wrapper FPs from the original report no longer reproduce on currentmain.Closes #524.