A green CI run now counts for your branch when only main moved under it (GST-3567) (#4728)

/ship's final CI check (`gstack-ship-release accept`) now accepts a
green pull request run that tested your branch merged onto a newer main,
when main changed none of your lines.

Why: before, it refused that run and you had to merge main and rerun CI,
which never settles on a busy repo (harness-evals #576, gstack #4722).

Nothing to do. Repos with a land step still re-check the merged tree;
repos with `land: null` get no merged-tree check.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/specialist-batched#1 reader=testing
Review-Finding: lib/pregate/run-check.ts:70:functional-contract reader=qa
Review-Finding: p2/outside-voice#1 reader=outside-voice
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-23 03:51:23 +00:00
1 parent 8751b382dd
commit 261f380002
13 files changed
+344 -27

No files matched your search

+14 -3
View File
@@ -951,7 +951,8 @@ once:
`tree.json` must name the head (`head_sha`) and the merge commit (`sha`), and
the tree git computes for that merge commit must equal the head's tree: the
head already contained its base, so the merge tested exactly the head tree
(`tree_mismatch` otherwise). The API answers with
(`tree_mismatch` otherwise), unless only the base moved
([below](#base-moved-carry)). The API answers with
the newest attempt, so an earlier green attempt under a newer red one is
refused, and the run is read again after the evidence is collected: a new
attempt meanwhile is `run_changed`. A newer run of the same workflow on the
@@ -1259,8 +1260,18 @@ the Ubicloud VM (`gstack-pregate --stage tests --remote`) is an opt-in for when
no such run exists. The order after a push: wait for Free Tests
(`gstack-ci-carry wait --base main`), then `gstack-pregate
--allow-repo-commands`. A `pull_request` run tests GitHub's merge commit, so on
a branch that does not contain the base tip it tested another tree and
`CI_CARRY` says `none (no_verified_run: … tree_mismatch)`: dispatch Free Tests
a branch that does not contain the base tip it tested another tree.
<a id="base-moved-carry"></a>That run still carries for HEAD when only the base
moved (GST-3567): the merge commit is HEAD merged onto a commit of the base, and
the pull request's own added and removed lines in it are byte-identical to
HEAD's at the same places (`lib/pregate/run-check.ts` `onlyBaseMoved`, used by every lane carry and by
`clear --run`, never by land's merged-tree CI; why that is safe:
[ship-policy.md](ship-policy.md#ci-carry-base-moved)). The receipt adds
`base_moved=<base commit>`. GitHub merges onto the base as it was when the run
started, so when that base commit is newer than your checkout's `origin/main`,
the check fetches main once before it refuses. Otherwise `CI_CARRY` says
`none (no_verified_run: … tree_mismatch)`, with a `CARRY_DIAGNOSIS:` line
when the rule refused: dispatch Free Tests
on the branch
(`gh workflow run free-tests.yml --ref <branch>`), which tests HEAD's own tree,
and wait again. When the pull_request run tested that merge commit, the