Skip to content

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

Merged
Helweg merged 2 commits into
Helweg:mainfrom
lisarium:fix/honor-exclude
Aug 20, 2026
Merged

fix: honor exclude globs so matched files are omitted from the index#315
Helweg merged 2 commits into
Helweg:mainfrom
lisarium:fix/honor-exclude

Conversation

@lisarium

@lisarium lisarium commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

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
Contributor 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.

@lisarium
lisarium force-pushed the fix/honor-exclude branch 2 times, most recently from dc59bc3 to 38d5bdb Compare August 20, 2026 11:18
@Helweg Helweg added the bug Bug fix label Aug 20, 2026

@Helweg Helweg left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the current head 38d5bdb: the hidden-parent failed-batch retry regression is covered, all hosted CI checks are green, and no inline review comments are outstanding. Approved.

@Helweg
Helweg marked this pull request as ready for review August 20, 2026 11:39
@Helweg
Helweg merged commit cf5b3c1 into Helweg:main Aug 20, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants