Fail a zero-match harness filter before codegen and export - #4743
Merged
Conversation
A `--harness` filter that matches no harness only fails in the final summary. `--quiet` skips that summary, so the run exits 0. With `--export-json`, the run also writes a file that reports a clean, empty run. Bail out in `determine_targets` instead. This runs before codegen and before any export. The final-summary check stays as a last guard for paths that skip harness filtering. Add a script-based regression test covering the `--quiet` exit code, the absent export file, and the several-filters error message. Resolves the first driver bug from model-checking#4731.
Contributor
There was a problem hiding this comment.
Pull request overview
Moves zero-match harness-filter validation earlier so failed selections exit non-zero before verification or JSON export.
Changes:
- Rejects empty filtered harness sets with existing error wording.
- Updates JSON export documentation.
- Adds regression coverage for quiet mode, export suppression, and multiple filters.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
kani-driver/src/metadata.rs |
Adds early zero-match validation. |
kani-driver/src/main.rs |
Updates empty-export commentary. |
tests/script-based-pre/harness_filter_no_match/no_match.sh |
Tests failure and export behavior. |
tests/script-based-pre/harness_filter_no_match/no_match.expected |
Defines expected test output. |
tests/script-based-pre/harness_filter_no_match/fixture.rs |
Provides a proof-harness fixture. |
tests/script-based-pre/harness_filter_no_match/config.yml |
Registers the script-based test. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
feliperodri
approved these changes
Aug 18, 2026
feliperodri
reviewed
Aug 18, 2026
feliperodri
reviewed
Aug 18, 2026
feliperodri
reviewed
Aug 18, 2026
feliperodri
enabled auto-merge
August 18, 2026 17:33
Extract the zero-match filter error into `no_harness_match_error` and use it from both `determine_targets` and the summary-stage guard, so the two sites cannot drift. The wording unifies with the `--exact` message. The summary-stage arm now carries its narrowed scope: `determine_targets` fails a zero-match filter before codegen, so the arm only guards paths that skip harness filtering. Tests that pinned the old wording are updated.
auto-merge was automatically disabled
August 18, 2026 19:01
Head branch was pushed to by a user without write access
Merged
via the queue into
model-checking:main
with commit Aug 21, 2026
46aa1a9
39 of 42 checks passed
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.
A
--harnessfilter that matches no harness only fails in the end-of-run summary.--quietskips that summary, so the run exits 0. With--export-json, the run also writes a file that reports a clean, empty run.This PR moves the zero-match check into
determine_targets, before codegen and before any export. The error is built by one shared helper, used by both the pre-codegen check and the summary-stage guard, and its wording is unified with the--exactmessage. The summary check stays as a last guard for paths that skip harness filtering.Testing: a new script-based test covers the
--quietexit code, the absent export file, and the several-filters message. The test fails onmainand passes with this change.cargo test -p kani-driver,rustfmt, andclippyare clean.First of the two driver fixes agreed in #4731.