Skip to content

v1.94.15.0 fix(ship-receipt): carry a stacked PR's receipt after its parent squash-merges into main (GST-1199) - #3928

Merged
capy-ai[bot] merged 5 commits into
mainfrom
capy/carry-a-stacked-prs
Nov 3, 2026
Merged

capy-ai[bot] merged 5 commits into
mainfrom
capy/carry-a-stacked-prs

Conversation

@garrytan

@garrytan garrytan commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3928,
  "head": "8d183032123fb7bc4903672dac325cf89584e4e2",
  "version": "1.94.8.0",
  "base": "main",
  "gate": {
    "targeted": {
      "pass": 17,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "2729b65bb9f7567094edd431d72cd60ce5f453a6",
  "product_patch_id": "dc1adaf0821090ab81ed2fce9ed0ba2f92afc6e5",
  "gstack_version": "1.94.8.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 88,
    "rules": "18dcd562316f56ed",
    "base": "c197a139b7eba04aa3a7a937bfcd1019bff224fb",
    "registry": "c197a139b7eba04aa3a7a937bfcd1019bff224fb",
    "gate_scan": {
      "tagged": 0,
      "head": "8d183032123fb7bc4903672dac325cf89584e4e2"
    },
    "reasons": [
      "gate-class",
      "risk:security",
      "runtime=88"
    ],
    "risk": [
      "security"
    ]
  },
  "pregate": "requires-remote cleared @2729b65bb9f7 (7 checks, current for 8d183032123f)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41597335814/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=2729b65bb9f7 tests=34667 skipped=71 runs=41597335814/1 profiles=ci-reuse/free-tests heads=8d183032123f verified=2026-11-03T07:41:26.353Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/ (ship-policy.md, troubleshooting.md checked against the carry change)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 1,
    "fixed": 1,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 2,
    "dispatches": {
      "specialist": 1,
      "red-team": 1
    }
  }
}

What changed

gstack-ship-receipt carry now keeps a stacked PR's /ship receipt after its parent squash-merges into main, when the receipt was written against main while the PR was still stacked.

Before (main at c197a13), on the GST-1199 fixture:

CARRY: refused (RECEIPT_CARRY_PRODUCT_CHANGED)
product diff changed between 24cb5b5fda87 and 22745046b489: lib/util.js

After: the same fixture prints CARRY: carried from <child> to <head> (stack parent <sha12> landed + base merge).

The carry finds the newest commit inside the reviewed range that main already holds: git merge-tree of that commit into main changes no product path. It then compares the child's range from that commit with HEAD's diff against main. Equal patch-ids carry. Base edits next to the child's own hunks go to RECEIPT_CARRY_SCOPED_REVIEW. Any other difference still refuses with RECEIPT_CARRY_PRODUCT_CHANGED. A commit with no product change of its own never counts, and neither does a parent that never landed, even when the child's merge dropped its change.

Why

gstack-evals#178 was stacked on #175 and targeted main. Its gate-class receipt was written at 4d1feef. After #175 squash-merged and main was merged into #178, the carry refused, even though the child's own patch-id was the same on both sides (20b669ce42fa). The only way through was a full gate-class re-review, about 45-60M tokens. Any crew that stacks PRs and squash-merges hits the same wall.

Blast radius

Only the receipt carry changes, and only when the product patch-ids at the two heads already differ and the receipt was not retargeted. Before, that path always refused or went to scoped review. Now it first looks for a landed commit inside the reviewed range. That costs one git diff and one git merge-tree per commit, for at most 100 commits. When it finds none, the carry behaves exactly as before. The receipt schema, the write path and the help text are unchanged. No new dependency, network call, environment read or workflow edit.

Approvals

Bug fix under the fix-lane exemption (no plan review). GStack Minder approved the cmdCarry edit in bin/gstack-ship-receipt after a clean trial merge with #3920.

Documentation

Scope: branch diff against origin/main (receipt carry for stacked PRs whose parent landed, GST-1199), with docs/ship-policy.md and docs/troubleshooting.md as the docs that describe it. Result: ship-policy.md already matched the code. I added one sentence to the RECEIPT_CARRY_PRODUCT_CHANGED entry in troubleshooting.md for base-written receipts. Debt: the Fix paragraph of that entry does not list the new carry case, and I did not read every doc in the repo.

Pre-Landing Review

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=1 fixed=1 scope=frozen fix_checks=1 dispatches=2

Pre-Landing Review: 1 issue, 1 fixed. The Red Team found that a test-first commit with no product change could pass as a landed parent, which wrote a false reason into the receipt. That's fixed in 1f1bd4d with a regression test that fails without the fix.

Gate edits: none detected (GATE_SCAN tagged=0).

Adversarial (Step 11): native voice issues_found (2 findings, neither blocking). Outside voice (openai/gpt-6.1-sol) found nothing blocking.

Open notes (below the blocking floor; review rounds used up under R65)

  • Fix-check (informational): the no-product-change guard diffs rangeBase..commit rather than the commit's own change. So on fork → parent A → child test-first commit B → reviewed head, the walk names B instead of A as the landed parent, and B's test hunks drop out of the reviewed-side test patch-id. The carry decision is unchanged. The suggested fix is git diff --quiet <commit>^ <commit>.
  • Adversarial, Medium, does not block: git merge-tree leaves the base's blob on a conflicted binary path, or on a path marked -merge/merge=ours. So a parent whose binary change conflicted can count as landed when the child's merge dropped that change. The shipped diff is still exactly the reviewed child hunks. The suggested fix: when merge-tree exits 1, reject the commit if any conflicted path is a product path the commit changed. Until that lands, the docs sentence "A conflicted product path never counts" overstates the case for binary paths.
  • Adversarial, Low, does not block: a test-only commit made before an earlier base merge inside the range can pass the guard. As far as the reviewer could trace, this fails closed with a refusal that names misleading paths.

Test plan

  • Failing first: on c197a13, two of the three new GST-1199 cases in test/ship-receipt-carry-squash.test.ts fail with RECEIPT_CARRY_PRODUCT_CHANGED. With the fix, the file passes (10 tests).
  • Targeted lane: 17 tests, 0 failures. Free Tests at tree 2729b65bb9f7: CI run 41597335814 is green (34,667 tests), and the macOS named-regressions job passed.

…sh-merges into main (GST-1199)

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

trunk-io Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 3, 2026 07:20
… parent (review fix, GST-1199)

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>
… audit, GST-1199)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions github-actions Bot changed the title fix(ship-receipt): carry a stacked PR's receipt after its parent squash-merges into main (GST-1199) v1.94.15.0 fix(ship-receipt): carry a stacked PR's receipt after its parent squash-merges into main (GST-1199) Nov 3, 2026
@capy-ai
capy-ai Bot merged commit bf2bcf1 into main Nov 3, 2026
49 checks passed
garrytan added a commit that referenced this pull request Nov 3, 2026
lib/ship-receipt.ts KEY_ORDER keeps flaky_exception (#3911) and no_stop.
bin/gstack-ship-receipt: main's review_exclude help and digest refusal text plus
--no-stop help; the J1 re-check block before one planCarry call carrying both
stackParent (#3928) and recheck; the recheck risk-class check after the digest check.
test/review-packets-removed.test.ts keeps both NO_LOSS_REPLAYS keys (GST-940 and
GST-508+GST-464+GST-967+GSTA-258-L4).

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