Skip to content

v1.92.13.0 fix: /ship's preflight skips git merge when the base is already in HEAD (GST-691) - #3774

Merged
capy-ai[bot] merged 5 commits into
mainfrom
gst-691-preflight-merge-noop
Nov 1, 2026
Merged

capy-ai[bot] merged 5 commits into
mainfrom
gst-691-preflight-merge-noop

Conversation

@garrytan

@garrytan garrytan commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3774,
  "head": "1a47ffa48c19599c0339d2134005a8e41ed51e66",
  "version": "1.92.2.0",
  "base": "main",
  "gate": {
    "focused": {
      "pass": 24,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "634acd14e729e1ba94fada625d148cb1b50d79a5",
  "product_patch_id": "eb0819689f57a9153708ed1fdb774a27f6300cfc",
  "gstack_version": "1.92.2.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 2,
    "rules": "150435b0a543019a",
    "base": "d9182b6250a06b7a5081cb1850088df8301ce5af",
    "registry": "d9182b6250a06b7a5081cb1850088df8301ce5af",
    "gate_scan": {
      "tagged": 0,
      "head": "1a47ffa48c19599c0339d2134005a8e41ed51e66"
    },
    "reasons": [
      "runtime=2<=50"
    ]
  },
  "pregate": "requires-remote cleared @634acd14e729 (1 checks, current for 1a47ffa48c19)",
  "requires_remote": [
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/41258226419",
    "pregate.json/remote_gate: remote-gate tree=634acd14e729 tests=340"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "AGENTS.md, CLAUDE.md, CONTRIBUTING.md, README.md, docs/, capy/, ship/ (diff hunks and tree grep)"
  },
  "review_loop": {
    "passes": 4,
    "blocking_found": 1,
    "deferred": 0,
    "noted": 4,
    "fixed": 2,
    "scope": "frozen",
    "dispatches": {
      "specialist": 4
    }
  }
}

What changed

gstack-ship-preflight (Step 3) used to run git merge origin/<base> every time, even when origin/<base> was already an ancestor of HEAD and the merge had nothing to do. It now checks git merge-base --is-ancestor origin/<base> HEAD first and prints MERGE: up to date without running git merge. An unfinished merge, cherry-pick or revert (conflicted, or resolved and staged) still falls through to the old merge path, so Step 3's stop still fires. A moved base still merges.

GST-691 before/after: preflight on a guarded shared checkout

Why

GST-691 (GEVA-85 on gstack-evals): on a Capy shared machine, the platform's shared-tree guard (/home/user/.capy/guard/shared-tree-*/git) refuses git merge in the checkout, so /ship's preflight stopped with git merge origin/main failed even when there was nothing to merge. Under queue_mode: stamp-at-merge (gstack itself) the merge is already skipped, so this matters for repos that merge the base in preflight.

Proof, failing first. test/ship-preflight-base-ancestor.test.ts puts a guard stub on PATH that logs and refuses git merge. On main 4eff47c the up-to-date case fails: [3, "", "STOP: git merge origin/main failed: shared-tree guard: git merge is not allowed in this checkout"] instead of [0, "MERGE: up to date", undefined]. With the fix it passes, the moved-base case still records exactly one merge origin/main --no-edit, and the unfinished-merge case still stops (it fails without the ls-files -u / MERGE_HEAD guards).

Blast radius

One condition in merge() in lib/ship-preflight.ts, used only by gstack-ship-preflight. No network, env, permission, workflow or dependency change. Output strings are unchanged (MERGE: up to date is the string the old no-op merge printed).

Approvals

None needed: an audited bug fix under the fix-lane exemption, assigned by GStack Minder (GSTA-36).

Review notes

  • Step 11 notes, below the blocking floor (Blocks: no), left for a follow-up: the unfinished-operation test covers a merge but not a resolved cherry-pick/revert; on a guarded machine an unfinished merge stops with the guard's refusal text rather than git's "You have not concluded your merge". .git/sequencer / git am states and a stale origin/<base> behave as they did before this change.
  • ship/SKILL.md.tmpl:188 doesn't name the up to date outcome (docs audit a691-1, minor omission).

Open in Capy

Pre-Landing Review

Pre-Landing Review: 7 issues — 2 fixed, 0 deferred, 4 noted

Gate edits: none detected

Documentation

Scope: the three-file diff (lib/ship-preflight.ts, test/ship-preflight-base-ancestor.test.ts, the changelog.d fragment) checked against ship/SKILL.md.tmpl, generated ship/SKILL.md, and docs/ship-policy.md. I audited committed content only, because the worktree had no staged, unstaged or new files. Result: no doc edits. The changelog fragment covers the new MERGE: up to date behavior, and docs/ship-policy.md doesn't describe the preflight merge step. Debt: the ship Step 3 line (ship/SKILL.md.tmpl:188, generated ship/SKILL.md:458) lists only MERGE: and skipped under stamp-at-merge, so it doesn't name up to date. It is a minor omission, not a wrong statement, and a template edit plus regeneration would close it.

garrytan and others added 5 commits October 31, 2026 23:57
… HEAD (GST-691)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…est names its bin (GST-691)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… 3's conflict stop (GST-691)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…tted merge, cherry-pick or revert to Step 3 (GST-691)

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

trunk-io Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@github-actions github-actions Bot changed the title fix: /ship's preflight skips git merge when the base is already in HEAD (GST-691) v1.92.13.0 fix: /ship's preflight skips git merge when the base is already in HEAD (GST-691) Nov 1, 2026
@capy-ai
capy-ai Bot merged commit 066ceb0 into main Nov 1, 2026
62 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