fix(miner): cover worktree-allocator's slot pool in the right-to-be-forgotten purge - #8515
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (99.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #8515 +/- ##
===========================================
+ Coverage 60.98% 88.78% +27.80%
===========================================
Files 793 99 -694
Lines 79483 22910 -56573
Branches 24017 3930 -20087
===========================================
- Hits 48471 20341 -28130
+ Misses 27218 2391 -24827
+ Partials 3794 178 -3616
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…e-forgotten purge
57ae39a to
da0feb7
Compare
|
Caution 🛑 LoopOver review result - fixes requiredReview updated: 2026-07-24 18:02:55 UTC
Review summary Nits — 1 non-blocking
CI checks failing
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver 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://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 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.
|
|
LoopOver is closing this pull request on the maintainer's behalf (CI is failing (codecov/patch)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Summary
worktree-allocator'sworktree_slotstable carries arepo_full_namecolumn but was missing fromloopover-miner purge's right-to-be-forgotten sweep (the same recurring gap class already fixed in purge-cli.js omits contribution-profile-cache.js and governor-state.js's two repo-scoped tables from its right-to-be-forgotten sweep #7091, purge-cli.js's right-to-be-forgotten sweep misses portfolio-queue.js and run-state.js #6599, purge-cli's right-to-be-forgotten spec list is missing ranked-candidates, replay-snapshot, and deny-hook-synthesis stores #8009). This adds it. Closes fix(miner): worktree-allocator.ts's worktree_slots (has repo_full_name) is absent from purge-cli.ts's right-to-be-forgotten sweep #8320.worktree_slotsis a fixed pool of pre-allocated slot rows, not an append-only ledger, so the genericDELETE-basedLedgerPurgeSpec/purgeStoreByRepohelper is the wrong shape (deleting a slot would shrink the pool belowmaxConcurrencyand breakensureSlots/selectFreeSlot's every-slot-exists invariant). Followinggovernor-state's precedent for a non-uniform store, the purge lives on the store object asWorktreeAllocator.purgeByRepo— a hand-writtenUPDATEthat blanks the repo columns of astatus = 'free'slot, mirroringrelease()/reclaimOrphanedAllocations()'s own clearing statement.activeslot is never touched or counted: itsrepo_full_namereflects a real, in-flight attempt's on-disk worktree checkout, so clearing it would desync the allocator from that checkout. Only astatus = 'free'slot left carrying a stalerepo_full_name(a crash betweenacquireand the normal clear) can match — by design this affects 0 rows in the overwhelming majority of real calls.--dry-rungets a matching read-only counter (countWorktreeSlotsToPurge) via a newcountDryRunhook on the purge target, so the preview counts exactly thestatus = 'free' AND repo_full_name = ?rows the real purge would clear — an active slot is never previewed as purgeable either.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #8320).Validation
git diff --checknpm run typecheckpurge-cli.ts57/57 branches (100%); the newworktree-allocator.tspurgeByRepo/countWorktreeSlotsToPurgepaths are fully covered (verified via targetedvitest --coverage).miner-worktree-allocator,miner-purge-cli,miner-attempt-cli, plus the broader affected set (11 files, 268 tests) andtest:miner-pack.command-reference:check,test:miner-deployment-docs-audit,docs:drift-checkIf any required check was skipped, explain why:
packages/loopover-miner/**, which Codecov does not gate and which touches no workflows, UI, MCP, OpenAPI, Cloudflare Workers, or auth/cookie/CORS surfaces. Soactionlint,test:workers,build:mcp/test:mcp-pack,ui:openapi:check, andui:*are not applicable and were not run. Full-repotest:coveragewas not run in one pass (environment constraint); coverage was measured on the changed files directly (100% of changed lines/branches) and the affected unit suites were run in full and are green.Safety
UI Evidencesection — N/A (no visible UI/frontend/docs change; miner CLI internals only).command-reference/deployment-docs drift checks pass).Notes
governor-state's on-storepurgeByRepofor a non-uniform store, andrelease()/reclaimOrphanedAllocations()'s field-blankingUPDATE. No genericspec/specsentry is registered for this store, by design.