Skip to content

fix(drift): treat resolution stubs like ./x as not-paths - #222

Open
dyk1454683243-sudo wants to merge 1 commit into
mex-memory:mainfrom
dyk1454683243-sudo:cursor/fix-hypothetical-paths-not-claims-dcd4
Open

dyk1454683243-sudo wants to merge 1 commit into
mex-memory:mainfrom
dyk1454683243-sudo:cursor/fix-hypothetical-paths-not-claims-dcd4

Conversation

@dyk1454683243-sudo

@dyk1454683243-sudo dyk1454683243-sudo commented Sep 19, 2026

Copy link
Copy Markdown

What

Treat hypothetical / mutual-alternative resolution examples such as `./x`, `x.ts`, and `x/index.ts` as not filesystem path claims, so they never become MISSING_PATH.

isNotAPath now rejects a single-letter basename (optional ./) that is bare, plus a known extension, or plus /index and a known extension. That is the class used in import-resolution prose: (`./x` may be `x.ts` or `x/index.ts`); at most one really exists.

Real files stay claims: src/auth/login.ts, .mex/ROUTER.md, package.json. Compound extensions such as x.d.ts are left for #216. Alternation shorthand (tests/grounding|traversal|…) is owned by #221.

Why

Addresses #202 (bullet 3 only).

Do not treat this as Fixes #202 or Closes #202 — that would auto-close the whole mega-issue.

Other #202 bullets are owned elsewhere and stay out of this PR:

  1. Symbol notation (src/auth/login.validateToken) — owned by fix(drift): treat qualified-name symbol notation as not a path #220
  2. Compound extensions (.d.ts) — owned by fix(drift): treat compound extensions like .d.ts as not-paths #216
  3. Alternation shorthand (tests/grounding|traversal|…) — owned by fix(drift): treat pipe-alternation shorthand as not a path #221 (still a separate PR; this change does not implement it)
  4. Scoped-package resolve (@scope/pkg/package.json vs bare specifier) — owned by fix(drift): resolve scoped packages by bare specifier #217
  5. gitignore trailing-slash directory exemption — owned by fix(drift): honor trailing-slash gitignore rules for absent paths #218

Issue #202 stays open.

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Docs
  • CI/Tooling

How to test

  1. npx vitest run src/drift
  2. Confirm markdown that says (`./x` may be `x.ts` or `x/index.ts`); at most one really exists produces zero path claims and zero MISSING_PATH for those three tokens.
  3. Confirm a real missing file such as src/auth/login.ts is still reported as MISSING_PATH.
  4. Confirm existing MISSING_PATH false positives: negation only heading-scoped, non-path tokens treated as paths, dot-dir glob blind spot #143 cases stay green, and .mex/ROUTER.md / package.json still extract as path claims.
  5. npm run typecheck

Checklist

  • Focused drift tests pass (npx vitest run src/drift — 11 passed, 1 skipped #201 version-shaped case left untouched)
  • Claims extraction tests pass (npx vitest run test/claims.test.ts — 30 passed, including the bullet-3 skip plus preserved real paths)
  • Typecheck passes (npm run typecheck)
  • Tests pass (npm test) — full suite is not the gate for this isNotAPath filter
  • No breaking changes (or documented below)
  • Tested locally with a real project

Code-graph changes

  • This PR targets main
  • A linked issue agrees on the bounded extractor/resolver scope
  • The change follows the frozen LanguageExtractor or FrameworkResolver interface
  • A focused fixture and assertions for the expected node/edge shape are included
  • Any new grammar WASM, extension mapping, extractor, or resolver is registered
  • No graph identity, reconciliation, schema, or drift-semantics changes are included, or a core / discuss-first issue is linked above

This is a drift claim-extraction filter only. It does not change graph identity, extractors, or the other #202 bullets. Issue #202 stays open.

Drop single-letter hypotheticals (`./x`, `x.ts`, `x/index.ts`) before
they become path claims, so mutual-alternative resolution prose no
longer reports MISSING_PATH. Real project paths stay claims.

Co-authored-by: David <dyk1454683243-sudo@users.noreply.github.com>
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