feat(miner): roll the SqliteDriver seam onto the non-transactional local stores#7547
feat(miner): roll the SqliteDriver seam onto the non-transactional local stores#7547shin-core wants to merge 1 commit into
Conversation
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🛑 LoopOver review result - fixes requiredReview updated: 2026-07-20 21:46:42 UTC
Review summary Nits — 2 non-blocking
CI checks failing
Flagged checks (non-blocking)
Decision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests (1), validate-tests (2), validate-tests (3), validate-tests (6), validate-tests (4), validate-code)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
What
Continues the #7175
SqliteDriverseam rollout (#7282): migrates the genuinely-non-transactional AMS local stores onto the same additive, still-synchronousopenLocalStoreAdapter/driver.querypattern already proven byrun-state.js(#7194) andpolicy-doc-cache.js.Migrated (4):
lib/contribution-profile-cache.jslib/policy-verdict-cache.jslib/prediction-ledger.jslib/replay-snapshot.jsFor each: the store is opened via
openLocalStoreAdapter(resolvedPath)(returning{ db, driver }), and all CRUD (SELECT/INSERT/UPDATE/DELETE) now routes throughdriver.query(sql, params). Schema creation, migrations, retention, and purge stay on the underlyingdbhandle exactly as before. The public store APIs remain synchronous and unchanged — this is purely additive, mirroring the reference stores.Verified out of scope (left unmigrated, on purpose)
Per the deliverable's own "verify each individually for hidden transaction/RETURNING usage" caveat, two of the six listed stores are not actually non-transactional and belong to the separate
runOn(client)interactive-transaction design the issue tracks in its next checkbox:ranked-candidates.js—replaceAllis a genuineBEGIN IMMEDIATE→ DELETE + multi-INSERT → COMMIT/ROLLBACK atomic block, which the currentdriver.queryseam can't express.worktree-allocator.js—acquireis an interactiveBEGIN IMMEDIATEread-then-conditional-write transaction, andreleaseByAttemptusesUPDATE … RETURNING …, whichstore-db-adapter.js's own doc explicitly flags as not-yet-safe to route through the seam.Migrating either would silently break an atomic path, so both are correctly deferred.
No behavior change
The SQL, parameters, return shapes, and synchronous API of every migrated store are byte-identical — only the handle CRUD goes through the seam instead of a raw
DatabaseSyncprepared statement. Proof: all six stores' existing test suites pass completely unmodified (90/90), including the two unmigrated ones.Validation
npm run typecheck— clean (one pre-existing unrelateddiscover-cli.tserror only).miner-contribution-profile-cache,miner-policy-verdict-cache,miner-prediction-ledger,miner-replay-snapshot,miner-ranked-candidates,miner-worktree-allocator-collisions— 90/90.prediction-ledger's corrupted-row throw and default-singleton wrappers).npm run test:miner-packpasses;git diff --checkclean.Closes #7282