Skip to content

fix(miner): orb-export.sqlite3 missing from status.ts's storeIntegrityChecks and migrate-cli.ts's STORES lists #8318

Description

@JSONbored

Context

packages/loopover-miner/lib/status.ts's storeIntegrityChecks and packages/loopover-miner/lib/migrate-cli.ts's STORES list are meant to enumerate every durable local SQLite store in the package — migrate-cli.ts's own header comment says it "Mirrors status.js's storeIntegrityChecks ... store list exactly", and status.ts's comment says to "Keep in sync with migrate-cli.js's STORES list". Both lists currently contain the same 16 stores (event-ledger, governor-ledger, prediction-ledger, portfolio-queue, claim-ledger, run-state, plan-store, governor-state, attempt-log, replay-snapshot, worktree-allocator, contribution-profile, policy-verdict-cache, policy-doc-cache, ranked-candidates, deny-hook-synthesis).

packages/loopover-miner/lib/orb-export.ts (openOrbExportStore, resolveOrbExportDbPath) is a real, durable local SQLite store — orb-export.sqlite3, holding the per-instance HMAC anonymization secret and the export cursor for the opt-in Orb telemetry export (#4277/#5681) — and it is in neither list. A corrupted orb-export.sqlite3 is invisible to loopover-miner doctor's per-store integrity sweep, and loopover-miner migrate never proactively brings it up to date, unlike every other store this package ships. This is the same gap class already fixed repeatedly for other stores (#7238 policy-doc-cache, #8008/#8036 ranked-candidates + deny-hook-synthesis, #6768 four earlier omissions) — orb-export.ts was simply never added when it shipped.

Requirements

⚠️ Required pattern. Add orb-export to both lists using the exact same tuple/descriptor shape every existing entry already uses — do not restructure either list.

  • Add ["orb-export", resolveOrbExportDbPath(env)] to storeIntegrityChecks's stores array in status.ts.
  • Add { name: "orb-export", resolveDbPath: resolveOrbExportDbPath, open: openOrbExportStore } to migrate-cli.ts's STORES array.
  • Update both files' "keep in sync" comments' store count if either references a specific count.

Deliverables

  • orb-export present in status.ts's storeIntegrityChecks.
  • orb-export present in migrate-cli.ts's STORES.

Test Coverage Requirements

packages/loopover-miner/** is not Codecov-gated, but npm run test:ci must stay green. Extend test/unit/miner-cli-doctor-checks.test.ts (or the equivalent doctor-check test) and test/unit/miner-migrate-cli.test.ts to assert orb-export appears in the doctor sweep's per-store integrity checks and in migrate's per-store results — covering both a missing-file (skip/healthy-by-absence) and an existing-file case, mirroring how the existing 16 stores are already tested there.

Expected Outcome

loopover-miner doctor and loopover-miner migrate cover all 17 real local stores this package ships, not 16.

Links & Resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions