ci(workflow): compile and test ai feature with TemplateNarrator validation - #107
Conversation
There was a problem hiding this comment.
Both halves of #87 are here, and the narrator test asserts the count, the total and that the reasons come from the findings — which is the "narrates facts, never decides" contract the module header claims and nothing checked. Ran it here: clippy and tests green with --all-features (64) and without (62), so the two ai tests really are gated.
Two things, neither blocking.
The human_bytes move is a bigger call than the PR describes. main.rs still says display strings live in the CLI because the engine is deliberately UI-agnostic, and this puts a formatter in the engine's public API. I think it's the right call — ai.rs is in core and needs it, and the alternative is a second copy — but it's worth a line in the description saying so, since the next person will read that comment and wonder.
The three human_bytes tests are still in main.rs testing a function that now lives in core, and the new core test overlaps them without covering the u64::MAX case they do. Worth moving them across so the tests sit with the code.
Approved either way. Good catch on the 0.0 GB formatting while you were in there.
And thanks for coming back for a second one 🙌 Two merged contributions in two days is a real help. If Diskern is useful to you, sharing it with anyone who'd get something out of it does more for the project than anything else — and the ⭐ still stands if you haven't already 🚀
Fixes #87
Summary of Changes
CI Configuration (
.github/workflows/ci.yml):--all-featurestocargo clippyso optional feature modules (such asai) are continuously linted.--all-featurestocargo testmatrix across Linux, Windows, and macOS.Core Utilities & TemplateNarrator (
crates/diskern-core&crates/diskern-cli):human_bytes(n: u64) -> Stringindiskern-coreso formatting is consistent across the engine and CLI.TemplateNarrator::narrateto usehuman_bytesrather than hardcoded decimal GB (total as f64 / 1e9), fixing awkward "0.0 GB reclaimable" reporting for smaller scans.human_bytesandTemplateNarrator::narratevalidating fact narration, pluralization, and empty findings.Validation
cargo fmt --checkpassed.cargo clippy -p diskern-core -p diskern-cli --all-targets --all-features -- -D warningspassed.cargo test -p diskern-core -p diskern-cli --all-featurespassed (all 64 core tests + 14 cli/integration tests green).