Repository navigation
test(witnesses): automated witness coverage audit (#1227) - #1279
Conversation
Add devtools verify-witness-coverage which scans merged fix PRs from the last 90 days via gh and flags any that modified polylogue/ source without adding (or modifying) a file under tests/witnesses/. Wired into devtools verify as a recommended (soft) gate so missing-witness findings surface without blocking PR readiness; nightly jobs invoke the command without --soft for the hard gate. A suppression list at docs/plans/witness-coverage-suppressions.yaml covers PRs that genuinely do not need a witness. Closes #1227 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR adds ChangesWitness Coverage Audit Tool
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd7979bc46
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Add
devtools verify-witness-coverage, which scans mergedfix:PRsfrom the last 90 days via
gh pr listand flags any that modifiedpolylogue/source without adding or modifying a file undertests/witnesses/. Wired intodevtools verifyas a recommended(soft) gate so missing-witness findings surface without blocking PR
readiness.
Problem
tests/witnesses/is the durable failure-case corpus for closed bugs,but nothing checks that every bug-fix PR contributed a witness. Bugs
quietly close without a regression artifact, eroding the corpus's
value over time (issue #1227).
Solution
devtools/verify_witness_coverage.py— new audit module. Callsgh pr list --state merged --search "is:pr is:merged merged:>=…",with PR title + labels (
bug) used to identify fix PRs and afilename heuristic (
polylogue/source touched, notests/witnesses/entry added) used to flag PRs.--softreturnszero on flag (used inside
devtools verify); the default exits 1.Skips cleanly with rc=0 in soft mode when
ghis unavailable, sothe local baseline does not regress in offline environments.
docs/plans/witness-coverage-suppressions.yaml— narrow opt-outregistry (PR number + rationale) for PRs that genuinely do not need
a witness.
devtools/command_catalog.py— registers the newverificationcommand so it shows in
--list-commandsanddocs/devtools.md.devtools/verify.py— added as a recommended step(
devtools verify-witness-coverage --soft) in the non-commitbaseline. The
--softflag means a flagged PR will not block thelocal baseline; nightly jobs invoke the command without
--softfor the hard gate.
tests/unit/devtools/test_verify_witness_coverage.py— 23 unittests covering the fix-PR heuristic, suppression parsing, audit
decisions, soft vs strict mode, and command registration.
docs/devtools.mdandAGENTS.mdrefreshed viadevtools render-all.Heuristic chosen deliberately broad:
fix:/fix(...)subject prefixOR
buglabel, and any added file undertests/witnesses/clears theflag (we do not enforce a specific witness-per-PR linkage to keep the
audit cheap to satisfy).
Verification
Closes #1227
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
verify-witness-coveragecommand to audit merged PRs for missing regression test witnesses, with soft (non-blocking) and strict (blocking) modes.Documentation
Tests