PR description generated from stale/wrong base diff, not the true merge-base with origin/develop

Author: latent-gradientCreated Sep 6, 2026Updated Sep 21, 2026
Labelsbugready-for-pr

What happened

On a fresh branch created directly from origin/develop with exactly one commit (docs: remove redundant CONTRIBUTING.md - confirmed via git reflog show <branch>: branch: Created from origin/develop then one commit, no rebase, no history rewrite), the no-mistakes-generated PR title and body described unrelated work: release-notes automation, a skills directory migration, an ESLint 8→9 config migration, and CI workflow changes - none of which are in the actual diff (files=[CONTRIBUTING.md] only).

The PR's own "Test" section correctly described only the CONTRIBUTING.md removal, so the test/verification step used the correct diff - only the title/description-generation step (the document pipeline step) appears to have picked up the wrong scope.

Repro context

  • Repo: sabhalog (private)
  • Branch: single commit off origin/develop, no rebases, no squash/amend
  • Between when the branch was cut and when document/PR-open ran, several unrelated PRs had merged into develop (skills migration, ESLint migration, CHANGELOG removal, CI changes) - real merges to the actual base branch, not local branch pollution
  • Reflog on the working branch shows exactly one commit, confirming the branch itself never carried those other commits

Likely root cause

The document/PR-description step appears to have computed its content from a diff against a stale cached develop ref (captured at some earlier point in the run, before those other merges landed) rather than the true current merge-base between the branch and origin/develop at PR-open time. That stale-base diff would include everything that changed on develop in the interim, which matches exactly what showed up in the bogus description (all real develop-side changes from that window).

Impact

The PR title/body is actively misleading about scope - a reviewer reading it would believe the PR does far more than it does. Had to manually correct it via gh pr edit after review caught the discrepancy.

Ask

Please confirm whether the document step re-resolves the base ref fresh (fetch + merge-base) immediately before diffing, or reuses an earlier-captured ref from earlier in the run. If the latter, that's the fix: always re-resolve the merge-base against the current remote base branch right before generating the description, not an earlier snapshot.