Skip to content

The merge queue checks a pull request against the branch it targets, not the default branch (GST-3445) - #4663

Merged
capy-ai[bot] merged 5 commits into
mainfrom
ship-queue-uses-the-pr-base
Nov 22, 2026
Merged

capy-ai[bot] merged 5 commits into
mainfrom
ship-queue-uses-the-pr-base

Conversation

@garrytan

@garrytan garrytan commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

gstack-ship-queue ready now checks a pull request against the branch it targets, so a PR into a branch other than main is no longer refused when its /ship review was done against that branch.
Why: Founderstar #1024 targets garrytan/v0.2-plan-wip, and ready refused its correct /ship review record because it compared that record against main.
Nothing to do: until this lands, passing --base <the PR's base> to ready works around it.

What changed
  • Without --base, ready reads the base of the PR that --pr names (gh pr view <n> --json baseRefName). Before, it used origin/HEAD first, which is the default branch. If gh can't answer, it falls back to the old lookup.
  • ready then reads the PR's base a second time, in the same gh pr view call that checks the PR's state, and refuses with QUEUE_NOT_READY ("#N targets X, not Y") when that base differs from the one it checks against or can't be read. So a failed first lookup, or a base name that starts with origin/, ends in a refusal instead of a wrong READY.
  • ready refuses an explicit --base that isn't the PR's base. Before, --base main on a PR into another branch would accept a review record made against main.
  • land keeps using the default branch unless --base names another, so it still refuses a stacked PR instead of merging it into its parent branch.
  • A review record made against any branch other than the PR's base is still refused.
Tests

New test file test/ship-queue-ready-pr-base.test.ts. Its fixture has origin/HEAD set to main and a PR into garrytan/v0.2-plan-wip. These cases fail on main 69ad103:

  • With no --base, the case fails with Founderstar's exact refusal. A review record for the PR's base is now accepted, and one for main is still refused.
  • With --base main, main printed READY. It now refuses with QUEUE_NOT_READY.

One more case in the same file checks the second base read in ready. Both parts printed READY (exit 0) at c531eb9 and now refuse with exit 3:

  • (a) the first base lookup fails, so ready falls back to main for a PR into another branch;
  • (b) the PR's base is named origin/foo.

test/ship-queue-land-direct.test.ts adds one case: land --pin with no --base refuses a stacked PR shipped against its parent branch and merges nothing.

The new test file spawns shell fixtures, so it gets a Windows curation entry like test/ship-queue-ready-fresh-base.test.ts.

Documentation

Status: current — docs already match the change; no edits.

Scope: branch ship-queue-uses-the-pr-base against base 69ad1031 (head ef08d775): gstack-ship-queue ready defaults --base to the base of the PR that --pr names, refuses a mismatched explicit --base, and lib/ship-queue.ts refuses a PR whose base is not the queue's base. land still defaults to the main branch.

Documentation health:

  • docs/troubleshooting.md — Current (the branch already updated the QUEUE_RECEIPT_BASE_MISMATCH section)
  • docs/ship-policy.md — Current (mentions of the queue's base still hold)
  • bin/gstack-ship-queue help and header — Current
  • changelog.d/ship-queue-uses-the-pr-base.md — Current (owned by the parent)

Debt: no coverage gaps; no diagram drift; no regeneration needed.

Agent notes

History: the exception below was recorded for the second full pass at 700e0d7.

Review-loop exception: accepted by Captain GStack Minder (GSTA-36) 2026-11-22 via GStack Minder ruling C on #4663 (agent message to this /ship run): Both fail closed: a failed PR lookup or an origin/-prefixed base name ends in a refusal, never a wrong READY. (second full pass at 700e0d7, deferred v1/outside-voice#1, v1/outside-voice#2)

Refs Founderstar#1024
Refs p1/specialist-batched#1
Refs p1/specialist-batched#2

Approvals

No approvals recorded for branch ship-queue-uses-the-pr-base.
Plan: exempt: bug fix (R65)
Plan check: exempt bug fix

{
  "schema_version": 1,
  "pr": 4663,
  "head": "ef08d7752acaea54f5e7616abb275a4090d2905a",
  "version": "1.102.2.0",
  "base": "main",
  "gate": {
    "shipqueue": {
      "pass": 162,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 44995170970,
      "attempt": 1,
      "tree": "848830be874e2b7f28b54464d9b2d57b014fab3a"
    }
  ],
  "calls": 55,
  "session_kind": "unattended",
  "run": "ship-4663-r2",
  "head_tree": "848830be874e2b7f28b54464d9b2d57b014fab3a",
  "product_patch_id": "54a96afd9ec13f522509985cfc5d4d44c81c8587",
  "gstack_version": "1.102.2.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 22,
    "rules": "630fd3101899e28e",
    "base": "c2b4f0d2adfa66e11143b95d9a42023a09380212",
    "registry": "c2b4f0d2adfa66e11143b95d9a42023a09380212",
    "gate_scan": {
      "tagged": 1,
      "head": "ef08d7752acaea54f5e7616abb275a4090d2905a"
    },
    "reasons": [
      "gate-class",
      "runtime=22"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @848830be874e (8 checks, current for ef08d7752aca)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44991990664/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44991990547/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=848830be874e tests=38787 skipped=72 runs=44995170970/1 profiles=ci-reuse/free-tests heads=ef08d7752aca verified=2026-11-22T07:18:03.740Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "README.md and docs/ (re-audit at ef08d77), searched for ship-queue ready/land and QUEUE_RECEIPT_BASE_MISMATCH"
  },
  "review_loop": {
    "passes": 3,
    "blocking_found": 3,
    "deferred": 2,
    "noted": 6,
    "fixed": 2,
    "scope": "frozen",
    "rounds": 3,
    "dispatches": {
      "specialist": 9
    }
  },
  "review_loop_exception": {
    "accepted_by": "Captain GStack Minder (GSTA-36)",
    "date": "2026-11-22",
    "via": "GStack Minder ruling C on #4663 (agent message to this /ship run)",
    "reason": "Both fail closed: a failed PR lookup or an origin/-prefixed base name ends in a refusal, never a wrong READY.",
    "second_pass": {
      "head": "700e0d77a3e1175cd682e85e3f35671d6b4b9418",
      "deferred": [
        "v1/outside-voice#1",
        "v1/outside-voice#2"
      ]
    }
  },
  "review_round_grants": [
    {
      "kind": "fix-check",
      "head": "700e0d77a3e1175cd682e85e3f35671d6b4b9418",
      "pr": 4663,
      "by": "Captain GStack Minder (GSTA-36)",
      "reason": "ready can print READY on a PR whose base differs from the receipt's base when the lookup fails or the name is stripped; land refuses, but ready must not lie.",
      "at": "2026-11-22T05:44:01.116Z",
      "approval": "a-5ed522a69631",
      "stop_run": "ship-4663",
      "findings": [
        "v1/outside-voice#1",
        "v1/outside-voice#2"
      ]
    }
  ],
  "gate_dispositions": [],
  "review_targeted": {
    "classes": [
      "gate"
    ],
    "rules": "b3f6f8b4843c0c30",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "54a96afd9ec13f522509985cfc5d4d44c81c8587",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}
{"head":"700e0d77a3e1175cd682e85e3f35671d6b4b9418","run":"ship-4663","mark":"stop","tree":"d66892fad5b7d8cff2b5547c94a8da87c1d4e3c4"}

…not the default branch (GST-3445)

gstack-ship-queue took its base from origin/HEAD when --base was missing, so ready refused a correct /ship receipt for a pull request into another branch with QUEUE_RECEIPT_BASE_MISMATCH (Founderstar #1024). Without --base it now uses the base of the pull request --pr names, and ready refuses an explicit --base that is not that base.

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

trunk-io Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 4 commits November 22, 2026 03:29
…ps make no extra GitHub call (GST-3445)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ready reads the pull request's base (GST-3445)

Review-Finding: p1/specialist-batched#1 reader=specialist-batched
Review-Finding: p1/specialist-batched#2 reader=specialist-batched
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…s the default branch (GST-3445)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…se it checked, even when the base lookup failed (GST-3445)

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