Skip to content

Commit 37369b9

Browse files
fix(miner): register ranked-candidates + deny-hook-synthesis in doctor/migrate store lists (#8036)
status.ts's storeIntegrityChecks and migrate-cli.ts's STORES both enumerate every durable local SQLite store so `loopover-miner doctor` reports each store's integrity and `loopover-miner migrate` applies pending migrations to each. Two stores were missing from both lists: ranked-candidates and deny-hook-synthesis -- so doctor never checked them and migrate never migrated them, unlike every sibling store. Add both to storeIntegrityChecks (via resolveRankedCandidatesDbPath / resolveDenyHookSynthesisDbPath) and to STORES (with their initRankedCandidatesStore / initDenyHookSynthesisStore openers), and update the pinned store-list tests (count and expected names) plus a #8008 regression assertion mirroring the existing #6768 one. Closes #8008
1 parent dc29c3a commit 37369b9

4 files changed

Lines changed: 19 additions & 1 deletion

File tree

packages/loopover-miner/lib/migrate-cli.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import { openWorktreeAllocator, resolveWorktreeAllocatorDbPath } from "./worktre
2525
import { initContributionProfileCache, resolveContributionProfileCacheDbPath } from "./contribution-profile-cache.js";
2626
import { initPolicyVerdictCacheStore, resolvePolicyVerdictCacheDbPath } from "./policy-verdict-cache.js";
2727
import { initPolicyDocCacheStore, resolvePolicyDocCacheDbPath } from "./policy-doc-cache.js";
28+
import { initRankedCandidatesStore, resolveRankedCandidatesDbPath } from "./ranked-candidates.js";
29+
import { initDenyHookSynthesisStore, resolveDenyHookSynthesisDbPath } from "./deny-hook-synthesis.js";
2830

2931
const MIGRATE_USAGE = "Usage: loopover-miner migrate [--json]";
3032

@@ -76,6 +78,8 @@ const STORES: MigrateStoreDescriptor[] = [
7678
},
7779
{ name: "policy-verdict-cache", resolveDbPath: resolvePolicyVerdictCacheDbPath, open: initPolicyVerdictCacheStore },
7880
{ name: "policy-doc-cache", resolveDbPath: resolvePolicyDocCacheDbPath, open: initPolicyDocCacheStore },
81+
{ name: "ranked-candidates", resolveDbPath: resolveRankedCandidatesDbPath, open: initRankedCandidatesStore },
82+
{ name: "deny-hook-synthesis", resolveDbPath: resolveDenyHookSynthesisDbPath, open: initDenyHookSynthesisStore },
7983
];
8084

8185
/** Read a store file's stamped schema version without ever creating it -- matches checkStoreIntegrity's

packages/loopover-miner/lib/status.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import { resolveWorktreeAllocatorDbPath } from "./worktree-allocator.js";
2828
import { resolveContributionProfileCacheDbPath } from "./contribution-profile-cache.js";
2929
import { resolvePolicyVerdictCacheDbPath } from "./policy-verdict-cache.js";
3030
import { resolvePolicyDocCacheDbPath } from "./policy-doc-cache.js";
31+
import { resolveRankedCandidatesDbPath } from "./ranked-candidates.js";
32+
import { resolveDenyHookSynthesisDbPath } from "./deny-hook-synthesis.js";
3133

3234
// Slim laptop-mode CLI commands (#2288): `status` (what's installed + where local state lives) and `doctor` (is
3335
// this laptop set up correctly). Both are read-only and 100% local — no repo-scanning, no coding-agent invocation,
@@ -376,6 +378,8 @@ function storeIntegrityChecks(env: Record<string, string | undefined>): DoctorCh
376378
["contribution-profile", resolveContributionProfileCacheDbPath(env)],
377379
["policy-verdict-cache", resolvePolicyVerdictCacheDbPath(env)],
378380
["policy-doc-cache", resolvePolicyDocCacheDbPath(env)],
381+
["ranked-candidates", resolveRankedCandidatesDbPath(env)],
382+
["deny-hook-synthesis", resolveDenyHookSynthesisDbPath(env)],
379383
];
380384
return stores.map(([name, dbPath]) => checkStoreIntegrity(`store-integrity:${name}`, dbPath));
381385
}

test/unit/miner-migrate-cli.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ const STORE_NAMES = [
3232
"contribution-profile",
3333
"policy-verdict-cache",
3434
"policy-doc-cache",
35+
"ranked-candidates",
36+
"deny-hook-synthesis",
3537
];
3638

3739
afterEach(() => {
@@ -40,13 +42,15 @@ afterEach(() => {
4042
});
4143

4244
describe("loopover-miner migrate (#4871)", () => {
43-
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", () => {
45+
it("covers the exact same sixteen stores doctor's store-integrity sweep covers, in the same order, and skips every one when nothing has been created yet", () => {
4446
const env = tempEnv();
4547
const results = runMigrateChecks(env);
4648

4749
expect(results.map((result) => result.name)).toEqual(STORE_NAMES);
4850
// REGRESSION (#6768): these four durable stores were previously omitted from both migrate and doctor.
4951
expect(STORE_NAMES).toEqual(expect.arrayContaining(["governor-state", "attempt-log", "replay-snapshot", "worktree-allocator"]));
52+
// REGRESSION (#8008): ranked-candidates and deny-hook-synthesis were likewise omitted from both lists.
53+
expect(STORE_NAMES).toEqual(expect.arrayContaining(["ranked-candidates", "deny-hook-synthesis"]));
5054
for (const result of results) {
5155
expect(result.ok).toBe(true);
5256
expect(result.status).toBe("skipped");

test/unit/miner-status.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ describe("loopover-miner status/doctor (#2288)", () => {
142142
"store-integrity:contribution-profile",
143143
"store-integrity:policy-verdict-cache",
144144
"store-integrity:policy-doc-cache",
145+
"store-integrity:ranked-candidates",
146+
"store-integrity:deny-hook-synthesis",
145147
]);
146148
// REGRESSION (#6768): doctor previously omitted these four durable local stores from the integrity sweep.
147149
expect(checks.map((check) => check.name)).toEqual(
@@ -152,6 +154,10 @@ describe("loopover-miner status/doctor (#2288)", () => {
152154
"store-integrity:worktree-allocator",
153155
]),
154156
);
157+
// REGRESSION (#8008): ranked-candidates and deny-hook-synthesis were likewise omitted from the sweep.
158+
expect(checks.map((check) => check.name)).toEqual(
159+
expect.arrayContaining(["store-integrity:ranked-candidates", "store-integrity:deny-hook-synthesis"]),
160+
);
155161
expect(runDoctor([], env, cwd)).toBe(0);
156162
expect(log).toHaveBeenCalled();
157163
});

0 commit comments

Comments
 (0)