From eb251e46ec636bbfd475e74352ea613fc1f1f98e Mon Sep 17 00:00:00 2001 From: RealDiligent Date: Tue, 21 Jul 2026 21:22:37 +0800 Subject: [PATCH] docs(queue): fix reconcileLiveDuplicateSiblings stale comment Describe claim-time duplicate-winner election (#3816) instead of the obsolete PR-number-based wording. Closes #7810. Co-authored-by: Cursor --- src/queue/duplicate-detection.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/queue/duplicate-detection.ts b/src/queue/duplicate-detection.ts index 1bca24a61c..753ce851e0 100644 --- a/src/queue/duplicate-detection.ts +++ b/src/queue/duplicate-detection.ts @@ -62,14 +62,16 @@ export function dupWinnerLinkedDuplicateWinnerNumber( * Live-reconcile the duplicate cluster's open siblings before the winner is elected (#dup-winner / audit #15). * * The stored open-PR cache ({@link listOtherOpenPullRequests}) lags GitHub: a sibling that was closed/merged on - * GitHub but is still cached `open` would keep "winning" the duplicate cluster, demoting the real lowest-OPEN PR - * to a loser and auto-closing it via the `duplicate_pr_risk` blocker. Only a LOWER-numbered overlapping sibling - * can demote this PR from winner, so re-fetch the LIVE state of just those siblings and drop any that are no - * longer open. Then the downstream election ({@link isDuplicateClusterWinnerByClaim}) reflects ground truth. + * GitHub but is still cached `open` would keep "winning" the duplicate cluster, demoting the true earliest + * claimant to a loser and auto-closing it via the `duplicate_pr_risk` blocker. Duplicate-winner election is + * claim-time based ({@link resolveDuplicateClusterWinnerNumber}, #3816): any overlapping sibling — lower or + * higher PR number — can demote this PR if it claimed the linked issue earlier, so re-fetch the LIVE state of + * all overlapping siblings and drop any that are no longer open. Then the downstream election + * ({@link isDuplicateClusterWinnerByClaim}) reflects ground truth. * * FAIL-OPEN to the stored state: a sibling is dropped ONLY on a positive "not open" confirmation — an unreadable * live fetch keeps it, so a transient GitHub hiccup never newly spares a real loser. Flag-OFF (default), no - * linked issues, or no lower overlapping sibling ⇒ returns the input unchanged with no extra API calls. + * linked issues, or no overlapping sibling ⇒ returns the input unchanged with no extra API calls. */ export async function reconcileLiveDuplicateSiblings( env: Env,