diff --git a/CLAUDE.md b/CLAUDE.md index 24719bf..12847b0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -34,7 +34,7 @@ fastest of several serial runs; see the file's module docs for why. - `selection.rs` — Shared between `run`, `status`, and `collect --diff`. Owns reachability classification (`check_shas_reachable`), per-sha diff collection (`changed_ranges_per_sha`), the divergence notice, and the selection itself: affected + config + new + stranded, where config hits (from `config.rs`) are a disjoint category that never inflates the coverage-overlap counts. - `config.rs` — Declarative input→test rules from `[workspace.metadata.affected]` (or `[package.metadata.affected]` for single-crate projects). Each `[[rule]]` pairs input globs with a nextest filterset; when a changed path matches, `cargo nextest list -E` resolves the filterset and those tests are force-selected. Closes the blind spot where a test reads a non-Rust file at runtime (an insta `.snap`, a doc `.md`) that has no coverage row, so a change to it would otherwise select no test. No rules means no extra `nextest list` call. - `plan.rs` — The decision `run` and `status` share, held in one place so a dry run can't predict something other than what runs: list tests, diff against every reachable `collect_sha`, apply config rules, select, classify `hit-exact` vs `hit-with-divergence`, and assemble either report shape. It was two hand-maintained copies annotated "mirrors the other", and they had drifted — `run` listed with the caller's build flags while `status` listed with none, so a feature-gated test was invisible to `status` and visible to `run`. `run.rs` and `status.rs` now hold only what differs for real: which stream, which tense, and whether anything gets executed at the end. -- `run.rs` — `collect_shas` → reachability → [`plan`] → `nextest run` against the generated filter config. Widens to all tests only when every sha is diverged. +- `run.rs` — `collect_shas` → reachability → [`plan`] → `nextest run` against the generated filter config. Widens to all tests only when no `collect_sha` is reachable (all missing from the repo); a reachable-but-diverged sha keeps the partial selection (`hit-with-divergence`). - `status.rs` — The conditional-tense rendering of the same plan, plus a database inventory on stdout. Takes the same post-`--` passthrough as `run`, because the build flags decide which tests exist to predict about. ## Principles