Skip to content

v1.92.25.0 fix(ship): Step 3 stops by name on an unfinished merge, cherry-pick or revert (GST-732) - #3785

Merged
capy-ai[bot] merged 10 commits into
mainfrom
gst-732-preflight-unfinished-op
Nov 1, 2026
Merged

capy-ai[bot] merged 10 commits into
mainfrom
gst-732-preflight-unfinished-op

Conversation

@garrytan

@garrytan garrytan commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3785,
  "head": "74be8b0af360c540fa4119b9d6d04b22370594a4",
  "version": "1.92.13.0",
  "base": "main",
  "gate": {
    "focused": {
      "pass": 22,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "1668e94d96ada30f8b0802abbcf65b39d43da72d",
  "product_patch_id": "ba8e92482bb18c7cdff7006f7b5e8a94adcc8810",
  "gstack_version": "1.92.16.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 21,
    "rules": "150435b0a543019a",
    "base": "3f1741ddb4bcebb068dade65277f64b884fce94e",
    "registry": "3f1741ddb4bcebb068dade65277f64b884fce94e",
    "gate_scan": {
      "tagged": 0,
      "head": "74be8b0af360c540fa4119b9d6d04b22370594a4"
    },
    "reasons": [
      "runtime=21<=50"
    ]
  },
  "pregate": "requires-remote cleared @1668e94d96ad (7 checks, current for 74be8b0af360)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41285514950",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/41285515017",
    "pregate.json/remote_gate: remote-gate tree=1668e94d96ad tests=18322 receipt=/home/user/.capy/work/ship-732/remote-gate-receipt2.txt sha256=c22500754236"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "AGENTS.md, CLAUDE.md, CONTRIBUTING.md, README.md, capy/, docs/, ship/ (re-audit a732-2 of 74be8b0)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 3,
    "deferred": 0,
    "noted": 3,
    "fixed": 5,
    "scope": "frozen",
    "fix_checks": 3,
    "dispatches": {
      "specialist": 3,
      "red-team": 2
    }
  }
}

Summary

gstack-ship-preflight's Step 3 now checks for an unfinished git operation before it does anything else. An in-progress merge, cherry-pick or revert stops by name (STOP: an unfinished cherry-pick is in progress (CHERRY_PICK_HEAD): …), with any conflicted files listed. Conflicted files with no operation in progress, as after a conflicted git stash pop, stop with those files named. Neither case runs git merge. The check looks for the operation's state file (git rev-parse --git-path MERGE_HEAD), so a branch or tag that happens to be named MERGE_HEAD, CHERRY_PICK_HEAD or REVERT_HEAD doesn't trip it. The ship skill's Step 3 also names the MERGE: up to date outcome #3774 added. Repositories on queue_mode: stamp-at-merge (gstack itself) still skip Step 3's merge as before.

GST-732 before/after: /ship Step 3 on an unfinished git operation

Why

GST-732 collects the two follow-ups from GST-691 (#3774). That PR stopped the preflight from running git merge when the base is already in HEAD. Its review left one gap: a resolved but uncommitted merge, cherry-pick or revert still fell through to git merge. On a Capy shared machine the shared-tree guard refuses git merge, so the agent saw only the guard's refusal and no cause. The second follow-up was the docs line for MERGE: up to date.

Proof, failing first. test/ship-preflight-base-ancestor.test.ts:

  • An unfinished merge, cherry-pick and revert each stop by name, and no git merge runs. On main 066ceb0 the merge case printed the old STOP: merge conflicts in src/a.ts…, and the resolved cases reached the guard's refusal.
  • A ref named REVERT_HEAD or CHERRY_PICK_HEAD is not an operation, and a conflicted stash pop stops with its files named. This was added after review. On the branch before that fix, the named refs stopped preflight (exit 3).
  • Dropping REVERT_HEAD from the list makes the test fail (mutation check).

Blast radius

  • Code: one function, merge() in lib/ship-preflight.ts, called once from the preflight's Step 3. It adds no network calls, environment reads, permission changes, workflow edits or dependencies.
  • Behavior: a run with an unfinished operation, or leftover conflicts, now stops before git merge instead of after it fails. Every other path is unchanged, including MERGE: up to date, a real merge of a moved base, and conflicts from that merge.
  • Not covered: a stopped git am and a hand-committed multi-commit cherry-pick leave no *_HEAD file, so they still reach git merge (noted below).

Approvals

None needed. This is a bug fix assigned by GStack Minder (GSTA-36) under GST-522, with proof first.

Pre-Landing Review

Pre-Landing Review: 8 issues — 5 fixed, 0 deferred, 3 noted

Gate edits: none detected

Review notes

  • Pass 1 (light, batched specialist): one test gap, the revert case. Fixed, and the fix-check found nothing.
  • Pass 1 adversarial: two FIXABLE findings, a ref named like an operation and leftover conflicts with no operation. Both fixed with a failing-first test. The changelog now scopes the claim to repositories that merge the base, which answers the stamp-at-merge note.
  • Pass 2 (scoped: fix-check, Red Team, adversarial): one fix, a --git-path probe that fails now counts as "not pending". The cap's fix-check found nothing.
  • Noted, not fixed: the stamp-at-merge skip (the changelog now says so), a stopped git am or sequencer state, and conflict paths shown repo-root-relative.
  • Late trim (rule 23 grant from GSTA-36): main grew the ship skill skeleton after this PR forked, so main plus this PR failed test/parity-suite.test.ts (skeleton 61428 > 61420). Step 3's note now reads up to date if nothing new` (10 bytes shorter). One fix-check found nothing, and the docs re-audit found the docs current.
  • Test environment: with a gstack launch file sourced, two Step 5 pregate tests in test/ship-preflight.test.ts fail on main and on this branch alike, because the fixture inherits the parent's install verdict (INSTALL_UNVERIFIED). The focused lane runs with the GSTACK_* launch variables unset (22/0). CI does not set them.
  • Evals: bun run eval:select makes lib/ship-preflight.ts a reference for 260 gate cases (85 shards). That is the whole gate, so the paid cases are left to the train's gstack/full-gate, as for v1.92.13.0 fix: /ship's preflight skips git merge when the base is already in HEAD (GST-691) #3774.

Documentation

Status: current. No documentation edits were needed.

Scope: re-audit of commit 74be8b0 on branch gst-732-preflight-unfinished-op against base 066ceb0. The commit shortened the Step 3 MERGE note in ship/SKILL.md.tmpl and regenerated ship/SKILL.md, the four ship goldens and the size-ledger entry. Nothing is staged, unstaged or untracked.

Documentation health:

  • ship/SKILL.md.tmpl: current. 'up to date if nothing new' matches the preflight, which prints MERGE: up to date both when the base is already in HEAD and when a merge leaves HEAD unchanged.
  • ship/SKILL.md: current, matches the template.
  • changelog.d/gst-732-preflight-unfinished-op.md: current. Its claim that Step 3 names the MERGE: up to date outcome still holds.

Coverage debt: none. Diagram drift: none.

The first audit (a732-1) also found the docs current. Its coverage debt still applies: the new Step 3 STOP lines have no docs/troubleshooting.md entry.

garrytan and others added 8 commits November 1, 2026 05:42
…GST-732, failing first)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… name before any git merge (GST-732)

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>
…wording (GST-732)

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

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ile stops Step 3; unresolved conflicts with none in progress stop by name)

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

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…not an operation in progress)

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.

garrytan and others added 2 commits November 1, 2026 07:33
…ton fits its cap on current main (GST-732)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions github-actions Bot changed the title fix(ship): Step 3 stops by name on an unfinished merge, cherry-pick or revert (GST-732) v1.92.25.0 fix(ship): Step 3 stops by name on an unfinished merge, cherry-pick or revert (GST-732) Nov 1, 2026
@capy-ai
capy-ai Bot merged commit f739756 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