Skip to content

review: Facet B of #625 — capture PR base rev before fallback fetch clobbers FETCH_HEAD (pure correctness, no design fork) #661

Description

@kyle-sexton

Split from #625 per the 2026-07-20 Class B research-resolution (see the research comment on #625 for full empirical repro + citations). #625 itself stays needs-decision for Facet A (deepen vs report-and-stop — maintainer-reserved call). This child is the fork-free half, executable now:

Defect: in single-branch clones with a non-default base, the diff-base ladder's fallback git fetch overwrites FETCH_HEAD, so merge-base runs against the wrong rev — empirically pulls 3 commits (folds the base branch in) where the correct release base yields 1.

Fix: capture the PR base as an explicit rev BEFORE any fallback fetch can overwrite FETCH_HEAD; run merge-base against the captured rev (or use git fetch --append semantics). Acceptance criteria + scratch-clone repro harness are in the #625 research comment (verified against post-#591 main).

[Control tower routing, decomposition-intake pattern; operator veto window]

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: highSignificant impact, or blocks an imminent release; staff this cycle.status: readyTriaged, unblocked, and fully specified; eligible to pick up.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions