Skip to content

fix: treat vendored and build dirs as a single trim candidate - #40

Merged
royalpinto007 merged 2 commits into
AgentPostmortem:mainfrom
sharadvc:fix/skip-vendored-dirs
Sep 18, 2026
Merged

royalpinto007 merged 2 commits into
AgentPostmortem:mainfrom
sharadvc:fix/skip-vendored-dirs

Conversation

@sharadvc

Copy link
Copy Markdown
Contributor

Fixes #3

The walker only skipped .git, so it descended into node_modules/, dist/, build/, etc. and fully read every file inside (up to 5 MB each) before classifying them as trimmable.

Change

  • The walker now consults the same VENDOR_DIRS / BUILD_DIRS lists the classifier uses, before recursing.
  • A vendored/build directory is recorded once by name, sized from a cheap stat walk (no content reads), and never descended into.
  • Directory-level category is decided by directory name, not by reading contents (documented in the README).

Acceptance criteria

  • scanRepo on a fixture containing node_modules/ does not read any file inside it (readFileSync/openSync/readSync are never called for those files).
  • Emitted patterns and byCategory totals are unchanged on the sample fixture (verified byte-identical).
  • README notes that directory-level categories are decided by name.

Tests: 26/26 pass (node --test). Version bumped 0.1.14 → 0.1.16 with a CHANGELOG entry.

This contribution was made with AI assistance (Claude).

sharadvc and others added 2 commits September 17, 2026 08:41
Don't descend into or read files in node_modules/vendor/dist/build
directories. Record the directory once by name, sized from a cheap
stat walk, so pattern output and byCategory totals are unchanged.

Closes #3
@royalpinto007
royalpinto007 merged commit a86b9db into AgentPostmortem:main Sep 18, 2026
1 check passed
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.

The walker descends into node_modules and reads every file before deciding it is vendored

2 participants