Archived
`gh pr list` orders by creation date, so `--limit 30` cut the candidate set by when PRs were opened, not when they merged. The `sort_by(.mergedAt)` that followed only reordered whatever survived that cut. A PR opened before the window but merged inside it — exactly the kind a release branch still needs — never reached the already-on-branch check at all. #7649 and #7709 were both missing from v4-0-2's list for this reason. The window is now bounded by the branch point instead of a count: pull a wide page and keep what merged after the merge-base's commit date, since anything merged into the dev branch before the release branch left it is already there by ancestry. v4-0-2 went from 11 candidates to 31. Widening it surfaced a second gap. A change re-applied by hand carries neither a PR number nor a cherry-pick trailer, so already_on_branch could not see it and offered it again (#6939, applied as 33d7363c). It now also compares the PR title against the branch's subjects, with any trailing "(#N)" stripped.