Skip to content

feat(drift): filter non-package dependency claims - #186

Open
abhinav-phi wants to merge 1 commit into
mex-memory:mainfrom
abhinav-phi:feat/claim-filtering
Open

feat(drift): filter non-package dependency claims#186
abhinav-phi wants to merge 1 commit into
mex-memory:mainfrom
abhinav-phi:feat/claim-filtering

Conversation

@abhinav-phi

Copy link
Copy Markdown
Contributor

Resolves #4.

Problem

The claim extractor treated every bold word in a stack/tech section as a dependency claim, so AWS, REST API, and Database Layer were checked against package.json and reported DEPENDENCY_MISSING — fewer false positives wanted, per the issue.

What

Three filters, layered after the existing PACKAGE_NAME shape check:

  1. All-caps words are acronyms (AWS, REST, JWT) — no package is styled that way.
  2. Multi-word phrases are descriptive labels (REST API, Database Layer); scoped names (@scope/pkg) keep an explicit exemption since npm scopes contain a slash but never spaces.
  3. A curated architectural-label blocklist (frontend, backend, middleware, auth, gateway, ...) as the complement the issue describes — the patterns cannot catch a single-word label like "Frontend".

Design note per the issue's framing: this stays pattern-based (zero-config), not structured output; the maintainer's earlier comment on this issue settled that direction.

Tests

Four new cases in test/claims.test.ts: acronyms dropped, multi-word phrases dropped, architectural labels dropped while real packages (Express, @scope/pkg) and mixed-case names (pino-http) survive. All 30 claims tests pass; npm run typecheck green.

Every bold word in a stack/tech section became a dependency claim, so
AWS, REST API, and Database Layer were checked against package.json and
reported DEPENDENCY_MISSING — warnings the author cannot act on.

Three structural filters now run after the existing name-shape check:
all-caps words (acronyms), multi-word phrases (descriptive labels —
scoped names like @mex/core keep their spacing exemption), and a
curated architectural-label blocklist (frontend, middleware, auth...).
Structural rules first, blocklist as the complement — real packages
never collide with the labels because npm names like 'api' are far
rarer in stack docs than the false positives they prevent.

Resolves mex-memory#4
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.

Smarter filtering for non-package dependency claims

1 participant