Skip to content

feat(goldenrec): coverage gate for golden fixtures - #327

Merged
randomizedcoder merged 5 commits into
mainfrom
feat/golden-coverage
Nov 25, 2026
Merged

randomizedcoder merged 5 commits into
mainfrom
feat/golden-coverage

Conversation

@randomizedcoder

Copy link
Copy Markdown
Owner

The golden fixture shows what the collector emits for the microVM workload, but nothing stops a workload change from quietly no longer populating a column. This adds a coverage gate, so the planned wider workload (every congestion algorithm, loss, more TCP states, socket options, NIC and locality) can be added red-first. No workload change here. Done test-first.

Feature

  • goldenrec.Coverage and CheckCoverage(Profile, Coverage, refs). A fixture must have:
    • populated columns nonzero;
    • values present in listed columns;
    • families and kinds (namespace kinds) with rows.
  • A value @manifest.KEY expands to the list under KEY in the fixture's manifest.json, so a requirement can follow the guest kernel (e.g. every congestion algorithm it offers)
  • Values may only be required of columns profileListed lists, so coverage can't name ASNs, uids or container names
  • xtcp2-golden check DIR applies DIR/../coverage.json when it exists, so checks.golden-records picks it up unchanged
  • pkg/xtcp/testdata/golden/coverage.json describes today's 7_3_1 fixture: 71 populated columns, 18 value sets (zero and empty values left out), families 2/10, kinds container/host/named
  • coverage.json is read through os.Root like the fixture files
  • nix/README and CHANGELOG

Tests

  • TestCheckCoverage, TestRunCheckCoverage, TestManifestRefs: table-driven, all four categories
  • TestRunCheckCommittedCoverage: the committed fixtures meet the committed coverage

Red (tests commit, before the feature)

pkg/goldenrec/coverage_test.go:12:11: undefined: Coverage
cmd/xtcp2-golden/coverage_test.go:105:19: undefined: goldenrec.Coverage
cmd/xtcp2-golden/coverage_test.go:127:17: undefined: manifestRefs

Green

go test ./... and the nix checks (gofmt, go-vet, nix-fmt, lint-baseline, golangci ×3, redteam-lint, golden-records, test-fuzz-all) pass. Includes the nix/default.nix nixfmt commit from #326, since main fails checks.nix-fmt.

🤖 Generated with Claude Code

randomizedcoder and others added 4 commits November 24, 2026 14:22
CheckCoverage: required populated columns, values (with @manifest
references), families and namespace kinds. xtcp2-golden check reads
DIR/../coverage.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CheckCoverage reports required columns never populated, required values
missing ("@manifest.KEY" expands to the fixture manifest's list), and
missing families and namespace kinds. xtcp2-golden check applies
../coverage.json; the committed one describes today's 7_3_1 fixture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main fails checks.nix-fmt on the binaries inherit added in #324.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gosec G703 on the os.ReadFile of a path built from the argument.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@randomizedcoder
randomizedcoder merged commit 5e0ae64 into main Nov 25, 2026
1 check 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.

1 participant