Skip to content

/ship counts a clean base merge as reviewed (GST-3562) - #4754

Merged
capy-ai[bot] merged 4 commits into
mainfrom
ship-clean-base-merge-reviewed
Nov 24, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
ship-clean-base-merge-reviewed

Conversation

@garrytan

@garrytan garrytan commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

When you merge main into a reviewed branch and your own lines, file modes and symlink targets come through byte-identical, /ship now treats the head as reviewed and lets CI check it, instead of asking for another reader.
Why: these routine merges cost a reader stop on almost every PR that sat a day, and the reader only ever re-read lines that had not changed.
Part of the /ship simplification Garry approved (items G and H); nothing for readers to do.

What changed
  • /ship now tells merge shapes apart. If main only changed lines near your unchanged code, the head counts as reviewed at the final check and when the review record moves to the merged head, and the record says CI on that head checked it.
  • If main replaced the very lines one of your changes replaces and the merge kept both, or main added lines at the exact spot where you inserted lines (so the merge had to choose their order), one scoped reader still reads those lines. The 200-line limit for that read now applies only to these cases.
  • A file mode that differs between the reviewed and current heads, or a diff git prints with bytes that are not UTF-8, now counts as a real change and gets a full review (one exception: the pathspec-name gap under Deferred findings).
  • /ship's record of a finished run is accepted without the docs, review-loop, issue or budget entries; a new test confirms that, and that older records with those entries are still accepted.
Why

The old rule sent every merge that touched nearby lines to a reader, even when none of your lines moved, so most PRs paid for a read that could not find anything new. The cases that can change what your code does, a splice into your own lines or a merge that orders your insertion against new lines, keep their reader.

Blast radius

Only /ship's final check and the step that moves a review record to a merged head. Merges that change your own lines, file modes or symlink targets still stop for review as before, with one known gap listed under Deferred findings: a file whose name starts with git pathspec magic (for example :() can hide a mode flip that comes from main. CI at the merged head remains a required check before anything lands.

Tests
  • New no-loss cases: a merge that keeps your own lines, an executable script and a symlink exactly as reviewed passes with no reader; a file-mode flip (in the merge or from main), a symlink retarget, a conflict resolution inside your own line, and bytes that are not UTF-8 each count as changed; insertions whose order against main's new lines the merge chose are sent to the scoped reader in either order.
  • The earlier fixtures for moved lines (GST-384, GST-442, GST-1226, GST-2229, qm#3457, founderstar#563, Ask each question once and check every handed-over file, in every skill that loads the shared preamble (GST-2756) #4383) stay as acceptance cases for the new rule, and every scoped-reader check (record validation, an unwritable packet directory, the dry run that writes nothing, the 200-line limit) moved to a spliced fixture so it still runs.
  • CI at 18290d5: every check green, including free-tests (run 45259819295, 39,272 tests across Linux, macOS and Windows).

Agent notes

Documentation

Status: updated. One factual correction in docs/ship-policy.md, no blockers.

Scope: 14 committed paths on ship-clean-base-merge-reviewed (base 1cb0a3e, head 8e66033), with nothing staged, unstaged or untracked. I searched every authored .md and .tmpl file for wording about receipt carry, base context and scoped review.

Documentation health

  • docs/ship-policy.md: Updated. Three carry-section sentences now say that base context next to the branch's unchanged hunks carries with no reader (GST-3562) and that only spliced hunks go to RECEIPT_CARRY_SCOPED_REVIEW.
  • docs/troubleshooting.md: Current. The diff already rewrote RECEIPT_CARRY_SCOPED_REVIEW and the carry list.
  • docs/unattended.md: Current. The CARRY refusal line already matches.
  • changelog.d/ship-clean-base-merge-reviewed.md: Current. Reviewed only, not edited.
  • docs/review-policy.md: Current. Its scoped-reader references cover other routes.

Coverage debt: None in this diff's docs. docs/ship-policy.md:1918 (reviewed-tree STALE wording) was not checked against code this diff doesn't touch.

Diagram drift: None. No diagrams cover this path.

Deferred findings

Each is outside this PR's own change or fails closed; none meets the blocking floor (would fail a test, break production, or lose data or secrets).

  • Deferred: CRITICAL (second-model review) lib/ship-receipt-patch.ts:232 Step 11.5's merge-only check (baseMergeOnly) still reads moved context as STALE, so an in-progress /ship that merges main before its first receipt asks for another full review. Stricter than finish, never looser; on main already. Follow-up work.
  • Deferred: CRITICAL (second-model review) lib/ship-receipt-depth.ts:258 A targeted-reader record made before such a base merge fails receipt write (product patch-id moved). On main already, fails closed. Follow-up work.
  • Deferred: CRITICAL (second-model review, round 2) lib/ship-patch.ts:195 The head-mode check calls git ls-tree without --literal-pathspecs and compares two failed lookups as equal; also flagged by the Red Team and the native adversarial reader. Needs a pathspec-magic file name (or a git failure on both heads) plus a mode flip from main. One-line fix, offered as a follow-up.
  • Deferred: CRITICAL (second-model review, round 2) lib/ship-patch.ts:189 The no-reader route compares hunks with the shared-preamble id mask applied; a change only inside that exact gstack shared preamble \<12 hex>`` form would read as unchanged. The mask predates this PR (it already let such paths compare as same).
  • Deferred: CRITICAL (second-model review, round 2) bin/gstack-ship-receipt:759 Carry skips comparePath when the 3-line patch-ids match, so an insertion moved to a spot with identical surroundings carries as a plain base merge. Finish still catches the splice, but its packet drops both matching hunks by text, so that reader would not see the moved insertion. Predates this PR.
  • Deferred: CRITICAL (second-model review, round 2) lib/ship-receipt.ts:385 A file name containing scoped re-check by would make the new reason read as a legacy advisory carry and the record refuse to bind (fails closed).
  • Open: Low (second-model review, round 2 feat: add handoff artifact generation for session persistence #7) lib/ship-preflight.ts:125 Preflight wording still describes splices as adjacent edits. Prose only; goes with the follow-up prose PR.

Fixed after round 2: Low (second-model review, round 2 #7) docs/ship-policy.md:2498 The dry-run guide still described the removed route. The Step 14.5 docs audit fixed it in 18290d5 and one scoped reader read that fix clean.

Review notes

  • INFORMATIONAL The policy choice that gate code also loses the reader for moved context follows the R51 reading of a base-only merge (native adversarial, both rounds).
  • INFORMATIONAL lib/ship-release.ts:410 A context path routes as base before the metadata, tests and docs buckets: it is treated like a same path, which is the point of G.
  • INFORMATIONAL lib/ship-patch.ts:171 A file that really contains U+FFFD now always gets a full review (fails closed).
  • INFORMATIONAL lib/review-targeted-delta.ts The spliced filter row keeps main's behavior (spliced was a subset of context) and has no dedicated test (coverage audit, 15/16 paths).

Review

Two full rounds, both at this PR's own heads, panel: batched specialist, Red Team, targeted gate reader, native adversarial (Opus 5.5), second-model review (GPT-6.2 Sol). Round 1 at e263f87: four readers independently found the same-spot insertion ordering gap; fixed in 283e9f6 with the non-UTF-8 and head-mode tightenings, the reason path cap and a changelog correction; two outside findings deferred above. Round 2 at 283e9f6: no fix round (last round); its findings are deferred or noted above. Two rounds is the limit, so the PR ships with these notes. The second-model reader marked four of them blocking; each was judged below the blocking floor because it predates this PR or fails closed, except the pathspec-name mode gap on the new no-reader route, which needs a file name starting with pathspec magic plus a mode flip from main and is offered as a one-line follow-up. The Step 14.5 docs edit got one scoped reader (clean). REVIEW_LOOP: passes=2 rounds=2.

Validation notes

  • Local full suite: bun run test at 18290d5 exited 1 with 81 failing tests in 13 files, all cso-* (no optional native helper on this machine), gbrain-sync-skip, codex-hooks-setup, model-policy-cli and redact-kv-after-slash (a /cso history test). None touches ship code; CI ran the same tree green. The runner also flagged writes to the real home during the run, all under ~/.codex/tmp/arg0-linux/ (Codex CLI temp files), not from ship code. Green CI on the same tree shows the difference is local; it does not by itself prove the cause of each local failure.
  • CI free-tests at 18290d5 (run 45259819295): 39272 tests, 90 skipped. This PR adds no skipped or todo test; earlier free-test runs on this work skipped 67 to 105 (platform and tier skips).
  • Focused tests for the fixture moves: 205 pass, 0 fail across 17 files (~/.capy/work/hg/focused2.log).
  • Focused: 693 pass, 0 fail across the ship-patch callers and guard tests after the round-1 fixes; the same-spot insertion test fails on e263f87 and passes after the fix.
  • No-loss condition (GStack Minder, before opening): byte-identical own lines, modes and symlink targets count as reviewed; a mode change, a symlink retarget and a conflict resolved inside the PR's own lines stay changed. All covered by test/ship-base-side-masks.test.ts.
  • F and J wait for the deletion PR. The CREW.md standing grant of 2026-11-17 now applies only to spliced hunks; its wording (native adversarial round 1 fix: harden /browse lifecycle and ref safety #5) is updated outside this repo when this lands.
  • An abandon mark that gstack-ship-run wrote for an earlier /ship run of /ship reviews fixes with full rounds instead of narrow re-checks (GST-3562) #4741 (run aship, head e263f87) was deliberately not added to this body: that run never reviewed this PR.

Approvals

Plan: approved (record r-e4cfb8408c4d)
Plan check: approved (record r-e4cfb8408c4d)

Agent notes
{
  "schema_version": 1,
  "pr": 4754,
  "head": "18290d5a15da0d690f88498b2bf85cb73f152d78",
  "version": "1.103.0.0",
  "base": "main",
  "ci_carried": [
    {
      "lane": "free",
      "run": 45259819295,
      "attempt": 1,
      "tree": "cd46453be072d0b6556c91b67a0e75d36eb0f37c"
    }
  ],
  "calls": 118,
  "session_kind": "unattended",
  "run": "hship",
  "head_tree": "cd46453be072d0b6556c91b67a0e75d36eb0f37c",
  "product_patch_id": "4a2cc584a74eb45fc0dee8a40d25342cb890464e",
  "gstack_version": "1.103.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 120,
    "rules": "33831f8248a814fd",
    "base": "a256d1530dad693df5b66ddd3e3a43351cefe3e4",
    "registry": "a256d1530dad693df5b66ddd3e3a43351cefe3e4",
    "gate_scan": {
      "tagged": 1,
      "head": "18290d5a15da0d690f88498b2bf85cb73f152d78"
    },
    "reasons": [
      "gate-class",
      "runtime=120"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @cd46453be072 (8 checks, current for 18290d5a15da)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/45259810500/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/45259810500/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/45259819514/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=cd46453be072 tests=39272 skipped=90 runs=45259819295/1 profiles=ci-reuse/free-tests heads=18290d5a15da base_moved=100e109ccd4b verified=2026-11-23T22:18:03.078Z"
  ],
  "docs": {
    "status": "updated",
    "scope": "README.md and docs/ (156 docs), carry and scoped-review wording against the GST-3562 code"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 10,
    "deferred": 9,
    "noted": 6,
    "fixed": 8,
    "scope": "frozen",
    "rounds": 2,
    "dispatches": {
      "specialist": 2,
      "red-team": 2
    }
  },
  "gate_dispositions": [],
  "review_targeted": {
    "classes": [
      "gate"
    ],
    "rules": "e01517eddd4b2350",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "4a2cc584a74eb45fc0dee8a40d25342cb890464e",
    "status": "done",
    "findings": 1,
    "raised_by": "targeted"
  }
}

A base merge that leaves the branch's own added and removed lines, file modes and symlink targets byte-identical now counts as reviewed in finish and in the receipt step, with CI on the merged head as the check. Only hunks the base merge spliced still take one scoped reader. A test locks in that a receipt without the docs, review-loop, issue or budget records binds.

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

trunk-io Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 23, 2026 19:32
…ed check (GST-3562)

An insertion whose order against lines the base inserted or replaced at the same spot was chosen by the merge now goes to one scoped reader instead of counting as reviewed. A diff with bytes that are not UTF-8, or a file mode that differs between the reviewed and current heads, now counts as changed. The carry reason names at most 20 moved-context paths, and the changelog no longer claims the slim receipt is new.

Review-Finding: p1/outside-voice#1 reader=outside-voice
Review-Finding: p1/outside-voice#2 reader=outside-voice
Review-Finding: p1/outside-voice#3 reader=outside-voice
Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: p1/red-team#2 reader=red-team
Review-Finding: p1/targeted#1 reader=targeted
Review-Finding: p1/adversarial-native#1 reader=adversarial-native
Review-Finding: p1/adversarial-native#4 reader=adversarial-native
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>
…y (GST-3562)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 6ef3861 into main Nov 24, 2026
86 checks passed
capy-ai Bot added a commit that referenced this pull request Nov 24, 2026
… with a colon (#4774)

/ship's file-mode check now reads file names literally, so a name like
`:!tool.sh` or `:(top)tool.sh` can no longer hide a mode change that a
merge brought in from main.

Why: this was the one open finding on #4754 that could let a changed
head count as reviewed. Nothing for readers to do.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/adversarial-native#1,#2,#3
@garrytan garrytan mentioned this pull request Nov 24, 2026
capy-ai Bot added a commit that referenced this pull request Nov 24, 2026
- `/ship` now tells you what to change when GitHub refuses a push for email privacy. (#4748)
- The release gate's /cso check accepts the low-confidence hypotheses /cso now reports. (#4753)
- /cso reports every security finding the code supports instead of dropping most of them. (#4739)
- /cso can search the whole repository in one call, and a daily report now lists its low-confidence hypotheses. (#4742)
- A first version's plan and try-it message now open with the owner's own words, and the build is tried the same way he will try it before he is asked. (#4759)
- A first version's public export now keeps out the owner's short quotes and his reasons to leave something out, and a phone first-use check installs a build the cloud phone can actually run. (#4772)
- Three intermittent test failures are fixed. (#4745)
- Free Tests runs its shards on 8-core runners again. (#4749)
- A land that waits on an earlier CI run now decides on what that run actually did. (#4763)
- Landing a PR no longer starts a new CI run when one for the same merged code is already running or has passed. (#4760)
- /ship no longer misses a file-mode change from main on files whose names start with `:`. (#4774)
- make-pdf keeps quotes in alt text, link titles and raw HTML attributes inside the attribute, so a Markdown file can no longer add an `onerror`, `onload` or `javascript:` link that runs in the print browser. (#4761)
- Posting a PR body that lists earlier /ship runs no longer stops for a phone number that isn't there. (#4747)
- A first version's public export now catches a short owner quote whose padding or quote marks are encoded. (#4778)
- A first version's public export now also keeps out a short owner quote written with spaces just inside its quote marks. (#4776)
- Posting a PR body that lists earlier /ship runs no longer stops for a card number that isn't there. (#4751)
- /ship no longer asks for an extra reader when you merge the base branch next to code that was already reviewed. (#4754)
- /ship no longer plans narrow re-checks after a fix. (#4741)
- /ship can't quietly gain new refusals. (#4740)
- `gstack-upgrade` no longer refuses to run after you disable skills. (#4743)
- The free test suite splits its shards from this week's recorded test times. (#4744)
- gstack now writes up a failed or shelved attempt before closing it. (#4735)

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