You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A local claim that's been "active" for weeks with no plan progress is stale and should stop blocking other miners (real or soft-claim adjudication) from picking up the issue. This is a small, pure, deterministic sweep function over the claim ledger's own rows — no network, no GitHub calls, so it's zero-risk foundation work independent of the rest of this phase.
Deliverables
packages/gittensory-miner/src/claim-ledger/expiry.ts exporting findExpiredClaims(claims: LocalClaimRecord[], nowMs: number, maxAgeMs: number): LocalClaimRecord[] — pure, no IO, no Date.now() internally (caller supplies nowMs so the function is fully deterministic and testable, mirroring src/signals/duplicate-winner.ts's own "PURE — no IO, no Date, no random" discipline stated in its header comment)
sweepExpiredClaims(store, nowMs, maxAgeMs) — the thin IO wrapper that calls findExpiredClaims then transitions matching rows to status: "expired" via the existing releaseClaim-shaped store API
Configurable maxAgeMs with a documented sane default (e.g. 14 days)
Unit tests: no expired claims, all expired, mixed, and the boundary (age === maxAgeMs exactly)
Depends on the claim-ledger schema issue for the store shape
References
src/signals/duplicate-winner.ts:10 (module header's "PURE — no IO, no Date, no random" discipline to mirror for findExpiredClaims)
Depends on: the local claim-ledger schema + CRUD issue (packages/gittensory-miner/src/claim-ledger/store.ts)
A local claim that's been "active" for weeks with no plan progress is stale and should stop blocking other miners (real or soft-claim adjudication) from picking up the issue. This is a small, pure, deterministic sweep function over the claim ledger's own rows — no network, no GitHub calls, so it's zero-risk foundation work independent of the rest of this phase.
Deliverables
packages/gittensory-miner/src/claim-ledger/expiry.tsexportingfindExpiredClaims(claims: LocalClaimRecord[], nowMs: number, maxAgeMs: number): LocalClaimRecord[]— pure, no IO, noDate.now()internally (caller suppliesnowMsso the function is fully deterministic and testable, mirroringsrc/signals/duplicate-winner.ts's own "PURE — no IO, no Date, no random" discipline stated in its header comment)sweepExpiredClaims(store, nowMs, maxAgeMs)— the thin IO wrapper that callsfindExpiredClaimsthen transitions matching rows tostatus: "expired"via the existingreleaseClaim-shaped store APImaxAgeMswith a documented sane default (e.g. 14 days)age === maxAgeMsexactly)References
src/signals/duplicate-winner.ts:10(module header's "PURE — no IO, no Date, no random" discipline to mirror forfindExpiredClaims)packages/gittensory-miner/src/claim-ledger/store.ts)