Skip to content

v1.91.379.0 fix: review readers work in the checkout /ship ships (GST-482) - #3701

Merged
capy-ai[bot] merged 4 commits into
mainfrom
gst-482-review-workdir
Oct 31, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
gst-482-review-workdir

Conversation

@garrytan

@garrytan garrytan commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3701,
  "head": "b901fbdb49cffe8b01eb391aeefd315c27db7e35",
  "version": "1.91.370.0",
  "base": "main",
  "gate": {
    "focused": {
      "pass": 160,
      "fail": 0,
      "skip": 0
    },
    "remote_gate": {
      "pass": 3311,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "61d76a70ef8fc5c5f89d85ce3ac859250459b299",
  "product_patch_id": "ed006bc823cc52046307e45bbb357b5e26f7dfee",
  "gstack_version": "1.91.370.0",
  "review_depth": {
    "depth": "standard",
    "class": "code",
    "runtime_lines": 155,
    "rules": "150435b0a543019a",
    "base": "0cd2b4a9f9445c5ef3ac715b996ab67ff75f9833",
    "registry": "0cd2b4a9f9445c5ef3ac715b996ab67ff75f9833",
    "gate_scan": {
      "tagged": 0,
      "head": "b901fbdb49cffe8b01eb391aeefd315c27db7e35"
    },
    "reasons": [
      "runtime=155>50"
    ]
  },
  "pregate": "requires-remote cleared @61d76a70ef8f (1 checks, current for b901fbdb49cf)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41216605615",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/41216605630",
    "pregate.json/remote_gate: remote-gate tree=61d76a70ef8f tests=3311"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, CLAUDE.md, AGENTS.md, capy/skill/gstack (base cae783e, head b901fbd)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 2,
    "fixed": 1,
    "scope": "frozen",
    "fix_checks": 1,
    "dispatches": {
      "specialist": 3
    }
  },
  "review_targeted": {
    "classes": [
      "money"
    ],
    "rules": "baeb8f7ef7da92d0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "ed006bc823cc52046307e45bbb357b5e26f7dfee",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}
{
  "schema_version": 1,
  "pr": 3701,
  "head": "b901fbdb49cffe8b01eb391aeefd315c27db7e35",
  "version": "1.91.370.0",
  "base": "main",
  "gate": {
    "focused": {
      "pass": 160,
      "fail": 0,
      "skip": 0
    },
    "remote_gate": {
      "pass": 3311,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "61d76a70ef8fc5c5f89d85ce3ac859250459b299",
  "product_patch_id": "ed006bc823cc52046307e45bbb357b5e26f7dfee",
  "gstack_version": "1.91.370.0",
  "review_depth": {
    "depth": "standard",
    "class": "code",
    "runtime_lines": 155,
    "rules": "150435b0a543019a",
    "base": "0cd2b4a9f9445c5ef3ac715b996ab67ff75f9833",
    "registry": "0cd2b4a9f9445c5ef3ac715b996ab67ff75f9833",
    "gate_scan": {
      "tagged": 0,
      "head": "b901fbdb49cffe8b01eb391aeefd315c27db7e35"
    },
    "reasons": [
      "runtime=155>50"
    ]
  },
  "pregate": "requires-remote cleared @61d76a70ef8f (1 checks, current for b901fbdb49cf)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41216605615",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/41216605630",
    "pregate.json/remote_gate: remote-gate tree=61d76a70ef8f tests=3311"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, CLAUDE.md, AGENTS.md, capy/skill/gstack (base cae783e, head b901fbd)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 2,
    "fixed": 1,
    "scope": "frozen",
    "fix_checks": 1,
    "dispatches": {
      "specialist": 3
    }
  },
  "review_targeted": {
    "classes": [
      "money"
    ],
    "rules": "baeb8f7ef7da92d0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "ed006bc823cc52046307e45bbb357b5e26f7dfee",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}

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

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
--- Before · main.txt · captured output
+++ After · branch.txt · captured output
 $ tail -c 600 adversarial-native.prompt.md
+ot qualify.
+
+Workspace: the checkout under review is /workspace/gstack. Your shell and file tools may start in 
+another checkout, and every command runs in a fresh shell: begin each command with `cd 
+'/workspace/gstack' && `, and give every file read, search, edit or write an absolute path under 
+/workspace/gstack. Make the first line of your final reply the line `cd '/workspace/gstack' && echo 
+"REVIEWED_TREE: $(git rev-parse 'HEAD^{tree}') $(git rev-parse --show-toplevel)"` prints, even 
+where this brief limits your output to findings; a reply without it, or from another checkout, does 
+not count.
-al|High|Medium|Low` and `Blocks: yes|no`. After listing findings, end your output with ONE line in 
-the canonical format `Recommendation: <action> because <one-line reason naming the most exploitable 
-finding>` — examples: `Recommendation: Fix the unbounded retry at queue.ts:78 because it'll DoS 
-the worker pool under sustained 429s` or `Recommendation: Ship as-is because the strongest finding 
-is a theoretical race that requires conditions we can't trigger in production`. The reason must 
-point to a specific finding (or no-fix rationale). Generic reasons like 'because it's safer' do not 
-qualify.
 
 $ gstack-review-dispatch collect (a reader that reviewed /workspace/gbrain)
+COLLECT_WRONG_TREE: reader=adversarial-native reported="61d76a70ef8fc5c5f89d85ce3ac859250459b299 
+/workspace/gbrain" expected="61d76a70ef8fc5c5f89d85ce3ac859250459b299 /workspace/gstack" (the reply 
+did not review the checkout its brief named; nothing merged; restore it with a fresh pass under a 
+new --pass and --out)
-COLLECT: reader=adversarial-native findings=1 
-sha256=9f506144676f7216b95e94a8836f6341e1e1c21e4fdb1ad977993af646dedd1e 
-merged=.gstack/tmp/shots/main/m.jsonl
 

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 collect gains 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

Date Asked Exact words Outcome Covers Still pending
2026-10-31 Approve the plan "Review readers work in the checkout /ship reviews (GST-482, S1)" (autoplan run autoplan-20261031144819, 2 decisions) “do it: rec plus A1, B1 and C1. This is my approval under the fix-lane exemption, not a relay to Garry.” (GStack Minder (GSTA-36), relayed by agent:jam_01M696G55QYAW6DG1N41PNXQHV) approved the reviewed plan (sha256 c15b93d7aed3), every recommendation taken none

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 cd there on every command and to use absolute paths under it, and asks for a first reply line REVIEWED_TREE: <HEAD^{tree}> <toplevel>. gstack-review-dispatch records that fingerprint when it renders the brief and checks the reply against it at collect.

Behavior changes a lane will notice:

  • New refusals at collect. A missing tree line, or one naming another checkout, prints COLLECT_WRONG_TREE. A line from the right checkout at a later commit prints COLLECT_TREE_MOVED. Both exit 1 and merge nothing, and verify reports the brief NOT_COLLECTED.
  • collect --manifest. With a pass manifest, a refused reader is marked failed, so a rerun stops on it instead of collecting the same reply twice. lib/capy-review-pass.js now passes it.
  • Audit readers are checked too. Their briefs (Steps 7, 8, 14.5 and 9.2.1's QA reader) are written to briefs/ as the prompt file plus the paragraph, and the prompt file itself is not changed. mark --state collected on an audit reader now needs --output so the reply can be checked.
  • Outside voice. A reply that fails the tree check and holds no finding is recorded as unavailable coverage, never clean. A reply with findings is refused like any other reader, so none of its findings is lost. Unavailable outside output never counts as a review in verify.
  • Render refuses an unreadable checkout (BRIEF_RENDER_FAILED) rather than record a fingerprint no reply can match.
  • Two test pins moved in test/review-pass.test.ts (lines 323 and 425): they asserted main's audit collection without --output and the old brief path.

Test Coverage

All new code paths have test coverage.

Tests: +13 new (8 in test/review-pass.test.ts, 5 in test/review-dispatch.test.ts); 2 existing pins in test/review-pass.test.ts and 1 in test/review-targeted.test.ts updated 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-pass tests 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:

  • An outside voice that failed the tree check lost its findings. Now only a reply with no finding becomes unavailable; one with findings is refused (outside-voice#1, adversarial-native#1).
  • The tree-line parser stripped characters from literal paths and read every line instead of the first. It now strips only Markdown around the label, sha and whole path, and the first line wins (outside-voice#2, adversarial-native#2, Project-local .claude/skills/gstack install breaks /browse and setup can report false success #3).
  • An unreadable checkout at render refused every reader later. Render now refuses up front (adversarial-native#5).
  • parseFindings dropped 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, record status=done.

Review notes

  • adversarial-native#4 (Medium, not fixed): a wrong-tree STOP tells the lane to start a fresh --pass and --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.
  • fix-check#2 (informational): lib/review-ledger.ts:94: a reply that repeats the REVIEWED_TREE line, on a checkout whose toplevel holds a label token like P1 or High, can produce a phantom finding from the second copy.
  • fix-check#3 (informational): 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 --dispatch was 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 --manifest option on collect, --output required on mark --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 fail
  • bun run typecheck: 0 errors; bun run typecheck:test: no new diagnostics
  • bun test test/module-size-ratchet.test.ts test/bun-entry-isolation.test.ts test/spawnsync-timeout-tripwire.test.ts: 19 pass, 0 fail
  • bun run gen:skill-docs freshness: fresh
  • Remote pregate (gstack-pregate --stage tests --remote, Ubicloud) at tree 61d76a70ef8f: 3311 tests, 0 failed, $0.05

🤖 Generated with Claude Code

garrytan and others added 4 commits October 31, 2026 15:11
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>
@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: review readers work in the checkout /ship ships (GST-482) v1.91.379.0 fix: review readers work in the checkout /ship ships (GST-482) Oct 31, 2026
@capy-ai
capy-ai Bot merged commit 2d1b55d into main Oct 31, 2026
62 checks passed
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>
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>
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