diff --git a/.github/workflows/static-analysis-gate.yml b/.github/workflows/static-analysis-gate.yml index a33b0240..8414a119 100644 --- a/.github/workflows/static-analysis-gate.yml +++ b/.github/workflows/static-analysis-gate.yml @@ -15,9 +15,14 @@ permissions: contents: read env: # Exact Hypatia repair canary: Agda keyword boundaries and patched dependencies. - # The panic-attack pin remains the standards-vetted source pending coverage repair. + # panic-attack runs ahead of the standards-vetted 410a8f8 (hypatia-scan-reusable + # default) because that commit cannot report complete coverage for this tree: + # 190 config/markup inputs were "unsupported", so --fail-on-incomplete exited 2 + # before any finding was counted. f2a6a70 includes the coverage repair + # (panic-attack#258: 913/913 inputs here) and Patch Bridge schema 0.3.0 + # (vulnerability_data), which the qualifier below checks. HYPATIA_REF: 82396d81677b11d17c7a0dede5bf0efcf768d5a1 - PANIC_ATTACK_REF: 410a8f821ea8297833162565b50a298f787815da + PANIC_ATTACK_REF: f2a6a70eaec0cb02331e3264e05f185b5faab0f7 SCAN_EXPECTED_SHA: ${{ github.event.pull_request.head.sha || github.sha }} jobs: panic-attack-assail: diff --git a/scripts/ci/static-analysis-evidence.sh b/scripts/ci/static-analysis-evidence.sh index 41041c5c..49f43fff 100755 --- a/scripts/ci/static-analysis-evidence.sh +++ b/scripts/ci/static-analysis-evidence.sh @@ -34,7 +34,7 @@ valid_report() { and (.weak_points | type == "array") and all(.weak_points[]; type == "object" and (.severity as $s | ["Critical","High","Medium","Low"] | index($s) != null)))' "$report" >/dev/null 2>&1 ;; patch-bridge) - jq -e -s 'length == 1 and (.[0] | type == "object" and .schema_version == "0.2.0" + jq -e -s 'length == 1 and (.[0] | type == "object" and .schema_version == "0.3.0" and .vulnerability_data == "queried" and (.total_dependencies | type == "number" and . > 0 and floor == .) and (.cves | type == "array") and all(.cves[]; type == "object" and (.classification as $c | diff --git a/scripts/ci/test-static-analysis-evidence.sh b/scripts/ci/test-static-analysis-evidence.sh index e2accf98..07b5f20b 100755 --- a/scripts/ci/test-static-analysis-evidence.sh +++ b/scripts/ci/test-static-analysis-evidence.sh @@ -135,7 +135,7 @@ expect_exit 2 panic # Bridge needs its real subcommand and output-file contract. CLI/parser errors # cannot turn into a fabricated zero-CVE report; no offline zero is requested. -printf '%s\n' '{"schema_version":"0.2.0","total_dependencies":2,"vulnerable_dependencies":1,"cves":[{"classification":"unmitigable"}],"mitigated":0,"unmitigable":1,"concatenative":0,"informational":0}' > "$MOCK_REPORT" +printf '%s\n' '{"schema_version":"0.3.0","vulnerability_data":"queried","total_dependencies":2,"vulnerable_dependencies":1,"cves":[{"classification":"unmitigable"}],"mitigated":0,"unmitigable":1,"concatenative":0,"informational":0}' > "$MOCK_REPORT" expect_exit 0 bridge grep -Fxq bridge "$MOCK_ARGS" grep -Fxq triage "$MOCK_ARGS" @@ -148,6 +148,19 @@ export MOCK_EXIT=0 jq '.unmitigable = 0' "$MOCK_REPORT" > "$tmp/inconsistent.json" cp "$tmp/inconsistent.json" "$MOCK_REPORT" expect_exit 2 bridge +# A report that never reached the vulnerability feed is not a zero-CVE result. +# Paired: the same zero-CVE report qualifies only when the feed was queried. +printf '%s\n' '{"schema_version":"0.3.0","vulnerability_data":"queried","total_dependencies":2,"vulnerable_dependencies":0,"cves":[],"mitigated":0,"unmitigable":0,"concatenative":0,"informational":0}' > "$MOCK_REPORT" +expect_exit 0 bridge +expect_exit 0 bash "$adapter" gate "$tmp/bridge/receipt.json" +printf '%s\n' '{"schema_version":"0.3.0","vulnerability_data":"offline-unavailable","total_dependencies":2,"vulnerable_dependencies":0,"cves":[],"mitigated":0,"unmitigable":0,"concatenative":0,"informational":0}' > "$MOCK_REPORT" +expect_exit 2 bridge +# A 0.3.0 report with no feed status at all must not qualify either. +printf '%s\n' '{"schema_version":"0.3.0","total_dependencies":2,"vulnerable_dependencies":0,"cves":[],"mitigated":0,"unmitigable":0,"concatenative":0,"informational":0}' > "$MOCK_REPORT" +expect_exit 2 bridge +# The pre-0.3.0 contract has no feed status, so it cannot qualify either. +printf '%s\n' '{"schema_version":"0.2.0","total_dependencies":2,"vulnerable_dependencies":1,"cves":[{"classification":"unmitigable"}],"mitigated":0,"unmitigable":1,"concatenative":0,"informational":0}' > "$MOCK_REPORT" +expect_exit 2 bridge # Deposit preserves actual critical findings even though their gate failed. # Only mutually matching completed scan receipts may create the legacy artifact. diff --git a/tests/corpus_fixtures/isabelle/Smoke.thy b/tests/corpus_fixtures/isabelle/Smoke.thy index 5537af2d..72b95075 100644 --- a/tests/corpus_fixtures/isabelle/Smoke.thy +++ b/tests/corpus_fixtures/isabelle/Smoke.thy @@ -17,6 +17,7 @@ theorem double_zero: "double 0 = 0" (* A lemma left open with `sorry` — the corpus adapter must flag this as a sorry hazard. *) lemma double_mono: "n \ m \ double n \ double m" + (* panic-attack: accepted (detector fixture: the corpus adapter must flag the unfinished proof below) *) sorry (* An axiomatization block — the adapter must flag the postulate hazard. *) diff --git a/tests/corpus_fixtures/minif2f/algebra.lean b/tests/corpus_fixtures/minif2f/algebra.lean index be3b1918..bf6a8a55 100644 --- a/tests/corpus_fixtures/minif2f/algebra.lean +++ b/tests/corpus_fixtures/minif2f/algebra.lean @@ -7,4 +7,5 @@ theorem mathd_algebra_171 (a b : ℝ) (h₀ : a + b = 10) (h₁ : a - b = 4) : a linarith theorem imo_1959_p1 (n : ℕ) (h : 0 < n) : Nat.gcd (21 * n + 4) (14 * n + 3) = 1 := by + -- panic-attack: accepted (detector fixture: the corpus adapter must flag the unfinished proof below) sorry