diskern-core has an optional ai feature, and no CI job ever turns it
on:
- run: cargo clippy -p diskern-core -p diskern-cli --all-targets -- -D warnings
- run: cargo test -p diskern-core -p diskern-cli
Both use default features, and ai is not one (default = []). So
src/ai.rs — the AiProvider trait, AiError, TemplateNarrator — is
never compiled by CI on any platform, and #[cfg(feature = "ai")] pub mod ai;
means a change to Finding that breaks it merges green.
It also has no tests of its own. cargo test -p diskern-core --features ai
runs the same 54 tests as without it; the module contributes none.
It compiles today — cargo clippy -p diskern-core --features ai --all-targets -- -D warnings
is clean as of this issue, which is what makes this cheap to close before
it stops being true.
Two parts, one PR:
- add
--all-features to the clippy and test steps in ci.yml, or a
dedicated cargo clippy -p diskern-core --features ai step;
- give
TemplateNarrator a test. It is a pure function from &[Finding]
to a String, so a test builds two or three findings and asserts the
count, the total and that the reasons it quotes are ones the findings
actually carry — the "narrates facts, never decides" contract the module
header states and nothing currently checks.
Whoever writes that test will notice the narrator reports every total in
GB (total as f64 / 1e9), so a real scan's worth of caches narrates as
"0.0 GB reclaimable". Fixing that belongs in the same PR.
.github/workflows/ci.yml:54 · .github/workflows/ci.yml:76 · crates/diskern-core/src/ai.rs:36
diskern-corehas an optionalaifeature, and no CI job ever turns iton:
Both use default features, and
aiis not one (default = []). Sosrc/ai.rs— theAiProvidertrait,AiError,TemplateNarrator— isnever compiled by CI on any platform, and
#[cfg(feature = "ai")] pub mod ai;means a change to
Findingthat breaks it merges green.It also has no tests of its own.
cargo test -p diskern-core --features airuns the same 54 tests as without it; the module contributes none.
It compiles today —
cargo clippy -p diskern-core --features ai --all-targets -- -D warningsis clean as of this issue, which is what makes this cheap to close before
it stops being true.
Two parts, one PR:
--all-featuresto the clippy and test steps inci.yml, or adedicated
cargo clippy -p diskern-core --features aistep;TemplateNarratora test. It is a pure function from&[Finding]to a
String, so a test builds two or three findings and asserts thecount, the total and that the reasons it quotes are ones the findings
actually carry — the "narrates facts, never decides" contract the module
header states and nothing currently checks.
Whoever writes that test will notice the narrator reports every total in
GB (
total as f64 / 1e9), so a real scan's worth of caches narrates as"0.0 GB reclaimable". Fixing that belongs in the same PR.
.github/workflows/ci.yml:54·.github/workflows/ci.yml:76·crates/diskern-core/src/ai.rs:36