⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.
Context
packages/loopover-miner/lib/status.ts's storeIntegrityChecks (lines 388-413) enumerates every
durable local SQLite store using resolveLocalStoreDbPath, with its own comment stating "Keep in
sync with migrate-cli.js's STORES list." packages/loopover-miner/lib/migrate-cli.ts's STORES
(lines 52-87) is the second half of that pair. This exact category of gap — a store omitted from
one or both lists — has been fixed repeatedly before (#6928, #7238, #8036, #8318/#8470), each time
adding the missing store to both lists.
laptop-state.sqlite3 (packages/loopover-miner/lib/laptop-init.ts) uses the identical
resolveLocalStoreDbPath + applySchemaMigrations pattern as every one of the 17 stores already
enumerated in both lists, but is absent from both today.
packages/loopover-miner/DEPLOYMENT.md compounds the gap: it lists laptop-state.sqlite3 as the
first entry in its store table (lines 71-78) and claims two things about it that are no longer
true:
Net effect: a corrupted laptop-state.sqlite3 is invisible to doctor's deep integrity check, and
migrate never proactively brings it up to date the way it does the other 17 stores.
Requirements
- Add
["laptop-state", resolveLaptopStateDbPath(env)] (or the equivalent call used by the other
16 entries) to storeIntegrityChecks in packages/loopover-miner/lib/status.ts.
- Add the matching entry to
migrate-cli.ts's STORES array.
- Update the hardcoded "seventeen stores" assertion in
test/unit/miner-migrate-cli.test.ts:46 and
the name list in test/unit/miner-status.test.ts:132-148 to reflect eighteen stores including
laptop-state.
- Fix
DEPLOYMENT.md's two stale claims (lines 75-78): laptop-state does support a
LOOPOVER_MINER_LAPTOP_STATE_DB override, and it is (after this PR) covered by the deep
store-integrity:laptop-state check, not just the shallow SELECT 1.
Deliverables
All Deliverables above are required in the same PR.
Test Coverage Requirements
packages/loopover-miner/** is measured by codecov/patch (99%+ target, branch-counted). The new
test cases must exercise both the "healthy" and "corrupted" branches of the new
store-integrity:laptop-state check, and the "needs migration" branch of migrate-cli.ts's
handling of the new STORES entry, mirroring the existing fixture pattern already used for the
other 17 stores in the same test files.
Expected Outcome
doctor reports store-integrity:laptop-state using the same deep PRAGMA integrity_check as
every other durable store, migrate proactively migrates laptop-state.sqlite3 schema version like
every other store, and DEPLOYMENT.md accurately describes both behaviors.
Links & Resources
Context
packages/loopover-miner/lib/status.ts'sstoreIntegrityChecks(lines 388-413) enumerates everydurable local SQLite store using
resolveLocalStoreDbPath, with its own comment stating "Keep insync with migrate-cli.js's STORES list."
packages/loopover-miner/lib/migrate-cli.ts'sSTORES(lines 52-87) is the second half of that pair. This exact category of gap — a store omitted from
one or both lists — has been fixed repeatedly before (#6928, #7238, #8036, #8318/#8470), each time
adding the missing store to both lists.
laptop-state.sqlite3(packages/loopover-miner/lib/laptop-init.ts) uses the identicalresolveLocalStoreDbPath+applySchemaMigrationspattern as every one of the 17 stores alreadyenumerated in both lists, but is absent from both today.
packages/loopover-miner/DEPLOYMENT.mdcompounds the gap: it listslaptop-state.sqlite3as thefirst entry in its store table (lines 71-78) and claims two things about it that are no longer
true:
doctor'sstore-integrity:*checks "report the persistent stores" — butstore-integrity:laptop-statedoesn't exist; laptop-state only gets a shallowSELECT 1via theseparate
checkLaptopStateSqlitefunction, not the deepPRAGMA integrity_checkthe other 17stores get.
LOOPOVER_MINER_<NAME>_DBoverride — but commit
ee4fa218b(fix(miner): orb-export.ts, deny-hook-synthesis.ts, and laptop-init.ts hand-duplicate local-store.js's resolveLocalStoreDbPath #8336/fix(miner): delegate three resolve*DbPath helpers to resolveLocalStoreDbPath (#8336) #8524) gave it exactly that override(
LOOPOVER_MINER_LAPTOP_STATE_DB, confirmed live inams-env-reference.ts) without updating thisdoc line.
Net effect: a corrupted
laptop-state.sqlite3is invisible todoctor's deep integrity check, andmigratenever proactively brings it up to date the way it does the other 17 stores.Requirements
["laptop-state", resolveLaptopStateDbPath(env)](or the equivalent call used by the other16 entries) to
storeIntegrityChecksinpackages/loopover-miner/lib/status.ts.migrate-cli.ts'sSTORESarray.test/unit/miner-migrate-cli.test.ts:46andthe name list in
test/unit/miner-status.test.ts:132-148to reflect eighteen stores includinglaptop-state.DEPLOYMENT.md's two stale claims (lines 75-78): laptop-state does support aLOOPOVER_MINER_LAPTOP_STATE_DBoverride, and it is (after this PR) covered by the deepstore-integrity:laptop-statecheck, not just the shallowSELECT 1.Deliverables
storeIntegrityChecks(status.ts) includes alaptop-stateentry using the same deepPRAGMA integrity_checkpath as the other 17 stores.migrate-cli.ts'sSTORESincludes the matchinglaptop-stateentry, somigrateproactivelybrings it up to date like every other store.
test/unit/miner-migrate-cli.test.tsandtest/unit/miner-status.test.tsare updated toassert eighteen stores (not seventeen), with a dedicated case proving
laptop-state.sqlite3'sintegrity is checked and its schema migrated the same way as a sibling store.
DEPLOYMENT.md's store table entry forlaptop-state.sqlite3accurately states it supportsthe
LOOPOVER_MINER_LAPTOP_STATE_DBoverride and is covered bydoctor's deep integritycheck.
All Deliverables above are required in the same PR.
Test Coverage Requirements
packages/loopover-miner/**is measured bycodecov/patch(99%+ target, branch-counted). The newtest cases must exercise both the "healthy" and "corrupted" branches of the new
store-integrity:laptop-statecheck, and the "needs migration" branch ofmigrate-cli.ts'shandling of the new
STORESentry, mirroring the existing fixture pattern already used for theother 17 stores in the same test files.
Expected Outcome
doctorreportsstore-integrity:laptop-stateusing the same deepPRAGMA integrity_checkasevery other durable store,
migrateproactively migrateslaptop-state.sqlite3schema version likeevery other store, and
DEPLOYMENT.mdaccurately describes both behaviors.Links & Resources
packages/loopover-miner/lib/status.ts:388-413(storeIntegrityChecks)packages/loopover-miner/lib/migrate-cli.ts:52-87(STORES)packages/loopover-miner/lib/laptop-init.ts:47-70(resolveLaptopStateDbPath,initLaptopState)packages/loopover-miner/DEPLOYMENT.md:71-78two lists);
LOOPOVER_MINER_LAPTOP_STATE_DBoverride added by commitee4fa218b(fix(miner): orb-export.ts, deny-hook-synthesis.ts, and laptop-init.ts hand-duplicate local-store.js's resolveLocalStoreDbPath #8336/fix(miner): delegate three resolve*DbPath helpers to resolveLocalStoreDbPath (#8336) #8524)