Skip to content

fix(queue): reconcile all overlapping duplicate siblings by claim-time election#4071

Merged
JSONbored merged 1 commit into
mainfrom
codex/fix-stale-sibling-reconciliation-issue
Jul 8, 2026
Merged

fix(queue): reconcile all overlapping duplicate siblings by claim-time election#4071
JSONbored merged 1 commit into
mainfrom
codex/fix-stale-sibling-reconciliation-issue

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Duplicate-winner election was changed to order by linkedIssueClaimedAt, which allows a higher-numbered PR that claimed earlier to precede a lower-numbered PR. The live reconciliation previously only refetched lower-numbered siblings, leaving stale higher-numbered claimants in the cache and causing false duplicate_pr_risk blockers and failed gates.
  • Reconcile every cached-open overlapping sibling before advisory/gate evaluation so the cluster winner is elected from true live state, preventing stale closed/merged rows from corrupting gate decisions.

Description

  • Change reconcileLiveDuplicateSiblings in src/queue/processors.ts to consider all overlapping open siblings (any PR that shares a linked issue), instead of only other.number < pr.number siblings, and maintain the existing live-fetch + fail-open semantics.
  • Preserve the existing behavior that only drops a sibling when a live fetch confirms it is not open and that unreadable fetches keep the cached row (no new spare on transient failures).
  • Update test/unit/reconcile-live-duplicate-siblings.test.ts to add and adjust cases that cover higher-numbered overlapping siblings (live-closed and live-open), mixed lower/higher clusters, non-overlapping siblings, and the previously-covered lower-sibling scenarios.
  • Files changed: src/queue/processors.ts, test/unit/reconcile-live-duplicate-siblings.test.ts.

Testing

  • Ran git diff --check which produced no trailing-whitespace or conflict-marker failures.
  • Attempted npx vitest run test/unit/reconcile-live-duplicate-siblings.test.ts, but Vitest failed to transform modules and did not execute the tests due to an existing unrelated syntax/transform error in the current src/queue/processors.ts around the deliveryId/job construction site, so the updated tests have not yet been validated in this branch.
  • No other automated CI steps were executed in this session; the intention is to re-run the unit tests and full npm run test:ci once the transform error is resolved so coverage and gate requirements can be met.

Codex Task

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.65%. Comparing base (95d2113) to head (3ddeb7f).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4071   +/-   ##
=======================================
  Coverage   93.65%   93.65%           
=======================================
  Files         384      384           
  Lines       35865    35865           
  Branches    13160    13160           
=======================================
  Hits        33589    33589           
  Misses       1618     1618           
  Partials      658      658           
Files with missing lines Coverage Δ
src/queue/processors.ts 95.15% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jul 7, 2026
@loopover-orb

loopover-orb Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-08 03:32:56 UTC

2 files · 2 blockers · readiness 93/100 · CI green · clean

⏸️ Suggested Action - Manual Review

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.

Concerns raised — review before merging

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
Signal Result Evidence
Code review ❌ 2 blockers No AI review summary
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 51 registered-repo PR(s), 43 merged, 505 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 51 PR(s), 505 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, JavaScript, Ruby, Go, Kotlin, MDX, Shell
  • Official Gittensor activity: 51 PR(s), 505 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 7, 2026
@JSONbored
JSONbored force-pushed the codex/fix-stale-sibling-reconciliation-issue branch from 903304b to 3ddeb7f Compare July 8, 2026 02:36
@JSONbored
JSONbored merged commit 1020663 into main Jul 8, 2026
10 checks passed
@JSONbored
JSONbored deleted the codex/fix-stale-sibling-reconciliation-issue branch July 8, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant