Skip to content

ci(workflow): compile and test ai feature with TemplateNarrator validation - #107

Merged
Muawiya-contact merged 1 commit into
Coding-Moves:mainfrom
vhmns14:fix/ci-ai-feature-and-test
Sep 8, 2026
Merged

ci(workflow): compile and test ai feature with TemplateNarrator validation#107
Muawiya-contact merged 1 commit into
Coding-Moves:mainfrom
vhmns14:fix/ci-ai-feature-and-test

Conversation

@vhmns14

@vhmns14 vhmns14 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #87

Summary of Changes

  1. CI Configuration (.github/workflows/ci.yml):

    • Added --all-features to cargo clippy so optional feature modules (such as ai) are continuously linted.
    • Added --all-features to cargo test matrix across Linux, Windows, and macOS.
  2. Core Utilities & TemplateNarrator (crates/diskern-core & crates/diskern-cli):

    • Moved and exposed human_bytes(n: u64) -> String in diskern-core so formatting is consistent across the engine and CLI.
    • Updated TemplateNarrator::narrate to use human_bytes rather than hardcoded decimal GB (total as f64 / 1e9), fixing awkward "0.0 GB reclaimable" reporting for smaller scans.
    • Added unit tests for human_bytes and TemplateNarrator::narrate validating fact narration, pluralization, and empty findings.

Validation

  • cargo fmt --check passed.
  • cargo clippy -p diskern-core -p diskern-cli --all-targets --all-features -- -D warnings passed.
  • cargo test -p diskern-core -p diskern-cli --all-features passed (all 64 core tests + 14 cli/integration tests green).

@Muawiya-contact Muawiya-contact left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 🚀

@Muawiya-contact
Muawiya-contact merged commit 0fdcfd4 into Coding-Moves:main Sep 8, 2026
12 checks passed
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.

CI never compiles the ai feature, and nothing tests it

2 participants