Skip to content

feat(miner): add laptop-mode init and doctor commands#2614

Closed
Crystora wants to merge 4 commits into
JSONbored:mainfrom
Crystora:feat/2329-miner-laptop-mode-cli
Closed

feat(miner): add laptop-mode init and doctor commands#2614
Crystora wants to merge 4 commits into
JSONbored:mainfrom
Crystora:feat/2329-miner-laptop-mode-cli

Conversation

@Crystora

@Crystora Crystora commented Jul 2, 2026

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.

Fixes #2329

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

Also run:

  • npx vitest run test/unit/miner-cli.test.ts
  • npm --workspace @jsonbored/gittensory-miner run build
  • npm run build:miner
  • npm run test:ci

If any required check was skipped, explain why:

  • None.

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 - CLI/package README change only; no visible UI, frontend, docs site, or extension surface changed.

State / title JPG/PNG evidence
Loaded state N/A
Empty/error/mobile state, if relevant N/A

Notes

  • gittensory-miner init respects GITTENSORY_MINER_CONFIG_DIR, then XDG_CONFIG_HOME, then ~/.config/gittensory-miner.
  • init opens and initializes the SQLite state database on every run, so an existing empty state file is repaired instead of treated as ready.
  • doctor reports Docker presence as informational only and does not require Docker, Redis, or Postgres.

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.09%. Comparing base (36405d4) to head (a8df921).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2614      +/-   ##
==========================================
+ Coverage   96.07%   96.09%   +0.02%     
==========================================
  Files         236      237       +1     
  Lines       26358    26446      +88     
  Branches     9559     9588      +29     
==========================================
+ Hits        25323    25414      +91     
  Misses        425      425              
+ Partials      610      607       -3     

see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb

loopover-orb Bot commented Jul 2, 2026

Copy link
Copy Markdown

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - reject/close recommended

Review updated: 2026-07-02 23:27:27 UTC

9 files · 1 AI reviewer · 1 blocker · readiness 78/100 · CI pending · blocked

🛑 Suggested Action - Reject/Close

  • AI reviewers agree on a likely critical defect: packages/gittensory-miner/package.json:40 advertises Node >=22.5.0 while packages/gittensory-miner/lib/laptop-init.js:78 imports node:sqlite, but Node 22.5.0 still requires --experimental-sqlite for that module (https:​//nodejs.org/download/release/v22.5.0/docs/api/cli.html#--experimental-sqlite), so gittensory-miner init fails on an allowed runtime unless you raise the engine floor to v22.13.0+ or explicitly launch/document the required flag. — Resolve the flagged defect, or override if the AI reviewers are mistaken, then re-run the gate.

Review summary
This adds the laptop-mode init/doctor surface, local config resolution, SQLite metadata bootstrapping, CLI dispatch, docs, and focused tests. The idempotent database initialization is sound, but the published runtime contract is wrong: the package allows a Node version where the new SQLite import is still behind an experimental flag, so the documented install-and-run path fails on an engine-satisfying runtime.

Blockers

  • packages/gittensory-miner/package.json:40 advertises Node >=22.5.0 while packages/gittensory-miner/lib/laptop-init.js:78 imports node:sqlite, but Node 22.5.0 still requires --experimental-sqlite for that module (https:​//nodejs.org/download/release/v22.5.0/docs/api/cli.html#--experimental-sqlite), so gittensory-miner init fails on an allowed runtime unless you raise the engine floor to v22.13.0+ or explicitly launch/document the required flag.
Nits — 5 non-blocking
  • nit: packages/gittensory-miner/lib/laptop-init.js:10 checks trim().length but returns the untrimmed path, so accidental leading or trailing whitespace becomes part of the config path.
  • nit: packages/gittensory-miner/lib/laptop-init.js:41 records stat/access errors in the report but formatLaptopDoctor at packages/gittensory-miner/lib/laptop-init.js:188 never prints the error detail, which makes permission failures harder to diagnose.
  • nit: packages/gittensory-miner/lib/laptop-init.js:67 accepts a relative XDG_CONFIG_HOME even though the XDG convention requires absolute paths; either reject/ignore relative values or document the intentional divergence.
  • Raise packages/gittensory-miner/package.json and package-lock.json to the first Node 22 release where node:sqlite is usable without --experimental-sqlite, then update the README requirement to match.
  • In cleanEnvPath, return value.trim() after the non-empty check so environment path handling matches the validation being performed.

Why this is blocked

  • packages/gittensory-miner/package.json:40 advertises Node >=22.5.0 while packages/gittensory-miner/lib/laptop-init.js:78 imports node:sqlite, but Node 22.5.0 still requires --experimental-sqlite for that module (https:​//nodejs.org/download/release/v22.5.0/docs/api/cli.html#--experimental-sqlite), so gittensory-miner init fails on an allowed runtime unless you raise the engine floor to v22.13.0+ or explicitly launch/document the required flag.
Signal Result Evidence
Code review ❌ 1 blocker 1 reviewer
Linked issue ✅ Linked #2329
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 (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: 109 registered-repo PR(s), 65 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor Crystora; Gittensor profile; 109 PR(s), 0 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Review context
  • Author: Crystora
  • 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: 109 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
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 2, 2026
@github-actions
github-actions Bot had a problem deploying to preview/pr-2614 July 2, 2026 23:28 Failure

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please fix/address all issues properly, then resubmit as a new PR:

AI reviewers agree on a likely critical defect: packages/gittensory-miner/package.json:40 advertises Node >=22.5.0 while packages/gittensory-miner/lib/laptop-init.js:78 imports node:sqlite, but Node 22.5.0 still requires --experimental-sqlite for that module (https:​//nodejs.org/download/release/v22.5.0/docs/api/cli.html#--experimental-sqlite), so gittensory-miner init fails on an allowed runtime unless you raise the engine floor to v22.13.0+ or explicitly launch/document the required flag. — Resolve the flagged defect, or override if the AI reviewers are mistaken, then re-run the gate.

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-packaging): add laptop-mode CLI entry (SQLite, no Docker, npm install-and-run)

2 participants