Skip to content

feat(check): rivet check verification-evidence — named-test-exists oracle (REQ-236, #556)#643

Merged
avrabe merged 1 commit into
mainfrom
feat/req-236-named-test-check
Jul 1, 2026
Merged

feat(check): rivet check verification-evidence — named-test-exists oracle (REQ-236, #556)#643
avrabe merged 1 commit into
mainfrom
feat/req-236-named-test-check

Conversation

@avrabe

@avrabe avrabe commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What

Closes #556 (part 2; part 1 — cited-source on verification types — shipped earlier). A verification step ties a requirement to a test via fields.steps[].run: "cargo test -p X some_test", but cargo test typo exits 0 with "0 passed" — so a renamed/typo'd test name silently keeps the requirement verified.

New oracle

rivet check verification-evidence: for each steps[].run that names a cargo test filter, assert a matching test exists in the scanned Rust sources (workspace-aware defaults, shared with rivet verify). Missing → error + non-zero exit; non-cargo steps and whole-crate runs are ignored.

✗ verification-evidence: 1 named-test step(s) reference a test that does not exist:
  FV-001 — no test matching `renamed_or_typod_test` found (from `cargo test -p X renamed_or_typod_test`)

Design

Pure logic (cargo filter parsing incl. -p/--test/--; Rust fn-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-approximates fn names — 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-targets clean.

Self-hosted CI busy (org runners 12, backlogged); verified locally.

🤖 Generated with Claude Code

…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>
@avrabe avrabe merged commit 57eefd5 into main Jul 1, 2026
23 checks passed
@avrabe avrabe deleted the feat/req-236-named-test-check branch July 1, 2026 06:08
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

📐 Rivet artifact delta

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

Graph

graph 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
Loading
Modified
ID Changes
REQ-236

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

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

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: 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

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.01980% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rivet-core/src/verification_evidence.rs 98.01% 2 Missing ⚠️

📢 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

1 participant