fix(miner): purge contribution-profile-cache and governor-state's repo-scoped tables#7110
Conversation
…o-scoped tables (JSONbored#7091) purge-cli.js's right-to-be-forgotten sweep covered only six of the miner's repo-scoped local stores. Three genuinely repo-scoped tables with the same `repoColumn` shape were missed, leaving per-repo data uncleaned: contribution-profile-cache's miner_contribution_profile table (keyed repo_full_name), and governor-state's governor_reputation_history and governor_own_submissions tables. Add the three purge specs to store-maintenance.js (the cache table name comes from its schema module's own CONTRIBUTION_PROFILE_STORE_TABLE constant so it can't drift), give each store a purgeByRepo method reusing the shared identifier-guarded purgeStoreByRepo, and wire both into REAL_PURGE_TARGETS. governor-state purges BOTH its tables against a single open handle; its reputation history is deleted by repo_full_name alone so a purge clears the repo across every api_base_url it was recorded against. governor_scalar_state (a whole-run scalar row with no repo dimension) is deliberately untouched. The dry-run path counts multi-table targets via a `specs` array. Closes JSONbored#7091
|
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 #7110 +/- ##
=======================================
Coverage 93.75% 93.75%
=======================================
Files 692 692
Lines 68808 68816 +8
Branches 18781 18781
=======================================
+ Hits 64511 64519 +8
Misses 3302 3302
Partials 995 995
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-17 22:01:00 UTC
Review summary Nits — 4 non-blocking
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.
|
Closes #7091
Summary
purge-cli.js's operator-invoked right-to-be-forgotten sweep purged only six of the miner's repo-scoped local stores. Three genuinely repo-scoped tables with the samerepoColumnshape were missed, so aloopover-miner purge --repo <owner/repo>left their per-repo rows behind:contribution-profile-cache.js'sminer_contribution_profiletable (keyedrepo_full_name).governor-state.js'sgovernor_reputation_historyandgovernor_own_submissionstables.store-maintenance.js— the cache table name comes from its schema module's ownCONTRIBUTION_PROFILE_STORE_TABLEconstant so the spec can't drift from a second literal — gives each store apurgeByRepomethod reusing the shared, identifier-guardedpurgeStoreByRepo, and wires both new targets intoREAL_PURGE_TARGETS.governor-statepurges both its repo-scoped tables against a single open handle (never reopening the file); itsgovernor_reputation_historyis deleted onrepo_full_namealone (its key is composite withapi_base_url), so a purge clears the repo across every forge host it was recorded against.governor_scalar_state— a single whole-run scalar row with no repo dimension — is deliberately left untouched.--dry-runcount path now handles multi-table targets via aspecsarray, so governor-state's preview sums both tables exactly like a real purge.Scope
type(scope): short summaryConventional Commit format.packages/loopover-miner/lib/**+ its test). No UI, MCP, API, or dependency changes.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #7091(bare, above).Validation
git diff --check— clean.npm run typecheck— 0 errors (hand-maintained.d.tsfiles updated for the new spec exports +purgeByRepomethods).npm run test:coverage(scoped locally):test/unit/miner-purge-cli.test.ts,miner-contribution-profile-cache.test.ts,miner-governor-state.test.ts— 64 tests pass; 100% patch coverage measured on every changed line and branch of all four source files (store-maintenance.js,contribution-profile-cache.js,governor-state.js,purge-cli.js).If any required check was skipped, explain why:
test:workers,build:mcp/test:mcp-pack,ui:openapi:check,ui:lint/ui:typecheck/ui:build,npm audit— not applicable: no worker/MCP/OpenAPI/UI surface and no dependency changes are touched. The full local gate (npm run test:ci) was not re-run end to end; the relevant slices (typecheck, the affected coverage suites) are green above.Safety
UI Evidencesection — N/A: this is a backend/CLI-logic change with no rendered surface.UI Evidence
Not applicable — no UI, frontend, or visible change. This PR changes the miner's local-store purge logic and its unit test only.
Notes
api_base_urls, while another repo's rows and the non-repo-scopedgovernor_scalar_statepause row survive — plus dry-run parity for the new targets and the existing six.