Repository navigation
v1.92.7.0 fix: /ship's review pass works on large diffs again (GST-507) - #3736
Merged
Merged
Conversation
…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>
|
😎 This pull request was 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.
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.
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.
Why
HARN-1's 4,000-file results PR produced a 1.39 MB review plan, and
gstack-review-dispatch passdied onJSON.parse: Unterminated string.gstack-review-plancalledprocess.exit(main())right after writing that plan to stdout, so a pipe only ever got the first 128 KB. Both bins now setprocess.exitCodeand 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-planandbin/gstack-review-dispatch; every caller reads their output throughspawnSyncwith 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). Neithermain()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 thatgstack-review-dispatch's BriefError handler fell through to its rethrow onceprocess.exitwas gone, so a brief-render refusal printed a Bun stack trace after theBRIEF_RENDER_FAILEDline. That is fixed in 51e6ca3, with a test that failed first (13 stderr lines) and passes now. The sameprocess.exit(main())pattern is still ingstack-coauthor-trailers,gstack-issue-linksandgstack-prose-lint; their outputs are small, so they are left alone here.Approvals
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 earlyprocess.exitcould bring the truncation back) is covered: no otherprocess.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),
passstaged 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.exitCodeso 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:
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 failbun run typecheck: exit 0gstack-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