registrystack / registrystack/registry-stack

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

Open
#1,090 0 comments 0 reactions 0 assignees View on GitHub
area:breg bug criticality:p3 triage:needs-implementation
Dominant language
Rust
Stars
2
Forks
0
Avg merge
2h 55m
Merged PRs (30d)
130

Description

`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.

Contributor guide

Open the contributing guide

Research direction

Start with AGENTS.md and reproduce the failure using `cargo clippy -p registry-casework --all-targets -- -D warnings` on clean main. Trace the feature gates and caller relationship between registry-casework and registry-breg, including `erase_expired_action_evidence`, then compare with the workspace lint. Done means the documented per-package command passes without weakening the workspace check, with relevant dependency cases considered.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, developer-experience
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.