Repository navigation
fix: require enough snapshots for regression analysis - #81
Merged
alexshapalov merged 1 commit intoOct 12, 2026
Merged
alexshapalov merged 1 commit into
alexshapalov merged 1 commit into
Conversation
Three snapshots yield only two interval measurements, but the sustained shift detector requires three. The earlier guard treated this as sufficient history and the CLI could report that nothing got worse without an analyzable baseline. Share the four-snapshot minimum across analysis, offline/live rendering, window guidance and the MCP tool description. Keep report field shapes and valid-history detection unchanged. Cover actual stored-history CLI output and a smallest-sufficient four-snapshot case that detects a real shift. Verification: new regressions fail on 282ffe8; full why and CLI race suites pass. No new queries, dependencies or schema changes.
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 #80.
Four snapshots are needed to produce the three interval observations required by the existing sustained-shift detector. Share that minimum across analysis, CLI rendering, wider-window guidance and the MCP description so an insufficient history is not reported as a clean diagnosis.
A real-store CLI regression exercises three snapshots inside the window plus older available history. A positive control proves that the smallest sufficient four-snapshot series still detects a genuine slowdown. Historical changelog entries and design records are left untouched.
Verification
Verified commit:
d59be1de91ba16551828a87e04ee4ab1695375af.282ffe8fdd7acdd7b6e1dbd8cf04c155401d3a92for missing guidance and the false clean result.go test -race ./internal/why ./cmd/pgbot -count=1: passed.bash scripts/gate.sh: passed on committed HEAD, including pinned lint, unit tests and all six release-target builds.go test -race ./...: passed; formatting andgit diff --checkclean.Scope and risk
This corrects the data-sufficiency boundary, not the shift algorithm. Four total snapshots remain necessary rather than sufficient when measurements are missing or reset. Tests use actual SQLite history and actual CLI/analyzer code; no PostgreSQL connection is required. No report-field, schema, dependency or SQL changes. Revert the commit to restore the previous threshold.
Checklist
scripts/gate.shpasses on committed HEAD; full race suite passes.