Skip to content

Commands that read cut-off output now fail instead of judging part of it (GST-3086) - #4492

Merged
capy-ai[bot] merged 5 commits into
mainfrom
cut-off-child-output-fails-closed
Nov 18, 2026
Merged

capy-ai[bot] merged 5 commits into
mainfrom
cut-off-child-output-fails-closed

Conversation

@garrytan

@garrytan garrytan commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Commands that read large git or gh output, including the credential pre-push hook, the pre-merge secret and literal scans and the sealed-output guard, now fail when Bun cuts that output off, instead of judging the part they got.
Why: Bun can report exit status 0 together with ENOBUFS and partial stdout, so a push whose diff passed 64 MiB could get a credential past the pre-push hook.
Nothing to do: the failure names SPAWN_OUTPUT_INCOMPLETE and links its troubleshooting entry.

What changed
  • lib/spawn-sync.ts exports a spawnSync with Node's exact signature. When the result carries error and a non-null status, or the error is ENOBUFS, it returns status: null, keeps error.code, adds (SPAWN_OUTPUT_INCOMPLETE) to error.message, and appends a line naming the code and its troubleshooting entry to a captured stderr. It imports nothing from lib/, because the paid test runner's global import closure includes it. Everything else passes through unchanged, so a launch failure or timeout that already had status null keeps its message.
  • 131 product files in lib/, bin/, scripts/ and crew/scripts now import it instead of node:child_process. They are the files with a buffered spawnSync that reads output of unbounded size: an explicit maxBuffer, a generic git/gh wrapper taking arbitrary args, or a diff, show, log, cat-file, ls-files, ls-tree, grep, merge-file or api read. Every status === 0 check there now fails closed with no call-site change.
  • Three reads needed more than the import: listRepoFiles (test selection for the pre-merge checks) read stdout with no status check and now throws on a spawn error; gstack-design-detect's Bun.spawnSync engine call now treats exitedDueToMaxBuffer as too large; the pre-push hook's gitStrict error now carries the reason code.
  • SPAWN_OUTPUT_INCOMPLETE is in lib/result-codes-release.ts (lib/result-codes.ts is at the 800-line module cap) with a docs/troubleshooting.md#spawn-output-incomplete entry.
  • Left alone: execFileSync/execSync (Bun throws ENOBUFS even at status 0; the one catch that reads err.stdout, gbrain doctor, JSON-parses it, so a cut-off read fails the parse), unbuffered calls, Bun.spawnSync without maxBuffer (no limit), small-output probes, browse/src (no unbounded buffered read; it bundles without lib/), and tests' own spawn helpers (out of scope, Two owner-answer adds at once no longer collide, and three flaky tests get real fixes (GST-3084) #4490).
Testing
  • test/spawn-sync.test.ts (new): a Bun child that ignores SIGTERM and prints 200 KB under a 1 KiB maxBuffer gives raw spawnSync status 0 with ENOBUFS every time (the GSTA-618 finding), and the helper turns it into status null with the code, in string and Buffer mode; clean reads and plain non-zero exits pass through. The scanner case runs the real pre-push hook with a stub git whose diff prints about 90 MB before the real diff, ignores SIGTERM and exits 0. On main the push carrying an AWS-format key exits 0 (allowed); on this branch it exits 1 with SPAWN_OUTPUT_INCOMPLETE. The shell-stub cases skip on Windows.
  • Passed locally: bun run typecheck; module-size ratchet, spawnSync timeout tripwire, troubleshooting anchors, Bun entry isolation and state-root ratchet (428 pass); the redact pre-push, design-detect, import-graph, gbrain-exec and pre-merge secret-scan suites (336 tests, one pinned-wording failure fixed, then 56/56 on the hook file); 609 passing tests in the suites that exercise overflow paths, from a run cancelled before its summary line (its failures are listed next).
  • Failed locally, and identically with this branch's edits stashed, so not counted against it: 12 CSO tests (bin/gstack-cso-launcher is not built in this checkout) and 2 test/evidence.test.ts cases hitting their 5 s limit under a concurrent run. CI is the full run.
Open review notes (none block)
  • lib/script-invocation.ts (runScriptSync, runBashSync) still calls node's spawnSync directly, so the pre-merge test-selection manifest read and the /ship review-log read can still take cut-off output as complete; about 60 product files keep a raw import and nothing stops a new one. The changelog line's "the other gstack commands that read large git or gh output" is broader than this change. Follow-up: route script-invocation.ts with an overflow test and add an import ratchet, or narrow the release note.
  • browse/src/session-name.ts:90 reads ps -A under the 1 MiB default with no error check; left alone because browse bundles without lib/, an accepted risk rather than a bound.
  • test/spawn-sync.test.ts finds git with Bun.which('git'); under a PATH-resolving git wrapper the stub recurses. CI and plain machines use real git.
  • The new throw in listRepoFiles has no test of its own.
  • The red-on-main claim was rerun independently by a second-model reviewer on Bun 1.4.4: the main hook exited 0 where the test expects 1, and this branch's hook blocked.
Agent notes

Plan: exempt: bug fix (--kind fix, R65; failing-first test test/spawn-sync.test.ts)
Plan check: exempt bug fix

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=3 fixed=0 scope=frozen ledgers_read=1 dispatches=4

Inventory: 451 sync spawn call sites in lib/, bin/, scripts/, browse/src, crew/scripts

How it was built: a text scanner found every spawnSync, Bun.spawnSync, execFileSync and execSync call outside tests (TypeScript 7 has no JS API). "Checked error before" means an .error, ENOBUFS or exitedDueToMaxBuffer mention within 30 lines of the call. That is a text test and over-reports: lib/sealed-guard.ts:96 matched it but does not check, and is corrected by hand below. "Wrong verdict" marks modules on a gate, scan, ship record or review path; "wrong answer" is everything else. Hand-checked: the pre-push hook, the pre-merge secret scan, the sealed guard, listRepoFiles and gstack-design-detect. Node's spawnSync under Bun inherits a 1 MiB maxBuffer when none is set, so every buffered call has a limit.

Sites that read unbounded output (198; 196 routed, the two scripts/lib/free-ci-health.ts rows stay on node and say why):

Site Command read Checked error before A cut-off read on main Now
lib/approval-citations.ts:194 'gh' yes already failed closed or read partial output on purpose routed
lib/approval-classes.ts:106 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/approval-record.ts:61 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/autoplan-lean.ts:66 'git' '-c', 'core.quotepath=off', ...args yes already failed closed or read partial output on purpose routed
lib/banned-terms.ts:98 'git' 'show', source no wrong verdict: cut-off output passes a status-only check routed
lib/ceo-review-gate.ts:27 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/changelog-fragments.ts:28 'git' no wrong answer: cut-off output passes a status-only check routed
lib/ci-gate.ts:287 'gh' yes already failed closed or read partial output on purpose routed
lib/code-intelligence/suggest.ts:36 "git" "-C", resolve(repoPath), "ls-files" no wrong answer: cut-off output passes a status-only check routed
lib/contributor-mode.ts:25 'gh' no wrong answer: cut-off output passes a status-only check routed
lib/contributor-mode.ts:45 'gh' 'api', endpoint, '--jq' yes already failed closed or read partial output on purpose routed
lib/default-base.ts:29 cmd 'ignore', 'pipe', 'pipe' no wrong answer: cut-off output passes a status-only check routed
lib/doc-links.ts:88 'git' 'cat-file', '-e', ${base}:${f} no wrong answer: cut-off output passes a status-only check routed
lib/doc-links.ts:93 'git' 'diff', '-U0', '--no-ext-diff' no wrong answer: cut-off output passes a status-only check routed
lib/docs-only.ts:64 'git' yes already failed closed or read partial output on purpose routed
lib/eval-models.ts:120 'git' yes already failed closed or read partial output on purpose routed
lib/eval-plan.ts:207 'sh' '-c', command yes already failed closed or read partial output on purpose routed
lib/eval-plan.ts:636 'git' no wrong answer: cut-off output passes a status-only check routed
lib/evidence-bundle.ts:53 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/evidence-bundle.ts:79 'git' 'show', ${treeish}:${rel} no wrong verdict: cut-off output passes a status-only check routed
lib/flaky-run.ts:197 'git' no wrong answer: cut-off output passes a status-only check routed
lib/gate-diff/git.ts:29 'git' '-c', 'core.quotePath=false', '--no-pager' no wrong verdict: cut-off output passes a status-only check routed
lib/gate-dispositions.ts:86 'git' yes already failed closed or read partial output on purpose routed
lib/gbrain-repo-policy-client.ts:106 cmd yes already failed closed or read partial output on purpose routed
lib/gbrain-repo-policy-client.ts:151 cmd yes already failed closed or read partial output on purpose routed
lib/gbrain-repo-policy-client.ts:206 cmd yes already failed closed or read partial output on purpose routed
lib/gh-poll.ts:111 'gh' yes already failed closed or read partial output on purpose routed
lib/gh-poll.ts:115 'gh' yes already failed closed or read partial output on purpose routed
lib/harness-qm.ts:32 'git' '-C', checkout, 'ls-tree' no wrong answer: cut-off output passes a status-only check routed
lib/harness-start-hook.ts:163 t SPECS[t yes already failed closed or read partial output on purpose routed
lib/history-read.ts:24 'git' yes already failed closed or read partial output on purpose routed
lib/inventory.ts:218 'git' '-C', root, ...args no wrong answer: cut-off output passes a status-only check routed
lib/land-merged-checks.ts:29 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/no-stop.ts:144 'git' no wrong answer: cut-off output passes a status-only check routed
lib/office-hours-probe.ts:88 exe ...subcommands, flag yes already failed closed or read partial output on purpose routed
lib/pregate/checks/literals.ts:179 'git' 'show', ${ctx.mergeBase}:${t.renamedFrom ?? t.path} no wrong verdict: cut-off output passes a status-only check routed
lib/pregate/checks/literals.ts:194 'git' 'show', ${ctx.mergeBase}:${from} no wrong verdict: cut-off output passes a status-only check routed
lib/pregate/checks/literals.ts:196 'git' 'ls-tree', ctx.mergeBase, '--' no wrong verdict: cut-off output passes a status-only check routed
lib/pregate/checks/secrets.ts:129 'git' 'diff', '--text', '--no-color' yes already failed closed or read partial output on purpose routed
lib/pregate/checks/secrets.ts:136 'git' '-c', 'diff.suppressBlankEmpty=false', 'diff' no wrong verdict: cut-off output passes a status-only check routed
lib/pregate/checks/secrets.ts:146 'git' 'ls-files', '--error-unmatch', '--' no wrong verdict: cut-off output passes a status-only check routed
lib/pregate/checks/strays.ts:20 'git' 'ls-tree', '--name-only', '-d' no wrong verdict: cut-off output passes a status-only check routed
lib/pregate/checks/timing.ts:190 'git' 'diff', '--no-ext-diff', '--no-textconv' yes already failed closed or read partial output on purpose routed
lib/pregate/config.ts:294 'git' yes already failed closed or read partial output on purpose routed
lib/pregate/context.ts:109 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/pregate/docs-only-lane.ts:38 process.execPath ...bunIsolationArgs(), 'test', '--timeout=30000' yes already failed closed or read partial output on purpose routed
lib/pregate/flaky-exception.ts:338 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/pregate/head-policy.ts:54 'git' 'show', ${mergeBase}:${PREGATE_CONFIG_PATH} yes already failed closed or read partial output on purpose routed
lib/pregate/head-policy.ts:86 'git' 'show', ${rev}:${file} yes already failed closed or read partial output on purpose routed
lib/pregate/import-graph.ts:172 'git' 'ls-files', '-co', '--exclude-standard' no wrong verdict: cut-off output passes a status-only check routed
lib/pregate/index.ts:87 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/pregate/lane-selection.ts:133 'git' 'ls-tree', ctx.mergeBase, '--' no wrong verdict: cut-off output passes a status-only check routed
lib/pregate/lane-selection.ts:135 'git' 'show', ${ctx.mergeBase}:${rel} no wrong verdict: cut-off output passes a status-only check routed
lib/pregate/lane-selection.ts:157 'git' 'grep', '--untracked', '-l' no wrong verdict: cut-off output passes a status-only check routed
lib/pregate/regate.ts:29 'git' yes already failed closed or read partial output on purpose routed
lib/pregate/regate.ts:34 'gh' yes already failed closed or read partial output on purpose routed
lib/pregate/remote-receipt.ts:50 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/pregate/run-check.ts:35 'git' 'show', ${ref}:${wf} no wrong verdict: cut-off output passes a status-only check routed
lib/pregate/workflows.ts:205 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/plan-reality-receipts.ts:87 'git' 'cat-file', '--batch-check' no wrong verdict: cut-off output passes a status-only check routed
lib/plan-record.ts:274 'git' no wrong answer: cut-off output passes a status-only check routed
lib/pr-shots.ts:36 'git' no wrong answer: cut-off output passes a status-only check routed
lib/prose-lint.ts:227 'git' no wrong answer: cut-off output passes a status-only check routed
lib/quarantine.ts:69 'git' no wrong answer: cut-off output passes a status-only check routed
lib/regen.ts:97 'git' no wrong answer: cut-off output passes a status-only check routed
lib/release-stamp.ts:45 'git' yes already failed closed or read partial output on purpose routed
lib/release-stamp.ts:117 'gh' no wrong answer: cut-off output passes a status-only check routed
lib/restamp.ts:74 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/restamp.ts:118 'gh' no wrong verdict: cut-off output passes a status-only check routed
lib/review-brief.ts:265 'git' '-C', dir, ...a no wrong verdict: cut-off output passes a status-only check routed
lib/review-collect.ts:41 'git' '-c', 'core.quotePath=false', ...args yes already failed closed or read partial output on purpose routed
lib/review-collect.ts:48 'git' '-c', 'core.quotePath=false', ...args yes already failed closed or read partial output on purpose routed
lib/review-collect.ts:313 'git' 'cat-file', 'blob', t.sha yes already failed closed or read partial output on purpose routed
lib/review-collect.ts:339 'git' 'cat-file', 'blob', ${headSha}:${p} yes already failed closed or read partial output on purpose routed
lib/review-evidence.ts:74 'git' '--no-replace-objects', '-c', 'core.fsmonitor=false' yes already failed closed or read partial output on purpose routed
lib/review-evidence.ts:194 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/review-exclude.ts:125 'git' '-c', 'core.quotePath=false', ...args no wrong verdict: cut-off output passes a status-only check routed
lib/review-exclude.ts:217 'git' 'cat-file', '--batch' yes already failed closed or read partial output on purpose routed
lib/review-exclude.ts:230 'git' 'cat-file', 'blob', sha yes already failed closed or read partial output on purpose routed
lib/review-exclude.ts:488 'git' '-c', 'core.quotePath=false', 'diff' yes already failed closed or read partial output on purpose routed
lib/review-platform.ts:14 'gh' no wrong verdict: cut-off output passes a status-only check routed
lib/review-round-grant.ts:98 'git' '-c', 'core.quotepath=off', ...args no wrong verdict: cut-off output passes a status-only check routed
lib/review-targeted-delta.ts:24 'git' '-c', 'core.quotePath=false', ...args no wrong verdict: cut-off output passes a status-only check routed
lib/review-targeted.ts:87 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/run-evidence.ts:411 'unzip' '-p', zip, 'tree.json' yes already failed closed or read partial output on purpose routed
lib/run-evidence.ts:432 'git' 'rev-list', --max-count=${max}, sha no wrong verdict: cut-off output passes a status-only check routed
lib/sealed-guard.ts:96 'git' (diff-tree, the sealed-output scan) no (hand-checked; the nearby .error belongs to runCaptured) wrong verdict: a cut-off commit list passes the sealed scan routed
lib/sealed-guard.ts:113 o.bin ?? 'git' inFd ?? (stdin ? 'pipe' : 'ignore'), outFd, 'pipe' yes already failed closed or read partial output on purpose routed
lib/sealed-guard.ts:287 'gh' yes already failed closed or read partial output on purpose routed
lib/sealed-guard.ts:345 'git' yes already failed closed or read partial output on purpose routed
lib/sealed-join.ts:150 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/ship-bin-common.ts:28 'git' yes already failed closed or read partial output on purpose routed
lib/ship-handoff.ts:40 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/ship-mechanical.ts:31 'git' '--literal-pathspecs', ...args no wrong verdict: cut-off output passes a status-only check routed
lib/ship-patch.ts:44 'git' '-c', 'core.quotepath=off', ...args no wrong verdict: cut-off output passes a status-only check routed
lib/ship-patch.ts:131 'git' 'cat-file', 'blob', ${ref}:${rel} no wrong verdict: cut-off output passes a status-only check routed
lib/ship-patch.ts:139 'git' '-c', 'core.quotepath=off', ...args no wrong verdict: cut-off output passes a status-only check routed
lib/ship-patch.ts:226 'git' 'cat-file', 'blob', ${ref}:${rel} no wrong verdict: cut-off output passes a status-only check routed
lib/ship-patch.ts:235 'git' 'merge-file', '-p', '-q' no wrong verdict: cut-off output passes a status-only check routed
lib/ship-policy-at.ts:12 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/ship-policy.ts:656 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/ship-queue-land.ts:106 'git' 'merge-file', '-p', o! no wrong verdict: cut-off output passes a status-only check routed
lib/ship-receipt-depth.ts:52 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/ship-receipt-depth.ts:372 'git' 'diff', '--name-only', '-z' no wrong verdict: cut-off output passes a status-only check routed
lib/ship-receipt-depth.ts:381 'git' 'cat-file', '--filters', ${rev}:${p} no wrong verdict: cut-off output passes a status-only check routed
lib/ship-receipt-depth.ts:413 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/ship-receipt-depth.ts:538 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/ship-receipt-depth.ts:550 'git' 'cat-file', 'blob', sha no wrong verdict: cut-off output passes a status-only check routed
lib/ship-receipt-depth.ts:576 'git' 'merge-file', '-p', '-q' no wrong verdict: cut-off output passes a status-only check routed
lib/ship-receipt-depth.ts:677 'git' 'diff', '--unified=0', '--no-color' no wrong verdict: cut-off output passes a status-only check routed
lib/ship-receipt-depth.ts:685 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/ship-receipt.ts:403 'git' '-c', 'core.quotepath=off', ...args no wrong verdict: cut-off output passes a status-only check routed
lib/ship-receipt.ts:440 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/ship-sidecar.ts:49 'git' '-c', 'core.quotepath=off', ...args no wrong verdict: cut-off output passes a status-only check routed
lib/ship-sidecar.ts:59 'git' '-c', 'core.quotepath=off', 'grep' no wrong verdict: cut-off output passes a status-only check routed
lib/skill-bill.ts:79 "git" no wrong answer: cut-off output passes a status-only check routed
lib/squash-message.ts:20 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/stable-release.ts:30 'git' '-C', repo, ...args yes already failed closed or read partial output on purpose routed
lib/test-impact/key.ts:62 'git' yes already failed closed or read partial output on purpose routed
lib/test-impact/key.ts:104 'git' 'cat-file', 'blob', ${treeish}:${rel} no wrong answer: cut-off output passes a status-only check routed
lib/transcript-consent.ts:243 'git' '-C', home, ...args no wrong answer: cut-off output passes a status-only check routed
lib/tree-receipt.ts:47 'git' no wrong verdict: cut-off output passes a status-only check routed
lib/tree-receipt.ts:51 'git' 'show', ${treeish}:${rel} no wrong verdict: cut-off output passes a status-only check routed
lib/tree-receipt.ts:161 'gh' yes already failed closed or read partial output on purpose routed
lib/tree-receipt.ts:181 'git' 'diff', '--unified=0', '--no-color' yes already failed closed or read partial output on purpose routed
lib/worktree.ts:57 'git' no wrong answer: cut-off output passes a status-only check routed
bin/gstack-archive-check:37 'gh' yes already failed closed or read partial output on purpose routed
bin/gstack-banned-terms:81 'git' 'diff', '--unified=0', '--no-color' no wrong verdict: cut-off output passes a status-only check routed
bin/gstack-ci-carry:53 'git' yes already failed closed or read partial output on purpose routed
bin/gstack-design-detect.ts:820 'git' no wrong answer: cut-off output passes a status-only check routed
bin/gstack-docs-candidate:74 'git' no wrong answer: cut-off output passes a status-only check routed
bin/gstack-evidence:373 "git" yes already failed closed or read partial output on purpose routed
bin/gstack-gbrain-read-capability.ts:40 invocation.cmd yes already failed closed or read partial output on purpose routed
bin/gstack-greptile-early:19 cmd yes already failed closed or read partial output on purpose routed
bin/gstack-issue-guard:28 "gh" yes already failed closed or read partial output on purpose routed
bin/gstack-issue-links:59 'git' no wrong verdict: cut-off output passes a status-only check routed
bin/gstack-issue-links:71 'gh' no wrong verdict: cut-off output passes a status-only check routed
bin/gstack-issue-links:153 path.join(binDir 'issue', String(issue) no wrong verdict: cut-off output passes a status-only check routed
bin/gstack-memory-ingest.ts:2507 "git" "-C", dir, "-c" yes already failed closed or read partial output on purpose routed
bin/gstack-motion-encode:78 ffmpeg! no wrong answer: cut-off output passes a status-only check routed
bin/gstack-no-stop:42 'git' no wrong answer: cut-off output passes a status-only check routed
bin/gstack-post:22 cmd "pipe", "pipe", "pipe" yes already failed closed or read partial output on purpose routed
bin/gstack-pregate:296 'git' yes already failed closed or read partial output on purpose routed
bin/gstack-redact-prepush:70 "git" no wrong verdict: cut-off output passes a status-only check routed
bin/gstack-redact-prepush:82 "git" no wrong verdict: cut-off output passes a status-only check routed
bin/gstack-redact-prepush:95 "git" "cat-file", "-e", sha no wrong verdict: cut-off output passes a status-only check routed
bin/gstack-redact-prepush:559 "git" "log", "--no-show-signature", "--no-color" yes already failed closed or read partial output on purpose routed
bin/gstack-restamp:64 'git' no wrong verdict: cut-off output passes a status-only check routed
bin/gstack-review-bots:18 cmd yes already failed closed or read partial output on purpose routed
bin/gstack-review-dispatch:303 'git' no wrong verdict: cut-off output passes a status-only check routed
bin/gstack-review-plan:134 'git' '-c', 'core.quotePath=false', ...a no wrong verdict: cut-off output passes a status-only check routed
bin/gstack-review-scope:65 'git' '-c', 'core.quotePath=false', ...args yes already failed closed or read partial output on purpose routed
bin/gstack-review-scope:78 'git' '-c', 'core.quotePath=false', 'diff' yes already failed closed or read partial output on purpose routed
bin/gstack-review-scope:213 'git' 'log', '--first-parent', '--no-merges' no wrong verdict: cut-off output passes a status-only check routed
bin/gstack-ship-receipt:200 'git' yes already failed closed or read partial output on purpose routed
bin/gstack-ship-receipt:550 'git' 'diff', '--no-color', '--no-ext-diff' no wrong verdict: cut-off output passes a status-only check routed
bin/gstack-ship-receipt:643 'git' 'show', ${ref}:${p} no wrong verdict: cut-off output passes a status-only check routed
bin/gstack-ship-receipt:753 'git' 'status', '--porcelain', '--untracked-files=all' yes already failed closed or read partial output on purpose routed
bin/gstack-ship-receipt:850 'git' 'show', ${ref}:${p} no wrong verdict: cut-off output passes a status-only check routed
bin/gstack-ship-receipt:900 'git' 'range-diff', '--no-color', ${rangeBase}..${from} no wrong verdict: cut-off output passes a status-only check routed
bin/gstack-ship-receipt:905 'git' 'diff', '--no-color', '--no-ext-diff' no wrong verdict: cut-off output passes a status-only check routed
bin/gstack-ship-receipt:907 'git' 'diff', '--numstat', from no wrong verdict: cut-off output passes a status-only check routed
bin/gstack-state-matrix:49 'git' no wrong answer: cut-off output passes a status-only check routed
bin/gstack-tasks:49 'git' no wrong answer: cut-off output passes a status-only check routed
scripts/check-conflict-markers.ts:32 'git' ...GIT, ...args yes already failed closed or read partial output on purpose routed
scripts/cso-requalification.ts:54 'git' '-C', root, 'archive' no wrong answer: cut-off output passes a status-only check routed
scripts/cso-verify-runtime-base.ts:52 docker yes already failed closed or read partial output on purpose routed
scripts/e2e-shard-reuse.ts:93 'git' 'ls-files', '-z' no wrong answer: cut-off output passes a status-only check routed
scripts/eval-bg.ts:255 command yes already failed closed or read partial output on purpose routed
scripts/eval-trial-series.ts:53 'git' no wrong answer: cut-off output passes a status-only check routed
scripts/eval-trial-series.ts:136 'git' 'rev-list', '-1', '--first-parent' no wrong answer: cut-off output passes a status-only check routed
scripts/lib/ci-history.ts:39 'gh' yes already failed closed or read partial output on purpose routed
scripts/lib/ci-history.ts:369 'git' no wrong answer: cut-off output passes a status-only check routed
scripts/lib/eval-history.ts:230 'gh' yes already failed closed or read partial output on purpose routed
scripts/lib/free-ci-health.ts:164 'git' 'ls-tree', '--name-only', sha no wrong answer: cut-off output passes a status-only check not routed: a test copies the shard runner's modules without lib/; advisory CI health note on a small seed file
scripts/lib/free-ci-health.ts:167 'git' 'show', ${sha}:${SEED_ALLOWLIST_FILE} no wrong answer: cut-off output passes a status-only check not routed: a test copies the shard runner's modules without lib/; advisory CI health note on a small seed file
scripts/lib/paid-select.ts:280 'git' 'show', ${sha}:package.json no wrong answer: cut-off output passes a status-only check routed
scripts/modules-install.ts:69 'git' '-C', root, ...args no wrong answer: cut-off output passes a status-only check routed
scripts/pr-dependencies.ts:133 'git' 'ls-files', '-z' no wrong answer: cut-off output passes a status-only check routed
scripts/ship-measure-sweep.ts:317 'git' yes already failed closed or read partial output on purpose routed
scripts/ship-measure.ts:263 'git' no wrong verdict: cut-off output passes a status-only check routed
scripts/skill-check.ts:73 'git' yes already failed closed or read partial output on purpose routed
scripts/skill-gates-smoke.ts:37 cmd yes already failed closed or read partial output on purpose routed
scripts/slop-diff.ts:22 "git" "diff", "--name-only", ${base}...HEAD no wrong answer: cut-off output passes a status-only check routed
scripts/test-health-report.ts:178 'git' 'grep', '-c', '-I' no wrong answer: cut-off output passes a status-only check routed
scripts/test-health-report.ts:181 'git' 'show', ${ref}:package.json no wrong answer: cut-off output passes a status-only check routed
scripts/test-impact.ts:67 'strace' ...STRACE_FLAGS, '-o', log no wrong answer: cut-off output passes a status-only check routed
scripts/typecheck-test.ts:132 process.execPath 'x', 'tsc', '-p' yes already failed closed or read partial output on purpose routed
crew/scripts/gate-cost-replay.ts:121 'git' yes already failed closed or read partial output on purpose routed
crew/scripts/gate-cost-replay.ts:205 'git' 'show', ${rev}:package.json no wrong verdict: cut-off output passes a status-only check routed
crew/scripts/gate-cost-replay.ts:380 'git' no wrong verdict: cut-off output passes a status-only check routed
crew/scripts/gate-reuse.ts:165 'git' yes already failed closed or read partial output on purpose routed
crew/scripts/recover-receipts.ts:67 'gh' yes already failed closed or read partial output on purpose routed
crew/scripts/release-cut.ts:95 'gh' yes already failed closed or read partial output on purpose routed
crew/scripts/release-cut.ts:99 'git' yes already failed closed or read partial output on purpose routed
crew/scripts/replay-pr-selection.ts:125 'gh' no wrong answer: cut-off output passes a status-only check routed
crew/scripts/review-dispatch-compare.ts:119 'git' no wrong verdict: cut-off output passes a status-only check routed
crew/scripts/train-gate.ts:56 'git' yes already failed closed or read partial output on purpose routed

Routed with its file; small output, harmless (72): lib/approval-record.ts:287, lib/approval-record.ts:292, lib/contributor-mode.ts:35, lib/doc-links.ts:83, lib/evidence-bundle.ts:57, lib/evidence-bundle.ts:183, lib/gate-dispositions.ts:106, lib/gate-dispositions.ts:108, lib/gate-dispositions.ts:115, lib/gate-dispositions.ts:127, lib/gate-dispositions.ts:207, lib/gate-dispositions.ts:208, lib/gbrain-exec.ts:282, lib/harness-qm.ts:84, lib/land-merged-checks.ts:131, lib/pregate/docs-only-lane.ts:27, lib/pregate/head-policy.ts:90, lib/pregate/run-check.ts:34, lib/pregate/run-check.ts:69, lib/pregate/run-check.ts:76, lib/plan-reality-receipts.ts:107, lib/restamp.ts:206, lib/restamp.ts:447, lib/restamp.ts:470, lib/restamp.ts:478, lib/review-brief.ts:238, lib/review-evidence.ts:104, lib/review-targeted.ts:96, lib/run-evidence.ts:421, lib/run-evidence.ts:425, lib/ship-mechanical.ts:137, lib/transcript-consent.ts:390, bin/gstack-banned-terms:43, bin/gstack-banned-terms:79, bin/gstack-design-detect.ts:124, bin/gstack-docs-candidate:81, bin/gstack-docs-candidate:196, bin/gstack-docs-candidate:211, bin/gstack-evidence:653, bin/gstack-gbrain-read-capability.ts:15, bin/gstack-pregate:152, bin/gstack-pregate:185, bin/gstack-pregate:334, bin/gstack-restamp:115, bin/gstack-review-dispatch:156, bin/gstack-ship-receipt:308, bin/gstack-ship-receipt:351, bin/gstack-ship-receipt:373, bin/gstack-ship-receipt:553, bin/gstack-ship-receipt:758, bin/gstack-ship-receipt:941, bin/gstack-ship-receipt:1109, scripts/cso-requalification.ts:58, scripts/e2e-shard-reuse.ts:149, scripts/e2e-shard-reuse.ts:225, scripts/eval-bg.ts:292, scripts/lib/ci-history.ts:219, scripts/lib/free-ci-health.ts:161, scripts/lib/paid-select.ts:277, scripts/ship-measure.ts:94, scripts/ship-measure.ts:530, scripts/slop-diff.ts:35, scripts/slop-diff.ts:54, scripts/slop-diff.ts:71, scripts/slop-diff.ts:89, scripts/slop-diff.ts:115, scripts/test-impact.ts:32, scripts/test-impact.ts:55, scripts/test-impact.ts:58, scripts/t... (line truncated to 2000 chars)

harmless (output far under the 1 MiB default) (112): lib/aside-render.ts:87, lib/aside-render.ts:96, lib/aside-render.ts:475, lib/autoplan-admission.ts:35, lib/autoplan-gate-items.ts:40, lib/autoplan-prompts.ts:48, lib/bin-context.ts:101, lib/bin-context.ts:371, lib/bin-context.ts:464, lib/bin-context.ts:564, lib/bin-context.ts:573, lib/claude-code-migration.ts:160, lib/claude-code-migration.ts:166, lib/code-intelligence/gbrain-adapter.ts:232, lib/code-intelligence/graphify-adapter.ts:86, lib/cso/windows-docker.ts:86, lib/gbrain-guards.ts:165, lib/gbrain-guards.ts:168, lib/gbrain-guards.ts:190, lib/gbrain-sources.ts:232, lib/gbrain-sources.ts:249, lib/harness-register.ts:175, lib/harness-register.ts:242, lib/harness-register.ts:731, lib/install-verdict.ts:102, lib/install-verdict.ts:172, lib/land-docs-only.ts:18, lib/pregate/runtime.ts:72, lib/pregate/supervise.ts:85, lib/pregate/supervise.ts:105, lib/qa-deadline.ts:125, lib/qa-evidence.ts:14, lib/qa-evidence.ts:393, lib/qa-evidence.ts:396, lib/qa-evidence.ts:411, lib/repo-state-clean.ts:114, lib/repo-state-clean.ts:162, lib/review-selection.ts:33, lib/review-sweep.ts:81, lib/review-sweep.ts:149, lib/ruled-notes.ts:51, lib/script-invocation.ts:72, lib/script-invocation.ts:77, lib/script-invocation.ts:232, lib/script-invocation.ts:239, lib/ship-clock.ts:70, lib/stamp-only.ts:71, bin/gstack-approval-classes:49, bin/gstack-approvals:177, bin/gstack-approvals:193, bin/gstack-approvals:206, bin/gstack-approvals:220, bin/gstack-brain-cache:618, bin/gstack-brain-context-load.ts:241, bin/gstack-brain-context-load.ts:322, bin/gstack-brain-context-load.ts:398, bin/gstack-checks:34, bin/gstack-contributor-mode:40, bin/gstack-eval-plan:111, bin/gstack-eval-plan:133, bin/gstack-eval-plan:263, bin/gstack-factory-scorecard:69, bin/gstack-gbrain-sync.ts:1551, bin/gstack-gbrain-sync.ts:1698, bin/gstack-gbrain-sync.ts:1757, bin/gstack-gbrain-sync.ts:1761, bin/gstack-gbrain-sync.ts:2122, bin/gstack-gbrain-sync.ts:2170, bin/gstack-... (line truncated to 2000 chars)

harmless (stdout inherited or ignored) (22): lib/autoplan-admission.ts:30, lib/code-intelligence/graphify-adapter.ts:193, lib/cso/preparation-container.ts:1052, lib/default-base.ts:37, lib/evidence-bundle.ts:206, lib/gbrain-local-status.ts:297, lib/gstack-memory-helpers.ts:163, lib/gstack-memory-helpers.ts:261, bin/gstack-decision-log:102, bin/gstack-gbrain-sync.ts:1559, bin/gstack-next-version:487, bin/gstack-version-bump:287, scripts/cso-eval.ts:344, scripts/cso-eval.ts:345, scripts/cso-eval.ts:346, scripts/garry-output-comparison.ts:129, scripts/ship-measure.ts:830, browse/src/domain-skill-commands.ts:194, browse/src/file-permissions.ts:118, browse/src/file-permissions.ts:184, browse/src/file-permissions.ts:320, browse/src/find-security-sidecar.ts:33

fails closed: Bun throws ENOBUFS even at status 0 (30): lib/code-intelligence/selection.ts:98, lib/design-build.ts:133, lib/gbrain-exec.ts:332, lib/gbrain-local-status.ts:326, lib/gbrain-local-status.ts:501, lib/gbrain-sources.ts:123, lib/gbrain-sources.ts:276, lib/gstack-memory-helpers.ts:407, bin/gstack-design-build:41, bin/gstack-gbrain-detect:77, bin/gstack-gbrain-sync.ts:659, bin/gstack-gbrain-sync.ts:668, bin/gstack-memory-ingest.ts:846, bin/gstack-next-version:479, bin/gstack-taste-update:69, bin/gstack-version-bump:292, bin/gstack-version-bump:410, scripts/cso-eval-producer.ts:249, scripts/cso-eval-producer.ts:463, scripts/dev-skill.ts:25, scripts/dev-skill.ts:62, scripts/garry-output-comparison.ts:49, scripts/garry-output-comparison.ts:174, scripts/garry-output-comparison.ts:187, scripts/garry-output-comparison.ts:266, scripts/host-config-export.ts:70, browse/src/file-permissions.ts:61, browse/src/meta-commands.ts:807, browse/src/meta-commands.ts:871, browse/src/project-slug.ts:37

harmless (no limit) (16): lib/outside-voice-runner.ts:135, browse/src/browser-manager.ts:909, browse/src/chromium-profiles.ts:41, browse/src/cli.ts:272, browse/src/cli.ts:317, browse/src/cli.ts:784, browse/src/config.ts:35, browse/src/config.ts:90, browse/src/config.ts:105, browse/src/config.ts:178, browse/src/find-browse.ts:16, browse/src/xprotect-heal.ts:169, browse/src/xvfb.ts:69, browse/src/xvfb.ts:102, browse/src/xvfb.ts:130, browse/src/xvfb.ts:240

advisory detector: output dropped as too large (1): bin/gstack-design-detect.ts:877

GST-3086, GSTA-619. Decision trail: shared drive reports/GSTA-619-decisions.tsv. gstack: ok 1.100.0.0 for=ship.

{
  "schema_version": 1,
  "pr": 4492,
  "head": "9786d006428c127ba8d383fa5ad63027a8a02872",
  "version": "1.100.0.0",
  "base": "main",
  "gate": {
    "targeted": {
      "pass": 707,
      "fail": 0,
      "skip": 0
    },
    "test": {
      "pass": 1699,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 44349311491,
      "attempt": 1,
      "tree": "edaa6356117cb16146c2e64bc36ee83b71673b76"
    }
  ],
  "calls": 23,
  "session_kind": "unattended",
  "run": "run4",
  "head_tree": "edaa6356117cb16146c2e64bc36ee83b71673b76",
  "product_patch_id": "52c1e353c9bd63453b0217296e3032acf8530dbb",
  "gstack_version": "1.100.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 313,
    "rules": "1afa38a4be3b5eef",
    "base": "fda9dea79f131d7731259b9275fc82c04387ca37",
    "registry": "fda9dea79f131d7731259b9275fc82c04387ca37",
    "gate_scan": {
      "tagged": 0,
      "head": "9786d006428c127ba8d383fa5ad63027a8a02872"
    },
    "reasons": [
      "gate-class",
      "risk:money",
      "risk:secret",
      "risk:security",
      "runtime=313"
    ],
    "risk": [
      "money",
      "secret",
      "security"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @edaa6356117c (8 checks, current for 9786d006428c)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/44349311491/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44349311491/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44343838079/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=edaa6356117c tests=37840 skipped=105 runs=44349311491/1 profiles=ci-reuse/free-tests heads=9786d006428c verified=2026-11-18T16:47:56.604Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md (only docs/troubleshooting.md selected by the diff)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 3,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "ledgers_read": 1,
    "dispatches": {
      "specialist": 3,
      "red-team": 1
    }
  },
  "gate_dispositions": [],
  "review_targeted": {
    "classes": [
      "money",
      "secret"
    ],
    "rules": "23eb808423669ba0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "52c1e353c9bd63453b0217296e3032acf8530dbb",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}

…d (GST-3086)

Bun can return exit status 0 with ENOBUFS and part of the output when a spawnSync child passes maxBuffer. gstack's scanners, gates and git reads that check only the status now see a failure named SPAWN_OUTPUT_INCOMPLETE.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 4 commits November 18, 2026 15:47
…-3086)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… calling exit (GST-3086)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…very test run (GST-3086)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…note keeps reading git directly (GST-3086)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 36b349d into main Nov 18, 2026
98 of 99 checks passed
capy-ai Bot added a commit that referenced this pull request Nov 18, 2026
…and output (GST-3104) (#4502)

The helper that runs gstack's own scripts and `bash -c` commands, and
the merge queue's branch-ownership, stacked-test, release-version and
merge-group record checks, now fail with `SPAWN_OUTPUT_INCOMPLETE` when
Bun cuts a command's output off, instead of treating part of it as the
whole answer.

Why: #4492 added this for the scanners and gates but left these on
Node's `spawnSync`, and its release note claimed wider coverage than it
shipped.

Nothing to do: a new test stops any new gstack command from calling
Node's `spawnSync` directly.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@garrytan garrytan mentioned this pull request Nov 19, 2026
capy-ai Bot added a commit that referenced this pull request Nov 19, 2026
- `gstack-artifact validate` no longer passes a run.json that gstack-autoplan never wrote. (#4494)
- /ship's changed-number check no longer stops on tests that only share a word with the change (#4478). (#4496)
- On Capy, /ship no longer edits or comments on pull requests as you. (#4518)
- The destructive-command check stops asking about scratch deletes and catches the real damage it used to miss. (#4513)
- The destructive-command check reads commands more carefully, closing gaps found after the last release. (#4525)
- The Codex readiness check and the second-model review now pick the same model for a custom Codex provider (GST-3089). (#4491)
- gstack's Codex hooks work when your Codex folder's path has a `(`, `&` or other shell character in it. (#4528)
- Uninstalling gstack keeps your own Codex hooks trusted. (#4528)
- Codex hook setup matches Codex more closely. (#4528)
- On Windows, setup copies the Claude Code hook code that gstack's Codex hooks import (#4528)
- /review's checklist on Codex reads shell commands more carefully. (#4528)
- On Codex, gstack now suggests the right skill for a prompt and stops destructive commands before they run. (#4512)
- On Codex, /review is now held once when it tries to finish without its adversarial pass or its report, as it already is on Claude Code. (#4522)
- On Codex, gstack's skill suggestion now names the skill the way Codex lists it. (#4523)
- On Codex, gstack's suggested prompts and docs now name skills the way Codex lists them. (#4524)
- /review on Codex with gpt-6.1-sol is no longer held back for a second-model pass it already ran. (#4526)
- On Codex, office-hours, plan-design-review and gstack-upgrade work again when you name them. (#4510)
- gstack knows when Codex is running unattended. (#4510)
- Codex reviewers start with a clean context. (#4510)
- Docs no longer say Codex has no hook support. (#4510)
- A command whose output was cut off no longer counts as a finished read. (#4492)
- A folder marked as published data can no longer hide source code or agent files from /ship's review. (#4516)
- Correction to the on-by-default helper hooks entry: the hook still routes only to /review, /qa and /verify, so skills you've installed yourself aren't suggested yet. With gstack's skills it routes 14 of 60 real bug reports (was 17), and long prompts are no longer skipped. (#4505)
- /sync-gbrain's read check now works when the first page in your code source is over 64 KB. (#4497)
- Free-suite CI no longer fails before any test runs when Ubuntu's package mirror is slow. (#4530)
- Syncing a second repo no longer makes the first one ask for /sync-gbrain again. (#4532)
- gstack's helper hooks are now on by default in Claude Code, OpenClaw and Hermes, and the prompt-routing hook fires on real bug reports. (#4503)
- `gstack-pregate clear --receipt` accepts a remote gate run from before a merged release when the release only regenerated a declared release output. (#4483)
- The second-model review now keeps the reviewer's own result, and reports a used-up budget as a budget stop. (#4515)
- When the reviewer wrote its review to the result file it was asked for, Codex then replaced that file with its short closing message ("Done, I wrote the review"), so the review was thrown away and reported as missing its markers. (#4515)
- When the provider refuses the call with HTTP 402 Payment Required (usually a metering proxy that hit its allowance, or an account out of credits or quota), gstack used to record only "exit 1". (#4515)
- The pre-commit /verify check now fails a check that times out, and its checks share one time budget (GST-3201). (#4527)
- /ship's review collector no longer reads a reviewer's own scope list or list of passed checks as findings (GST-3201). (#4527)
- Merge-queue stack tests fail when git cannot list a PR's added test files (GST-3201). (#4527)
- /ship can now review results PRs that publish raw session data. (#4511)
- /ship's review pass works when the checkout you ship isn't the project's default checkout. (#4507)
- A second review round no longer reports done when nothing was reviewed. (#4520)
- The prompt-routing hook now suggests skills you install yourself, and no longer sends ordinary bug reports to /qa (GST-3123). (#4506)
- gstack's script runner and merge-queue checks now also refuse cut-off output. (#4502)
- A failed second-model review reports the cause that actually stopped it, and the runner never deletes its own prompt. (#4519)
- `gstack-ship-queue ready` now fills in the trial merges and the second-model trail read instead of printing lines to fill. (#4529)
- Five small ship-tool fixes. (#4529)
- A ruling the owner gives while a `/ship` run is open can be relayed. (#4529)
- /ship no longer kills a working test run as stalled when the test command starts its workers in their own session. (#4533)
- /ship no longer stops a review because the state-machine reader started its reply the way its instructions say. (#4504)
- When Claude Code runs /verify right before a commit, it now gets a quick check instead of the full fix loop (GST-3150). (#4508)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.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.

1 participant