feat(miner-mcp): expose status/doctor diagnostics tool (#5154)#5313
feat(miner-mcp): expose status/doctor diagnostics tool (#5154)#5313andriypolanski wants to merge 6 commits into
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - reject/close recommendedReview updated: 2026-07-12 14:35:27 UTC
🛑 Suggested Action - Reject/Close
Review summary Blockers
Nits — 5 non-blocking
Why this is blocked
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk 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.
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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5313 +/- ##
=======================================
Coverage 94.40% 94.40%
=======================================
Files 550 550
Lines 44116 44128 +12
Branches 14631 14631
=======================================
+ Hits 41649 41661 +12
Misses 1792 1792
Partials 675 675
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
7fd46ba to
a4918a5
Compare
a4918a5 to
415b412
Compare
d9d94cb to
8e5768e
Compare
|
An AI reviewer flagged a likely defect, but its confidence was below this repository's configured close-confidence floor, so this is held for a maintainer to confirm instead of closing automatically. Resolve the flagged defect (see the review notes), or ask a maintainer to override. |
JSONbored
left a comment
There was a problem hiding this comment.
Please fix + resubmit:
packages/gittensory-miner/bin/gittensory-miner-mcp.js:101 and packages/gittensory-miner/lib/status.js:339 make `gittensory_miner_status` call `runDoctorChecks()`, whose `checkStateDirWritable()` path creates the state directory and writes a probe file, so the supposedly read-only MCP diagnostics tool mutates disk on a reachable request; change the MCP/status snapshot to use a non-mutating writability check or explicitly separate the mutating doctor probe from the read-only MCP path.
Closes #5154
Summary
Adds
gittensory_miner_status, a read-only MCP tool ongittensory-miner-mcpthat returns the same diagnostics asgittensory-miner statusanddoctor --json, via a new sharedcollectMinerDiagnostics()helper instatus.js. No duplicated logic — the MCP tool and future callers share one snapshot builder.Driver-info fields (
MINER_CODING_AGENT_PROVIDER, model-env-var name, provider CLI presence) are deferred until #5164 lands, per the issue dependency note.Changes
packages/gittensory-miner/lib/status.jscollectMinerDiagnostics()— mergescollectStatus()+runDoctorChecks()with derived presence booleanspackages/gittensory-miner/bin/gittensory-miner-mcp.jsgittensory_miner_statustoolpackages/gittensory-miner/bin/gittensory-miner-mcp.d.tspackages/gittensory-miner/lib/status.d.tsMinerDiagnosticstypepackages/gittensory-miner/README.mdtest/unit/miner-mcp-status.test.tstest/unit/miner-status.test.tscollectMinerDiagnostics()test/unit/miner-mcp-scaffold.test.tsResponse shape
{ "package": { "name": "@jsonbored/gittensory-miner", "version": "…" }, "engine": { "name": "@jsonbored/gittensory-engine", "version": "…" }, "node": "v22.x.x", "stateDir": "/path/to/state", "configFile": "/path/to/.gittensory-miner.yml", "configValid": true, "engineVersionSkew": { "ok": true, "detail": "…" }, "presence": { "docker": false, "claudeCli": false, "codexCli": false }, "doctor": { "ok": true, "checks": [ … ] } }configValid: config file readable (or absent — defaults OK). Full schema validation follows Makedoctorvalidate config content, not just its path #4873.presence.*: binary on PATH, independent of doctor pass/fail (Gatedoctor's claude/codex CLI-presence checks by the configuredMINER_CODING_AGENT_PROVIDER#5165 gating).Follow-ups
driversection tostatus --json, then wire intocollectMinerDiagnostics()/ MCP toolconfigValidwith schema validationTest plan
collectMinerDiagnosticsmerges status + doctor without driftgittensory_miner_statusmatchescollectMinerDiagnostics()(invariant)configValid: falsewhen config path is unreadablenpx vitest run test/unit/miner-mcp-status.test.ts test/unit/miner-status.test.ts test/unit/miner-mcp-scaffold.test.tsnpm run test:ciNotes
help wanted,gittensor:feature— confirm contributor eligibility before opening.gittensory-miner mcpstdio server (bin entry, one health-check tool) #5153) — already onmain.