Skip to content

fix(miner): add policy-doc-cache to doctor and migrate store lists (#7238) - #7263

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
xfodev:fix/doctor-store-integrity-list-7238
Jul 19, 2026
Merged

fix(miner): add policy-doc-cache to doctor and migrate store lists (#7238)#7263
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
xfodev:fix/doctor-store-integrity-list-7238

Conversation

@xfodev

@xfodev xfodev commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

packages/loopover-miner/lib/policy-doc-cache.js is a durable local SQLite store (opened through
resolveLocalStoreDbPath, like every other miner store), but it was missing from the two lists that are
meant to cover every such store:

  • status.js's storeIntegrityChecksdoctor's per-store PRAGMA integrity_check sweep, whose own
    comment says to keep it in sync with migrate-cli's STORES. A corrupted policy-doc-cache.sqlite3 went
    unflagged by doctor.
  • migrate-cli.js's STORES — the migrate sweep. The store's schema was never brought up to date by migrate.

This adds policy-doc-cache to both, strictly appended after policy-verdict-cache (its distinct sibling)
without reordering or touching any of the existing 13 entries.

Closes #7238

Scope

  • Conventional Commit title; focused (two modules + their tests); no site//CNAME/lovable; no new dependency.
  • Linked a currently open issue (Closes #7238).

Validation

  • git diff --check
  • npm run typecheck (root — clean)
  • npm run test:coverage100% of the changed lines covered. The existing doctor/migrate parity tests
    (which assert the exact store list, in order) are updated from 13 to 14 entries and pass; the migrate
    test's STORE_NAMES and the doctor integrity-list assertion now include policy-doc-cache.
  • npm run build:miner (node --check on both files passes).

If any required check was skipped, explain why:

  • Backend change confined to packages/loopover-miner/lib/**; CI runs the full suite.

Safety

  • No secrets, wallets, hotkeys, coldkeys, PATs, trust scores, or private data exposed.
  • Public GitHub text stays sanitized and low-noise.
  • No auth/CORS/session/API/OpenAPI/MCP surface change — additive store-list entries only.
  • No UI change — no UI Evidence needed.

@xfodev
xfodev requested a review from JSONbored as a code owner July 19, 2026 11:08
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.81%. Comparing base (a575ac2) to head (7147385).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7263   +/-   ##
=======================================
  Coverage   93.81%   93.81%           
=======================================
  Files         704      704           
  Lines       69506    69506           
  Branches    18912    18912           
=======================================
  Hits        65210    65210           
  Misses       3302     3302           
  Partials      994      994           
Flag Coverage Δ
shard-1 43.16% <ø> (-0.40%) ⬇️
shard-2 37.31% <ø> (+0.12%) ⬆️
shard-3 32.95% <ø> (-0.14%) ⬇️
shard-4 32.71% <ø> (-1.59%) ⬇️
shard-5 32.86% <ø> (+0.59%) ⬆️
shard-6 46.03% <ø> (+0.27%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/loopover-miner/lib/migrate-cli.js 100.00% <ø> (ø)
packages/loopover-miner/lib/status.js 94.53% <ø> (ø)

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 19, 2026
@loopover-orb

loopover-orb Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-19 11:18:17 UTC

4 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is a clean, narrow fix that adds the previously-omitted `policy-doc-cache` store to both `migrate-cli.js`'s STORES list and `status.js`'s storeIntegrityChecks, matching the pattern of every existing entry (name, resolveDbPath, open function). The change is strictly additive/appended after `policy-verdict-cache` as described, with no reordering of existing entries. Tests are updated in lockstep (13→14 stores) and the new entry is exercised the same way as its siblings via the existing parameterized-style assertions, so coverage is real rather than fabricated.

Nits — 4 non-blocking
  • packages/loopover-miner/lib/status.js:319-320's comment still says 'Keep in sync with migrate-cli.js's STORES list (doctor's integrity sweep and migrate's proactive sweep both omit four real local stores #6768)' — worth double-checking there isn't a third list (e.g. a CLI help text or docs table) that also needs `policy-doc-cache` added.
  • The PR description says 'strictly appended after policy-verdict-cache (its distinct sibling)' but doesn't explain why policy-doc-cache and policy-verdict-cache are siblings — a one-line comment distinguishing the two caches' purposes would help future maintainers avoid re-confusing them.
  • Consider adding a lint/test helper that diffs the STORES list in migrate-cli.js against storeIntegrityChecks in status.js automatically, so a future new store can't be added to only one of the two lists without a test failure — this would prevent the exact regression this PR fixes from recurring for the next store.
  • Code changes lack test evidence — Add focused regression tests or explain why existing coverage is sufficient.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #7238
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 19 registered-repo PR(s), 9 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor xfodev; Gittensor profile; 19 PR(s), 0 issue(s).
Improvement ℹ️ None detected risk: low · value: none · LLM: minor
Linked issue satisfaction

Addressed
The diff adds the exact imports and list entries specified for both status.js and migrate-cli.js, appended after policy-verdict-cache without reordering existing entries, and updates the existing parity tests to assert the new 14th entry in both doctor and migrate outputs.

Review context
  • Author: xfodev
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: JavaScript, TypeScript
  • Official Gittensor activity: 19 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask 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.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

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.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 3aea7c7 into JSONbored:main Jul 19, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(miner): policy-doc-cache.js missing from doctor's storeIntegrityChecks and migrate's STORES lists

1 participant