Skip to content

Expose AMS's persisted plan-store as read-only MCP tools (gittensory_miner_list_plans / gittensory_miner_get_plan) #5161

Description

@JSONbored

Context

AMS persists an actual plan store — a local SQLite-backed record of plans that survives across CLI invocations — in packages/gittensory-miner/lib/plan-store.js. This is distinct from ORB's gittensory_plan_status tool, which is stateless (the caller's own harness holds the plan object in memory; ORB's tool does not read from a persistent store). AMS currently has no MCP read path into its persisted plan-store at all, so this is net-new coverage rather than a duplicate of the ORB tool.

Dependencies

Requires the AMS MCP server scaffold to exist first (same scaffold C06–C08 depend on). Otherwise independent — not covered by Wave 5 or Wave 3.5.

Requirements

  1. Add two new read-only MCP tools: gittensory_miner_list_plans and gittensory_miner_get_plan, registered on the AMS MCP server.
  2. gittensory_miner_list_plans must wrap plan-store.js's existing list query, optionally filtered by status (using whatever status values plan-store.js already defines — do not invent new statuses).
  3. gittensory_miner_get_plan must wrap plan-store.js's existing get-by-id lookup, taking a plan id parameter and returning the full persisted plan record, or an explicit not-found result for an unknown id.
  4. Both tools must be strictly read-only: neither may create, update, delete, or otherwise mutate any row in the plan-store, and neither may touch the plan DAG or any planning/decision logic.
  5. Each tool's MCP-facing description must include a doc note explicitly distinguishing this store-backed pair from ORB's stateless gittensory_plan_status tool, so callers don't conflate the two mechanisms.
  6. Handle the not-found case for gittensory_miner_get_plan explicitly — return a clear "no such plan" result rather than an unhandled error/throw.

Deliverables / Acceptance Criteria

  • gittensory_miner_list_plans tool implemented, wrapping plan-store.js's list query with optional status filter
  • gittensory_miner_get_plan tool implemented, wrapping plan-store.js's get-by-id lookup
  • Both tools' MCP descriptions include the doc note distinguishing them from ORB's stateless gittensory_plan_status
  • Explicit not-found handling for gittensory_miner_get_plan
  • Unit tests: list with/without status filter, get-plan for existing id, get-plan for unknown id
  • No mutation of plan-store.js rows or the plan DAG from either tool

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 both tools' success and failure paths (filtered/unfiltered list, existing plan id, unknown plan id, malformed input), (2) an invariant test asserting neither read-only plan tool ever writes to the plan-store table or alters the plan DAG, and (3) no regression test is required 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 MCP-connected agent can list and inspect AMS's persisted plans (which survive across CLI invocations) over MCP — a capability that didn't exist before, and one explicitly not covered by ORB's stateless plan-status tool.

Links & Resources

  • packages/gittensory-miner/lib/plan-store.js
  • ORB's gittensory_plan_status tool (for the explicit stateless-vs-persisted distinction)
  • Theme: MCP exposure

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