Skip to content

feat(miner): add slim laptop-mode status and doctor CLI commands#2866

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
dhgoal:feat/miner-laptop-status
Jul 4, 2026
Merged

feat(miner): add slim laptop-mode status and doctor CLI commands#2866
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
dhgoal:feat/miner-laptop-status

Conversation

@dhgoal

@dhgoal dhgoal commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the miner CLI's first real commands — gittensory-miner status and gittensory-miner doctor — the "slim laptop-mode entry point" the phase brief calls for. Both are read-only and 100% local: no repo-scanning, no coding-agent invocation, no GitHub writes, and no network calls of any kind.

  • status (--json for machine output) prints the installed miner + engine version, the local-state directory (where the run-state / queue / ledger SQLite files live), the Node version, and the discovered .gittensory-miner.yml config file (or none found).
  • doctor (exit non-zero on any failure) checks: Node major ≥ the engines.node floor, the pinned @jsonbored/gittensory-engine version is readable, and the local-state directory is creatable/writable. Mirrors gittensory-mcp doctor's "is this laptop set up correctly" spirit.
  • --help now lists both commands.

Wiring mirrors the existing hooks check command: lib/status.js exports pure collectStatus / runDoctorChecks (parameterized on env/cwd for testability) plus runStatus/runDoctor handlers, dispatched from bin/gittensory-miner.js.

On the engine version: the engine package's exports map blocks require("@jsonbored/gittensory-engine/package.json"), and its built dist/ may be absent depending on build order, so both status and doctor read the pinned dependency version from the miner's own package.json — the reliable, always-available source of "which engine this miner is built against" — rather than resolving the installed package at runtime.

Closes #2288.

Note (resubmit): an earlier revision was auto-closed by the gate because the bin started the opportunistic npm-registry update check for all commands, so status/doctor could reach that network path despite their no-network contract. Fixed: status and doctor are now dispatched at the top of bin/gittensory-miner.js, before startUpdateCheck runs, so they never touch the update path (the check still runs for the other commands).

Scope

Validation

  • git diff --check
  • npm run typecheck
  • npm run test:coverage locally — the new test/unit/miner-status.test.ts passes (whole miner suite green, 170 tests). This change lives entirely in packages/**, which Codecov does not measure, so it carries no codecov/patch obligation; the logic is nonetheless exercised across state-dir resolution, the status snapshot + config discovery, text vs --json output, doctor happy-path, the doctor failure (unwritable state dir → exit 1), and a vi.stubGlobal("fetch") assertion that no network call is made.
  • node --check over the new files + bin via npm run --workspace @jsonbored/gittensory-miner build
  • npm audit --audit-level=moderate — this PR adds no dependencies, so dependency-review has nothing new to evaluate.
  • New behavior has unit tests for both commands' happy path and a failure path each, plus the no-network invariant.

If any required check was skipped, explain why:

  • UI/OpenAPI/migration/workers checks are not applicable: this change is a local CLI module in packages/gittensory-miner plus its test — no src/**, UI, API schema, DB, or Cloudflare-binding surface is touched.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed. Output is version/path metadata only.
  • 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. — n/a: read-only local CLI, no auth/session/network surface (asserted no-network).
  • API/OpenAPI/MCP behavior is updated and tested where needed. — n/a: no API/OpenAPI/MCP surface changed.
  • UI changes use live API data or real states. — n/a: no UI change.
  • Visible UI changes include a UI Evidence section. — n/a: no visible UI, frontend, docs, or extension change (CLI text output only).
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

Notes

Additive: a new lib/status.js + lib/status.d.ts, two lines added to the --help text, a status/doctor dispatch block in bin/gittensory-miner.js (mirroring the existing hooks check block), one line added to the package build gate, and one new test file. No existing behavior is changed.

Add gittensory-miner status and gittensory-miner doctor: the miner CLI's first
real commands. status (text or --json) prints the miner + pinned engine version,
Node version, local-state directory, and discovered .gittensory-miner.yml config
file. doctor checks Node major against the engines.node floor, the pinned engine
version is readable, and the local-state directory is creatable/writable,
exiting non-zero on failure. Both are read-only and 100% local — no
repo-scanning, no GitHub writes, no network calls. lib/status.js holds pure,
env/cwd-parameterized helpers; bin dispatches them like the existing hooks check.

Closes JSONbored#2288.
@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.01%. Comparing base (883a237) to head (8ca8bc1).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2866   +/-   ##
=======================================
  Coverage   96.01%   96.01%           
=======================================
  Files         259      259           
  Lines       28304    28304           
  Branches    10291    10291           
=======================================
  Hits        27177    27177           
  Misses        491      491           
  Partials      636      636           
🚀 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 added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 4, 2026
@loopover-orb

loopover-orb Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-04 02:11:03 UTC

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

⏸️ Suggested Action - Manual Review

Review summary
This PR adds the advertised local `status` and `doctor` commands, wires them before the opportunistic update check, and covers the main output and writable-state failure paths. The implementation is small and coherent, and the visible diff does not introduce a reachable command-dispatch or build break. The main concern is contract clarity: `doctor` intentionally creates the state directory and writes a probe file, so the PR should stop describing both commands as read-only.

Nits — 5 non-blocking
  • nit: `packages/gittensory-miner/lib/status.js:94` makes `doctor` create the state directory and write a probe file, so the command and PR description should not call `doctor` read-only unless that side effect is removed.
  • nit: `packages/gittensory-miner/lib/status.js:122` names the package.json dependency check `engine-resolves`, but it does not resolve the installed engine package; rename it to something like `engine-version-declared` or actually resolve the installed package.
  • nit: `packages/gittensory-miner/lib/status.js:116` reports the Node requirement as `>= 22`, which loses the package's actual `>=22.13.0` floor and can make a failing setup harder to diagnose.
  • Update the `doctor` wording in `packages/gittensory-miner/lib/status.js` comments and user-facing docs/PR text to say it performs a local writable-state probe rather than being read-only.
  • In `packages/gittensory-miner/lib/status.js:122`, align the check name/detail with the chosen source of truth: `engine-version-declared: @​jsonbored/gittensory-engine 0.1.0`.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2288
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 ❌ 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: 40 registered-repo PR(s), 19 merged, 1 issue(s).
Contributor context ✅ Confirmed Gittensor contributor dhgoal; Gittensor profile; 40 PR(s), 1 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: dhgoal
  • 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: 40 PR(s), 1 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 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.

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit cea0943 into JSONbored:main Jul 4, 2026
10 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(miner-foundation): slim laptop-mode CLI entry point (status/doctor commands)

1 participant