feat(contract): test_count_baseline post-commit guard (#1584)#1619
Merged
Conversation
Closes #1584. Defense-in-depth alongside test_diff (#1583) + llm_judge (#1582). Compares COMMITTED tree counts of test declarations: HEAD vs BaseRef (default HEAD~1). Catches deletions slipping past diff inspection — file moves, force-pushes, multi-commit sequences. Language-agnostic: shares TestFilePattern + TestFuncPattern with test_diff. wave.yaml documents the Go defaults explicitly so non-Go projects know the knobs. Tests cover: no-change, addition, deletion, file-move, tolerance config, no-base-ref / no-git silent pass, Python config.
This was referenced Apr 30, 2026
Without these fields the wave.yaml entries from the same PR fail YAML unmarshal in TestLoadWaveYAML_PersonaPermissions. Mirrors the contract fields added in internal/contract/contract.go.
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.
Closes #1584. Third sibling to #1582 (llm_judge) + #1583 (test_diff).
What
Post-commit
test_count_baselinecontract. Compares committed tree counts of test declarations: HEAD vs BaseRef (default HEAD~1). Catches deletions that slip past per-diff inspection (file moves, force-pushes within session, multi-commit sequences).Language-agnostic
Shares
TestFilePattern+TestFuncPatternwithtest_diffso a project configures patterns once. Defaults match Go.wave.yaml
Adds explicit Go patterns under
project:so non-Go projects see the knobs:Tests
8 cases: no-change, addition, deletion fails, file move nets zero, higher tolerance, no base ref / no git silent pass, Python config detects deletion. All green locally.
Validation
No smoke pipeline yet — covered by
internal/contract/test_count_baseline_test.goGo tests. Wiring intoimpl-issue.yamlaftercommitstep is a separate small PR (mirrorstest_diffplan).