Context
packages/loopover-miner/lib/claim-ledger-expiry.js:15,30 exports sweepExpiredClaims/findExpiredClaims, with portfolio-queue-expiry.js:38's own comment claiming it "uses the same store/sweep split sweepExpiredClaims uses." But the portfolio-queue side's actual sweep (sweepStuckItems) is called from portfolio-queue-manager.js:114,123, while sweepExpiredClaims/findExpiredClaims have zero callers anywhere in the repo. claim-ledger.js's expireClaim mutation exists and works, but nothing ever calls the sweep that would invoke it — so a claim left behind by a crashed/killed miner process never automatically expires, unlike the portfolio-queue's own stuck-item sweep.
Requirements
- Wire
sweepExpiredClaims/findExpiredClaims into the same recurring-sweep call site portfolio-queue-manager.js's sweepStuckItems already uses (or an equivalent scheduled entry point for the claim ledger specifically, if one exists separately) — read portfolio-queue-manager.js:114,123's call site for the exact integration pattern to mirror.
- Ensure the sweep actually invokes
claim-ledger.js's expireClaim for each expired claim found.
- Do not change
claim-ledger.js's expireClaim mutation itself — it already works correctly.
Test Coverage Requirements
99%+ Codecov patch coverage on the new call site; add a regression test proving a stale claim is actually expired when the sweep runs (not just that the sweep function is called).
Deliverables
Expected Outcome
A claim left behind by a crashed miner process is automatically expired instead of blocking the repo indefinitely.
Links & Resources
packages/loopover-miner/lib/claim-ledger-expiry.js:15,30
packages/loopover-miner/lib/portfolio-queue-expiry.js:38, portfolio-queue-manager.js:114,123 (the sibling pattern to mirror)
packages/loopover-miner/lib/claim-ledger.js (expireClaim)
Context
packages/loopover-miner/lib/claim-ledger-expiry.js:15,30exportssweepExpiredClaims/findExpiredClaims, withportfolio-queue-expiry.js:38's own comment claiming it "uses the same store/sweep splitsweepExpiredClaimsuses." But the portfolio-queue side's actual sweep (sweepStuckItems) is called fromportfolio-queue-manager.js:114,123, whilesweepExpiredClaims/findExpiredClaimshave zero callers anywhere in the repo.claim-ledger.js'sexpireClaimmutation exists and works, but nothing ever calls the sweep that would invoke it — so a claim left behind by a crashed/killed miner process never automatically expires, unlike the portfolio-queue's own stuck-item sweep.Requirements
sweepExpiredClaims/findExpiredClaimsinto the same recurring-sweep call siteportfolio-queue-manager.js'ssweepStuckItemsalready uses (or an equivalent scheduled entry point for the claim ledger specifically, if one exists separately) — readportfolio-queue-manager.js:114,123's call site for the exact integration pattern to mirror.claim-ledger.js'sexpireClaimfor each expired claim found.claim-ledger.js'sexpireClaimmutation itself — it already works correctly.Test Coverage Requirements
99%+ Codecov patch coverage on the new call site; add a regression test proving a stale claim is actually expired when the sweep runs (not just that the sweep function is called).
Deliverables
sweepExpiredClaims/findExpiredClaimswired into a real recurring call site.Expected Outcome
A claim left behind by a crashed miner process is automatically expired instead of blocking the repo indefinitely.
Links & Resources
packages/loopover-miner/lib/claim-ledger-expiry.js:15,30packages/loopover-miner/lib/portfolio-queue-expiry.js:38,portfolio-queue-manager.js:114,123(the sibling pattern to mirror)packages/loopover-miner/lib/claim-ledger.js(expireClaim)