Repository navigation
v1.91.379.0 fix: review readers work in the checkout /ship ships (GST-482) - #3701
Merged
Merged
Conversation
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…indings kept, unreadable checkout refused) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
garrytan
added a commit
that referenced
this pull request
Oct 31, 2026
…D row (Rule 25 with #3701) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This was referenced Oct 31, 2026
v1.92.82.0 fix(ship): verify re-derives each merged finding from the reader's output (GST-541)
#3717
Merged
capy-ai Bot
added a commit
that referenced
this pull request
Nov 2, 2026
…reader's output (GST-541) (#3717) * fix(ship): verify re-derives each merged row by index (GST-541) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(ship): verify fails closed on a missing output, a forged merged copy and uncollected rows (GST-541 review) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(ship): a missing recorded output file is dirty even with no findings (GST-541 fix-check) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(ship): a reply collect refused as no review keeps its NOT_REVIEWED row (Rule 25 with #3701) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(ship): only a reply refused for its tree skips verify's count check (GST-541 fix-check) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(ship): verify re-derives a tree refusal from the reply before it skips the count check or voids an output (GST-541 fix-check 2) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(ship): an output with no readable recorded file is dirty even with no ids (GST-541 fix-check 3) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(ship): verify accepts an output as a review only when its reply names the render's tree (GST-541 red team) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(review-ledger): judge binding compares real paths, so a run reached through a symlink verifies clean Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.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.
What changed
A review reader that worked in another checkout: main merges its finding; this branch refuses it, because the brief now names the checkout and the reply must prove which tree it read.
Before/after as text: A review reader that worked in another checkout: main merges its finding; this branch refuses it, because the brief now names the checkout and the reply must prove which tree it read
Why
GBrain's crew reported a /ship specialist that "returned four findings in files outside the PR" (GBRA-218, GST-482). On Capy, review readers start as subagents on the shared machine, so each one opens in the machine's working directory, and the briefs never named a folder. A /ship run from a worktree had its readers review whatever branch the primary checkout held, and a clean review of the wrong tree looked the same as a clean review of the right one. Now every brief names the checkout, and a reply that cannot show it reviewed that checkout is refused before anything it said is merged.
Blast radius
Every /ship and /review reader brief gets one paragraph at its end, and
collectgains a check, so every lane that runs a review pass is touched. The rest of each brief is the same bytes as main's render, which a test asserts for every role (script ran). A ledger rendered before this change has no recorded fingerprint and collects as before, which a test also covers (script ran). The preregistered live smoke ran a real pass from a worktree on a shared machine and passed 4 of 4 conditions (repro).Approvals
Source: gstack-approvals record for gst-482-review-workdir (display only; not an approval citation).
Summary
Readers on a shared machine reviewed the primary checkout instead of the worktree /ship was shipping. Every brief now ends with a workspace paragraph that names the checkout, tells the reader to
cdthere on every command and to use absolute paths under it, and asks for a first reply lineREVIEWED_TREE: <HEAD^{tree}> <toplevel>.gstack-review-dispatchrecords that fingerprint when it renders the brief and checks the reply against it at collect.Behavior changes a lane will notice:
COLLECT_WRONG_TREE. A line from the right checkout at a later commit printsCOLLECT_TREE_MOVED. Both exit 1 and merge nothing, andverifyreports the briefNOT_COLLECTED.collect --manifest. With a pass manifest, a refused reader is markedfailed, so a rerun stops on it instead of collecting the same reply twice.lib/capy-review-pass.jsnow passes it.briefs/as the prompt file plus the paragraph, and the prompt file itself is not changed.mark --state collectedon an audit reader now needs--outputso the reply can be checked.verify.BRIEF_RENDER_FAILED) rather than record a fingerprint no reply can match.test/review-pass.test.ts(lines 323 and 425): they asserted main's audit collection without--outputand the old brief path.Test Coverage
All new code paths have test coverage.
Tests: +13 new (8 in
test/review-pass.test.ts, 5 intest/review-dispatch.test.ts); 2 existing pins intest/review-pass.test.tsand 1 intest/review-targeted.test.tsupdated for the new behavior.Test value: 13 tests written, 0 rejected by the authoring gate, 3 existing tests extended, 0 paths weakly covered.
Regression proof — fails at HEAD · passes at base · passes after fix: all 8 new
review-passtests fail against main's dispatch code and pass on this branch.Tests ran: focused 160
Tests ran: typecheck count unavailable
Pre-Landing Review
Step 9 (specialists batched, plus the money-class targeted reader): no issues found. Step 11's adversarial voices (native and the Codex outside voice) raised 7 CRITICAL and 1 Medium; after judgment (1 fold) the CRITICALs were fixed in 26bc5b8:
parseFindingsdropped any tree-shaped line from finding bodies. It now skips only the reply's first tree line (adversarial-native#6).The fix-check on the touched hunks found nothing at the blocking floor and 3 informational items; the doc one was fixed in b901fbd.
REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=2 fixed=1 scope=frozen fix_checks=1 dispatches=3
Gate edits: none detected (12 listed, 9 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: Codex outside voice completed with 2 findings, both fixed. Targeted reader (money class): re-dispatched on the final diff after the fixes changed the patch,
NO FINDINGS, recordstatus=done.Review notes
--passand--out, which sends every reader again rather than only the failed one. Left as is because resending one reader under the same manifest needs a manifest change outside this fix.lib/review-ledger.ts:94: a reply that repeats the REVIEWED_TREE line, on a checkout whose toplevel holds a label token likeP1orHigh, can produce a phantom finding from the second copy.lib/review-brief.ts:160: two Markdown forms the first parser accepted (an italic whole line, and a backtick outside bold) are now refused as a missing line.Exploratory QA
Preregistered live smoke (Captain's A1, capped at $3): a real review pass from a worktree on a shared machine, with readers starting in the primary checkout. It passed 4 of 4 preregistered conditions at 652 credits; the smoke worktree and branch were removed afterward.
Design Review
No frontend files changed — design review skipped.
Eval Results
Not run on this PR.
bun run eval:bg:pr --dispatchwas refused (this gh account cannot dispatch workflows on garrytan/gstack), and eval selection maps every changed lib to all 260 dependent gate cases, which is the train's full gate (gstack/full-gate), not a focused slice. Coverage: missing until the train gate runs. The live smoke above is the behavior evidence for this PR.Plan Completion
Plan items from the approved autoplan run (rec, A1, B1, C1) are done: the code findings were folded into plan v2 and built, the live smoke replaced the no-loss replay, a bad or missing outside-voice line is recorded unavailable only without findings, and this S1 lands before GSTA-167's worktree guard (#3670), which drops that guard on rebase.
Verification Results
Preregistered smoke: 4 PASS, 0 FAIL, 0 BLOCKED, 0 NOT RUN.
TODOS
No TODO items completed in this PR.
Documentation
Scope: branch gst-482-review-workdir at head b901fbd, diff against base cae783e. This covers 10 committed files (the review-dispatch bin, four review libs, three tests, docs/review-policy.md, and the changelog.d fragment). Nothing is staged, unstaged, or untracked. Mode was edit.
Result: current. The new workspace paragraph, the REVIEWED_TREE check, COLLECT_WRONG_TREE and COLLECT_TREE_MOVED, the
--manifestoption oncollect,--outputrequired onmark --state collected, and the unavailable outside voice behavior are all documented. They appear in docs/review-policy.md (new item 7, already in the diff), in the changelog fragment, and in the bin's HELP text. A grep of the other docs found no stale references to the changed commands or codes: capy/skill/gstack/SKILL.md line 49 does not describe audit-reader collection, and troubleshooting.md, ship-policy.md, captain.md, README.md and CLAUDE.md name none of these codes or flags.Debt: the codes COLLECT_WRONG_TREE and COLLECT_TREE_MOVED have no docs/troubleshooting.md anchor. AGENTS.md says reason codes in lib/gate-outcomes.ts each have one, but these are dispatch output codes, not entries there. This was left alone as an uncertain, larger change. I did not run the gen or skill-size checks, because generators are out of scope.
Test plan
bun test test/review-pass.test.ts test/review-dispatch.test.ts test/review-targeted.test.ts test/review-plan-cli.test.ts test/ship-driver.test.ts test/review-dispatch-compare.test.ts test/ship-budget-reader-drift.test.ts test/prose-voice-floor.test.ts: 160 pass, 0 failbun run typecheck: 0 errors;bun run typecheck:test: no new diagnosticsbun test test/module-size-ratchet.test.ts test/bun-entry-isolation.test.ts test/spawnsync-timeout-tripwire.test.ts: 19 pass, 0 failbun run gen:skill-docsfreshness: freshgstack-pregate --stage tests --remote, Ubicloud) at tree 61d76a70ef8f: 3311 tests, 0 failed, $0.05🤖 Generated with Claude Code