fix(git_discovery): collect all nested modules subtrees, not just the last (#211)#248
fix(git_discovery): collect all nested modules subtrees, not just the last (#211)#248SAY-5 wants to merge 2 commits intoTrueNine:devfrom
Conversation
Fix two CI failures from previous merge
… last Closes TrueNine#211. `find_git_module_info_dirs::walk` tracked the nested \`modules\` dir in a single \`Option<PathBuf>\`, so a directory listing that yielded more than one entry whose \`file_name()\` matched \`modules\` would keep only the last one walked. The case is unusual on case-sensitive filesystems but reachable on case-insensitive ones (macOS / NTFS) where \`modules\` and \`Modules\` can collide as dir entries from different writers, and a future relax of the equality match (icase, alt names) would silently start dropping subtrees. Replace the \`Option<PathBuf>\` with a \`Vec<PathBuf>\` and walk each collected nested-modules dir in turn. The \`return\` on the inner \`fs::read_dir\` error becomes a \`continue\` so a single unreadable nested dir no longer aborts the walk for sibling subtrees in the same parent. `cargo test --lib policy::git_discovery` is green (3/3, including \`test_find_git_module_info_dirs_finds_nested_submodules\`).
|
Not supported. In our model, each scan is effectively a full check, and the downstream aindex is treated as a complete, whole artifact rather than something incrementally repairable. Continuing after failure would allow partial traversal to leak through as if the result were still valid, which breaks the semantic guarantee of aindex completeness. For that reason, preserving fail-closed behavior here is intentional unless we explicitly redesign the contract around partial results. |
|
Not supported. In our model, each scan is effectively a full check, and the downstream aindex is treated as a complete, whole artifact rather than something incrementally repairable. Continuing after read_dir() failure would allow partial traversal to leak through as if the result were still valid, which breaks the semantic guarantee of aindex completeness. For that reason, preserving fail-closed behavior here is intentional unless we explicitly redesign the contract around partial results. |
|
Merged into dev via cherry-pick. The PR base was changed from main to dev, which caused conflicts because dev had diverged significantly. All commits have been cherry-picked onto dev and pushed. Thanks for the contributions! |
|
Thank you for the contribution! All commits have been cherry-picked and merged into the dev branch. 🙏 |
Closes #211.
find_git_module_info_dirs::walktracked the nestedmodulesdir in a singleOption<PathBuf>, so a directory listing that yielded more than one entry whosefile_name()matchedmoduleswould keep only the last one walked. The case is unusual on case-sensitive filesystems but reachable on case-insensitive ones (macOS / NTFS) wheremodulesandModulescan collide as dir entries from different writers, and a future relax of the equality match (icase, alt names) would silently start dropping subtrees.Fix
Replace the
Option<PathBuf>with aVec<PathBuf>and walk each collected nested-modules dir in turn. Thereturnon the innerfs::read_direrror becomes acontinueso a single unreadable nested dir no longer aborts the walk for sibling subtrees in the same parent.Test plan
cargo build --manifest-path sdk/Cargo.toml— cleancargo test --manifest-path sdk/Cargo.toml --lib policy::git_discovery— 3/3 pass (includingtest_find_git_module_info_dirs_finds_nested_submodules)