Problem
cargo build -p stella-cli --bin stella — the build make gate runs to produce the
binary for scripts/test-self-driving.sh — emits:
warning: unused imports: `DiagnosticInvocation` and `DiagnosticRunner`
--> crates/stella-cli/src/agent/tools.rs:11:46
|
11 | ArtifactIdentity, ArtifactKind, CmdKind, DiagnosticInvocation, DiagnosticRunner,
Both names are dead in the non-test build:
DiagnosticRunner (the trait) is imported but never implemented here —
rg 'impl .*for GitDiagnosticRunner' crates/stella-cli/src/agent/tools.rs finds
nothing. GitDiagnosticRunner::run_diagnostic is an inherent method, so the trait
needs no import for the calls to resolve.
DiagnosticInvocation is named only inside #[cfg(test)] code (tools.rs:1096,
tools.rs:1410), and that test module already re-imports it for itself at
tools.rs:1367.
Why no gate catches it
This is the shape of #2045: cargo clippy --all-targets compiles the test targets,
where cfg(test) code does use DiagnosticInvocation, so the import is live in
every configuration clippy builds and clippy stays green. Only a build that excludes
tests — the shipping binary — sees it. The gate runs that build, but as a plain
cargo build without -D warnings, so the warning scrolls past and nothing fails.
Two things are worth deciding separately:
- the dead import itself (trivial), and
- whether the gate should compile the shipping binary under
-D warnings, which
is the only configuration that can catch this class at all.
Files
crates/stella-cli/src/agent/tools.rs:11 — the import
crates/stella-cli/src/agent/tools.rs:1367 — the test module's own import
Makefile — the self-driving-test step's cargo build -q -p stella-cli --bin stella
Repro
cargo build -p stella-cli --bin stella 2>&1 | rg -A 4 'unused imports'
Green (masks it):
cargo clippy -p stella-cli --all-targets -- -D warnings
Definition of done
cargo build -p stella-cli --bin stella is warning-free.
- The gate fails if a future import goes dead the same way — e.g. the
self-driving-test step's binary build carries RUSTFLAGS="-D warnings", or a
dedicated step builds the shipping binary under it. Whichever is chosen, add a
witness: revert the import removal and confirm the gate step goes red.
cargo clippy --workspace --all-targets -- -D warnings still passes.
Constraints
crates/stella-cli/src/agent/tools.rs is not itself a god file, but
crates/stella-cli/src/agent.rs and src/agent/tests.rs are — keep any new code
out of those (AGENTS.md § God files).
- Found while working in
stella-observatory; the branch that noticed it touches no
stella-cli file, so this is inherited from main (6bc6a072), not introduced.
Problem
cargo build -p stella-cli --bin stella— the buildmake gateruns to produce thebinary for
scripts/test-self-driving.sh— emits:Both names are dead in the non-test build:
DiagnosticRunner(the trait) is imported but never implemented here —rg 'impl .*for GitDiagnosticRunner' crates/stella-cli/src/agent/tools.rsfindsnothing.
GitDiagnosticRunner::run_diagnosticis an inherent method, so the traitneeds no import for the calls to resolve.
DiagnosticInvocationis named only inside#[cfg(test)]code (tools.rs:1096,tools.rs:1410), and that test module already re-imports it for itself attools.rs:1367.Why no gate catches it
This is the shape of #2045:
cargo clippy --all-targetscompiles the test targets,where
cfg(test)code does useDiagnosticInvocation, so the import is live inevery configuration clippy builds and clippy stays green. Only a build that excludes
tests — the shipping binary — sees it. The gate runs that build, but as a plain
cargo buildwithout-D warnings, so the warning scrolls past and nothing fails.Two things are worth deciding separately:
-D warnings, whichis the only configuration that can catch this class at all.
Files
crates/stella-cli/src/agent/tools.rs:11— the importcrates/stella-cli/src/agent/tools.rs:1367— the test module's own importMakefile— theself-driving-teststep'scargo build -q -p stella-cli --bin stellaRepro
Green (masks it):
Definition of done
cargo build -p stella-cli --bin stellais warning-free.self-driving-teststep's binary build carriesRUSTFLAGS="-D warnings", or adedicated step builds the shipping binary under it. Whichever is chosen, add a
witness: revert the import removal and confirm the gate step goes red.
cargo clippy --workspace --all-targets -- -D warningsstill passes.Constraints
crates/stella-cli/src/agent/tools.rsis not itself a god file, butcrates/stella-cli/src/agent.rsandsrc/agent/tests.rsare — keep any new codeout of those (AGENTS.md § God files).
stella-observatory; the branch that noticed it touches nostella-clifile, so this is inherited frommain(6bc6a072), not introduced.