From 71473852e17b66bd75a3db576969edd9a0eb2028 Mon Sep 17 00:00:00 2001 From: xfodev Date: Sun, 19 Jul 2026 04:08:50 -0700 Subject: [PATCH] fix(miner): add policy-doc-cache to doctor and migrate store lists (#7238) --- packages/loopover-miner/lib/migrate-cli.js | 2 ++ packages/loopover-miner/lib/status.js | 2 ++ test/unit/miner-migrate-cli.test.ts | 3 ++- test/unit/miner-status.test.ts | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/loopover-miner/lib/migrate-cli.js b/packages/loopover-miner/lib/migrate-cli.js index f35ba85837..623edd6823 100644 --- a/packages/loopover-miner/lib/migrate-cli.js +++ b/packages/loopover-miner/lib/migrate-cli.js @@ -24,6 +24,7 @@ import { openReplaySnapshotStore, resolveReplaySnapshotDbPath } from "./replay-s import { openWorktreeAllocator, resolveWorktreeAllocatorDbPath } from "./worktree-allocator.js"; import { initContributionProfileCache, resolveContributionProfileCacheDbPath } from "./contribution-profile-cache.js"; import { initPolicyVerdictCacheStore, resolvePolicyVerdictCacheDbPath } from "./policy-verdict-cache.js"; +import { initPolicyDocCacheStore, resolvePolicyDocCacheDbPath } from "./policy-doc-cache.js"; const MIGRATE_USAGE = "Usage: loopover-miner migrate [--json]"; @@ -41,6 +42,7 @@ const STORES = [ { name: "worktree-allocator", resolveDbPath: resolveWorktreeAllocatorDbPath, open: (dbPath) => openWorktreeAllocator({ dbPath }) }, { name: "contribution-profile", resolveDbPath: resolveContributionProfileCacheDbPath, open: initContributionProfileCache }, { name: "policy-verdict-cache", resolveDbPath: resolvePolicyVerdictCacheDbPath, open: initPolicyVerdictCacheStore }, + { name: "policy-doc-cache", resolveDbPath: resolvePolicyDocCacheDbPath, open: initPolicyDocCacheStore }, ]; /** Read a store file's stamped schema version without ever creating it -- matches checkStoreIntegrity's diff --git a/packages/loopover-miner/lib/status.js b/packages/loopover-miner/lib/status.js index e77f52764a..78cfa057d6 100644 --- a/packages/loopover-miner/lib/status.js +++ b/packages/loopover-miner/lib/status.js @@ -27,6 +27,7 @@ import { resolveReplaySnapshotDbPath } from "./replay-snapshot.js"; import { resolveWorktreeAllocatorDbPath } from "./worktree-allocator.js"; import { resolveContributionProfileCacheDbPath } from "./contribution-profile-cache.js"; import { resolvePolicyVerdictCacheDbPath } from "./policy-verdict-cache.js"; +import { resolvePolicyDocCacheDbPath } from "./policy-doc-cache.js"; // Slim laptop-mode CLI commands (#2288): `status` (what's installed + where local state lives) and `doctor` (is // this laptop set up correctly). Both are read-only and 100% local — no repo-scanning, no coding-agent invocation, @@ -320,6 +321,7 @@ function storeIntegrityChecks(env) { ["worktree-allocator", resolveWorktreeAllocatorDbPath(env)], ["contribution-profile", resolveContributionProfileCacheDbPath(env)], ["policy-verdict-cache", resolvePolicyVerdictCacheDbPath(env)], + ["policy-doc-cache", resolvePolicyDocCacheDbPath(env)], ]; return stores.map(([name, dbPath]) => checkStoreIntegrity(`store-integrity:${name}`, dbPath)); } diff --git a/test/unit/miner-migrate-cli.test.ts b/test/unit/miner-migrate-cli.test.ts index 776a76b304..7068513032 100644 --- a/test/unit/miner-migrate-cli.test.ts +++ b/test/unit/miner-migrate-cli.test.ts @@ -31,6 +31,7 @@ const STORE_NAMES = [ "worktree-allocator", "contribution-profile", "policy-verdict-cache", + "policy-doc-cache", ]; afterEach(() => { @@ -39,7 +40,7 @@ afterEach(() => { }); describe("loopover-miner migrate (#4871)", () => { - it("covers the exact same thirteen stores doctor's store-integrity sweep covers, in the same order, and skips every one when nothing has been created yet", () => { + it("covers the exact same fourteen stores doctor's store-integrity sweep covers, in the same order, and skips every one when nothing has been created yet", () => { const env = tempEnv(); const results = runMigrateChecks(env); diff --git a/test/unit/miner-status.test.ts b/test/unit/miner-status.test.ts index 6898013096..5e6a359c07 100644 --- a/test/unit/miner-status.test.ts +++ b/test/unit/miner-status.test.ts @@ -139,6 +139,7 @@ describe("loopover-miner status/doctor (#2288)", () => { "store-integrity:worktree-allocator", "store-integrity:contribution-profile", "store-integrity:policy-verdict-cache", + "store-integrity:policy-doc-cache", ]); // REGRESSION (#6768): doctor previously omitted these four durable local stores from the integrity sweep. expect(checks.map((check) => check.name)).toEqual(