Report new rustqual findings from cargo_check
Make the cargo_check tool (.config/jp/tools/src/cargo/check.rs) report the rustqual findings that CI would fail on, so an assistant can find out before pushing. It runs the same gate binary CI runs, so it gives the same verdict and the same messages: qual diff from T-0yh5frr today, rustqual's own command once T-1dhk659's follow-up folds qual into it. Run the binary and read its JSON output rather than linking qual as a library: qual is going away, and the binary call survives the move with a changed command line.
Behaviour
- Add a
QualCheckstep next toComfortCheck, with the sameClean/Findings(note)/Failed(stderr)shape. - Run it only after clippy succeeds: findings on code that doesn't compile are noise.
- The head is the working tree, including uncommitted changes. The base is
merge-base(HEAD, origin/main), falling back tomainwhen there's no remote, and the gate caches its report. - The
packageparameter filters which findings are reported, not what is analysed. Dead-code and duplicate detection need the whole workspace. - Render in the AI-oriented format with per-rule guidance, and list the allowed escape hatches (see the escape-hatch ticket).
- Update the tool summary in
.jp/mcp/tools/cargo/check.toml, and therust-developmentskill description if it lists whatcargo_checkcovers.
Tests
Follow check_tests.rs: cover clean, findings and failure with MockProcessRunner, plus the case where clippy fails and the qual step is skipped. Pin the JSON the step reads in a fixture, so a change to the gate's output shape fails a test here.
Comments
- From: jp
- Date: 2026-11-11T10:44:10Z
Decisions taken while implementing:
- The JSON verdict carries the rules.
qual diff --format jsonprinted no guidance and no rule titles, so a reader of the JSON couldn't render the AI-oriented format. It now has arulesobject with the title and guidance of each rule the verdict reports.cargo_checkrenders its note from that, in the layout of--format ai. - One fixture, two readers.
crates/internal/qual/fixtures/verdict.jsonis whatqual's render test asserts it prints and what thecargo_checktests parse. - Opt-in. The step runs when
options.qual_checkis set, aswiki_checkdoes, since the tool can point at a cargo workspace withoutqual..jp/mcp/tools/cargo/check.tomlsets it. - A gate that reaches no verdict is a note, not an error. An error outcome drops clippy's diagnostics, and a missing
rustqualsays nothing about them. The note reads "New rustqual findings weren't checked: …". - Findings outside
packageare counted. A change in one package can leave a function in another without callers, and CI fails on that too. - The escape hatches are listed after the findings, with the instruction not to use one unless the user asked. The persona changes stay in T-0yh5qjg.
No guidance shows up yet: .config/rustqual/guidance/ is T-0yh8q2s.