Skip to content

v1.92.7.0 fix: /ship's review pass works on large diffs again (GST-507) - #3736

Merged
capy-ai[bot] merged 3 commits into
mainfrom
gst-507-review-plan-large-diff
Nov 1, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
gst-507-review-plan-large-diff

Conversation

@garrytan

@garrytan garrytan commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3736,
  "head": "51e6ca3a4d0b16546baba607888fa068d34f5e92",
  "version": "1.91.379.0",
  "base": "main",
  "gate": {
    "focused": {
      "pass": 85,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "14b8286f35221e4a25688d2ef1cf8dc04b50a8dd",
  "product_patch_id": "0dd2b05e27bf1050e8d66a8dd165560a479d7b3f",
  "gstack_version": "1.91.379.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 7,
    "rules": "150435b0a543019a",
    "base": "2d1b55d7621df1a71e02037c79b63b7ee2fdc64f",
    "registry": "2d1b55d7621df1a71e02037c79b63b7ee2fdc64f",
    "gate_scan": {
      "tagged": 0,
      "head": "51e6ca3a4d0b16546baba607888fa068d34f5e92"
    },
    "reasons": [
      "gate-class",
      "runtime=7<=50"
    ]
  },
  "pregate": "requires-remote cleared @14b8286f3522 (1 checks, current for 51e6ca3a4d0b)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41233253529",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/41233253580",
    "pregate.json/remote_gate: remote-gate tree=14b8286f3522 tests=3265"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, CONTRIBUTING.md and the changelog fragment (targeted grep for review-plan/review-dispatch exit and size claims)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 0,
    "scope": "frozen",
    "fix_checks": 1,
    "dispatches": {
      "specialist": 3
    }
  }
}

What changed

On a 4,000-file diff, the plan JSON was cut to 131,072 bytes in a pipe and pass died on JSON.parse. Now all 911,551 bytes arrive and pass stages 5 readers.

On a 4,000-file diff, the plan JSON was cut to 131,072 bytes in a pipe and pass died on JSON.parse. Now all 911,551 bytes arrive and pass stages 5 readers.

Before/after as text: On a 4,000-file diff, the plan JSON was cut to 131,072 bytes in a pipe and pass died on JSON.parse. Now all 911,551 bytes arrive and pass stages 5 readers.
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+# this branch 51e6ca3, the same 4,000-file diff
-# main 2d1b55d, a 4,000-file diff
 $ gstack-review-plan --base main --json > plan.json; wc -c < plan.json
 911551
 $ gstack-review-plan --base main --json | wc -c
+911551
-131072
 $ gstack-review-dispatch pass --base main --out run/p1 --pass big-p1
+MANIFEST: pass=big-p1 readers=5 first=0 specialists=1 red-team=1 voices=3
+exit=0
-SyntaxError: JSON Parse error: Unterminated string
-exit=1
 

Why

HARN-1's 4,000-file results PR produced a 1.39 MB review plan, and gstack-review-dispatch pass died on JSON.parse: Unterminated string. gstack-review-plan called process.exit(main()) right after writing that plan to stdout, so a pipe only ever got the first 128 KB. Both bins now set process.exitCode and let stdout drain, so /ship's review pass works on large diffs again.

Blast radius

The change touches the exit line of bin/gstack-review-plan and bin/gstack-review-dispatch; every caller reads their output through spawnSync with a 64 MB buffer, and exit codes are unchanged (EXIT.* values pass through; a bad base still exits 1 and a bogus subcommand 2, from the QA probes). Neither main() is async or opens a handle, so the process still ends as soon as stdout drains; the adversarial reviewer walked that path in the source. The review loop also caught that gstack-review-dispatch's BriefError handler fell through to its rethrow once process.exit was gone, so a brief-render refusal printed a Bun stack trace after the BRIEF_RENDER_FAILED line. That is fixed in 51e6ca3, with a test that failed first (13 stderr lines) and passes now. The same process.exit(main()) pattern is still in gstack-coauthor-trailers, gstack-issue-links and gstack-prose-lint; their outputs are small, so they are left alone here.

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-10-31 Approve the plan "Plan: review_exclude_paths and a diff ceiling for /ship's reviewers (GST-508)" (autoplan run autoplan-20261031162841, 1 decisions) “Add it on Saturday mornings do it” (Garry Tan (via GStack Minder), relayed by agent:GSTA-202) approved the reviewed plan (sha256 6bb912dd4fad), every recommendation taken none
2026-10-31 Captain's brief for GSTA-202: how to ship GST-507 (the review-plan large-diff truncation) “Item 1 is a fix: build it first as its own PR” (GStack Minder (Captain)) approved GST-507 built and shipped as its own fix PR, ahead of GST-508 none

Source: gstack-approvals record for gst-507-review-plan-large-diff (display only; not an approval citation).

The first row is GST-508's plan approval, recorded on this branch's record by the same thread; it covers GST-508, not this PR.

Summary

/ship's review pass failed outright on any diff big enough to make a plan JSON over 128 KB, because the planner exited before its piped stdout drained. It now drains, and a 4,000-file test keeps it that way.

Test Coverage

Coverage: deterministic (each of 2 changed runtime files has a changed test naming it; no audit reader).

  • test/review-pass.test.ts "a large diff (GST-507)": a 4,000-file diff round-trips a plan JSON over 1 MB and pass stages its readers. Regression proof: fails at main (438,528 bytes received), passes after the fix.
  • test/review-dispatch.test.ts "a BriefError prints only its BRIEF_RENDER_FAILED line and exits 1": fails before 51e6ca3 (13 stderr lines), passes after.

Tests ran: focused 85
Tests ran: typecheck count unavailable

Pre-Landing Review

One finding, from the testing specialist and the adversarial voice: the BriefError fall-through at bin/gstack-review-dispatch:349 (above). Fixed in 51e6ca3 on the Captain's call; one fix-check on the touched hunk found nothing, and a second Step 11 run of both voices on the fixed tree found nothing. The adversarial voice's low note (another early process.exit could bring the truncation back) is covered: no other process.exit( is on either bin's path.

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

(The pass 1 row logged the finding as skipped under the blocking floor; the Captain then asked for the fix, which landed in 51e6ca3 and went through the fix-check above.)

Gate edits: none detected (GATE_SCAN tagged=0 at 51e6ca3)

Outside review (openai/gpt-6.1-sol, a Capy subagent): no findings on either tree.

Exploratory QA

Smoke on a 4,000-file fixture at 4373dc2: the plan JSON piped whole (911,551 bytes, exit 0), pass staged its readers (exit 0), and failures still exit nonzero (bad base 1 and 1, bogus subcommand 2). The reader's first capture misfired on its own unset path and was superseded by the second; no product defects.

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). The fix was scoped by the Captain's brief and is exempt from the plan step as a fix to an already-diagnosed problem.

Verification Results

No Step 8.1 obligations (no plan bound).

TODOS

No TODO items completed in this PR.

Documentation

Status: current. No documentation edits needed.

Scope: base 2d1b55d, head 51e6ca3, no staged, unstaged or untracked content. The 5-file diff changes two bins to set process.exitCode so large piped output drains, adds a changelog fragment and adds two tests. Checked the diff and fragment in full, and grepped docs and templates for claims about the review-plan and review-dispatch bins, size limits, truncation and exit handling. Full-file reads were limited to the changelog fragment.

Documentation health:

  • changelog.d/gst-507-review-plan-large-diff.md: current, user-facing and accurate.
  • docs/review-policy.md: current, no contradicting claim.
  • docs/troubleshooting.md: current.
  • docs/ship-budget.md: current.
  • ship/sections/review-army.md.tmpl: current, authored source, no regeneration needed.

Coverage debt: none, no new public surface. Diagram drift: none. Banned terms: none.

Test plan

  • bun test test/review-pass.test.ts test/review-dispatch.test.ts test/review-targeted.test.ts: 85 pass, 0 fail
  • bun run typecheck: exit 0
  • Remote pregate (gstack-pregate --stage tests --remote) at 51e6ca3: remote gate 3265 tests, 0 failed on tree 14b8286f3522 ($0.05); the macOS and Windows lanes clear from this PR's CI runs

garrytan and others added 3 commits October 31, 2026 18:43
…before exit, so a large plan JSON reaches pass whole (GST-507)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…o longer falls through to the rethrow, GST-507)

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

trunk-io Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@github-actions github-actions Bot changed the title fix: /ship's review pass works on large diffs again (GST-507) v1.92.7.0 fix: /ship's review pass works on large diffs again (GST-507) Nov 1, 2026
@capy-ai
capy-ai Bot merged commit 5b7b095 into main Nov 1, 2026
62 checks 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.

1 participant