Skip to content

fix: honor exclude globs so matched files are omitted from the index - #315

Draft
lisarium wants to merge 1 commit into
Helweg:mainfrom
lisarium:fix/honor-exclude
Draft

fix: honor exclude globs so matched files are omitted from the index#315
lisarium wants to merge 1 commit into
Helweg:mainfrom
lisarium:fix/honor-exclude

Conversation

@lisarium

@lisarium lisarium commented Aug 19, 2026

Copy link
Copy Markdown

Summary

Config exclude globs were recorded as skipped but still indexed, because walkDirectory continued only the inner pattern loop. Matching files (and stale failed-batch retries for those paths) are now omitted from the index.

Changes

  • Skip files as soon as an exclude glob matches in collectFiles / walkDirectory, instead of falling through to include matching.
  • Skip walking directories covered by /** exclude globs (for example **/common/**).
  • Drop stale failed-batch retries for newly excluded paths on incremental /index and retryFailedBatches.
  • Document the behavior and add unit/indexer coverage.

Testing

How were these changes tested?

  • Unit tests added/updated
  • Manual testing performed
  • Build passes (npm run build)
  • Typecheck passes (npm run typecheck)
  • Tests pass (npm run test:run)
  • Lint passes (npm run lint)

Release Labels

  • Added at least one release category label (feature, bug, performance, documentation, dependencies, refactor, test, chore, or skip-changelog)
  • Added at most one semver label (semver:major, semver:minor, or semver:patch) when needed

Labels: bug

Related Issues

No tracked issue.

@lisarium

lisarium commented Aug 19, 2026

Copy link
Copy Markdown
Author

@Helweg Hi, could you please approve the first-time-contributor workflows and add bug label to this PR?

@Helweg

Helweg commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Review finding

isStoredPathExcluded() now checks the absolute storedPath against config globs before normalizing project-owned paths relative to the project (src/indexer/index.ts:1268-1271). In global scope, the default **/.*/** can match a hidden parent directory such as /Users/me/.work/project, so valid failed batches are silently discarded instead of retried.

Please normalize project-owned absolute paths before glob matching, then add coverage for a project beneath a hidden directory. I verified the regression: the PR fails 5 affected failed-batch cases, while main passes 28/28 in the same setup. Build, CLI smoke test, native build, typecheck, and lint pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants