You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(graph): multi-root reachability for orphan detection
The orphan rule previously computed reachability from a single entry
module, so on a corpus with several CI roots it over-reported: every
module reachable only from a non-`All.agda` root looked orphaned. The
echo-types dogfood made this concrete — 38 orphan hits, most of them
false.
Changes
- `graph::discover_roots` auto-discovers CI roots (`All.agda`/`Smoke.agda`
at any depth); `graph::reachable_from_roots` unions reachability across
them.
- `LintContext.entry_module: &Path` -> `entry_modules: &[PathBuf]`; the
orphan rule flags a module only if it is unreachable from *every* root
and is not itself a root.
- `scan` and `dag` share `resolve_roots_and_rules`: explicit `--entry`
(now repeatable) wins, else auto-discover; if no roots are found the
orphan rule is dropped (with a note) rather than flagging everything.
- `dag` document now carries `entry_modules` (the roots it used).
Verification
- cargo fmt/clippy(-D warnings)/test clean; 21 tests (added a graph unit
test proving union reachability: Used via All + Other via Smoke are
reachable, Orphan via neither is not).
- Re-dogfooded on echo-types (193 modules, 5 discovered roots): orphan
reports drop 38 -> 17 genuine orphans (the experimental/echo-additive
tree incl. VarianceGate.agda, plus standalone scratch files); the
`dag` clean count rises 155 -> 176. postulate/pragma hits unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019GiSiEfgZCte35dyykgBHs
0 commit comments