Skip to content

fix(map): read only the first 64 KB of each file - #1391

Open
daviorlando wants to merge 1 commit into
DietrichGebert:mainfrom
daviorlando:fix/map-read-head
Open

daviorlando wants to merge 1 commit into
DietrichGebert:mainfrom
daviorlando:fix/map-read-head

Conversation

@daviorlando

Copy link
Copy Markdown

buildMap now reads only the first 64 KB of each file through a file descriptor, instead of reading the whole file and slicing it. The result is the same: names in the head are listed and anything past 64 KB was already cut.

Added a case to tests/map.test.js: a 70 KB file whose head export is listed and whose tail export is not. npm test, check-rule-copies and check-versions pass. The only failure is the pandas CSV case, which fails because pandas isn't installed locally, same as on main.

Fixes #1390

🤖 Generated with Claude Code

A tracked multi-MB bundle outside dist/ or build/ was read whole on every
SessionStart and then cut to 64 KB, which can push the map past its 3 s
timeout in large repos.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.

Codebase map reads every candidate file whole to keep 64 KB

1 participant