-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Current Behavior
When running `chainsaw trace --cut nonexistent-pkg`, the CutReport has `direct_import: true` even though the target does not exist in the graph. This is because the condition `cuts.is_empty() && chains.iter().all(|c| c.len() == 2)` evaluates to true when chains is empty (vacuous truth of `all()` on empty iterator).
Expected Behavior
When the target is not found in the graph (no chains), `direct_import` should be `false`. The report should indicate the target was not found, not that it's a direct import.
Context
This produces misleading output telling users to "remove the import" for a package that doesn't even exist in the graph.
Technical Details
Relevant Code
`src/session.rs:498`
```rust
direct_import: cuts.is_empty() && chains.iter().all(|c| c.len() == 2),
```
When `chains` is empty, `all()` returns `true` (vacuous truth), and `cuts.is_empty()` is also `true`, so `direct_import` is incorrectly `true`.