Context
packages/loopover-miner/lib/laptop-init.js:66 opens new DatabaseSync(dbPath, { readonly: true }). node:sqlite's DatabaseSync only recognizes the camelCase readOnly option; the lowercase key is silently ignored, so the connection opens read-write. This exact footgun is already documented elsewhere in the same package (purge-cli.js:88-90, claim-ledger.js:267-269), and migrate-cli.js:37/store-maintenance.js:74 both correctly use the camelCase form — laptop-init.js:66 is the one remaining lowercase instance. It's wired into doctor (status.js:426), whose own header states the contract this violates: "no writes, no network."
Requirements
- Change
{ readonly: true } to { readOnly: true } in checkLaptopStateSqlite (laptop-init.js:66).
- Add a regression test asserting the connection is driver-enforced read-only (a write attempt through it throws), mirroring
claim-ledger.js's equivalent tests.
- Grep the rest of
packages/loopover-miner/lib/** for any other lowercase readonly: DatabaseSync options.
Deliverables
Test Coverage Requirements
99%+ Codecov patch coverage on every changed line and branch, plus a regression test that reproduces the exact failure mode described above and asserts it's fixed.
Expected Outcome
doctor's laptop-state check genuinely never writes, matching its own documented contract.
Links & Resources
packages/loopover-miner/lib/laptop-init.js:56,66, packages/loopover-miner/lib/status.js:26,245,426, packages/loopover-miner/lib/claim-ledger.js:267-269, packages/loopover-miner/lib/purge-cli.js:88-90.
Context
packages/loopover-miner/lib/laptop-init.js:66opensnew DatabaseSync(dbPath, { readonly: true }).node:sqlite'sDatabaseSynconly recognizes the camelCasereadOnlyoption; the lowercase key is silently ignored, so the connection opens read-write. This exact footgun is already documented elsewhere in the same package (purge-cli.js:88-90,claim-ledger.js:267-269), andmigrate-cli.js:37/store-maintenance.js:74both correctly use the camelCase form —laptop-init.js:66is the one remaining lowercase instance. It's wired intodoctor(status.js:426), whose own header states the contract this violates: "no writes, no network."Requirements
{ readonly: true }to{ readOnly: true }incheckLaptopStateSqlite(laptop-init.js:66).claim-ledger.js's equivalent tests.packages/loopover-miner/lib/**for any other lowercasereadonly:DatabaseSyncoptions.Deliverables
readOnlycasing inlaptop-init.js:66Test Coverage Requirements
99%+ Codecov patch coverage on every changed line and branch, plus a regression test that reproduces the exact failure mode described above and asserts it's fixed.
Expected Outcome
doctor's laptop-state check genuinely never writes, matching its own documented contract.Links & Resources
packages/loopover-miner/lib/laptop-init.js:56,66,packages/loopover-miner/lib/status.js:26,245,426,packages/loopover-miner/lib/claim-ledger.js:267-269,packages/loopover-miner/lib/purge-cli.js:88-90.