feat(validate): --new-since <ref> — show only NEW diagnostics (REQ-208, closes #488)#499
Merged
Merged
Conversation
…it ref (REQ-208, closes #488) Answers "did MY change add any diagnostics?" without jq over hundreds of lines. `rivet validate --new-since <REF>` validates the current tree and a detached git worktree of <REF> (each via a `rivet validate --format json` subprocess of the same binary), then prints the set-difference keyed on (severity, artifact_id, rule, message). Exits non-zero when any NEW diagnostic is at/above `--fail-on` — a ready "this PR adds no new diagnostics" CI gate (e.g. `rivet validate --new-since origin/main --fail-on warning`). - Pure diff factored into `diff_new_diagnostics` (unit-tested: current-minus- baseline by the 4-field key; empty when current is a subset). - `--new-since` short-circuits in the Validate dispatch (like `--explain`). - Worktree always cleaned up; no new runtime dep (PID-scoped temp dir, not the dev-only `tempfile`, per #456). Confirmed with: cargo test -p rivet-cli --bin rivet new_since_diff_tests (2 pass); `rivet validate --new-since f7fc2d0` on this repo correctly reports the 8 new diagnostics introduced by REQ-201..207 (their requirement-coverage warnings), `--new-since HEAD` reports 0, no worktree left behind; cargo fmt --check + clippy --all-targets -- -D warnings (exit 0); rivet validate PASS. Implements: REQ-208 Verifies: REQ-208 Refs: REQ-007
📐 Rivet artifact delta
Graphgraph LR
REQ_208["REQ-208"]:::added
classDef added fill:#d4edda,stroke:#28a745,color:#155724
classDef removed fill:#f8d7da,stroke:#dc3545,color:#721c24
classDef modified fill:#fff3cd,stroke:#ffc107,color:#856404
classDef overflow fill:#e2e3e5,stroke:#6c757d,color:#495057,stroke-dasharray: 3 3
Added
Posted by |
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Rivet Criterion Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 456e8f7 | Previous: 8fa8d5a | Ratio |
|---|---|---|---|
traceability_matrix/1000 |
59667 ns/iter (± 215) |
44622 ns/iter (± 1155) |
1.34 |
query/10000 |
334011 ns/iter (± 1607) |
232754 ns/iter (± 7729) |
1.44 |
This comment was automatically generated by workflow using github-action-benchmark.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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 #488 (my own issue — the edit-verify-loop friction I kept hitting).
What
rivet validate --new-since <REF>prints only the diagnostics that are new relative to a git ref — "did my change add any warnings?". It validates the current tree and a detached worktree of<REF>(each via arivet validate --format jsonsubprocess), then set-diffs by(severity, artifact_id, rule, message). Exits non-zero when any NEW diagnostic is at/above--fail-on— a ready "this PR adds no new diagnostics" CI gate:Verification (fully local — deterministic)
new_since_diff_tests(2 tests) — pure diff logic.rivet validate --new-since f7fc2d0correctly reports the 8 new diagnostics introduced by REQ-201…207 (their requirement-coverage warnings + a prose-mention);--new-since HEAD→ 0; no worktree left behind.cargo fmt --check+clippy --all-targets -- -D warningsexit 0 ·rivet validatePASS.Notes: the pure diff is factored + unit-tested; the git-worktree glue is verified by the e2e above; no new runtime dependency (PID-scoped temp dir, not the dev-only
tempfile, per #456).Implements + Verifies REQ-208.
🤖 Generated with Claude Code