Skip to content

Reviews stay valid after merging main when a stacked parent was already on main (GST-3315) - #4580

Merged
capy-ai[bot] merged 4 commits into
mainfrom
reuse-review-past-parent-already-on-main
Nov 21, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
reuse-review-past-parent-already-on-main

Conversation

@garrytan

@garrytan garrytan commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

/ship keeps a PR's review when the PR merges main and its stacked parent had already landed before the review. It used to refuse over the parent's files.
Why: yc-software/qm#3457 was asked to re-review files it never changed. Nothing for readers to do.

What changed

A stacked PR whose parent had already squash-merged into main before the review would later merge main again, and /ship then asked for a fresh review that blamed the parent's files, which the PR never touched. On qm's real commits (7e790c7d to 2c777efc), /ship used to blame parent 635834740 even though the reviewed base 91716d50 already held it. Now it compares from the merge base, so an unchanged PR keeps its review, and context that main moved next to the PR's own lines gets one scoped review of just that file (there, src/mcp/mcp-client.ts).

  • The stacked-parent finder skips a parent commit that the reviewed base already contains.
  • Step 11.5's base-merge check uses the same parent rule, and patch IDs are taken with --unified=3, so a user's diff.context can't shrink the context that gets compared.
  • docs/ship-policy.md gets one paragraph on the rule, and changelog.d/ gets the release note.
  • New tests cover the qm#3457 shape, negative controls (the PR's own edit still refuses; a parent not yet on the base still counts), Step 11.5 using the same rule, and diff.context=0. The qm#3457, Step 11.5 and diff.context=0 tests failed before their fixes; the two controls pass before and after.
Why

"Asked to re-review files it never changed" (yc-software/qm#3457). A PR that only merged main should keep the review it already passed, and only lines that actually moved next to its own changes should be read again.

Blast radius

The parent finder is also used by the squash commit message at land time (lib/squash-message.ts:64); see review note 1. Every other change can only make /ship compare more of the branch, never less, so a mismatch still refuses (walked failure path in both reviews, plus the new negative-control tests).

Pre-Landing Review

One full review pass of the whole diff: a batched specialist reader (testing, security, state machines), a red-team reader, a native adversarial reader and a second-model review (GPT-6.1 Sol). No blocking findings. The specialists found nothing, the second-model review was clean, the red-team reader's one finding is recorded privately (security-category details stay out of the body), and the adversarial reader's three findings are the review notes below. No fixes were applied.

Review notes
  1. (Medium, not blocking) For a stacked child that merges main after its parent's squash lands, the squash commit body now repeats the landed parent's Co-authored-by and trailer lines. Before this change it pulled in main's trailers instead, so it was wrong both ways. No test covers that case yet. A follow-up can apply the new skip only to the review-reuse check and Step 11.5, with a squash-message test where the child merges main.
  2. (Low) --unified=3 pins only diff.context. diff.algorithm, diff.interHunkContext and the indent heuristic can still change patch IDs between machines; that can only cause a wrong refusal, never a wrong acceptance.
  3. (Low) A review recorded by an older gstack under a non-default diff.context refuses once after this change and needs a fresh /ship.
Exploratory QA

Functional smoke, 2 probes through the repository's own tests: an unrelated main change keeps the review (pass) and an own edit after the base merge refuses (pass). Verdict: pass. The squash-message case in note 1 was reproduced by the reviewers in a scratch repository, not here.

Scope Drift

Scope Check: CLEAN. Intent: keep a review valid when a stacked parent was already on the reviewed base. Delivered: that rule in the parent finder and Step 11.5, the patch ID context pin, docs, a release note and tests.

TODOS

No TODO items completed in this PR.

Documentation

Current: the docs already match this branch and needed no edits. Scope: docs/, README.md, CLAUDE.md and AGENTS.md against base 92c57ca. The audit's full section is in the Agent notes.

Tests
  • Free Tests, workflow_dispatch run 44838983598 at 98fa579: green, 1722 test files (38613 tests)
  • Pull request checks at 98fa579: green, including macOS named regressions and Windows smoke
  • Two targeted probes of the new tests: pass
Agent notes

Refs yc-software/qm#3457, GST-3315. Lane GSTA-678 under GStack Minder (GSTA-36).

Approvals

No approvals recorded for branch reuse-review-past-parent-already-on-main.
Plan: exempt: bug fix, no new functionality (R4)
Plan check: exempt bug fix

Documentation audit docs-4580-1 (verbatim):

Status: current. Docs already match this branch; no edits needed.

Scope: base 92c57ca to HEAD 98fa579 (5 committed files; nothing staged, unstaged or untracked). Diff touches lib/ship-receipt.ts, lib/ship-receipt-patch.ts, a test, docs/ship-policy.md and one changelog fragment.

Documentation health:

  • docs/ship-policy.md: current (the branch already documents the held-parent rule in the stacked-PR carry section, plus Step 11.5's matching rule)
  • changelog.d/receipt-carry-held-parent.md: current (plain-language note covering both fixes; not edited, per scope)

Coverage debt: none. No new commands, flags, refusal codes or config keys; the behavior change is documented in the reference section for receipt carry.

Diagram drift: none.

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=3 fixed=0 scope=frozen dispatches=4
Gate edits: none detected (2 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

{
  "schema_version": 1,
  "pr": 4580,
  "head": "98fa579b6c938bc76045e2d4537f4fb11aa55bbb",
  "version": "1.102.1.0",
  "base": "main",
  "gate": {
    "test": {
      "pass": 1722,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 44838983598,
      "attempt": 1,
      "tree": "d6af2636d987489e5db57f920366265c51f129e2"
    }
  ],
  "calls": 28,
  "session_kind": "unattended",
  "run": "/home/user/.capy/work/ship-4580/run",
  "head_tree": "d6af2636d987489e5db57f920366265c51f129e2",
  "product_patch_id": "78fe24af673d159534b581bac9c3a505c1c6495a",
  "gstack_version": "1.102.1.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 52,
    "rules": "85b3923b1a978e41",
    "base": "faae7f725a4834207c24704639c807af146d33f4",
    "registry": "faae7f725a4834207c24704639c807af146d33f4",
    "gate_scan": {
      "tagged": 0,
      "head": "98fa579b6c938bc76045e2d4537f4fb11aa55bbb"
    },
    "reasons": [
      "gate-class",
      "runtime=52"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @d6af2636d987 (8 checks, current for 98fa579b6c93)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44838983598/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44838279367/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=d6af2636d987 tests=38613 skipped=71 runs=44838983598/1 profiles=ci-reuse/free-tests heads=98fa579b6c93 verified=2026-11-20T23:51:40.196Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, CLAUDE.md, AGENTS.md against base 92c57ca4"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 3,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "dispatches": {
      "specialist": 3,
      "red-team": 1
    }
  },
  "gate_dispositions": []
}
{"head":"4379282f14f10d136f49edd51101bdfa54f1f206","run":"ship-4580","status":"started","review_loop":{"passes":1,"blocking_found":0,"deferred":0,"noted":0,"fixed":0,"scope":"frozen","rounds":1,"dispatches":{"specialist":3,"red-team":1}}}

Open in Capy

garrytan and others added 3 commits November 20, 2026 22:44
… (GST-3315)

yc-software/qm#3457: the parent squash-landed before the review, the child merged main, and a later main merge moved
context beside one of its hunks. landedStackParent took the parent's commits (held by both bases) as a parent that
landed since and measured from them, refusing on the parent's files. A commit rangeBase already holds is now no
parent. baseMergeOnly measures a reviewed range from a parent that landed after the review, as the carry does.

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

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 Nov 20, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit ef4a7f5 into main Nov 21, 2026
77 checks passed
@garrytan garrytan mentioned this pull request Nov 21, 2026
capy-ai Bot added a commit that referenced this pull request Nov 21, 2026
- Habits from nine teams, written into gstack. (#4585)
- Three more habits from teams that run evals. (#4602)
- The /ship conductor trial plan gives its real-problem judge one more attempt on fresh labels after it missed its agreement bar twice, and stops the trial incomplete if it misses again (GST-3003). (#4611)
- The /ship conductor trial plan now stops a trial only at the final remote-gate refusal, gives both arms the same note that the brief overrides team rules, and counts every report the no-gstack arm returns (GST-3003). (#4609)
- The /ship conductor trial plan now ends a trial at the remote gate when its case base isn't main, gives the no-gstack arm a test runner, and audits every trial for exposure to the plan (GST-3003). (#4605)
- The /ship conductor trial plan now runs an uncounted pilot in every arm before its counted trials and takes one planned look at half the cases (GST-3003). (#4587)
- gstack's own use on Capy can be counted, and is kept out of real-use numbers. (#4576)
- Free Tests shards finish closer together. (#4578)
- The weekly test-time recording can land again on its own. (#4581)
- The job-log tree.json step's recommended sleep is long enough for real runners. (#4589)
- Pull requests no longer wait on the Trunk flaky-test upload, and the quick tier's flaky passes now reach Trunk. (#4579)
- Windows Setup E2E finishes sooner on install changes. (#4575)
- Skills no longer stop on Codex when they clean up temp files. (#4612)
- /review on Codex with OpenAI models no longer holds back a review that ran its adversarial pass. (#4622)
- Crew threads on Capy now check in at 500M own tokens, standing threads rotate at 250M and any subagent past 50M gets a look, half the old lines, because Capy's token counts read about half what they did before 2026-11-15. (#4582)
- gstack no longer offers to add a `## Skill routing` section to your project's CLAUDE.md. (#4629)
- The README and docs no longer say gstack makes your agent fix more bugs. (#4598)
- `/eval-plan` now writes eval plans that waste less money. (#4591)
- /cso checks every folder above a source file before it looks at the file, so it never looks through a symlinked folder. (#4592)
- Plan reviews no longer read a /design-review audit summary as the branch's design doc. (#4623)
- Node's built-in test files now run with `node --test` in repos that use vitest or jest. (#4626)
- A quarantined test that the runner skipped now fails the run instead of passing it. (#4590)
- A flaky free test is fixed: the spawnSync overflow check no longer fails about once an hour on CI. (#4613)
- Free Tests runs its shards on 16-core runners. (#4600)
- /office-hours asks for ground truth first. (#4468)
- Every startup session ends with a dated test. (#4468)
- /plan-tune's dream cycle now logs each send of your typed answers to Anthropic. (#4621)
- Landing a ready PR no longer depends on a hand-copied gate decision, and the ready note, release PR and squash message say the right thing. (#4596)
- /ship no longer asks for a fresh review because of a stacked parent that main already had. (#4580)
- Results PRs with large captured agent sessions can be reviewed. (#4574)
- /ship no longer stalls on review notes a reviewer already cleared, counts review rounds the way the review policy reads them, and keeps security findings out of the PR body. (#4595)
- /ship's review readers are now told never to stop processes they didn't start. (#4607)
- /ship's review no longer stops when Capy's own drive sync database grows past 100 MB. (#4606)
- /ship's preflight now honors your repository's time limit for rerunning CI-skipped tests, and tells you when a fresh worktree needs its packages installed. (#4608)
- The slowest free test file is now six files. (#4588)
- Step 11.5 keeps a reviewed head current across base-only merges. (#4577)
- On a Capy install, only the owner's opt-in sends telemetry. (#4597)
- New page: working across agent systems. (#4583)

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