Skip to content

/ship's review works when the shipped checkout isn't the project's default checkout (GST-3145) - #4507

Merged
capy-ai[bot] merged 3 commits into
mainfrom
fix-review-readers-in-another-checkout
Nov 19, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
fix-review-readers-in-another-checkout

Conversation

@garrytan

@garrytan garrytan commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

/ship's review pass now lets its readers start in a checkout of an unrelated repository, and refuses to start them in any other checkout that holds the review's diff base, such as a sibling worktree or a separate clone of the shipped repository.
Why: a project whose default checkout is another repository needed a fresh machine for every /ship review, while a worktree or clone of the same history could read the wrong diff with no error.
Nothing to do: the pass still stops before anything starts if the shipped checkout can't be reached.

What changed

The review pass in lib/capy-review-pass.js runs one check from the directory readers start in. It runs cd <checkout> and reads that checkout's top level, and it asks whether the start directory's repository holds the pass's diff base commit (git cat-file -e <base>^{commit}). The pass stops with nothing started when the shipped checkout can't be reached, or when the start directory is another checkout holding that commit, which covers sibling worktrees and separate clones. A checkout of another history, a directory outside any checkout, and a directory with a broken .git dispatch. test/review-pass.test.ts adds a separate-clone case, which fails on the previous version, and pins the broken-.git dispatch. docs/review-policy.md and the changelog fragment describe the check.

Why

Two teams hit STOP: readers on the shared machine start in <dir>, not in <checkout> when the checkout they shipped wasn't their machine's default one. The previous version of this PR stopped only for a sibling worktree, so a separate clone of the same repository still dispatched, and a reader command that skipped its cd would read that clone's diff silently.

Blast radius

Only the dispatch check of the review pass on a shared machine changes; reviewer briefs and collection are untouched. bun test test/review-pass.test.ts passes 80 tests at this head.

Documentation

Scope: the branch fix-review-readers-in-another-checkout against base 5afef04. It changes the /ship review pass so it no longer stops when readers start in a different checkout. Changed files: lib/capy-review-pass.js, docs/review-policy.md, changelog.d/review-readers-start-in-another-checkout.md and test/review-pass.test.ts.

Result: the docs are current. The review-policy paragraph and the changelog fragment describe the new reach check accurately: readers may start in another checkout; the pass stops when the shipped checkout can't be reached, or when the start checkout holds the diff base, such as another worktree or a clone of the same history. A search of Markdown files and templates outside CHANGELOG.md found no remaining text that tells users to run /ship in the thread's own checkout.

Debt: none found.

Test Coverage

Coverage audit (audit only, no tests written): 8 of 9 changed code paths tested (89%, value-weighted 89%). The gap: every test uses one shared diff base, so the branch that also collects each active reader's own diff_base is never exercised. Proposed test: a row in the separate-clone test whose clone holds only a reader's own base.

Pre-Landing Review

No finding reached the blocking floor (a failing test, a production break, or lost data or secrets). This was the PR's read-only final review: it had two full review rounds on earlier heads, so this head got one full review with no fix round. Four review notes were raised and left unfixed. Second-model review (openai/gpt-6.1-sol): clean. The targeted reader and the red-team reader found nothing.

Review notes

Below the blocking floor; recorded here and not fixed in this PR.

  • INFORMATIONAL test/review-pass.test.ts:130 The new unrelated() helper sits between repo()'s doc comment and repo(), so that comment now attaches to unrelated().
  • INFORMATIONAL lib/capy-review-pass.js:193 A start directory whose git call fails with another error, such as dubious ownership, now dispatches without an early stop; a wrong-tree reply is still refused by the reviewed-tree check.
  • INFORMATIONAL lib/capy-review-pass.js:193 In a partial clone that lacks the base commit, git cat-file -e can start a lazy network fetch, adding up to the 300 s timeout.
  • INFORMATIONAL lib/capy-review-pass.js:194 The check's reply is split by line position; a shell that prints a preamble shifts the fields, and the pass stops with a confusing message rather than dispatching.
  • INFORMATIONAL lib/review-sweep.ts:48 (open from an earlier round) The fetch sweep's default roots omit the readers' start directory when it lies outside the checkout's parent, $HOME and the temp directory.
Exploratory QA

Not run at this head: the Step 9.2.1 smoke probes never ran in this review, so there is no functional smoke report. The only behavioural evidence is bun test test/review-pass.test.ts (80 pass) and the readers' own runs of that file.

Tests
  • bun test test/review-pass.test.ts: 80 pass, 0 fail
  • CI free suite at this head (run 44481518699): green, 37,891 tests
  • Flaky: free-suite (8) at ea65183 failed on a runner apt lock during the Chromium install, and its single rerun (attempt 2 of run 44472661656) passed.
Agent notes

Agent notes

Reported by HARN-105 (2026-11-18) and HARN-107 (2026-11-19) on gstack 1.101.0.0. Read-only final review (R51) at ea65183 after two full rounds (eb78975, 6b90158); no fix round. Refs GST-3145.

Plan: exempt: bug fix
Gate edits: 3 listed, 2 read, 0 findings (RH-15 test rewrite justified by the GST-3145 behaviour change in the same diff)
Skipped findings: p1/specialist-batched#1 (below floor; no fix round in the read-only final review). Notes p1/adversarial-native#1, #2, #3 recorded below floor.
Outside review: openai/gpt-6.1-sol host subagent, completed, VERDICT: CLEAN.
Exploratory QA: not run (Step 9.2.1 smoke probes skipped; named gap).
Flaky: free-suite (8), run 44472661656 attempt 1, runner apt lock during Chromium install; attempt 2 passed.
Documentation: current (read-only audit, no edits).

{
  "schema_version": 1,
  "pr": 4507,
  "head": "ea6518399f5972285d9c6f22bc64ec3a08d314c2",
  "version": "1.101.0.0",
  "base": "main",
  "gate": {
    "review-pass": {
      "pass": 80,
      "fail": 0,
      "skip": 0
    },
    "free": {
      "pass": 37891,
      "fail": 0,
      "skip": 0
    }
  },
  "calls": 47,
  "session_kind": "unattended",
  "run": "ship-4507-r3",
  "head_tree": "7ff2aa738e12eb1e273119cc733a5ef36c5a4a59",
  "product_patch_id": "2f6455cbad7a16897f6a48b6e47dc25aa06ca276",
  "gstack_version": "1.101.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 24,
    "rules": "1afa38a4be3b5eef",
    "base": "b7022438597edd2b877449608f7449f5c13c3511",
    "registry": "b7022438597edd2b877449608f7449f5c13c3511",
    "gate_scan": {
      "tagged": 1,
      "head": "ea6518399f5972285d9c6f22bc64ec3a08d314c2"
    },
    "reasons": [
      "gate-class",
      "risk:security",
      "runtime=24"
    ],
    "risk": [
      "security"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @7ff2aa738e12 (8 checks, current for ea6518399f59)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44481518699/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=7ff2aa738e12 tests=37891 skipped=67 runs=44481518699/1 profiles=ci-reuse/free-tests heads=ea6518399f59 verified=2026-11-19T08:36:47.223Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, CLAUDE.md, AGENTS.md, CONTRIBUTING.md (read-only audit of the committed diff 5afef04e..ea651839)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 3,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "dispatches": {
      "specialist": 1,
      "red-team": 1
    }
  },
  "gate_dispositions": [],
  "review_targeted": {
    "classes": [
      "gate"
    ],
    "rules": "23eb808423669ba0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "2f6455cbad7a16897f6a48b6e47dc25aa06ca276",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}

…fault checkout (GST-3145)

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

trunk-io Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 2 commits November 19, 2026 05:33
…ed repository (GST-3145)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ff base, clones included (GST-3145)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit c25390d into main Nov 19, 2026
100 of 102 checks passed
@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