feat(miner): add queue release/requeue escape-hatch subcommands (#4828) - #5520
Conversation
This update introduces two new commands to the gittensory-miner CLI: `queue release` and `queue requeue`. The `release` command allows users to return a claimed item back to the queue, while the `requeue` command enables users to put a completed item back on the queue, maintaining its original FIFO position. Additionally, the necessary parsing and handling functions have been implemented, along with corresponding usage messages and error handling. Tests have been added to ensure the correct functionality of these new commands. Closes JSONbored#4828.
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5520 +/- ##
==========================================
+ Coverage 94.78% 94.79% +0.01%
==========================================
Files 566 566
Lines 45023 45065 +42
Branches 14675 14675
==========================================
+ Hits 42673 42718 +45
+ Misses 1616 1613 -3
Partials 734 734
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-13 00:56:40 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Flagged checks (non-blocking)
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 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.
|
Summary
The portfolio-queue CLI exposed only
list/next/done/claim-batch, so an operator had no manual way to return an item to the queue outside the automated stuck-lease sweep (#4827/#5202). This adds the two escape-hatch subcommands #4828 asks for:queue release <owner/repo> <identifier>— give up a CLAIMED (in_progress) item, returning it toqueued. The manual counterpart to the automated reclaim sweep; reuses the store's existingreclaimStuckItem.queue requeue <owner/repo> <identifier>— put a COMPLETED (done) item back on the queue so it is picked up again, keeping its original FIFO position (rowid/enqueued_at unchanged). Backed by a newrequeueItemstore method.The two target distinct source states (
in_progressvsdone), so a manual op can never disturb an active claim; anything else (alreadyqueued, wrong state, or absent) is a no-op that exits non-zero with a specific code.Both follow the existing
queue doneshape exactly — same<owner/repo> <identifier> [--json]parsing (refactored into one sharedparseRepoIdentifierArgshelper;done's behavior is unchanged),withPortfolioQueuestore lifecycle, exit codes (0 success / 2 failure), and machine-readable error codes (queue_entry_not_in_progress,queue_entry_not_requeuable). Both are documented in--help.Closes #4828
Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run typecheck(clean, incl. the updated.d.tsdeclarations)node --checkon the changed lib files (the miner package's build gate)miner-portfolio-queue-cli.test.tscovering, for each command, success · not-applicable-state ·--json· parse-error · fail-safe (store throws, both Error and non-Error) · dispatch — all pass.packages/gittensory-miner/**sits outside Codecov'ssrc/**include glob, but every new statement and branch is covered to the 100% house standard.npm run test:workers·build:mcp·ui:*— N/A (miner-package + test change only; no worker/MCP/UI/OpenAPI surface touched).If any required check was skipped, explain why:
Change is confined to the
packages/gittensory-minerlib (authored JS validated bynode --check) + its.d.ts+ unit tests. No boundary beyond the lease work's schema is touched (per the issue's boundary) —requeueItemis a new store method, not a schema change.Safety
UI Evidence
N/A — no UI/frontend/docs changes.
Notes
requeuedeliberately targets onlydoneitems andreleaseonlyin_progressitems, so the two escape hatches are unambiguous and never race an active claim; a requeued item keeps its FIFO position rather than jumping to the back.queue listimmediately (asserted in the tests), satisfying the issue's acceptance criteria.