The rust-tests pre-push lane ran `just test-unit` (11 nextest
invocations, ~460s) on every push that touched any crate. For
single-crate branches this was unnecessary; the full suite routinely
exceeded the 10-minute MCP shell cap, leaving agents unable to push.
Replace the bare `just test-unit` with scripts/rust-tests-selective.sh
(Variant A: path→crate mapping, no dependency graph). The script:
- Maps changed paths under crates/<name>/ or examples/<name>/ to
their package names and runs only those packages' test suites.
- Falls back to the full `just test-unit` battery for any full-battery
trigger (Cargo.lock, root Cargo.toml, rust-toolchain.toml, deny.toml,
Justfile, scripts/run-tests.sh, migrations/**, schema/**), any
unmapped path, a missing cargo-nextest, or any script error.
- Preserves per-package invocation shapes exactly: buzz-auth runs
nextest --lib plus cargo test --doc; buzz-conformance and buzz-cli
run all targets; buzz-relay uses the scoped api::admin filter.
- Enforces a drift guard: PACKAGE_TABLE keys must exactly match the
CANONICAL_PACKAGES list; a mismatch falls back to the full battery.
The desktop-tauri-checks lane is intentionally left coarse-grained this
round — scoping it requires the tauri workspace transitive path-dep
closure, which depends on the dependency-graph machinery deferred per
Will's direction. This is noted in lefthook.yml.
CI (dorny/paths-filter + cargo clippy --workspace --all-targets) remains
the authoritative gate; the local lane is a fast pre-filter only.
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>