Repository navigation
fix: suppress baseline comparisons across statistics resets - #64
Open
DivyamTalwar wants to merge 1 commit into
Open
DivyamTalwar wants to merge 1 commit into
DivyamTalwar wants to merge 1 commit into
Conversation
Offline comparisons could expose cumulative deltas or report no material change after detecting a statistics reset or server restart. Apply the existing reset-suppression contract in Compute and terminate rendering after the unavailable-comparison explanation. Regression coverage includes the real SQLite baseline store, CLI/MCP-shared JSON, first and later resets, restarts, normal comparisons and eviction notices. Existing JSON field shapes remain unchanged. Closes pgrundev#61
This was referenced Sep 22, 2026
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.
What and why
Closes #61.
A detected statistics reset or server restart makes the two snapshots incomparable. The standalone diff path nevertheless calculated deltas, and the text renderer could print either those deltas or "nothing material changed" after its reset warning.
Reuse the existing
StatsResetBetweencontract indiff.Computeand stop rendering after the reset explanation. JSON retains its reset caveat andchanges: []; ordinary comparisons and the independent eviction warning are preserved.Verification
Verified commit:
0e9cecb8cafe087cdc5efc661c91ee067804dccb.a1e6561e366455756c45a16a46647f882b3b6a1cfor the reported behavior.go test -race ./internal/diff ./internal/render ./cmd/pgbot -run 'TestCompute_|TestDiffReport_|TestResolveDiff_Reset' -count=20: passed.bash scripts/gate.sh: passed on the committed HEAD, including build, vet, pinned lint, unit tests and six release-target builds.go test -race ./...: passed; formatting andgit diff --checkare clean.Risk and rollback
The behavior changes only when the existing reset detector says comparison is unavailable. No PostgreSQL queries, dependencies, migrations or JSON field shapes change. Revert this commit to restore the previous behavior. The new store/JSON regression is database-independent; PostgreSQL-specific integration tests self-skip in the local suite.
Checklist