Skip to content

fix(check): fail closed when Rust analysis sees no source files - #126

Merged
kvlonge merged 1 commit into
mainfrom
fix/rust-host-facts
Nov 5, 2026
Merged

kvlonge merged 1 commit into
mainfrom
fix/rust-host-facts

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Why

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: fensu check printed Found 0 faults and exited 0, unless the RSL901 setup diagnostic happened to be selected. A Rust gate could silently pass.

Changes

  • fensu check exits 2 with the Cargo cause when a Rust target has .rs sources but analysis returned no files.
  • Docs (docs/rust.md, Rust analyzer page) updated in place.

Verification

  • New table test 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 with Found 0 faults, exit 0.
  • cargo test -p fensu-cli --test command --test check: all pass except given_forced_color_when_inspecting_rule_then_fault_code_renders_in_orange, which fails on main too in a shell with NO_COLOR=1 and passes without it.
  • make check-ci and make skills-content-check: exit 0. Hygiene scan clean.

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
kvlonge enabled auto-merge (squash) November 5, 2026 09:36
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying fensu with  Cloudflare Pages  Cloudflare Pages

Latest commit: e1c764c
Status: ✅  Deploy successful!
Preview URL: https://6beaafa6.fensu.pages.dev
Branch Preview URL: https://fix-rust-host-facts.fensu.pages.dev

View logs

@kvlonge
kvlonge merged commit 077800e into main Nov 5, 2026
35 checks passed
@kvlonge
kvlonge deleted the fix/rust-host-facts branch November 5, 2026 10:28
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