Skip to content

feat(miner-packaging): add laptop-mode init command - #3622

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
kiannidev:feat/miner-laptop-init-2329
Jul 5, 2026
Merged

feat(miner-packaging): add laptop-mode init command#3622
JSONbored merged 1 commit into
JSONbored:mainfrom
kiannidev:feat/miner-laptop-init-2329

Conversation

@kiannidev

Copy link
Copy Markdown
Contributor

Summary

  • Add gittensory-miner init to bootstrap ~/.config/gittensory-miner/ (respecting GITTENSORY_MINER_CONFIG_DIR / XDG_CONFIG_HOME) and a local laptop-state.sqlite3 file; re-running is idempotent.
  • Extend gittensory-miner doctor with SQLite readiness and informational Docker presence checks (Docker never required).
  • Document the laptop-mode quickstart in the miner README.

Closes #2329

Test plan

  • test/unit/miner-laptop-init.test.ts — init, idempotency, doctor sqlite/docker checks, no network
  • test/unit/miner-status.test.ts — doctor passes after init with expanded checks
  • npm run build --workspace @jsonbored/gittensory-miner

Made with Cursor

Bootstrap local SQLite state with gittensory-miner init, extend doctor with sqlite and Docker checks, and document the zero-infra quickstart.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kiannidev
kiannidev requested a review from JSONbored as a code owner July 5, 2026 20:04
@superagent-security

Copy link
Copy Markdown
Contributor

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

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

loopover-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-05 20:39:16 UTC

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

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review: This PR changes guardrail-protected path(s): packages/gittensory-miner/package.json (matched **/package.json).

Review summary
Adds a `gittensory-miner init` command that idempotently bootstraps `~/.config/gittensory-miner/` and a `laptop-state.sqlite3` file, wires two new informational doctor checks (SQLite readiness, optional Docker presence), and documents the laptop-mode quickstart. The command is correctly dispatched before the network-touching update-check path (mirroring the existing `status`/`doctor` pattern), the idempotency logic (check-then-create with a `created` flag, `CREATE TABLE IF NOT EXISTS`) is sound for the single-process CLI use case, file permissions are locked down (0700 dir / 0600 db), and the test suite covers fresh-init, idempotent re-init, both doctor-check outcomes, and the no-network contract. This closes #2329 and stays narrowly scoped to the stated feature.

Nits — 7 non-blocking
  • packages/gittensory-miner/lib/laptop-init.js:4 imports `dirname` from node:path but never uses it — `mkdirSync` is called on `stateDir` directly, not `dirname(dbPath)`; drop the unused import.
  • packages/gittensory-miner/lib/laptop-init.js:9-19 duplicates `resolveMinerStateDir` from status.js verbatim; the comment explains it's to avoid an import cycle (status.js now imports from laptop-init.js), which is a reasonable tradeoff but worth a shared-util extraction if a third consumer shows up.
  • packages/gittensory-miner/lib/laptop-init.js:66-73 shells out to `which docker` via execFileSync, which won't resolve on Windows (no `which`); since Docker is informational-only this just yields a slightly misleading 'not installed' rather than a failure, but consider `where` as a Windows fallback if the CLI targets Windows laptops.
  • packages/gittensory-miner/lib/laptop-init.js:31/44 use bare octal literals (0o700/0o600) for permissions with no named constant — consistent with the existing claim-ledger.js pattern in this repo, so acceptable, but a shared constant would read slightly better.
  • Extract the duplicated `resolveMinerStateDir` into a small shared module (e.g. lib/miner-paths.js) that both status.js and laptop-init.js import, eliminating the cycle concern instead of working around it with copy-paste.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2329
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 (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: 1478 registered-repo PR(s), 770 merged, 48 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kiannidev; Gittensor profile; 1478 PR(s), 48 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Review context
  • Author: kiannidev
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: TypeScript, MDX, C++, HTML, Rust
  • Official Gittensor activity: 1478 PR(s), 48 issue(s).
  • Related work: Titles/paths share 5 meaningful terms. (issue #2189, issue #1681)
  • Related work: Titles/paths share 5 meaningful terms. (issue #1680, issue #1681)
  • Related work: Titles/paths share 5 meaningful terms. (issue #1683, issue #1681)
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

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.20%. Comparing base (20e04c5) to head (36abb6a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3622   +/-   ##
=======================================
  Coverage   93.20%   93.20%           
=======================================
  Files         313      313           
  Lines       31910    31910           
  Branches    11677    11677           
=======================================
  Hits        29741    29741           
  Misses       1517     1517           
  Partials      652      652           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit ed65188 into JSONbored:main Jul 5, 2026
9 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. manual-review Gittensor contributor context

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