Repository navigation
fix(cli): refuse an implicit home root and cap omissions - #3
Merged
Merged
Conversation
An agent session runs with the working directory set to the user's home, so selecting the current directory as the project walked ~2.4M files, ran past any subprocess timeout, and produced no output at all. Refuse an implicit root that is a home directory or the filesystem root, naming the fix in the error. An explicit --root keeps selecting whatever the caller asks for. A wide root also omits one entry per skipped file: a status envelope for /tmp carried 22,933 entries and 9 MB of JSON, and both the project and cached lists duplicated it. Cap each reported omission list at 256 entries, keep the full count in omittedFiles / omitted_files (new on IndexOutput, so the index report no longer implies its total by list length), and mark a capped list with omissionsTruncated. Human output names the truncation and reports the index total from the count instead of the list.
farhan-syah
requested changes
Oct 4, 2026
farhan-syah
left a comment
Member
There was a problem hiding this comment.
The accidental home scan and oversized omission envelopes deserve this focused change. The Windows home guard needs correction before merging. Preserve complete reason totals when truncating diagnostic entries.
Checks pass on Linux:
cargo test -p code2graph-cli --offline: 253 unit tests and 20 integration tests.cargo fmt --all -- --check.cargo clippy -p code2graph-cli --all-targets --offline -- -D warnings.
The Windows finding follows the documented canonical path representation. I did not run Windows tests locally.
farhan-syah
approved these changes
Oct 4, 2026
farhan-syah
left a comment
Member
There was a problem hiding this comment.
Both review findings are resolved.
| Finding | Resolution |
|---|---|
| Canonical home comparison | Home and cwd now use canonical paths. Explicit selection bypasses home discovery. |
| Full omission reason counts | Index and status retain complete reason totals while diagnostic entries remain capped at 256. |
Regression coverage checks actual selection paths, Windows prefixes, and mixed reasons outside the entry cap.
Checks:
- All nine CI jobs pass, including Linux, macOS, and Windows tests.
- Local CLI tests pass: 255 unit tests and 20 integration tests.
- Formatting, CLI lint, and documentation checks pass.
5 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
An agent session runs with the working directory set to the user's home, so selecting the current directory as the project walked ~2.4M files, ran past any subprocess timeout, and produced no output at all.
A wide root also omits one entry per skipped file: a status envelope for
/tmpcarried 22,933 entries and 9 MB of JSON, and both the project and cached lists duplicated it.What
--rootstill selects whatever the caller asks for.omittedFiles/omitted_files(new onIndexOutput), and mark a capped list withomissionsTruncated.Tests
implicit_cwd_root_refuses_home_and_filesystem_root_only(cli/src/project/select.rs)omission_entry_lists_are_capped_while_the_truncation_is_reported(cli/src/result.rs)cargo test -p code2graph-cli— 20 pass