Repository navigation
Description
Source of truth: epic #1461. On main under packages/core/src/components/verbs/. Cold-handoff; the pre-existing local vitest failures are green in CI — ignore that baseline, add no NEW failures. tsc/eslint clean. Branch, commit Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>, PR to main, end body with the Claude Code line.
Phase 1 of 4. Depends on #1462 and #1463.
Problem
There are two paths a finding can take to the gate, and the exploitability fields must survive both:
scan-vulnerabilitiesstep →ScanVulnerabilitiesOutput.findings→vuln-gatestep'sfindingsinputvuln-gatewith nofindings→ gate scans the SBOM itself via the injectedVulnScanner(createVulnGateCapability,verbs/vuln-gate.ts)
Path 1 crosses a capability boundary and a phase-output wiring ("@Sbom.sbom"-style). It is exactly the kind of seam where a field gets dropped by an intermediate mapping and nobody notices until a KEV finding silently fails to block.
Scope
A test file (extend vuln-gate.test.ts, or add exploitability-roundtrip.test.ts beside it) proving a finding carrying inKev, epss, epssPercentile and the KEV date fields arrives at the gate intact via both paths.
⚠️ MockVulnScanner does not exist
verbs/vuln-scan.ts:13 and :75 both point at ./__tests__/mock-vuln-scanner.ts. That file is not in the repo. verbs/__tests__/ contains only mock-cloud-executor.ts, mock-process-runner.ts, mock-sbom-generator.ts. Do not waste time looking for it.
The real pattern, from vuln-gate.test.ts:142, is an inline object literal:
const fake: VulnScanner = { async scan() { return [CRIT_FIXABLE]; } };
await createVulnGateCapability(fake).run(ctx, { sbom: SBOM_SPDX });Use that. Also fix the two stale doc comments in verbs/vuln-scan.ts to describe the inline-fake pattern instead of naming a file that isn't there — it is two lines and it is the reason this issue needed a warning box.
(If you would rather add the missing MockVulnScanner than fix the comments, that is acceptable too, but pick one and leave the tree consistent. A comment pointing at a nonexistent file is the thing being fixed either way.)
Acceptance criteria
- A finding with
inKev: true,epss: 0.42,epssPercentile: 0.97and KEV dates reachesvuln-gatewith every field intact via the pre-scanned-findingspath. - Same via the gate-scans-for-you path with an inline fake
VulnScanner. - A finding with none of those fields reaches the gate with all six
undefined— notfalse, not0. - VEX suppression (
applyVex) preserves the exploitability fields on findings it does not suppress.applyVexpartitions intogating/suppressed; confirm it does not rebuild finding objects and drop unknown keys. - No live scanner, network, or vuln DB touched by any test added here.
-
tscandeslintclean.
Out of scope
Gate behavior — after this merges, a KEV finding still changes no outcome. #1465 does that. This issue only proves the data gets there.
Activity
[-]Contract test: exploitability survives scan → gate[/-][+]Contract test: exploitability survives scan -> gate[/+]test(supply-chain): exploitability survives scan to gate on both rout…