Skip to content

fix(miner): keep in-progress portfolio rows off re-enqueue demotion#2884

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
james3773:fix/miner-portfolio-queue-in-progress-enqueue
Jul 4, 2026
Merged

fix(miner): keep in-progress portfolio rows off re-enqueue demotion#2884
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
james3773:fix/miner-portfolio-queue-in-progress-enqueue

Conversation

@james3773

Copy link
Copy Markdown
Contributor

Summary

  • Prevent portfolio queue re-enqueue from demoting an in_progress item back to queued.

Problem

The upsert path always reset conflicting rows to queued, even when the item had already been claimed via dequeueNext. Re-enqueueing the same identifier could silently undo an in-progress claim.

Validation

  • Added regression test covering re-enqueue on an in-progress row.
  • Full CI gate on push.

Safety

  • Local SQLite portfolio queue only — no network, no secrets.

Skip the enqueue upsert update when a portfolio item is already in_progress so duplicate enqueue calls cannot reset an active claim back to queued.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.03%. Comparing base (3faf216) to head (df56cc7).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2884   +/-   ##
=======================================
  Coverage   96.03%   96.03%           
=======================================
  Files         259      259           
  Lines       28393    28393           
  Branches    10326    10326           
=======================================
  Hits        27266    27266           
  Misses        491      491           
  Partials      636      636           
🚀 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 gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 4, 2026
@loopover-orb

loopover-orb Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-04 03:57:07 UTC

2 files · 1 AI reviewer · no blockers · readiness 73/100 · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
The change correctly uses SQLite's conditional upsert to leave already claimed portfolio queue rows untouched when the same item is re-enqueued, and the regression test exercises the real enqueue/dequeue path. Existing queued and done rows still follow the prior reactivation behavior, while in-progress rows preserve both status and priority. The main remaining issue is documentation drift in the enqueue comment, not a functional defect.

Nits — 3 non-blocking
  • nit: packages/gittensory-miner/lib/portfolio-queue.js:105 still says every already-tracked item refreshes priority and resets to queued, which is no longer true for in-progress rows.
  • Update packages/gittensory-miner/lib/portfolio-queue.js:105 to document the in-progress exception so the SQL predicate and API behavior stay aligned.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
Signal Result Evidence
Code review ✅ No 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 ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 906 registered-repo PR(s), 642 merged, 38 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jony376; Gittensor profile; 906 PR(s), 38 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: jony376
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 906 PR(s), 38 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Explain no-issue PR.
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
  • 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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 1e62742 into JSONbored:main Jul 4, 2026
10 checks passed
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant