Skip to content

fix(miner): drift-guard doctor store-integrity list against migrate STORES (#9689) - #9899

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
kai392:fix/9689-store-list-drift-guard
Jul 29, 2026
Merged

fix(miner): drift-guard doctor store-integrity list against migrate STORES (#9689)#9899
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
kai392:fix/9689-store-list-drift-guard

Conversation

@kai392

@kai392 kai392 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What

The migrate CLI's STORES list and doctor's store-integrity sweep are twin lists that must cover the same durable local SQLite stores, but nothing enforced it. A store added to one and not the other drifts silently — exactly what happened with orb-export (#8318) and laptop-state (#8641), both caught only by hand.

How

  • status.ts: derive STORE_INTEGRITY_NAMES from a single STORE_INTEGRITY_RESOLVERS table and export it. Behavior-preserving — the doctor sweep produces the same store-integrity:<name> checks in the same order.
  • migrate-cli.ts: export STORES; refresh the two stale store-count comments.
  • miner-migrate-cli.test.ts: assert STORES names and STORE_INTEGRITY_NAMES are set-equal in both directions, pinned against a sorted canonical list so any future single-sided store addition fails CI.

Closes #9689

@kai392
kai392 requested a review from JSONbored as a code owner July 29, 2026 19:55
@superagent-security

Copy link
Copy Markdown
Contributor

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

@loopover-orb

loopover-orb Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-29 20:04:50 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
The PR introduces a drift guard between the `STORES` list in `migrate-cli.ts` and `STORE_INTEGRITY_NAMES` in `status.ts` by centralizing store definitions in `STORE_INTEGRITY_RESOLVERS`. This ensures both lists derive from the same source, with tests enforcing synchronization. The fix addresses historical issues where stores like `orb-export` and `laptop-state` were missed in one list but not the other.

Nits — 2 non-blocking
  • The `STORE_INTEGRITY_NAMES` export in `status.ts` could benefit from a comment clarifying its purpose, as the comment is duplicated in `migrate-cli.ts`.
  • Consider adding a utility function to validate list synchronization across files, reducing duplication in test logic.

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 #9689
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: 89 registered-repo PR(s), 43 merged, 7 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kai392; Gittensor profile; 89 PR(s), 7 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: significant
Linked issue satisfaction

Addressed
The PR exports both STORE_INTEGRITY_NAMES and STORES, adds a drift-guard test with set-equality and pinned sorted array assertions, and updates stale comments. All four deliverables are fully implemented in a single PR.

Review context
  • Author: kai392
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, Cuda, JavaScript, Kotlin, MDX, Perl, Ruby, TypeScript
  • Official Gittensor activity: 89 PR(s), 7 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

…TORES (JSONbored#9689)

The `migrate` CLI's STORES list and doctor's store-integrity sweep must
cover the same durable local stores, but nothing enforced it -- a new
store added to one and not the other would silently drift (as orb-export
JSONbored#8318 and laptop-state JSONbored#8641 both did before being caught by hand).

- status.ts: derive STORE_INTEGRITY_NAMES from a single
  STORE_INTEGRITY_RESOLVERS table (behavior-preserving; same check names,
  same order) and export it.
- migrate-cli.ts: export STORES; refresh the stale store-count comments.
- miner-migrate-cli.test.ts: assert STORES names and
  STORE_INTEGRITY_NAMES are set-equal (both directions), with a pinned
  sorted list so any future single-sided addition fails CI.

Closes JSONbored#9689

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 29, 2026
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.35%. Comparing base (e3247ed) to head (a6080c6).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #9899       +/-   ##
===========================================
- Coverage   91.75%   79.35%   -12.41%     
===========================================
  Files         920      283      -637     
  Lines      113064    58728    -54336     
  Branches    27214     8675    -18539     
===========================================
- Hits       103746    46603    -57143     
- Misses       8033    11840     +3807     
+ Partials     1285      285     -1000     
Flag Coverage Δ
backend 99.05% <100.00%> (+3.37%) ⬆️

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.ts 100.00% <100.00%> (ø)
packages/loopover-miner/lib/status.ts 98.84% <100.00%> (+0.01%) ⬆️

... and 770 files with indirect coverage changes

@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 49a3b17 into JSONbored:main Jul 29, 2026
8 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.

miner(store): add a drift guard for the doctor/migrate twin store lists

2 participants