Skip to content

fix(drift): treat compound extensions like .d.ts as not-paths - #216

Open
dyk1454683243-sudo wants to merge 1 commit into
mex-memory:mainfrom
dyk1454683243-sudo:cursor/fix-extension-only-compound-dts-167d
Open

dyk1454683243-sudo wants to merge 1 commit into
mex-memory:mainfrom
dyk1454683243-sudo:cursor/fix-extension-only-compound-dts-167d

Conversation

@dyk1454683243-sudo

Copy link
Copy Markdown

What

Widen EXTENSION_ONLY so compound file-extension tokens such as `.d.ts`, `.d.mts`, and `.d.cts` are treated as extension-only prose and never become path claims.

The previous pattern /^\.[A-Za-z0-9]+$/ matched .ts / .yaml but not extra dotted segments. Inline `.d.ts` still hit KNOWN_EXTENSIONS (ends with .ts) and was not filtered by isNotAPath, so the SDK prose example in #202 became MISSING_PATH twice.

Real paths with extensions stay claims: src/index.ts, .mex/ROUTER.md, .github/workflows/ci.yml.

Why

Addresses #202 (bullet 2 only).

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

Remaining #202 bullets stay open for follow-ups:

  1. Symbol notation (src/auth/login.validateToken)
  2. Hypothetical examples (./x, x.ts, x/index.ts)
  3. Alternation shorthand (tests/grounding\\|traversal\\|…)
  4. Scoped-package resolve (@scope/pkg/package.json vs bare specifier)
  5. gitignore trailing-slash directory exemption

Type of change

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

How to test

  1. npx vitest run src/drift
  2. Confirm `.d.ts` / `.d.mts` / `.d.cts` produce zero path claims and zero MISSING_PATH.
  3. 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 real extension paths (src/index.ts, .mex/ROUTER.md, .github/workflows/ci.yml) are still checked.
  4. npm run typecheck

Checklist

  • Focused drift tests pass (npx vitest run src/drift — 12 passed, 1 skipped #201 version-shaped case left untouched)
  • Typecheck passes (npm run typecheck)
  • Tests pass (npm test) — full suite is not the gate for this one-regex change
  • 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.

Widen EXTENSION_ONLY so `.d.ts` / `.d.mts` / `.d.cts` are extension-only
prose instead of MISSING_PATH claims. Real paths with extensions stay
checked. Addresses mex-memory#202 bullet 2 only.

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