feat(miner): migrate policy-doc-cache onto the SqliteDriver store seam#7294
Merged
Conversation
Continues #7175/#7194's storage-abstraction pattern (currently only run-state.js had migrated): routes policy-doc-cache's get/put through openLocalStoreAdapter's driver.query instead of raw DatabaseSync-backed prepared statements. Public API stays synchronous -- this is a pure seam migration, no behavior change, proven by every existing test passing unmodified. Advances #7282
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
run-state.jshad beenmigrated onto the
SqliteDriverseam (store-db-adapter.js), despite Migrate AMS's local-store layer (node:sqlite) to the shared pg-adapter/SqliteDriver seam #7175 closing with thebroader migration still ~1/13 done (see feat(miner): finish rolling the SqliteDriver seam onto AMS's remaining local stores #7282, updated to track the accurate remaining scope).
policy-doc-cache.js'sget/putnow route throughopenLocalStoreAdapter'sdriver.queryinstead of raw
DatabaseSync-backed prepared statements, matchingrun-state.js's exactpattern.
abstraction that could later back onto a different driver), not a behavior or logic change.
Proven by every existing test passing completely unmodified.
Advances #7282
Scope
type(scope): short summaryConventional Commit format.backend, UI, MCP, docs, dependency, and deploy changes.
CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Advances #7282above -- deliberately notCloses, since feat(miner): finish rolling the SqliteDriver seam onto AMS's remaining local stores #7282 tracks migrating the remaining ~11 stores too, not just this one).Validation
git diff --checknpm run typecheck(root -- clean)npm run test:coverageon the changed module -- 100% statements/branches/functions/lines(28/28, 14/14, 7/7, 24/24), verified against the raw coverage report.
test/unit/miner-policy-doc-cache.test.tsandtest/unit/opportunity-fanout-policy-doc-cache.test.ts(20 tests total) passes completelyunmodified -- direct evidence this migration changed no observable behavior.
npm run test:cigreen end to end, run under the repo's pinned Node 22 (.nvmrc), on aclean coverage directory (a prior run hit a transient coverage-tmp-file race from overlapping
local gate invocations; re-run clean to confirm).
npm audit --audit-level=moderate-- clean except the same pre-existing, unrelatedadm-zip/github-actionlintadvisory with no fix available.Safety
private rankings, or private maintainer evidence are exposed.
optimization tactics.
(N/A -- local SQLite cache store, not an auth surface.)
surface touched.)
UI Evidencesection -- N/A, backend-only change, no visible UI.release-prep PRs. (No
CHANGELOG.mdedit; internal storage-abstraction detail.)Notes
policy-doc-cache.jswas chosen as the next store to migrate for being the smallest (79 lines,no interactive transactions, no
RETURNINGstatements to tripstore-db-adapter.js's owndocumented read/write heuristic limitation).
and is proven; the actual Postgres driver and interactive-transaction support are separate,
larger follow-on efforts, not part of this PR or feat(miner): finish rolling the SqliteDriver seam onto AMS's remaining local stores #7282's current scope).