Repository navigation
fix: keep generated files and project paperwork out of the code index - #133
PatrickSys wants to merge 7 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR changes which files become searchable across indexed projects. Restore indexing of source inside initialized submodules before merging. Findings
SummaryThe PR uses Git's tracked and non-ignored file list to select source, adds index-only exclusions, and wires
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Project files] --> B[Normal include patterns]
B --> C[Built-in and project exclusions]
C --> D[Git tracked and non-ignored files]
A --> E[Explicit includeExcluded patterns]
D --> F[File type, binary, size, and path checks]
E --> F
F --> G[Search index]
Reviews (1) · Last reviewed commit: "fix: isolate Git repository context for ..." · Reviewed by Greptile |
| } | ||
|
|
||
| return new Promise((resolve, reject) => { | ||
| const git = spawn('git', ['ls-files', '-co', '--exclude-standard', '-z'], { |
There was a problem hiding this comment.
When indexing a repository with initialized submodules, git ls-files -co --exclude-standard lists each submodule directory, not the files inside it. The new membership check then drops those source files even though the existing scan finds them. Previously indexed submodule code disappears from search.
Discover eligible files inside submodules too, while honoring their own ignore rules.
Knowledge Base Used: Codebase indexing
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5e36fd7f2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| absolute: true, | ||
| ignore: excludePatterns, | ||
| ignore: selection.explicit ? [] : excludePatterns, | ||
| dot: selection.explicit || gitFiles !== null, |
There was a problem hiding this comment.
Prune ignored hidden directories before globbing
In a Git repository containing an ignored hidden dependency tree such as a Python .venv, enabling dot makes every include glob descend through that entire directory before the Git membership check at line 1192 discards its files. A typical virtual environment contains tens of thousands of matching .py files, so default indexing can consume substantial time and memory even though none are eligible; the 10,000-file limit is applied only after this scan. Drive the scan from the Git file set or otherwise prune Git-ignored directories during traversal.
AGENTS.md reference: AGENTS.md:L108-L108
Useful? React with 👍 / 👎.
| } | ||
|
|
||
| return new Promise((resolve, reject) => { | ||
| const git = spawn('git', ['ls-files', '-co', '--exclude-standard', '-z'], { |
There was a problem hiding this comment.
Preserve source from checked-out submodules
When the selected root is a superproject with an initialized submodule, this command returns the submodule's gitlink path but not paths such as submodule/src/file.ts; the subsequent glob finds those files and the membership check rejects every one, whereas the previous scanner indexed them. Git documents -c as listing cached index entries and submodule recursion as separate behavior, with recursion unsupported in the combined -o mode used here (git-ls-files documentation), so active submodules need separate discovery if their checked-out source is to remain searchable.
Useful? React with 👍 / 👎.
| ...(projectConfig?.includeExcluded | ||
| ? { includeExcluded: projectConfig.includeExcluded } | ||
| : {}) |
There was a problem hiding this comment.
Apply CLI excludePatterns before explicit opt-ins
When a project config combines excludePatterns with a narrow includeExcluded override—for example, excluding generated/** while restoring generated/keep.ts—codebase-context reindex forwards only the opt-in. Because the indexer never receives the custom exclusion, the normal scan admits every file under generated/, not just the restored file, unlike MCP indexing and the documented configuration contract. Forward projectConfig.excludePatterns in this CLI configuration as well.
AGENTS.md reference: AGENTS.md:L112-L112
Useful? React with 👍 / 👎.
Parked for this release.
The current scanner misses source inside checked-out Git submodules.
Review also found that ignored hidden dependency folders are walked before their files are filtered.
The new submodule test fails, so this change is not ready to merge.
The earlier source-selection and Git-isolation tests pass, but they do not cover this failure.