Skip to content

package.json dependency lists pollute the domain graph with noisy "dependency" communities #2523

Open

Description

@CrihoJamesB

Problem
Running /graphify . on a real monorepo scans package.json files alongside actual source code. Every entry in dependencies/devDependencies gets extracted as a graph node, producing entire communities that are just npm package lists (e.g. "Config ESLint (devDependencies)", "Dependances API (production)"). On a repo with several package.json files (root + per-workspace), this can account for a meaningful fraction of communities and bury the actual domain architecture the user is trying to explore.

Repro

  • Corpus: TypeScript monorepo (NestJS API + worker + Next.js web + shared package), ~440 files.
  • /graphify . → 139 communities, several of which are pure package.json dependency arrays (e.g. one community with 49/49 members from a single devDependencies block).
  • Re-scoping the corpus to just apps/*/src, packages/*/src, docs/ (manually excluding every package.json) produces a materially cleaner graph (128 communities, zero dependency-list noise) with the same domain communities intact.

Suggested fix (any of)

  1. Exclude manifest/lockfiles (package.json, package-lock.json, pnpm-lock.yaml, yarn.lock, Cargo.lock, ...) from the default corpus, or extract them into a distinct node type excluded from clustering by default.
  2. Add a --code-only / --exclude-manifests flag.
  3. At minimum, document this behavior so users know they need to manually scope paths to avoid it.

Happy to share the two GRAPH_REPORT.md outputs (noisy vs scoped) if useful as a repro fixture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions