Skip to content

test(supply-chain): exploitability survives scan to gate on both routes - #1574

Merged
lex00 merged 1 commit into
mainfrom
test/exploitability-roundtrip
Aug 7, 2026
Merged

lex00 merged 1 commit into
mainfrom
test/exploitability-roundtrip

Conversation

@lex00

@lex00 lex00 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Phase 1 of epic #1461, second half. Depends on #1462 (#1561) and #1463 (#1573), both merged. Proves the data gets there; gate behavior on it is #1465 — after this merges a KEV finding still changes no outcome, which is expected.

What

New packages/core/src/components/verbs/exploitability-roundtrip.test.ts — six hermetic tests over the real captured fixtures from #1463 plus inline fake scanners:

  • Path 1 (cross-capability seam): scan-vulnerabilities output wired into vuln-gate's findings input, with the KEV finding's fields verified at the decision point twice — once via the suppression report (VEX suppresses the criticals so the gate passes and reports them), once via VulnGateFailedError.blocking when they block on severity as before.
  • Path 2: the gate-scans-for-you route through an injected inline fake VulnScanner; asserts the reported finding is the same object reference, nothing rebuilt it.
  • Warnings list surfaces a KEV-listed high finding intact.
  • Negative space: the real trivy capture (no exploitability data) reaches the gate with all six fields undefined — asserted not.toBe(false) and not.toBe(0) explicitly, so the tri-state is pinned by tests.
  • applyVex passes unsuppressed findings through by reference and drops no keys.

Also

Fixed the two stale doc comments in vuln-scan.ts pointing at ./__tests__/mock-vuln-scanner.ts, a file that does not exist — they now describe the inline-fake pattern the tests actually use.

No live scanner, network, or vuln DB in any test.

Closes #1464

Contract test for the #1462/#1463 fields: a finding carrying inKev, epss,
epssPercentile, and the KEV date/ransomware fields reaches vuln-gate
intact via the pre-scanned findings path (scan-vulnerabilities output
wired into the gate's findings input) and via the gate-scans-for-you path
with an inline fake VulnScanner. Verified at the decision point through
the suppression report, the warnings list, and VulnGateFailedError's
blocking findings.

Also pins the negative space: a scanner reporting no exploitability data
(the real trivy capture) reaches the gate with all six fields undefined,
explicitly not false and not 0; and applyVex passes unsuppressed findings
through by reference, dropping nothing.

Fixes the two stale doc comments in vuln-scan.ts that pointed at a
nonexistent ./__tests__/mock-vuln-scanner.ts — the real pattern is an
inline fake, which these tests use.

Hermetic throughout: fixture stdout only, no live scanner, network, or
vuln DB.

Closes #1464
@lex00
lex00 merged commit ee41944 into main Aug 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Contract test: exploitability survives scan -> gate

1 participant