Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
95fde73
chore: add recording HTTP transport for feed snapshot capture
scarson Mar 19, 2026
8f1d492
chore: add capture-feeds CLI for snapshotting feed API responses
scarson Mar 19, 2026
4212c6a
docs: add edge case matrix for test fixture CVE selection
scarson Mar 19, 2026
7412464
test: add golden file server and URL-rewrite transport helpers
scarson Mar 19, 2026
e06b4c0
Merge branch 'dev' into phase10/test-fixture-corpus
scarson Mar 19, 2026
d841730
chore: add fixture extraction tool for building golden test files
scarson Mar 19, 2026
ef2ff87
docs: add curated CVE manifest for test fixture corpus
scarson Mar 19, 2026
81ca561
test: add golden file test fixtures from captured feed data
scarson Mar 19, 2026
50311cb
test: add NVD golden file test against captured API responses
scarson Mar 19, 2026
8f5b4c1
test: add golden file tests for KEV, GHSA, MITRE, OSV, Red Hat adapters
scarson Mar 19, 2026
b00ba27
test: add SeedCorpus helper for deterministic test data from golden f…
scarson Mar 19, 2026
9e52efe
Merge branch 'dev' into phase10/test-fixture-corpus
scarson Mar 20, 2026
8b311a8
test: replace CVRF fixtures with real CSAF 2.0 files from msrc.micros…
scarson Mar 20, 2026
f9acc39
refactor(msrc): rewrite Fetch to use CSAF static files via changes.csv
scarson Mar 20, 2026
5cf3d01
test(msrc): update tests for CSAF static file Fetch flow
scarson Mar 20, 2026
c6a4895
test(msrc): add CVE- prefix assertion to golden test
scarson Mar 20, 2026
22c4241
Merge branch 'dev' into phase10/test-fixture-corpus
scarson Mar 20, 2026
4dc0c63
test: add MSRC to SeedCorpus golden fixture helper
scarson Mar 20, 2026
85b7d4a
fix(msrc): resolve import cycle in internal test package
scarson Mar 20, 2026
9272858
docs: add fixture corpus refresh process documentation
scarson Mar 20, 2026
12ab434
fix(ghsa): references field is []string not []object
scarson Apr 5, 2026
4c59633
docs: update feed snapshot paths from D: drive to .data/
scarson Apr 5, 2026
7f113fc
docs: update feed snapshot paths from D: drive to .data/
scarson Apr 5, 2026
4580cd3
docs(log): add Phase 10 test fixture corpus implementation log entry
scarson Apr 5, 2026
480a399
chore: gitignore .data/ directory and update MSRC plan appendix
scarson Apr 5, 2026
4825a88
chore: clean up old test coverage reports
scarson Apr 5, 2026
980fb69
docs: document SeedCorpus and golden file test infrastructure
scarson Apr 5, 2026
fae2051
docs: add SeedCorpus and golden file test guidance to AGENTS.md
scarson Apr 5, 2026
09d8dde
Merge commit '7f113fc' into dev
scarson Apr 5, 2026
493734f
test: add EPSS golden file test against captured EPSS scores
scarson Apr 5, 2026
13bd5ef
test(epss): cross-check DB scores against golden CSV values
scarson Apr 5, 2026
33e96ad
test(epss): add review comments for SeedCorpus choice and 0.0 gap
scarson Apr 5, 2026
79145bf
docs: add code comments for future reviewers
scarson Apr 5, 2026
f1fac59
fix: resolve all golangci-lint errors in Phase 10 code
scarson Apr 5, 2026
dd7709d
ci: add expiring govulncheck exception for docker/docker CVEs
scarson Apr 5, 2026
5336d71
fix: validate path component in Red Hat golden test handler
scarson Apr 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,28 @@ jobs:
run: go install golang.org/x/vuln/cmd/govulncheck@latest

- name: govulncheck
run: govulncheck ./...
run: |
# Temporary exceptions for unpatched docker/docker vulns (test-only dependency).
# GO-2026-4887: AuthZ plugin bypass (daemon-side, not client SDK)
# GO-2026-4883: Plugin privilege validation off-by-one (daemon-side)
# These affect testcontainers-go's transitive dep, not production code.
# Expiry: 2026-07-05 — after this date CI fails to force re-evaluation.
EXPIRY="2026-07-05"
if [[ "$(date +%Y-%m-%d)" > "$EXPIRY" ]]; then
echo "::error::govulncheck exception expired on $EXPIRY — re-evaluate docker/docker vuln status"
govulncheck ./...
exit 1
fi
govulncheck ./... 2>&1 | tee /tmp/vulncheck.out || true
if grep -q 'Vulnerability #' /tmp/vulncheck.out; then
filtered=$(grep 'Vulnerability #' /tmp/vulncheck.out | grep -v 'GO-2026-4887\|GO-2026-4883' || true)
if [[ -n "$filtered" ]]; then
echo "::error::New vulnerabilities found beyond known exceptions:"
echo "$filtered"
exit 1
fi
echo "::warning::Known docker/docker vulns still present — no fix available. Exception expires $EXPIRY."
fi

test-web:
name: "Test: Web"
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ chats/
# Private journal (personal MCP server data, never shared)
.private-journal/

# Data (text fixture files, etc.)
.data/

# Git worktrees
.worktrees/
.claude/worktrees/
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ This is a security product — supply chain risk from unmaintained dependencies
- YOU MUST NEVER ignore system or test output - logs and messages often contain CRITICAL information.
- Test output MUST BE PRISTINE TO PASS. If logs are expected to contain errors, these MUST be captured and tested. If a test is intentionally triggering an error, we *must* capture and validate that the error output is as we expect

### Test data seeding

- **`testutil.SeedCorpus(t, db)`** — seeds a test database with 65 real CVEs from 8 feeds (NVD, MITRE, GHSA, OSV, KEV, MSRC, Red Hat, EPSS) via golden fixtures and the real merge pipeline. Requires Docker (testcontainers). Use this for integration tests that need a realistic CVE corpus (alert evaluation, search, reports, watchlists).
- **Do NOT seed CVE test data with raw SQL inserts** — use `SeedCorpus` or store methods. Raw inserts bypass `material_hash` computation, child table population, and FTS index updates. See `dev/testing-pitfalls.md` §7.
- **Golden file tests** exist for each feed adapter at `internal/feed/<adapter>/golden_test.go`. They serve captured real API responses via httptest. Do not delete or skip these — they catch upstream schema drift that unit tests with hand-crafted fixtures cannot detect.
- **When NOT to use `SeedCorpus`:** For unit tests that need a specific CVE shape (e.g., CVSS 0.0, null description, specific CWE), hand-craft the `CanonicalPatch` directly. `SeedCorpus` provides breadth, not targeted edge cases. For adapter unit tests, continue using inline JSON fixtures for precise control over individual fields.

### Test execution is mandatory — compilation is not verification

- **Tests MUST be executed, not just compiled.** `go build` and `go vet` verify syntax; only `go test` verifies behavior. Code that compiles but was never executed is unverified code.
Expand Down
7 changes: 7 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@ When PRing from a worktree that was created from `main` and merged `dev`:
- YOU MUST NEVER ignore system or test output - logs and messages often contain CRITICAL information.
- Test output MUST BE PRISTINE TO PASS. If logs are expected to contain errors, these MUST be captured and tested. If a test is intentionally triggering an error, we *must* capture and validate that the error output is as we expect

### Test data seeding

- **`testutil.SeedCorpus(t, db)`** — seeds a test database with 65 real CVEs from 8 feeds (NVD, MITRE, GHSA, OSV, KEV, MSRC, Red Hat, EPSS) via golden fixtures and the real merge pipeline. Requires Docker (testcontainers). Use this for integration tests that need a realistic CVE corpus (alert evaluation, search, reports, watchlists).
- **Do NOT seed CVE test data with raw SQL inserts** — use `SeedCorpus` or store methods. Raw inserts bypass `material_hash` computation, child table population, and FTS index updates. See `dev/testing-pitfalls.md` §7.
- **Golden file tests** exist for each feed adapter at `internal/feed/<adapter>/golden_test.go`. They serve captured real API responses via httptest. Do not delete or skip these — they catch upstream schema drift that unit tests with hand-crafted fixtures cannot detect.
- **When NOT to use `SeedCorpus`:** For unit tests that need a specific CVE shape (e.g., CVSS 0.0, null description, specific CWE), hand-craft the `CanonicalPatch` directly. `SeedCorpus` provides breadth, not targeted edge cases. For adapter unit tests, continue using inline JSON fixtures for precise control over individual fields.

### Test execution is mandatory — compilation is not verification

- **Tests MUST be executed, not just compiled.** `go build` and `go vet` verify syntax; only `go test` verifies behavior. Code that compiles but was never executed is unverified code.
Expand Down
Loading
Loading