Repository navigation
0.3.3: stop one large file poisoning every audit in a repo - #4
Merged
Merged
Conversation
`git show <tree>:<path>` ran with Node's default 1MB execFileSync buffer. Any tracked file over ~1MB threw ENOBUFS, the catch set oldText to '', and the whole file then read as newly added, attributing all of its pre-existing comments to whatever command happened to run next. In practice a single 2.5MB untracked HTML artifact blocked every Bash call in the repo. Raise the buffer to 256MB and, more importantly, stop treating a failed read as proof the file is new: `git cat-file -e` now decides, and a path that is in the snapshot tree but unreadable is skipped rather than blamed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HB3yGBbL5aiL9m7ZBg9ahM
TAJD
added a commit
that referenced
this pull request
Oct 5, 2026
A heredoc redirect or tee (e.g. cat <<EOF > script.sh) was being flagged the same as sed/perl in-place edits and pre-emptively denied, forcing Edit/Write for a case the existing pre/post snapshot audit already handles correctly. Reported as live friction: it blocked a working script-generation approach mid-task. Rebased onto 0.3.4 (temp-dir exemption + all-targets check); renumbered from 0.3.3, which #4 already used. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcfZR5roFkrPHCxKBUgdoC
TAJD
added a commit
that referenced
this pull request
Oct 5, 2026
A heredoc redirect or tee (e.g. cat <<EOF > script.sh) was being flagged the same as sed/perl in-place edits and pre-emptively denied, forcing Edit/Write for a case the existing pre/post snapshot audit already handles correctly. Reported as live friction: it blocked a working script-generation approach mid-task. Rebased onto 0.3.4 (temp-dir exemption + all-targets check); renumbered from 0.3.3, which #4 already used. Claude-Session: https://claude.ai/code/session_01FcfZR5roFkrPHCxKBUgdoC Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
auditChangesread the pre-command contents of each changed file withgit show <tree>:<path>under Node's default 1MBexecFileSyncbuffer. Any tracked file over roughly 1MB threwENOBUFS, and the barecatchsetoldText = ''— so the file diffed as if every line were newly added, and all of its pre-existing, human-authored comments were attributed to whatever command had just run.Observed in a real repo: one 2.5MB untracked HTML artifact caused every Bash call to be blocked, blaming a file the agent had never touched.
Two changes:
maxBuffer: 256 * 1024 * 1024on thegit showcall.git cat-file -edecides: a path present in the snapshot tree but unreadable is skipped, not blamed. This is the part that actually closes the class, the buffer bump alone just moves the threshold.Test plan
main(audit reports a violation), passes with the fix.npm test— 154 pass, 0 fail.manifests ok.Version bumped to 0.3.3 in
package.jsonandplugin.jsontogether, per the parity gate added in #2.🤖 Generated with Claude Code
https://claude.ai/code/session_01HB3yGBbL5aiL9m7ZBg9ahM