Skip to content

fix(miner): delegate three resolve*DbPath helpers to resolveLocalStoreDbPath (#8336)#8524

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
claytonlin1110:fix/miner-resolve-local-store-db-path-8336-v2
Jul 24, 2026
Merged

fix(miner): delegate three resolve*DbPath helpers to resolveLocalStoreDbPath (#8336)#8524
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
claytonlin1110:fix/miner-resolve-local-store-db-path-8336-v2

Conversation

@claytonlin1110

Copy link
Copy Markdown
Contributor

Summary

  • Delegate resolveOrbExportDbPath, resolveDenyHookSynthesisDbPath, and resolveLaptopStateDbPath to resolveLocalStoreDbPath (same one-line pattern as resolvePredictionLedgerDbPath).
  • Add LOOPOVER_MINER_LAPTOP_STATE_DB as the laptop store's explicit override (paths unchanged when unset). Leave private resolveMinerStateDir for non-SQLite callers.
  • Regenerate miner/AMS env-reference docs ("" to (none) for the two pure refactors; new laptop row).
  • Note in packages/loopover-engine/README.md so CI sets engine=true and runs the unscoped suite — fresh PR after fix(miner): delegate three resolve*DbPath helpers to resolveLocalStoreDbPath (#8336) #8496, where scoped --changed uploaded empty codecov/patch (0%) for these miner lib lines even though the matching unit tests passed.

Closes #8336

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally on the changed miner path helpers (resolve lines hit in lcov)
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Fresh PR after fix(miner): delegate three resolve*DbPath helpers to resolveLocalStoreDbPath (#8336) #8496 (closed for a follow-up push; Codecov patch was 0% under scoped selection). Locally verified: typecheck, miner env-reference check, targeted vitest with coverage hits on the three return resolveLocalStoreDbPath(...) lines, npm audit. Engine README note forces unscoped validate-tests so Codecov sees those hits. Remaining UI/pack steps unchanged in substance beyond generated AMS env-reference sync.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

N/A — generated AMS env-reference sync only; no visible UI change.

State / title JPG/PNG evidence
N/A

Notes

  • Pure refactor for orb-export and deny-hook-synthesis (existing env var names unchanged).
  • laptop-init adds LOOPOVER_MINER_LAPTOP_STATE_DB; default path resolution unchanged when unset.
  • Do not push follow-up commits on this PR (one-shot gate).

@superagent-security

Copy link
Copy Markdown
Contributor

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

@JSONbored
JSONbored force-pushed the fix/miner-resolve-local-store-db-path-8336-v2 branch from df24dfe to 0e2b72d Compare July 24, 2026 18:16
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 24, 2026
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8524      +/-   ##
==========================================
- Coverage   92.53%   92.53%   -0.01%     
==========================================
  Files         793      793              
  Lines       79561    79551      -10     
  Branches    24043    24033      -10     
==========================================
- Hits        73625    73612      -13     
- Misses       4799     4800       +1     
- Partials     1137     1139       +2     
Flag Coverage Δ
backend 93.71% <100.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
packages/loopover-miner/lib/deny-hook-synthesis.ts 96.72% <100.00%> (-0.25%) ⬇️
packages/loopover-miner/lib/laptop-init.ts 97.18% <100.00%> (-2.12%) ⬇️
packages/loopover-miner/lib/orb-export.ts 100.00% <100.00%> (ø)

@loopover-orb

loopover-orb Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-24 18:52:15 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR mechanically delegates three resolve*DbPath helpers (orb-export, deny-hook-synthesis, laptop-init) to the shared resolveLocalStoreDbPath, matching the existing resolvePredictionLedgerDbPath pattern, and regenerates the env-reference docs/markdown to match. It adds a new explicit override env var LOOPOVER_MINER_LAPTOP_STATE_DB for the laptop store and backs every changed path with both existing behavioral tests (updated for join()-based path assertions) and new byte-identical parity tests against resolveLocalStoreDbPath. The diff is well-scoped, closes #8336, and the engine README note plausibly explains why CI needs the unscoped test suite for Codecov to see these lines.

Nits — 5 non-blocking
  • apps/loopover-ui/src/lib/ams-env-reference.ts: the LOOPOVER_MINER_CONFIG_DIR row's firstReference now points to lib/laptop-init.ts instead of lib/deny-hook-synthesis.ts — worth double-checking this is the intended first-reference (laptop-init.ts still reads LOOPOVER_MINER_CONFIG_DIR via resolveMinerStateDir) rather than a byproduct of alphabetical/generation-order drift.
  • packages/loopover-miner/lib/laptop-init.ts:48-49: resolveMinerStateDir (private) still hand-duplicates the config-dir/XDG-home walk that resolveLocalStoreDbPath also performs internally — fine per the PR's stated scope but worth a follow-up if it's called elsewhere for non-SQLite purposes.
  • test/unit/miner-orb-export.test.ts and miner-deny-hook-synthesis.test.ts: the new 'stays byte-identical to resolveLocalStoreDbPath' tests are a bit redundant with the pre-existing explicit assertions right above them, though harmless.
  • Confirm the env-reference generator (scripts/generate-env-reference.mjs) is what produced the firstReference reordering for LOOPOVER_MINER_CONFIG_DIR, rather than a manual hand-edit, since the docs are marked 'do not edit manually'.
  • Consider whether resolveMinerStateDir in laptop-init.ts should also delegate to a shared directory-resolution helper in local-store.js in a future follow-up, to fully eliminate the duplicated XDG/config-dir 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 #8336
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: 409 registered-repo PR(s), 255 merged, 92 issue(s).
Contributor context ✅ Confirmed Gittensor contributor claytonlin1110; Gittensor profile; 409 PR(s), 92 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Linked issue satisfaction

Addressed
All three resolve*DbPath helpers now delegate to resolveLocalStoreDbPath with the exact one-line pattern and literal args required, laptop-init.ts adds the new LOOPOVER_MINER_LAPTOP_STATE_DB override while leaving resolveMinerStateDir intact for other callers, and env-reference.md/ams-env-reference.ts are regenerated with the expected (none) defaults and new row, plus tests cover both the default

Review context
  • Author: claytonlin1110
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 409 PR(s), 92 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 ee4fa21 into JSONbored:main Jul 24, 2026
10 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): orb-export.ts, deny-hook-synthesis.ts, and laptop-init.ts hand-duplicate local-store.js's resolveLocalStoreDbPath

1 participant