Skip to content

v1.94.21.0 fix(ship-receipt): a stacked carry ignores files the child's own earlier main merge brought in (GST-1214) - #3940

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

capy-ai[bot] merged 4 commits into
mainfrom
capy/a-stacked-carry-ignores

Conversation

@garrytan

@garrytan garrytan commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3940,
  "head": "4e8b1de50303dca54667abf5aaff09303d4a3694",
  "version": "1.94.15.0",
  "base": "main",
  "gate": {
    "targeted": {
      "pass": 20,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "95be2f798d232061babfb50ca236cfe781fcd2c9",
  "product_patch_id": "7336ed45b6115ff9862cbf261457974a23e4eacb",
  "gstack_version": "1.94.15.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 23,
    "rules": "19881e1ecf7ed1ad",
    "base": "bf2bcf14b08d774291613c8073674a0e90eb4f9f",
    "registry": "bf2bcf14b08d774291613c8073674a0e90eb4f9f",
    "gate_scan": {
      "tagged": 0,
      "head": "4e8b1de50303dca54667abf5aaff09303d4a3694"
    },
    "reasons": [
      "gate-class",
      "runtime=23"
    ],
    "risk": []
  },
  "pregate": "pass @95be2f798d23 (7 checks, current for 4e8b1de50303)",
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/ (ship-policy.md, troubleshooting.md checked against the carry change)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 1,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 2,
    "dispatches": {
      "specialist": 2,
      "red-team": 2
    }
  }
}

Fixes GST-1214.

What changed

gstack-ship-receipt carry now carries a stacked PR's receipt when the child merged main before its receipt was written, its parent squash-landed afterward, and the child merged main again. After it finds the landed parent, the carry leaves out every path whose content at the reviewed head is main's (paths the child's first main merge brought in), unless HEAD changed that path against main. A path with any compared path beneath it always stays in.

Before (main at bf2bcf1), on the GST-1214 fixture:

CARRY: refused (RECEIPT_CARRY_PRODUCT_CHANGED)
product diff changed between acd40062c617 and 2f44c1569950: wiki/a.md, wiki/b.md

After: CARRY: carried from <reviewed> to <head> (stack parent <sha12> landed + base merge).

Why

gstack-evals#178 merged main once before its receipt (20 wiki/ files came in). Its parent then squash-landed, and #178 merged main again. The carry from #3928 compared the range from the parent's head, which still held those 20 files, with HEAD's diff against main, which didn't. So it refused, even though the product diff against main was unchanged (the same 3 files, patch-id 20b669ce42fa). Without this fix, GEVA-2 reruns a full /ship.

Blast radius

Only the stack-parent branch of the carry changes, which runs only when the receipt's head is an ancestor of HEAD, the product patch-ids differ and a landed parent was found. A path drops out of both patch-ids only when the reviewed head holds main's content there, HEAD's diff against main doesn't touch it, and no compared path sits beneath it. No receipt field, write path or help text changes. No new dependency, network call, environment read or workflow edit.

Approvals

Bug fix under the fix-lane exemption (no plan review).

Documentation

Scope: committed diff bf2bcf1..4e8b1de (4 files, 0 staged, 0 unstaged, 0 untracked). Reviewed the stacked-carry change in gstack-ship-receipt against docs/ship-policy.md and docs/troubleshooting.md, plus the changelog fragment. Result: docs already describe the GST-1214 behavior in docs/ship-policy.md and troubleshooting stays accurate, so no edits were made. Debt: the new ship-policy.md hunk leaves a short orphaned line ('difference refuses ...'); cosmetic, left as is.

Pre-Landing Review

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

Pass 1 (specialist, Red Team): no findings. In Step 11, the outside voice (openai/gpt-6.1-sol) found a High, blocking bug: :(exclude,literal)p also leaves out everything beneath p. So when the child's first main merge turned a file into a directory, an unreviewed edit beneath it could carry. I reproduced it as a failing test, then fixed it in 4e8b1de: a path with any compared path beneath it is never left out. Pass 2 (a full pass on the fix range) found nothing blocking. The REVIEW_LOOP line counts Step 9 rows only, so it doesn't include this Step 11 blocker.

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

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

  • Pass 2 Red Team (informational, fails closed): the guard counts descendants that the base merge itself added. So a file the base turned into a directory, with no child edit beneath it, refuses with RECEIPT_CARRY_PRODUCT_CHANGED naming that path instead of carrying. The suggested fix is to build compared from HEAD's paths and the reviewed range's own paths (listed[1], listed[2]).
  • Native adversarial (Low, fails closed): each left-out path is one more git diff argument. An earlier main merge of hundreds of files on Windows, or thousands on macOS, can hit the command-line limit, and then carry refuses with an unclear "git diff failed" message.
  • Native adversarial (Low): splitting a rename across the exclusion can read as a delete and refuse (fails closed).

Test plan

  • Failing first: on bf2bcf1, "the child carries when only its earlier base merge separates the parent range from HEAD's diff against main" fails with RECEIPT_CARRY_PRODUCT_CHANGED naming wiki/a.md and wiki/b.md. The negative control (the child edits wiki/a.md after the receipt) refuses both before and after. The review-fix case (a file turned into a directory, with an edit beneath it) carried wrongly before 4e8b1de and refuses after it.
  • test/ship-receipt-carry-squash.test.ts: 13 pass. Targeted lane: 20 tests, 0 failures. Free Tests at tree 95be2f798d23: CI run 41629056664 is green (34,761 tests).

…ier main merge brought in (GST-1214)

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 2 commits November 3, 2026 11:22
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…h it (review fix, GST-1214)

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): a stacked carry ignores files the child's own earlier main merge brought in (GST-1214) v1.94.21.0 fix(ship-receipt): a stacked carry ignores files the child's own earlier main merge brought in (GST-1214) Nov 3, 2026
@capy-ai
capy-ai Bot merged commit 95fc210 into main Nov 3, 2026
49 checks passed
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