Repository navigation
fix(scripts): tree-scaled git listings in two gate scripts read past the 1 MiB default buffer - #39027
Merged
objectstack-fleet[bot] merged 1 commit intoDec 2, 2026
Conversation
check-closed-ceremony-text read `git ls-files -z -- packages content/docs .changeset` into node's 1 MiB default stdout buffer; the listing is 1,048,565 bytes on main, so one added path kills the gate with ENOBUFS. Spawn it with the 64 MiB ceiling dispatch-gates already uses, and pin a fixture index past 1 MiB in --self-test with an ENOBUFS control. affected-docs' sh() wrapper had the same default; its self-test's `git ls-files packages` is 953,424 bytes, and its `git show` readers caught ENOBUFS as "file absent". Same ceiling, same pin shape. Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
Contributor
Author
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 L1 ACCEPT · PR #39027 (#39025) · head 席位核对 · ACCEPTACCEPT · repo:objectstack@os-justin · head
|
objectstack-fleet
Bot
deleted the
claude/issue-39025-gate-git-maxbuffer
branch
December 2, 2026 04:44
This was referenced Dec 2, 2026
os-support-ai
pushed a commit
that referenced
this pull request
Dec 2, 2026
…nout-judge Brings in the ENOBUFS fix for check:closed-ceremony-text (#39027). Claude-Session: https://claude.ai/code/session_01WGufzhKEbEnW8pwZRgK2gJ Co-authored-by: Claude <noreply@anthropic.com>
This was referenced Dec 2, 2026
Merged
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.
Fixes #39025
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
Two repo scripts read a git listing that grows with the tree into node's 1 MiB default stdout buffer (
maxBuffer). Past it the child is killed withENOBUFSand the gate dies instead of answering. Both now pass an explicit 64 MiB ceiling, the value and constant namescripts/pm/dispatch-gates.mjsalready uses (GIT_MAX_BUFFER_BYTES). There is no shared git-buffer helper in the repo (scripts/git-env.mjsexports none), so each file declares its own constant. Importing the constant from dispatch-gates would make an ordinary gate depend on a governed file.444dce61f2scripts/check-closed-ceremony-text.mjstrackedFiles()git ls-files -z -- packages content/docs .changesetmaxBuffer: GIT_MAX_BUFFER_BYTES(64 MiB)scripts/docs-audit/affected-docs.mjssh()git ls-files packages(in--self-test, i.e.pnpm check:docs-audit-scope)maxBuffer: SH_MAX_BUFFER_BYTES(64 MiB) on the wrappersh()is one wrapper with several callers, so the ceiling goes on the wrapper itself. Itsgit show REF:FILEcallers catch the throw, so a file over 1 MiB used to read as absent with no error. The constant sits in the file's hoisted-constants block, because aconstbesidesh()is in the temporal dead zone when--self-testruns.Behaviour is otherwise unchanged. On this tree both listings already fit, so no verdict moves.
The sweep: every other git spawn under
scripts/with nomaxBufferI found these with a scanner that reads each
execFileSync/spawnSync/execSync/spawnofgitto its closing parenthesis, so multi-line calls count. I then checked every wrapper (git(),run(),sh(),runGit()) that is called withls-files,ls-tree -r,diff --name-onlyorgrep. 29 directexecFileSync('git', ['ls-files'…sites exist; all the others already pass a ceiling of 16 MiB or more.I left these alone, with the reason:
git-env.mjs322/344/350/369/372,check-nul-bytes.mjs:1067,check-system-context-census.mjs:2463,check-bash32-floor.mjs:1414,check-gitlink-declared.mjs:424,overlap-check.mjs:429,tenant-audit-census-replay.mjs:148.444dce61f2:changeset-changelog.mjs:175(*CHANGELOG.md): 5,078 bytespm/release-rehearsal-clone.mjs:144(.changeset/*.md): 78,763 bytespm/check-prior-rulings.mjs:2179(docs/adr/): 9,243 bytespm/write-pace.mjs:1822(scripts/pm): 1,936 bytescheck-regen-pending.mjs:1558(package.json): 13 bytesgit-merge-regen.mjs:1093: 0 bytes for each of the 6 declared-untracked pathscheck-test-source-alias.mjs:4103-4104checklist-select.mjs:542pm/check-harness-current.mjs:124pm/git-history.mjs:662pm/overlap-check.mjs:148/160gen-upgrade-harness-fixture.mjs:104For scale: the whole-tree
git ls-files -zis 1,902,552 bytes andls-files --stage -zis 3,377,652 bytes. Every gate that reads either one already passes a ceiling of 64 MiB or more.Tests
node scripts/check-closed-ceremony-text.mjs --self-test: 38 assertion(s) passed. The new cases stage 16,000 paths underpackages/into an index-only fixture repo (update-index --index-info, about 1.3 MB of listing). The CONTROL reads that listing at the default buffer and must die withENOBUFS.trackedFiles()must then read every path, including the first and last, and the ceiling must stay finite and above the fixture.node scripts/docs-audit/affected-docs.mjs --self-test: 607 cases pass. The new cases use a child that prints 2 MiB. The CONTROL isexecSyncat the default buffer and must answerENOBUFS;sh()must then return all 2,097,152 bytes.Ablation (maxBuffer removed on disk, then restored from HEAD)
Acceptance notes
files[], and the root package isprivate. This PR carriesskip-changeset, which is the conventioncheck-empty-changeset.mjsnames.check-governed-merges --branchreports 0 of 2 paths governed, 95 changed lines: ordinary queue landing.git show REF:FILEreaders inaffected-docs.mjsturn every failure into "absent", not onlyENOBUFS. This PR does not change that shape; it only stops a large file from tripping it.Verification
Local subset at
4b802eaf2b(dispatch-gates --commands, 36 families derived from this diff): 35 exit 0, 1 NOT MEASURED.--ranreconciliation: 36 derived, 35 run, 1 NOT-MEASURED, 0 UNRUN.pnpm check:closed-ceremony-text: exit 0,6622 shipped file(s) read; none says the ownership ceremony is closed.pnpm check:docs-audit-scope: exit 0pnpm check:nul-bytes: exit 0pnpm check:entry-guard: exit 0pnpm check:scripts-symbol-anchors: exit 0node scripts/check-self-test-wired.mjs: exit 0pnpm check:pm-dispatch-gates, reason: it exited 124 when it hit the local 280 s per-command timeout on the shared container. It does not read either changed file, so CI owns the verdict.Every other family, including the full Lint & Repo Gates farm, is CI's to run on this head.
Two-minute check:
node scripts/check-closed-ceremony-text.mjs --self-testprints38 assertion(s) passed. Delete themaxBuffer: GIT_MAX_BUFFER_BYTES,line and the same command prints2 of 38 assertion(s) FAILED.Generated by Claude Code