go test served a cached pass against a corrupted parity corpus - #105
Merged
Conversation
|
The Go lane loads parity/sampling-corpus.json and parity/pii-corpus.json from
OUTSIDE its package directory. Go's test cache does not treat such a file as a
package input, so editing it does not invalidate the cache.
Reproduced on main, not taken on faith:
$ go test ./... -> ok github.com/SmooAI/observability/go 3.5s
$ <corrupt a corpus hash vector>
$ go test ./... -> ok github.com/SmooAI/observability/go (cached)
$ go test -count=1 ./... -> FAIL FNV1a32("") = 2166136261, want 12345
So a green Go lane on a corpus-only change could mean nothing was run. That is
the exact failure the corpora exist to prevent, in the one language whose cache
can hide it — `actions/setup-go` restores GOCACHE, which includes the test
cache, so CI is not immune.
`-count=1` on both `go test` invocations (pr-checks and the publish gate).
Scope check on the other four: Rust reads the corpus via include-free
std::fs at runtime but cargo has no test-result cache, .NET and TS have none,
and pytest's is opt-in and not enabled. Go was the only one.
This does NOT invalidate #95's negative controls — those edited sampling.go, a
package source file, which invalidates correctly. What it invalidates is the
weaker claim that a green Go lane proves the CURRENT corpus was read.
Closes th-062793 for this repo.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0152bbE1veqfG1SVJdyLCBxC
brentrager
force-pushed
the
fix/go-test-cache
branch
from
August 20, 2026 19:09
a517fb1 to
119df81
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reproduced on main, not taken on faith
The Go lane loads
parity/sampling-corpus.jsonandparity/pii-corpus.jsonfrom outside its package directory. Go's test cache does not treat such a file as a package input, so editing it does not invalidate the cache:A green Go lane on a corpus-only change could therefore mean nothing ran — the exact failure the corpora exist to prevent, in the one language whose cache can hide it. CI is not immune:
actions/setup-gorestoresGOCACHE, which includes the test cache.Fix
-count=1on bothgo testinvocations — the PR lane and the publish gate.Scope check on the other four
Go was the only one. Cargo has no test-result cache; .NET and TypeScript have none; pytest's is opt-in and not enabled here.
What this does and does not invalidate
It does not invalidate #95's negative controls — those edited
sampling.go, a package source file, which invalidates the cache correctly, and each one did go red.It does invalidate the weaker claim that a green Go lane proves the current corpus was read. That claim is now true.
Closes th-062793 for this repo.
🤖 Generated with Claude Code
https://claude.ai/code/session_0152bbE1veqfG1SVJdyLCBxC