Skip to content

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

Description

@JSONbored

Context

gittensory-miner status / gittensory-miner doctor already compute and print state-dir paths, engine-version skew, Docker/Claude-CLI/Codex-CLI presence, and config validity, but none of this is reachable over MCP today. A companion status --json driver-info section (resolved MINER_CODING_AGENT_PROVIDER, the relevant model-env-var name, and CLI-presence booleans) is landing separately. This is distinct from the rate-limit telemetry (#4837) and event-ledger scrape (#4841) issues, which are metrics/observability feeds — this is specifically the human-facing status/doctor output made available to an MCP-connected agent.

Dependencies

Requires the MCP scaffold issue in this same batch (gittensory-miner-mcp bin entry) to land first — this tool is added onto that server. It also benefits from the companion status --json driver-info section (MINER_CODING_AGENT_PROVIDER resolution, model-env-var name, CLI-presence booleans): if that piece is still in flight when this issue is picked up, ship the state-dir/version-skew/Docker-CLI-presence/config-validity portion first and add the driver-info fields in a fast-follow once available — do not guess at driver-info field names or values.

Requirements

  1. Add a new tool (e.g. gittensory_miner_status) to the AMS MCP server scaffolded in the companion scaffold issue.
  2. The tool must return the same fields gittensory-miner status/doctor already compute: state-dir paths, engine-version skew, Docker presence (boolean), Claude-CLI presence (boolean), Codex-CLI presence (boolean), and config validity.
  3. Once the companion status --json driver section is available, additionally return: the resolved MINER_CODING_AGENT_PROVIDER value, the name (never the value) of the relevant model env var, and CLI-presence booleans for that provider.
  4. The tool must never return secret values — only names of env vars and booleans indicating presence/validity; never the contents of any env var, token, key, or credential.
  5. The tool must be strictly read-only: no writes to any state file, config file, or ledger, and no side effects beyond reading and reporting already-computed status.
  6. Reuse the existing status/doctor computation logic rather than duplicating it — call into whatever function(s) the CLI commands already use, so the MCP tool and the CLI output can never drift apart.

Deliverables / Acceptance Criteria

  • New MCP tool added to the gittensory-miner-mcp server, calling into existing status/doctor logic
  • Tool returns state-dir paths, engine-version skew, Docker/Claude-CLI/Codex-CLI presence, config validity
  • Tool returns resolved MINER_CODING_AGENT_PROVIDER, model-env-var name, and CLI-presence booleans (once the companion driver-info piece is available; otherwise tracked as a documented follow-up)
  • No secret values are ever returned by the tool — verified by test
  • Unit tests + invariant test added
  • README/docs updated to list the new tool and its fields

Test Coverage Requirements

This PR must ship with full test coverage for every changed line and branch — the repo's Codecov patch gate requires 99%+ coverage and the house standard is to aim for 100%, including both sides of every conditional/nullish-coalescing branch introduced. Add: (1) unit tests covering the tool's success path (all fields present, CLI tools detected/not detected) and failure paths (missing state dir, invalid config), (2) an invariant test asserting the tool's output never contains a value matching a secret-shaped pattern (env var contents, tokens, keys) — only names and booleans, and (3) no regression test is needed since this is new functionality, not a bug fix.

Codecov visibility note: packages/gittensory-miner/**, apps/gittensory-miner-ui/**, and apps/gittensory-miner-extension/** currently sit entirely outside vitest's coverage.include glob, so codecov/patch cannot measure changes there yet — closing that gap is exactly what #4864 and #4865 (in this same milestone) do. Any part of this change under packages/gittensory-engine/src/** or the repo's own src/** remains fully Codecov-instrumented as usual. Either way, this does not lower the bar: treat the 100%-including-invariants-and-regression target above as the enforced house standard regardless of what Codecov can currently see, and it becomes gate-enforced for real once #4864/#4865 ship.

Expected Outcome

An operator or an MCP-connected agent can query miner health/diagnostics remotely, seeing the same status/doctor data available locally today, without shelling into the machine.

Links & Resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    Status
    In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions