Repository navigation
Description
Three superproject legs in one day pinned a submodule at a sha that could never appear on that submodule's main. Two were caught before merging; the pattern is consistent enough to be a rule rather than three PR comments.
Why a PR head can never be a valid pin
The landing sequence guarantees it:
author pushes <head A>
pr-validator PASSES, then finalizes the CalVer by ADDING a commit -> <head B>
squash-merge produces a third sha -> <merge C>
branch deleted
Only C is ever on main. A and B survive solely under refs/pull/<N>/head, and only while the PR exists. So pinning any sha observed on an open PR names a commit that will be reachable from no branch, permanently.
This is the same mechanism as the already-known trap that "after a validator passes, the sha you last pushed is not the sha that merged" — pointed at gitlinks instead of at status queries.
The three instances
| leg | pinned | what it was | caught |
|---|---|---|---|
charly#296 |
plugins@4d63f91b |
plugins#195's then-current head, unmerged |
before merge |
charly#297 |
plugins@84cd062e |
a superseded head of plugins#200 — that PR had pushed since |
open now |
charly#289 |
re-derived from plugins/main at every staging step |
— | n/a — the correct behaviour |
#297's is the instructive one: the sha was not on main, and not even the PR's current tip. A git submodule update there fails for anyone who has not fetched that PR ref.
The rule
A superproject gitlink may only name a commit reachable from the submodule's
main. Re-derive it fromorigin/mainat the moment you stage the bump — never from an earlier reading, and never from a sha observed on an open PR.
charly#289 had its pins invalidated five times in one evening by other chains landing, and every invalidation was a non-event, because it re-derived at staging every time. The cost of the discipline was zero; the cost of skipping it is a dangling pin in a merge commit.
Distinguish stale from dangling — the remedy is the same, the urgency is not
STALE the pin is an ancestor of the submodule's main. A clone works today; it merely lags.
DANGLING the pin is not reachable from main. A clone FAILS.
git -C <sub> merge-base --is-ancestor <pin> origin/main separates them in one command. Reporting a stale pin as gone sends someone after a recovery procedure they do not need — and an over-alarming report costs more than the wasted procedure, because the next accurate alarm is discounted.
A cheap mechanical guard
The defect is invisible in review: a 40-hex sha in a gitlink looks identical whether or not it is reachable. A pre-merge check that runs merge-base --is-ancestor <pinned> <submodule origin/main> for each changed gitlink would catch all three instances, and it needs no judgement — the same argument as every other guard this codebase has adopted after paying for it repeatedly.
Related: #294 (a check reading a path where the committed object is meant — same family: the artifact you can reach is not the artifact you ship).
Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
Activity
atrawog commentedon Aug 18, 2026
A fourth instance, live right now:
charly#297charly#297pinsplugins@c7b6cc38. Measured:c7b6cc38is a merge commit onplugins#200's feature branch. It was never onplugins/mainand never could be — the squash-merge minteda9a94e4binstead. So#297pinned an unmerged PR's branch head, and the squash orphaned it. Exactly the shape this issue names.Remedy for that PR: re-pin to
a9a94e4b, or the tagv2026.230.1151.One precision worth adding to this issue's model, because it changes the detection story. A fresh validator described the pin as "superseded and now unreachable from any branch (feat branch deleted on merge)". That is not the current state —
origin/feat/kube-host-generated-disambiguationstill exists, so the pin still resolves. A clone succeeds. The defect is not that it dangles; it is that it names a commit offmain, which is this issue's actual criterion.That distinction matters for how the class gets caught: a dangling pin fails loudly at fetch time, while a pin that resolves to a live feature branch is silent — everything clones, everything builds, and the superproject is simply pointing at work that was never merged. If the branch is later deleted, the same pin becomes a hard failure with no code change in between. So the observable symptom depends on someone else's branch-cleanup timing rather than on the defect.
This one is also load-bearing for a chain right now.
charly#289's gate cannot go green until#297merges, so this pin is holding a second PR indirectly. Not an argument for lowering the bar on#297— its validator raised two further blocking findings — but worth recording that the cost of this defect class is not confined to the PR that carries it.Detection suggestion, offered rather than prescribed: the check this issue implies is
git -C <submodule> merge-base --is-ancestor <pin> origin/main, which distinguishes correctly in both cases above and does not care whether the branch still exists.Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
atrawog commentedon Aug 28, 2026
Validation (2026-08-28) — RESOLVED
Verified against current repos. The rule was codified:
marketplace/internals/skills/git-workflow/references/branch-and-pr-loop.md:115now reads "Before merging a superproject leg, verify every gitlink is an ANCESTOR of its own repo's..." — the pattern is a rule, not three PR comments. Current superproject pins are all valid (each submodule at a main-head commit).Closing as resolved.