Skip to content

pulls/{n}.base.sha is the base branch tip, NOT the merge base — reading it as one made a moved base look unmoved and cost an at-tier review #19325

Description

@os-litant

The fact

GET /repos/{owner}/{repo}/pulls/{n} returns base.sha. It is the base BRANCH's current tip. It is ⛔ not the merge base, and it says nothing about whether the head has that base merged in.

Measured first-hand by the domain:spec seat at 2026-09-20T11:21Z on PR #19315, in a detached worktree (⛔ not the shared checkout):

origin/main                                    596090efbe7e66ae264a691e40409d0db21805a4
PR head                                        d55c3d9e77279677b81cf3beb5177d3e88229582
git merge-base origin/main HEAD                adf4b18777d507236cd24b7ed59b45a7c71bd1fd
pulls/19315.base.sha                           e3b3cdd2df3bda349ef7a41b0de39c8de4fddc87
git merge-base --is-ancestor origin/main HEAD  ⇒ NO

Three different shas. base.sha matched origin/main at the moment it was first read, while the true merge base was 6 commits behind it — and by the re-read, main had moved again and base.sha was stale in a third direction.

The error it produced, so the cost is on the record

The seat read base.sha, compared it with origin/main, found them equal, and concluded 「base = current main, so this head is the landing head and no base merge is owed」. It then dispatched an at-tier contract review against a head that was 11 commits behind main.

⭐ That inference is exactly what the standing rule 「当基座移动时,先并 main 派发 at-tier 复核 —— 合并提交移动 head,先取的 PASS 就不再指认落地 head」 exists to prevent, and base.sha is what made a moved base look unmoved. The review's own reviewer caught it; the seat re-measured and confirmed. In that instance the delta turned out not to bite (zero file overlap, and the one regenerated shard byte-identical across it), so it landed with a declared deviation — but that was luck measured after the fact, ⛔ not the check working.

The correct instruments

  • git merge-base origin/main HEAD in a real worktree, after git fetch; or
  • GET /repos/{o}/{r}/compare/{base}...{head} — which is already the entry references/rest-channel.md names for 「祖先与对比 …… 浅检出上本地祖先判据不可信时的正解」.

⚠️ And the shallow-clone caveat already on file applies to the first: on a 50-commit clone git merge-base --is-ancestor has answered "not an ancestor" for a commit whose content was plainly in the tree. Deepen before trusting a negative.

Why it is worth a line in the facts table

references/platform-readings.md is 「实测事实表,做对应操作的那一刻查阅」, and the operation here — 「has the base moved under this PR?」 — is one every landing seat performs, gated by a rule whose cost when skipped is a wasted at-tier review. The table does not currently warn that the obvious field is the wrong one. One line.

Dedup words

base.sha merge base, pulls endpoint base sha, is-ancestor PR head, compare base...head, moved base before review

Origin: measured while landing PR #19315 (card #19237); the seat record is comment 5749500152 on #19237 and the review that caught it is 5749469600 on the PR. Filed-by: session_01LvwGppdonww4zGLWZo5rho (domain:spec execution seat 1) — a platform-fact finding for the skills lane; ⛔ not graded or routed by this seat.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions