Skip to content

feat(miner): expose status/doctor diagnostics via a read-only MCP tool - #5415

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jaytbarimbao-collab:feat-miner-mcp-status
Jul 12, 2026
Merged

feat(miner): expose status/doctor diagnostics via a read-only MCP tool#5415
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jaytbarimbao-collab:feat-miner-mcp-status

Conversation

@jaytbarimbao-collab

Copy link
Copy Markdown
Contributor

Adds gittensory_miner_status to the gittensory-miner MCP server (scaffold #5153) — remote/agent-facing, read-only status + doctor diagnostics. This completes the read-only AMS MCP tool surface (status, portfolio, claims, event-ledger, governor-ledger, run-state, plan-store).

What this adds

A single tool returning { status, doctor }, reusing the exact functions the CLI uses (requirement 6 — so the MCP output and gittensory-miner status/doctor can never drift):

  • status = collectStatus(): package/engine versions (and skew), node version, state-dir path, config-file path, and the resolved coding-agent driver — provider name, the model ENV-VAR NAME (never its value), and a CLI-present boolean (requirement 3).
  • doctor = runDoctorChecks(): the same checks gittensory-miner doctor runs (Docker presence, CLI presence, config validity, …) as { name, ok, detail } (requirement 2).

Strictly read-only and secret-safe: only names / booleans / paths — never any env-var value, token, key, or credential (requirements 4, 5). The status.js readers are unchanged (wrapped, not modified); the readers are injectable (options.collectStatus / options.runDoctorChecks) so tests are deterministic.

Validation (local)

  • tsc --noEmit: 0 errors.
  • vitest across the affected files: 35/35 pass — new status cases assert the { status, doctor } passthrough, the driver's env-var-NAME/CLI-boolean shape, and that no token/key-shaped secret appears anywhere in the serialized response.
  • check-miner-package, docs:drift-check, git diff --check: clean. Rebased onto latest main; overlap-free at open time.

Note: this change touches only bin/ + tests + README (no lib/*.js), so it's outside vitest's coverage.include; the tests above enforce full behavioral coverage regardless.

Closes #5154

Add gittensory_miner_status to the gittensory-miner MCP server (scaffold JSONbored#5153): returns
{ status, doctor } by reusing status.js's existing collectStatus (package/engine versions + skew,
node, state-dir/config paths, and the resolved coding-agent driver -- provider name, model ENV-VAR
NAME never its value, CLI-present boolean) and runDoctorChecks (Docker/CLI presence, config
validity, ... as { name, ok, detail }). Reuses the same functions the CLI uses so the two can't
drift. Returns only names/booleans/paths -- never any env-var value, token, key, or credential.
Read-only; the readers are injectable for tests. Completes the read-only AMS MCP tool surface.

Closes JSONbored#5154
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.45%. Comparing base (c535aa4) to head (c5c5afa).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5415   +/-   ##
=======================================
  Coverage   94.45%   94.45%           
=======================================
  Files         553      553           
  Lines       44357    44357           
  Branches    14659    14659           
=======================================
  Hits        41898    41898           
  Misses       1784     1784           
  Partials      675      675           
Flag Coverage Δ
shard-1 43.89% <ø> (-0.24%) ⬇️
shard-2 34.12% <ø> (-0.49%) ⬇️
shard-3 32.13% <ø> (+0.55%) ⬆️
shard-4 31.22% <ø> (-0.21%) ⬇️
shard-5 32.91% <ø> (-0.39%) ⬇️
shard-6 43.94% <ø> (+0.53%) ⬆️

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

🚀 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 12, 2026
@loopover-orb

loopover-orb Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-12 17:43:21 UTC

4 files · 2 AI reviewers · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This adds a straightforward read-only MCP tool that wraps the existing collectStatus/runDoctorChecks readers from status.js, following the exact same pattern (injection seams, try/finally-free since no store is opened, JSON passthrough) as the other read-only tools in this file. The implementation is correct: no store is opened so there's no leak/close concern, secrets are excluded by construction since status.js is unchanged and only returns the env-var name/booleans per the description, and tests assert both the passthrough shape and absence of token-shaped strings in the serialized output. This closes issue #5154 and cleanly completes the read-only AMS MCP tool surface as described.

Nits — 5 non-blocking
  • The secret-shaped-string test in test/unit/miner-mcp-scaffold.test.ts only checks a hardcoded FAKE_STATUS/FAKE_DOCTOR fixture, not the real collectStatus()/runDoctorChecks() output, so it can't catch a future regression in status.js itself that leaks a real env value.
  • The tool description string in gittensory-miner-mcp.js:248-254 is quite long; consider trimming to match the terser descriptions used by sibling tools like gittensory_miner_ping.
  • Consider adding one integration-style test that calls the real collectStatus()/runDoctorChecks() (not the injected fakes) to verify status.js's actual output never contains a secret-shaped string, since the fake-based test only proves the wiring, not the source data safety.
  • nit: `test/unit/miner-mcp-scaffold.test.ts:378` checks the no-secret invariant only against injected fake data, so it does not protect the real `collectStatus` / `runDoctorChecks` serialization path; add a real-reader or fixture-backed assertion if this is meant to enforce the secret-safety requirement.
  • nit: `packages/gittensory-miner/bin/gittensory-miner-mcp.js:259` has no explicit assertion that `collectStatus` and `runDoctorChecks` are invoked only when `gittensory_miner_status` is called, which would match the lazy-read convention used by the store-backed tools.
Signal Result Evidence
Code review ✅ No blockers 2 reviewers, synthesized
Linked issue ✅ Linked #5154
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: 26 registered-repo PR(s), 15 merged, 1 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jaytbarimbao-collab; Gittensor profile; 26 PR(s), 1 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence. LLM value judgment: moderate — This is a small, well-scoped, correctly-wired addition that completes a documented read-only MCP tool surface and directly closes a linked issue, following the exact conventions already established by sibling tools in the same file.
Linked issue satisfaction

Addressed
The PR adds a gittensory_miner_status MCP tool that reuses collectStatus/runDoctorChecks from status.js, returning state-dir/config paths, version skew, doctor checks (Docker/Claude-CLI/Codex-CLI presence, config validity), and driver info (provider, env-var name, cliPresent boolean) without ever exposing secret values, matching nearly all stated requirements and deliverables including unit tests,

Review context
  • Author: jaytbarimbao-collab
  • 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: 26 PR(s), 1 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.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

🟩 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 b7d3308 into JSONbored:main Jul 12, 2026
16 checks passed
@loopover-orb loopover-orb Bot added gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. and removed gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jul 12, 2026
@JSONbored JSONbored added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. and removed gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jul 12, 2026
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.

Expose gittensory-miner status/doctor diagnostics as a read-only MCP tool, including resolved coding-agent driver info

2 participants