feat(drift): filter non-package dependency claims - #186
Open
abhinav-phi wants to merge 1 commit into
Open
Conversation
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
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.
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.jsonand reportedDEPENDENCY_MISSING— fewer false positives wanted, per the issue.What
Three filters, layered after the existing
PACKAGE_NAMEshape check:AWS,REST,JWT) — no package is styled that way.REST API,Database Layer); scoped names (@scope/pkg) keep an explicit exemption since npm scopes contain a slash but never spaces.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 typecheckgreen.