Repository navigation
Description
Problem
Once golden_diff.py is actually wired into CI and passing/failing the
build, nothing stops a contributor from simply re-running the tool and
copying its new output over the golden master to make a failing diff
"pass." A green check on this test currently means (and would continue to
mean) "output matches the last accepted snapshot" or "output was just
silently re-blessed" -- there's no way for a reviewer to tell the difference
from the CI result alone.
This matters because the whole point of this test is to catch unintended
output drift. If updating the baseline is as easy as cp new_output.json golden_master.json, the test provides a false sense of safety: a
bug that changes output will "fail" once, and can be silently
made to "pass" again without anyone examining whether the new output is
actually correct.
Fix
Make golden-master updates deliberate and reviewable:
- A separate, explicit update path. e.g. a
make update-golden-master
target or a script undertests/tools/, clearly distinct from the normal
test-run path, so updating the baseline is never an accidental side
effect of just running tests. - A PR-level forcing function. Either:
- A CONTRIBUTING.md requirement: any PR that touches
tests/golden_master/*.jsonmust explain in the PR description what
output change was intended and why. - Or a lightweight CI check that flags (not necessarily blocks) any PR
modifying the golden master file, so it's never invisible in a large
diff.
- A CONTRIBUTING.md requirement: any PR that touches
- Ownership/review requirement (optional, if the repo grows past a
single maintainer): require a specific reviewer or label on any PR that
touches the golden master fixture.
Explicitly out of scope for this issue
- The mechanics of the diff test itself (companion issues).
- A true correctness test suite with hand-verified expected findings --
golden-diff testing, even done perfectly with full governance, can only
ever prove output hasn't silently drifted from a prior baseline. It can
never prove the baseline was correct in the first place. That's a
separate, larger piece of work.
Activity
Wire the dead key auditor into CI as a baseline-gated required check (#…
Fix prism.py's comment-family taxonomy -- comment/code separation was…
Fix prism.py's comment-family taxonomy -- comment/code separation was…
Require deliberate, reviewable golden master updates (#330) (#399)
squid-protocol commentedon Jul 25, 2026
Resolved by #399: tests/tools/update_golden_master.py is now the one sanctioned update path (shows the diff, requires confirmation before writing), and .github/workflows/golden-master-guard.yml flags any PR touching the fixture files for reviewer attention.