Skip to content

fix(review): preserve priority repairs during regate backlog - #4484

Merged
JSONbored merged 2 commits into
mainfrom
codex/fix-priority-repairs-skipping-under-backlog
Jul 10, 2026
Merged

fix(review): preserve priority repairs during regate backlog#4484
JSONbored merged 2 commits into
mainfrom
codex/fix-priority-repairs-skipping-under-backlog

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Prevent priority repair PRs (missing current Gate checks / unpublished surface) from being sliced out when the re-gate sweep runs under an active per-PR backlog, which could starve required repair work.

Description

  • When regateBacklog > 0 and there are priority repairs, narrow the input pool to only those priority PRs before calling selectRegateCandidates so the backlog-time cap cannot drop repairs (src/queue/processors.ts).
  • Reuse a Set of priorityPullNumbers and apply the repairCandidateLimit as before, preserving the intended global ordering semantics outside backlog windows.
  • Strengthen the existing regression test to reproduce the bug by making the priority repair newer-by-regate than ordinary stale PRs and asserting only the repair is fanned out (test/unit/queue.test.ts).

Testing

  • Ran git diff --check which passed with no issues.
  • Ran npm run typecheck which completed successfully with no TS errors.
  • Ran targeted unit tests with npx vitest run test/unit/agent-sweep.test.ts test/unit/queue.test.ts -t "repair priority|active per-PR regate backlog restricts|sweep tags a priority" and the relevant tests passed.
  • npm audit --audit-level=moderate was blocked by the registry (403 Forbidden).
  • The full npm run test:ci run failed at cf-typegen:check because worker-configuration.d.ts is stale and requires npm run cf-typegen to regenerate; this is unrelated to the logic fix but blocks the full gate in this environment.

Codex Task

@superagent-security

Copy link
Copy Markdown
Contributor

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

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

loopover-orb Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-10 07:17:35 UTC

2 files · 1 AI reviewer · 2 blockers · readiness 93/100 · CI green · unstable

⏸️ 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.

Review summary
Fixes a real bug where sweepRepoRegate assumed selectRegateCandidates sorts priority repairs first, but that behavior was intentionally removed upstream to stop PR spraying — so capping max=priorityPullNumbers.length alone could let an ordinary stale PR evict the repair. The fix pre-filters the input pool to priority PRs before calling selectRegateCandidates during an active backlog, which is a root-cause fix, not a symptom patch. The strengthened test reproduces the bug realistically by making the repair sort newer (and thus last) than the ordinary stale PRs.

Nits — 4 non-blocking
  • PR description doesn't link an eligible open issue per repo convention for external contributor PRs.
  • processors.ts:1863 comment could more explicitly state the new invariant (input-pool filtering, not max-capping, guarantees repair survival) to prevent this regressing again.
  • Confirm which open issue this closes, per repo policy.
  • Cross-reference the agent-sweep.ts 'priority affects eligibility only' doc comment directly from processors.ts.

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 1 reviewer
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: 48 registered-repo PR(s), 40 merged, 334 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 48 PR(s), 334 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: not available
  • Official Gittensor activity: 48 PR(s), 334 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

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.12%. Comparing base (63d5a0f) to head (3f10052).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4484   +/-   ##
=======================================
  Coverage   94.12%   94.12%           
=======================================
  Files         430      430           
  Lines       38181    38183    +2     
  Branches    13922    13923    +1     
=======================================
+ Hits        35939    35941    +2     
  Misses       1585     1585           
  Partials      657      657           
Files with missing lines Coverage Δ
src/queue/processors.ts 95.31% <100.00%> (+<0.01%) ⬆️
🚀 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 the manual-review Gittensor contributor context label Jul 9, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 10, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 3f10052 Commit Preview URL

Branch Preview URL
Jul 10 2026, 07:01 AM

@JSONbored
JSONbored merged commit c88a793 into main Jul 10, 2026
12 checks passed
@JSONbored
JSONbored deleted the codex/fix-priority-repairs-skipping-under-backlog branch July 10, 2026 07:20
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