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
packages/loopover-miner/lib/policy-verdict-cache.js (schema at lines 56-67) keys its policy_verdict_cache table on repo_scope TEXT PRIMARY KEY — a genuine per-repo column, structurally identical to the six stores store-maintenance.js already documents as purgeable (packages/loopover-miner/lib/store-maintenance.js:27-36: "the six stores whose rows are directly scoped by a repoColumn"). That comment explains why attempt-log.js is deliberately excluded (its payload has no dedicated repo column) but says nothing about policy-verdict-cache.js — it simply isn't in any of the three "known local stores" lists it structurally qualifies for:
status.js's storeIntegrityChecks (packages/loopover-miner/lib/status.js:305-320, whose own comment claims to cover "every durable local SQLite store using resolveLocalStoreDbPath")
policy-doc-cache.js (keyed by url, not a repo column) is correctly absent from these lists — its omission is intentional, mirroring attempt-log.js. policy-verdict-cache.js's omission is not: it fits the exact repoColumn purge/health-check pattern and was simply never wired in.
Requirements
Add a POLICY_VERDICT_CACHE_PURGE_SPEC = { table: "policy_verdict_cache", repoColumn: "repo_scope" } to store-maintenance.js, following the exact shape of the six existing specs.
Wire that spec into purge-cli.js's REAL_PURGE_TARGETS.
Add policy-verdict-cache.js's resolvePolicyVerdictCacheDbPath to status.js's storeIntegrityChecks and migrate-cli.js's STORES list, following the existing entries' exact shape.
Do not touch policy-doc-cache.js — its exclusion is intentional and out of scope for this issue.
Deliverables
policy_verdict_cache purgeable via purge-cli.js (by repo scope)
policy_verdict_cache covered by status.js's store-integrity check
policy_verdict_cache covered by migrate-cli.js's migration sweep
Test confirming a purge/status/migrate run actually touches policy_verdict_cache
Test Coverage Requirements
99%+ Codecov patch coverage on every changed line and branch, plus the regression test above confirming all three code paths reach the newly-wired store.
Expected Outcome
policy_verdict_cache is purgeable, health-checked, and migration-covered exactly like the other six repo-scoped stores, closing a gap where per-repo data in this table could persist indefinitely uncleaned and unmonitored.
Links & Resources
packages/loopover-miner/lib/store-maintenance.js:27-36 — the six-store pattern to extend. packages/loopover-miner/lib/purge-cli.js, status.js, migrate-cli.js — the three lists to update.
Context
packages/loopover-miner/lib/policy-verdict-cache.js(schema at lines 56-67) keys itspolicy_verdict_cachetable onrepo_scope TEXT PRIMARY KEY— a genuine per-repo column, structurally identical to the six storesstore-maintenance.jsalready documents as purgeable (packages/loopover-miner/lib/store-maintenance.js:27-36: "the six stores whose rows are directly scoped by arepoColumn"). That comment explains whyattempt-log.jsis deliberately excluded (its payload has no dedicated repo column) but says nothing aboutpolicy-verdict-cache.js— it simply isn't in any of the three "known local stores" lists it structurally qualifies for:purge-cli.js'sREAL_PURGE_TARGETS(packages/loopover-miner/lib/purge-cli.js:38-45)status.js'sstoreIntegrityChecks(packages/loopover-miner/lib/status.js:305-320, whose own comment claims to cover "every durable local SQLite store using resolveLocalStoreDbPath")migrate-cli.js'sSTORESlist (packages/loopover-miner/lib/migrate-cli.js:28-40, citing "doctor's integrity sweep and migrate's proactive sweep both omit four real local stores #6768" and "same eleven stores")policy-doc-cache.js(keyed byurl, not a repo column) is correctly absent from these lists — its omission is intentional, mirroringattempt-log.js.policy-verdict-cache.js's omission is not: it fits the exactrepoColumnpurge/health-check pattern and was simply never wired in.Requirements
POLICY_VERDICT_CACHE_PURGE_SPEC = { table: "policy_verdict_cache", repoColumn: "repo_scope" }tostore-maintenance.js, following the exact shape of the six existing specs.purge-cli.js'sREAL_PURGE_TARGETS.policy-verdict-cache.js'sresolvePolicyVerdictCacheDbPathtostatus.js'sstoreIntegrityChecksandmigrate-cli.js'sSTORESlist, following the existing entries' exact shape.policy-doc-cache.js— its exclusion is intentional and out of scope for this issue.Deliverables
policy_verdict_cachepurgeable viapurge-cli.js(by repo scope)policy_verdict_cachecovered bystatus.js's store-integrity checkpolicy_verdict_cachecovered bymigrate-cli.js's migration sweeppolicy_verdict_cacheTest Coverage Requirements
99%+ Codecov patch coverage on every changed line and branch, plus the regression test above confirming all three code paths reach the newly-wired store.
Expected Outcome
policy_verdict_cacheis purgeable, health-checked, and migration-covered exactly like the other six repo-scoped stores, closing a gap where per-repo data in this table could persist indefinitely uncleaned and unmonitored.Links & Resources
packages/loopover-miner/lib/store-maintenance.js:27-36— the six-store pattern to extend.packages/loopover-miner/lib/purge-cli.js,status.js,migrate-cli.js— the three lists to update.