From 3d7702e8a3566a5eba41d26ec294244972a84b09 Mon Sep 17 00:00:00 2001 From: Mac Anderson Date: Thu, 6 Aug 2026 22:09:37 -0700 Subject: [PATCH] fix(stella-cli): drop imports left unused when the diagnostic impl moved out MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `main` fails `cargo check`/`clippy` on the non-test build at 94d013c5: error: unused imports: `DiagnosticInvocation` and `DiagnosticRunner` --> crates/stella-cli/src/agent/tools.rs:11:46 #2034 moved `impl DiagnosticRunner for GitDiagnosticRunner` into `agent/diagnostics.rs`. Nothing outside `cfg(test)` in tools.rs names those two types any more, so the top-level import became dead in a non-test build. Why the local gate missed it: `clippy --all-targets` compiles the test cfg, where both types ARE still used (`mod tests`, `mod diff_baseline_tests`), so the import reads as live and the run is green. Only a build WITHOUT the test targets sees it — which is what `cargo check on the declared MSRV` runs. An `--all-targets` clippy can mask an unused import that only tests use; it is not a superset of the plain build. Imported per test module rather than re-added at the top, so the non-test build carries nothing it does not use. Verified both ways: `clippy -p stella-cli --bin stella -- -D warnings` (the build that was failing) and `--all-targets`, plus the 1468 tests. --- crates/stella-cli/src/agent/tools.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/stella-cli/src/agent/tools.rs b/crates/stella-cli/src/agent/tools.rs index e1a35c3e..e8300771 100644 --- a/crates/stella-cli/src/agent/tools.rs +++ b/crates/stella-cli/src/agent/tools.rs @@ -7,10 +7,11 @@ //! ports. use super::*; -use stella_pipeline::{ - ArtifactIdentity, ArtifactKind, CmdKind, DiagnosticInvocation, DiagnosticRunner, - TestInvocation, TestRunner, -}; +// `DiagnosticInvocation`/`DiagnosticRunner` are deliberately absent: the impl +// that used them moved to `super::diagnostics`, and only this file's tests +// still name them. They are imported per test module rather than here so a +// non-test build does not carry an unused import. +use stella_pipeline::{ArtifactIdentity, ArtifactKind, CmdKind, TestInvocation, TestRunner}; /// Apply the cross-crate policy shared by every model/repository-controlled /// subprocess. Kept as a named seam so the CLI's pipeline-only spawns have a @@ -848,6 +849,8 @@ mod tests { atomic::{AtomicUsize, Ordering}, }; + use stella_pipeline::{DiagnosticInvocation, DiagnosticRunner}; + use stella_media::{ CostDecision, ImageRequest, MediaArtifact, MediaCapabilities, MediaError, MediaJob, MediaJobStatus, MediaKind, MediaProvider, MediaSpendGate, MediaSpendRequest, VideoRequest, @@ -1364,7 +1367,7 @@ mod benchmark_tests { #[cfg(test)] mod diff_baseline_tests { use super::*; - use stella_pipeline::DiagnosticInvocation; + use stella_pipeline::{DiagnosticInvocation, DiagnosticRunner}; fn git(root: &std::path::Path, args: &[&str]) { let ok = std::process::Command::new("git")