fix(drift): honor trailing-slash gitignore rules for absent paths - #218
Open
dyk1454683243-sudo wants to merge 1 commit into
Open
dyk1454683243-sudo wants to merge 1 commit into
dyk1454683243-sudo wants to merge 1 commit into
Conversation
Git check-ignore cannot classify a path that does not exist, so directory-only rules like local/ never matched .mex/local on a clean checkout — the only case MISSING_PATH can fire. Also ask about the directory form and ignored parent prefixes so a deliberately ignored path stays exempt whether or not it exists. Addresses mex-memory#202 (bullet 6 only). Co-authored-by: David <dyk1454683243-sudo@users.noreply.github.com>
This was referenced Sep 19, 2026
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
Honor directory-only gitignore rules when collecting ignored paths for
MISSING_PATH.collectIgnoredPathsasked Git viagit check-ignore --stdin. Trailing-slash patterns such aslocal/match directories only, and Git cannot classify a path that does not exist. On a clean checkout.mex/localwas therefore not ignored — yet that is the only caseMISSING_PATHcan fire (when the directory is present,existsSyncalready skips).graph.db*already escaped because it is a glob with no trailing slash.The ignore-collection path now also asks Git about:
.mex/local/)The original claim is treated as ignored when any of those queries match. Real missing non-ignored paths still error.
Why
Addresses #202 (bullet 6 only).
Do not treat this as
Fixes #202orCloses #202— that would auto-close the whole mega-issue.Remaining #202 bullets stay open for follow-ups:
src/auth/login.validateToken).d.ts) — owned by fix(drift): treat compound extensions like .d.ts as not-paths #216./x,x.ts,x/index.ts)tests/grounding|traversal|...)@scope/pkg/package.jsonvs bare specifier) — owned by fix(drift): resolve scoped packages by bare specifier #217Type of change
How to test
npx vitest run src/driftnpx vitest run test/checkers.test.ts.mex/local(and a path under it) is notMISSING_PATHwhenlocal/is in.mex/.gitignore..mex/graph.db/graph.db*stay exempt..mex/local/case still reportsMISSING_PATH.npm run typecheckChecklist
npx vitest run src/drift— 15 passed, 1 skipped#201version-shaped case left untouched)npx vitest run test/checkers.test.ts— 111 passed, including absentlocal/exemption, present ignored path, non-ignored missing path, andgraph.db*)npm run typecheck)npm test) — full suite is not the gate for this ignore-collection changeCode-graph changes
mainLanguageExtractororFrameworkResolverinterfacecore / discuss-firstissue is linked aboveThis is a drift path-ignore check only. It does not change graph identity, extractors, or the other #202 bullets.