@@ -7,14 +7,11 @@ import { runMigrate, runMigrateChecks } from "../../packages/loopover-miner/lib/
77import { initPortfolioQueueStore , resolvePortfolioQueueDbPath } from "../../packages/loopover-miner/lib/portfolio-queue.js" ;
88import { resolveEventLedgerDbPath } from "../../packages/loopover-miner/lib/event-ledger.js" ;
99import { applySchemaMigrations , BASELINE_SCHEMA_VERSION } from "../../packages/loopover-miner/lib/schema-version.js" ;
10- import { openGovernorState , resolveGovernorStateDbPath } from "../../packages/loopover-miner/lib/governor-state.js" ;
11- import { initAttemptLog , resolveAttemptLogDbPath } from "../../packages/loopover-miner/lib/attempt-log.js" ;
12- import { openReplaySnapshotStore , resolveReplaySnapshotDbPath } from "../../packages/loopover-miner/lib/replay-snapshot.js" ;
1310import { openWorktreeAllocator , resolveWorktreeAllocatorDbPath } from "../../packages/loopover-miner/lib/worktree-allocator.js" ;
1411
1512const roots : string [ ] = [ ] ;
1613
17- function tempEnv ( ) : NodeJS . ProcessEnv {
14+ function tempEnv ( ) {
1815 const root = mkdtempSync ( join ( tmpdir ( ) , "loopover-miner-migrate-" ) ) ;
1916 roots . push ( root ) ;
2017 return { LOOPOVER_MINER_CONFIG_DIR : join ( root , "state" ) } ;
@@ -72,24 +69,17 @@ describe("loopover-miner migrate (#4871)", () => {
7269 expect ( portfolioQueue ?. versionBefore ) . toBeGreaterThan ( 0 ) ;
7370 } ) ;
7471
75- it ( "REGRESSION (#6768): opens the four previously-omitted stores through migrate's real open wrappers " , ( ) => {
72+ it ( "REGRESSION (#6768): opens worktree-allocator through migrate's open adapter " , ( ) => {
7673 // worktree-allocator's STORES entry is `(dbPath) => openWorktreeAllocator({ dbPath })` — a one-line
7774 // adapter that only executes when an on-disk file exists. Skip-only sweeps leave that line at 0% patch
78- // coverage; seeding + migrating all four stores proves the adapter (and the other three open bindings) .
75+ // coverage; seeding + migrating it proves the adapter runs .
7976 const env = tempEnv ( ) ;
80- openGovernorState ( resolveGovernorStateDbPath ( env ) ) . close ( ) ;
81- initAttemptLog ( resolveAttemptLogDbPath ( env ) ) . close ( ) ;
82- openReplaySnapshotStore ( resolveReplaySnapshotDbPath ( env ) ) . close ( ) ;
8377 openWorktreeAllocator ( { dbPath : resolveWorktreeAllocatorDbPath ( env ) } ) . close ( ) ;
8478
85- const results = runMigrateChecks ( env ) ;
86- for ( const name of [ "governor-state" , "attempt-log" , "replay-snapshot" , "worktree-allocator" ] as const ) {
87- const row = results . find ( ( result ) => result . name === name ) ;
88- expect ( row , name ) . toMatchObject ( { ok : true , status : "up-to-date" } ) ;
89- expect ( row ?. versionBefore ) . toBe ( row ?. versionAfter ) ;
90- // These four stores may stamp baseline 0; the regression is that migrate opens them at all.
91- expect ( row ?. versionBefore ) . toEqual ( expect . any ( Number ) ) ;
92- }
79+ const row = runMigrateChecks ( env ) . find ( ( result ) => result . name === "worktree-allocator" ) ;
80+ expect ( row ) . toMatchObject ( { ok : true , status : "up-to-date" } ) ;
81+ expect ( row ?. versionBefore ) . toBe ( row ?. versionAfter ) ;
82+ expect ( row ?. versionBefore ) . toEqual ( expect . any ( Number ) ) ;
9383 } ) ;
9484
9585 it ( "actually migrates a pre-existing older-schema portfolio-queue file, bumping its stamped version and adding the missing column" , ( ) => {
0 commit comments