feat(check): rivet check verification-evidence — named-test-exists oracle (REQ-236, #556)#643
Merged
Merged
Conversation
…acle (REQ-236, #556) A verification step commonly ties a requirement clause to a specific test via `fields.steps[].run: "cargo test -p X some_test"`. But `cargo test -p X typo` exits 0 with "0 passed" when the filter matches nothing, so a renamed / removed / typo'd test name silently keeps the requirement `verified`. A downstream user (relay) had to bolt a gate-script workaround on top. New `rivet check verification-evidence`: for each `steps[].run` that is a cargo test invocation naming a filter, assert a matching test exists in the scanned Rust sources (workspace-aware defaults, shared with `rivet verify`; #603). Missing → error + non-zero exit. Non-cargo steps and whole-crate runs (no filter) are ignored. Pure logic (cargo-command filter parsing incl. `-p`/`--test`/`--` handling, and Rust `fn`-name extraction with cargo's substring-match semantics) lives in a unit-tested rivet-core module; the file walk + artifact iteration in the CLI. Scope is cargo/Rust (the reported case) — the extractor over-approximates `fn` names, the safe direction (only errors when a filter matches NOTHING). Completes REQ-236 (part 1 — cited-source on verification types — shipped earlier). Confirmed: a real test passes, a typo'd filter is flagged, `make lint` is skipped. Implements: REQ-236 Verifies: REQ-236 Refs: REQ-004 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
📐 Rivet artifact delta
Graphgraph LR
REQ_236["REQ-236"]:::modified
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
Modified
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: 63cc9fa | Previous: cc2a638 | Ratio |
|---|---|---|---|
validate/10000 |
1270151652 ns/iter (± 10301535) |
966378623 ns/iter (± 16985466) |
1.31 |
traceability_matrix/1000 |
61308 ns/iter (± 277) |
45639 ns/iter (± 221) |
1.34 |
query/10000 |
319566 ns/iter (± 2018) |
241498 ns/iter (± 5622) |
1.32 |
This comment was automatically generated by workflow using github-action-benchmark.
Codecov Report❌ Patch coverage is
📢 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.
What
Closes #556 (part 2; part 1 —
cited-sourceon verification types — shipped earlier). A verification step ties a requirement to a test viafields.steps[].run: "cargo test -p X some_test", butcargo test typoexits 0 with "0 passed" — so a renamed/typo'd test name silently keeps the requirementverified.New oracle
rivet check verification-evidence: for eachsteps[].runthat names a cargo test filter, assert a matching test exists in the scanned Rust sources (workspace-aware defaults, shared withrivet verify). Missing → error + non-zero exit; non-cargo steps and whole-crate runs are ignored.Design
Pure logic (cargo filter parsing incl.
-p/--test/--; Rustfn-name extraction with cargo's substring semantics) is a unit-tested rivet-core module; the file walk + iteration in the CLI. Scope is cargo/Rust (the reported case); the extractor over-approximatesfnnames — the safe direction (only errors when a filter matches nothing).Verification
rivet-core unit tests (4) +
check_verification_evidence_flags_missing_named_test(CLI). rivet-core lib 1164 + cli_commands 151 green; clippy--all-targetsclean.🤖 Generated with Claude Code