Skip to content

aprender-test-lib fails strict clippy under its own non-default features — the trap that hid probar's dead code #2500

Description

@noahgift

Found while working #2473. Separate from that issue and not fixed in #2497 or #2498.

$ cargo clippy -p aprender-test-lib --all-targets \
    --features browser,docker,llm,proptest,derive,compute-blocks -- -D warnings
rc=101

Five distinct violations, all in files neither open PR touches:

site lint
src/tui/brick.rs:209 only a panic! in if-then statement
src/tui/compute_block.rs:171 only a panic! in if-then statement
src/docker.rs:161 from_str can be confused for std::str::FromStr::from_str
src/llm/report.rs:96 redundant closure
src/llm/score.rs:229 clamp-like pattern without using clamp

plus an unsafe block missing a safety comment in the test targets.

Why nobody noticed

Without the feature flags, the same command is clean. This is the trap already
recorded as project_theater_triage_dark_targets: "clippy --all-targets -p X is
CLEAN while X is broken behind a non-default feature."
browser, docker, llm,
proptest, derive and compute-blocks are all off by default in
aprender-test-lib, and nothing in CI turns them on for a lint pass.

It is the same root cause as the probar findings themselves: code that no
configuration compiles is code nothing checks.
ProbarDriver had only
MockDriver and ActionExecutor had no production impl at all, for years, behind
a feature flag CI never enabled.

Worth noting how this was measured, because it nearly went the other way: my first
run reported 0 errors and I was about to record the finding as unreproducible.
The difference was -- -D warnings. Without it clippy exits 0 and prints warnings;
the repo's actual gate uses -D warnings. A "clean" clippy run that omits the flag
the gate uses is not evidence of anything.

Suggested fix

  1. Fix the five sites — all mechanical, none behavioural.
  2. Add a lint pass over aprender-test-lib with its features enabled to CI, or
    the same five will come back and the next mock-only trait will hide just as
    long.

Related: #2473 (what the dark feature hid), #2495, #2496 (same family — targets
and scans that nothing exercises).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions