Skip to content

Per-package clippy for registry-casework fails on unused registry-breg evidence-retention code #1090

Description

@jeremi

AGENTS.md tells contributors to lint the crate they changed. For Casework that command does not currently work, on clean main, before any change:

cargo clippy -p registry-casework --all-targets -- -D warnings

It fails inside registry-breg, not in Casework:

  • unused import: action::erase_expired_action_evidence
  • function erase_expired_action_evidence is never used

Why it happens

Cargo feature unification. Selecting only registry-casework resolves a narrower feature set for the transitively built registry-breg than a workspace build does, and under that narrower set nothing calls erase_expired_action_evidence, so it becomes dead code and -D warnings fails the build.

Why CI is green

The workspace-wide lint is clean:

cargo clippy --locked --workspace --all-targets -- -D warnings   # passes

because another crate in the workspace turns the relevant feature on. Root CI runs the workspace form, so nothing is broken today. This is latent rather than breaking, which is exactly why it has gone unnoticed.

Why it is still worth fixing

The per-package command is the one AGENTS.md documents, and it is what a contributor touching a single crate will reach for. Hitting a failure in a crate they did not touch costs them time working out whether they caused it. I lost that time today and confirmed it was pre-existing by stashing my changes and re-running against pristine main.

Reproduce

From a clean checkout of main, with no local modifications:

cargo clippy -p registry-casework --all-targets -- -D warnings

Confirmed on 2026-09-15.

Possible fixes

Not a recommendation, just the shape of the options:

  1. Gate the import and the function behind the same feature that gates its caller, so the narrow selection compiles neither.
  2. Give registry-breg a feature that the Casework dependency edge enables, so the caller is always present when the function is.
  3. Decide the per-package command in AGENTS.md is not supported for crates with this dependency shape, and say so there instead.

Worth noting that the underlying pattern is not unique to this pair, so whichever fix is chosen, it is worth checking whether other per-package lint invocations in AGENTS.md have the same problem.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions