Skip to content

source-control: D6's reachability gate hardcodes origin, regressing the skill's non-origin and triangular-fork support #2310

Description

@kyle-sexton

Escaped from #2262: the merged D6 verify-commit-pushed gate (0.51.12, merge 9daeecb) writes
git fetch origin <branch> && git merge-base --is-ancestor <fix-sha> origin/<branch> into
reference/review-discipline.md (line ~233) and skills/pull-request/SKILL.md (line ~181).

Codex raised this as P1-2 on #2262 (thread: #2262 (comment)) and the PR merged before the fix landed; the fix commit 5a94f502 exists on the recreated fix/2244-d6-presence-read branch but is not on main.

Why it is a defect

The hardcoded origin is new in 0.51.12 — base 78dbb10e greps clean for git fetch origin in both files. The same skill pushes through push-branch.sh / resolve-remote.sh --push, which support branch.<name>.pushRemote, remote.pushDefault, non-origin tracking, and triangular fork flows. On such a checkout:

  • a successful push to a vendor/fork remote is followed by a fetch of the wrong remote → false D6 failure, blocking D7 and thread resolution;
  • an origin base repo carrying a same-named branch verifies the wrong ref entirely.

Same defect family the 0.51.12 change itself targeted: a check that answers confidently about the wrong thing.

Fix

Route the gate through the existing resolve-remote.sh --push (reuse, not reimplement) and compare against FETCH_HEAD — exactly what the resolved remote just served:

REMOTE=$(bash "${CLAUDE_PLUGIN_ROOT}/skills/pull-request/scripts/resolve-remote.sh" --push <branch>) \
  && git fetch "$REMOTE" <branch> && git merge-base --is-ancestor <fix-sha> FETCH_HEAD

Fold in two non-blocking wording corrections the #2262 verifier flagged in the shipped 0.51.12 CHANGELOG entry: "matching the reachability primitiveverify_fix_commit" overstates (that helper uses the fork-aware compare API, not git merge-base — same guarantee, different mechanism), and babysit_gh.py's per_page=100 lives at fetch_paginated_api's call sites, not adjacent to the --paginate flag.

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

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions