Repository navigation
fix(check): fail closed when Rust analysis sees no source files - #126
Merged
Merged
Conversation
When Cargo could not run (for example, cargo missing from PATH) or the workspace had no packages, Rust analysis produced no file facts. Custom Rust rules then evaluated nothing, and fensu check printed 'Found 0 faults' and exited 0 unless the RSL901 setup diagnostic happened to be selected. fensu check now exits 2 with the Cargo cause when a Rust target has .rs sources but analysis returned no files. A regression test covers missing cargo, a workspace with no packages, and a custom-rule host reply over the 16 MiB capture limit, which already failed closed.
kvlonge
enabled auto-merge (squash)
November 5, 2026 09:36
Deploying fensu with
|
| Latest commit: |
e1c764c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6beaafa6.fensu.pages.dev |
| Branch Preview URL: | https://fix-rust-host-facts.fensu.pages.dev |
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.
Why
When Cargo could not run (for example,
cargomissing fromPATH) or the workspace had no packages, Rust analysis produced no file facts. Custom Rust rules then evaluated nothing:fensu checkprintedFound 0 faultsand exited 0, unless the RSL901 setup diagnostic happened to be selected. A Rust gate could silently pass.Changes
fensu checkexits 2 with the Cargo cause when a Rust target has.rssources but analysis returned no files.docs/rust.md, Rust analyzer page) updated in place.Verification
given_unavailable_rust_facts_when_custom_rule_is_selected_then_check_fails_closed: missing cargo, a workspace with no packages, and a custom-rule host reply over the 16 MiB capture limit (which already failed closed: exit 2, empty stdout). Without the fix the first case fails withFound 0 faults, exit 0.cargo test -p fensu-cli --test command --test check: all pass exceptgiven_forced_color_when_inspecting_rule_then_fault_code_renders_in_orange, which fails on main too in a shell withNO_COLOR=1and passes without it.make check-ciandmake skills-content-check: exit 0. Hygiene scan clean.