Commit 870fed7
feat(ci): add fail_on_severity so the scan gate can actually fail (#169)
## The problem
`panic-attack assail` has **no non-zero exit path of its own** — no
`process::exit`, no `ExitCode`, no `--fail-on` anywhere in its
3,132-line
`src/main.rs`. It always exits 0.
So a consumer of `scan-and-report.yml` gets a job whose only real output
is the
cross-repo report. When that dispatch is skipped — which is the
*documented,
supported* path when `VERISIMDB_PAT` is absent — the job scans, throws
the
result away, and reports success no matter what it found.
Measured on `hyperpolymath/verisimdb` at `origin/main`: 113 findings,
including
one live High, with the Security Scan reporting green throughout.
## The change
A `fail_on_severity` input (`none | low | medium | high | critical`)
plus a gate
step that fails when an **unsuppressed** finding sits at or above the
threshold.
Four things worth reviewing specifically:
1. **Default `none` — this is a no-op until opted into.** verisimdb,
echidna and
ambientops all stay exactly as green on merge as they are now. Nobody
gets a
surprise red from this landing.
2. **Only unsuppressed findings count.** `suppressed` comes from the
repo's own
classification registry and from test-context detection, and it is
*omitted*
rather than set to `false` — so the filter is `select(.suppressed !=
true)`,
not `== false`. Getting that backwards would make the gate count
nothing.
3. **An unrecognised threshold aborts the job.** A typo such as `hgih`
must not
fall through to "threshold 0" and pass everything. A gate that silently
accepts a malformed configuration is the same class of defect this PR
exists
to remove, so the `case` has an explicit `*)` that errors.
4. **The failure message points at the classification registry, not at
this
workflow.** Suppression should live next to the evidence with an audit
rationale, in review — not get buried in CI config where nobody re-reads
it.
## Verification
Gate logic run against a real 113-finding scan (verisimdb
`origin/main`):
| threshold | offending |
|---|---|
| `critical` | 0 |
| `high` | 1 |
| `medium` | 39 |
The single High was genuine, and instructive: it was live *only* because
a
classification key still named `VeriSimVcl.res`'s pre-rename path, so a
rename
had silently un-suppressed it. Exactly the kind of drift a real gate
catches and
an always-exit-0 scan cannot. That key is fixed in verisimdb#201, which
takes
that repo to 0 High / 0 Critical — so it can adopt `fail_on_severity:
high`
immediately without a flag day.
A malformed threshold was confirmed to abort rather than pass. YAML
parses.
## Not included
No baseline/grandfathering file. Suppression already has a home — the
per-repo classification registry — and adding a second, CI-local
mechanism
would split the audit trail across two places. Happy to add one if you'd
rather
have a fast path for bulk-accepting an existing backlog.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent d032185 commit 870fed7
1 file changed
Lines changed: 60 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
12 | 24 | | |
13 | 25 | | |
14 | 26 | | |
| |||
41 | 53 | | |
42 | 54 | | |
43 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
44 | 104 | | |
45 | 105 | | |
46 | 106 | | |
| |||
0 commit comments