Repository navigation
fix(workspaceindex): skip common build-cache dirs (target, __pycache__, .venv, ...) - #6
Merged
FabioLeitao merged 3 commits intoOct 2, 2026
Conversation
…_, .venv, ...)
ShouldSkipDir's denylist was missing several directory names that are build
output or cache in virtually every ecosystem, so the fixed MaxFiles scan
budget was burned on them before reaching real source. Against a real
multi-crate Rust repo, rust/*/target/debug/.fingerprint/* alone produced 308
.d/.rlib/.rmeta/.timestamp files that outranked the actual source file a
repo-map query was looking for (15/15 top results were build-cache noise,
zero real source).
Adds: target, __pycache__, .venv, venv, .pytest_cache, .terraform,
.mypy_cache, .ruff_cache.
Regression tests: ShouldSkipDir unit coverage for the new names (incl.
case/whitespace-insensitivity) plus an end-to-end Scan() case reproducing
the target/debug/.fingerprint/* scenario.
Verified locally: go test (fails without the fix, for the claimed reason;
passes with it), go vet, gosec (0 issues), govulncheck (no vulnerabilities),
gitleaks (no leaks), go run ./cmd/zero-release build + smoke (pass), git diff
--check. golangci-lint lint-static reports 4 pre-existing staticcheck findings
in internal/proxydial and internal/tools, both untouched by this change --
left alone per AGENTS.md ('unrelated pre-existing advisory findings do not
justify expanding a focused pull request').
Reported upstream as Twigpine#1108 (repo
renamed from Gitlawb/zero). Will follow CONTRIBUTING.md's community-PR
process (parent issue + issue-approved label) before opening a PR against
upstream; this commit lands on the fork in the meantime.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012f6peupAXjUTeqdEZKFh7e
Zero automated PR reviewVerdict: No blockers found Blockers
Validation
ScopeHead: This deterministic review checks validation status and basic diff hygiene. A human reviewer still owns product judgment and design quality. |
TestScanDoesNotFollowSymlinkedDirectories used a real directory called 'target' as the symlink destination. workspaceindex.ShouldSkipDir now (correctly) skips 'target' (Cargo build output), so the real directory was skipped and the test failed on 'want [main.go target/hidden.go]'. The directory name is incidental to what the test checks (a symlink must not be followed; the real dir must be scanned), so rename it to 'real-dir'. Caught by comparing 'go test ./...' on main against this branch: no new failures remain; the other six failures are identical on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012f6peupAXjUTeqdEZKFh7e
FabioLeitao
added a commit
that referenced
this pull request
Oct 5, 2026
… ShouldSkipDir untouched Replaces fork PRs #6/#7 with fix/1108-scan-ignored-dirs, the shape the maintainer approved on Twigpine#1108: git's ignored set inside a work tree, a fixed build/cache list only outside one, both confined to workspaceindex.Scan so glob, grep, list_directory and autocomplete keep seeing target/, .venv/ and friends. Conflicts resolved to the rework; workspaceindex, repomap test and workspaceseed now match that branch.
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.
What
ShouldSkipDir's denylist was missing several directory names that are buildoutput or cache in virtually every ecosystem (
target,__pycache__,.venv/venv,.pytest_cache,.terraform,.mypy_cache,.ruff_cache),so the fixed
MaxFilesscan budget could be burned on them before reachingreal source.
Why / evidence
Against a real multi-crate Rust repo,
rust/*/target/debug/.fingerprint/*alone produced 308
.d/.rlib/.rmeta/.timestampfiles. Concretely:Tests
ShouldSkipDirunit coverage for the new names (incl. case/whitespace-insensitivity)Scan()case reproducing thetarget/debug/.fingerprint/*scenarioShouldSkipDir("target")=false want true)Verification (AGENTS.md §3)
make fmt-checkmake vetgo test ./internal/workspaceindex/...(and full regression-proof cycle)go run ./cmd/zero-release buildgo run ./cmd/zero-release smokegosec ./internal/workspaceindex/...— 0 issuesgovulncheck ./internal/workspaceindex/...— no vulnerabilitiesgitleaks detect --no-git— no leaksgit diff HEAD --check— cleanmake lint-static— reports 4 pre-existingstaticcheckfindings ininternal/proxydialandinternal/tools, both untouched by this change. Left alone per AGENTS.md §3/§4 ("unrelated pre-existing advisory findings do not justify expanding a focused pull request").Upstream
Reported as Twigpine#1108 (repo renamed from
Gitlawb/zero— confirmed viagh api, not just the redirect). This PRtargets my own fork for now; I'll open the upstream PR once/if that issue
gets the
issue-approvedlabel, perCONTRIBUTING.md's community-PR process.🤖 Generated with Claude Code
https://claude.ai/code/session_012f6peupAXjUTeqdEZKFh7e