Skip to content

feat(miner): add local run-state store - #2663

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
oktofeesh1:codex/miner-run-state-store
Jul 3, 2026
Merged

feat(miner): add local run-state store#2663
JSONbored merged 1 commit into
JSONbored:mainfrom
oktofeesh1:codex/miner-run-state-store

Conversation

@oktofeesh1

Copy link
Copy Markdown
Contributor

Summary

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 an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires >=99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • 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:

  • None. npm run test:ci passed, and npm audit --audit-level=moderate found 0 vulnerabilities.
  • Additional focused checks: npx vitest run test/unit/miner-run-state.test.ts test/unit/miner-cli.test.ts test/unit/miner-opportunity-fanout.test.ts test/unit/miner-ci-poller.test.ts; npm --workspace @jsonbored/gittensory-miner run build.

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 - no visible UI, frontend, docs, or extension change.

Notes

  • The store is local client-side miner infrastructure only; it makes no network calls and does not upload persisted state.
  • No auth, API, MCP protocol, Cloudflare binding, UI, docs, dependency, or migration behavior is changed.

@oktofeesh1
oktofeesh1 requested a review from JSONbored as a code owner July 3, 2026 01:46
@dosubot dosubot Bot added the size:L label Jul 3, 2026
@loopover-orb

loopover-orb Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-03 05:45:14 UTC

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

⏸️ Suggested Action - Manual Review

Review summary
The diff adds a focused local SQLite-backed run-state module for the miner package, exposes matching TypeScript declarations, raises the package engine floor for `node:sqlite`, and covers path resolution, persistence, validation, and module-level helpers. The implementation is small and internally consistent: writes are constrained to fixed states, repo keys are normalized, the DB file is created privately, and the default store can be closed/reset for tests. I do not see a reachable correctness or wiring defect in the provided changed files.

Nits — 6 non-blocking
  • nit: `packages/gittensory-miner/lib/run-state.js:27` assumes `dbPath` is string-like and will throw a raw `.trim is not a function` TypeError for non-string callers; validate the runtime type if this API is intended to be defensive beyond the `.d.ts` contract.
  • nit: `packages/gittensory-miner/lib/run-state.js:53` creates missing parent directories with mode `0o700` but does not tighten permissions on an already-existing config directory, so the privacy guarantee relies entirely on the database file mode.
  • nit: `test/unit/miner-run-state.test.ts:44` only regex-checks the default path suffix, so it does not pin the exact `homedir()` fallback behavior as tightly as the explicit env cases.
  • At `packages/gittensory-miner/lib/run-state.js:27`, change `normalizeDbPath` to reject non-string paths with `invalid_run_state_db_path` before trimming, matching the clearer repo/state validation style already used below.
  • At `packages/gittensory-miner/lib/run-state.js:53`, either document that existing parent directory permissions are not modified or explicitly chmod the miner config directory when this module creates/owns it.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2289
Related work ⚠️ 3 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (size label size:L; 1 linked issue).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 76 registered-repo PR(s), 69 merged, 4 issue(s).
Contributor context ✅ Confirmed Gittensor contributor oktofeesh1; Gittensor profile; 76 PR(s), 4 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: oktofeesh1
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 76 PR(s), 4 issue(s).
  • Related work: Titles/paths share 10 meaningful terms. (issue #2277, issue #2278)
  • Related work: Titles/paths share 9 meaningful terms. (issue #2277, issue #2291)
  • Related work: Titles/paths share 10 meaningful terms. (issue #2277, issue #2280)
  • Additional title-only matches omitted; title-only overlap does not block.
Contributor next steps
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
  • Check active issues and PRs before submitting.
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.

🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added gittensor gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jul 3, 2026
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.10%. Comparing base (01e8371) to head (1388a82).
⚠️ Report is 24 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2663   +/-   ##
=======================================
  Coverage   96.10%   96.10%           
=======================================
  Files         237      237           
  Lines       26540    26540           
  Branches     9625     9625           
=======================================
  Hits        25507    25507           
  Misses        424      424           
  Partials      609      609           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dosubot dosubot Bot added the lgtm label Jul 3, 2026
@JSONbored
JSONbored merged commit 99e175a into JSONbored:main Jul 3, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Development

Successfully merging this pull request may close these issues.

feat(miner-foundation): local run-state SQLite store for gittensory-miner

2 participants