feat(miner): track real per-issue attempt-history on the portfolio queue - #5661
Conversation
buildAttemptGovernorContext previously hardcoded convergenceInput to a first-attempt-shaped literal on every call, so the Governor's fully-built non-convergence detector never saw real data. portfolio-queue.js now gains an additive attempts_count/consecutive_failures/reenqueue_count schema migration, incremented/reset on claim, reclaim, markFailed, and markDone, plus a getAttemptHistory read that attempt-cli.js threads through into the Governor context for the target issue. Closes #5654
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
loopover-ui | 3ebe095 | Commit Preview URL Branch Preview URL |
Jul 13 2026, 10:15 PM |
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-13 22:18:26 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 7 non-blocking
Linked issue satisfactionAddressed 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
buildAttemptGovernorContexthardcodedconvergenceInputto a first-attempt-shaped literal on every call — the Governor's fully-builtclassifyPortfolioConvergencedetector (#4286) has never seen real data.portfolio-queue.jsgains an additivev3 -> v4migration:attempts_count,consecutive_failures,reenqueue_count(allINTEGER NOT NULL DEFAULT 0), guarded by the same per-column presence check theleased_atmigration already usesattempts_countincrements on every real claim (dequeueNext/batchClaim)consecutive_failures+reenqueue_countincrement together on everyin_progress -> queuedtransition that did not reach done (markFailed,reclaimStuckItem) — exactly the "cycling queued → in_progress → queued without ever reaching done" the detector's own header namesconsecutive_failuresresets to 0 onmarkDone;reenqueue_countis a lifetime total, deliberately untouched thererequeueItem(a manual reopen of already-completed work) touches no counter — a different transition than the stuck-loop cyclegetAttemptHistory(repoFullName, identifier, apiBaseUrl)returns a realPortfolioConvergenceInput; an item never enqueued reads the same honest zero-state as a genuine first attemptattempt-cli.jsreads this item's real history (keyedissue:<n>, matching howportfolio-discovery.jsenqueues issue-shaped candidates) and threads it intobuildAttemptGovernorContext, which stays pure and just forwards itCloses #5654
Test plan
test/unit/miner-portfolio-queue.test.ts— schema migration (fresh v3 file, and a defensive idempotency test for a file that already carries all three columns), counter correctness across claim/reclaim/markFailed/markDone/requeue sequences, thereachedDoneinvariant, apiBaseUrl scoping, and a REGRESSION proving a genuinely non-convergent item now produces aPortfolioConvergenceInputthatclassifyPortfolioConvergenceclassifies asnon_convergenttest/unit/miner-attempt-input-builder.test.ts— realconvergenceInputthreads through unchanged; omitted falls back to the honest zero-statetest/unit/miner-attempt-cli.test.ts— the real per-issue read is called with the right key and flows intogovernor.convergenceInput; the real (non-DI) default is exercised via an isolated tmp storetest/unit/miner-migrate-cli.test.tsupdated for the new schema version (v4)npm run test:cigreen;npm run test:coverage(unsharded) — 100% branch coverage on every new/changed line, verified against lcov.infonpm run typecheck,npm run build:miner,npm run test:miner-pack,npm audit --audit-level=moderateall clean