Skip to content

feat(validate): --new-since <ref> — show only NEW diagnostics (REQ-208, closes #488)#499

Merged
avrabe merged 1 commit into
mainfrom
feat/req-208-validate-new-since
Jun 6, 2026
Merged

feat(validate): --new-since <ref> — show only NEW diagnostics (REQ-208, closes #488)#499
avrabe merged 1 commit into
mainfrom
feat/req-208-validate-new-since

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Jun 6, 2026

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 a rivet validate --format json subprocess), 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:

rivet validate --new-since origin/main --fail-on warning

Verification (fully local — deterministic)

  • Unit: new_since_diff_tests (2 tests) — pure diff logic.
  • E2E on this repo: rivet validate --new-since f7fc2d0 correctly 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 warnings exit 0 · rivet validate PASS.

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

…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
@avrabe avrabe merged commit ed8612b into main Jun 6, 2026
19 of 20 checks passed
@avrabe avrabe deleted the feat/req-208-validate-new-since branch June 6, 2026 01:54
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 6, 2026

📐 Rivet artifact delta

Change Count
Added 1
Removed 0
Modified 0
Downstream impacted (depth ≤ 5) 0

Graph

graph 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
Loading
Added
  • REQ-208

📎 Full HTML dashboard attached as workflow artifact rivet-delta-pr-499download from the workflow run.

Posted by rivet-delta workflow. The graph shows only changed artifacts; open the HTML dashboard (above) for full context.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 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
Copy link
Copy Markdown

codecov Bot commented Jun 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant