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
- Add two new read-only MCP tools:
gittensory_miner_list_plans and gittensory_miner_get_plan, registered on the AMS MCP server.
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).
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.
- 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.
- 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.
- 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
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
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'sgittensory_plan_statustool, 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
gittensory_miner_list_plansandgittensory_miner_get_plan, registered on the AMS MCP server.gittensory_miner_list_plansmust wrapplan-store.js's existing list query, optionally filtered by status (using whatever status valuesplan-store.jsalready defines — do not invent new statuses).gittensory_miner_get_planmust wrapplan-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.gittensory_plan_statustool, so callers don't conflate the two mechanisms.gittensory_miner_get_planexplicitly — return a clear "no such plan" result rather than an unhandled error/throw.Deliverables / Acceptance Criteria
gittensory_miner_list_planstool implemented, wrappingplan-store.js's list query with optional status filtergittensory_miner_get_plantool implemented, wrappingplan-store.js's get-by-id lookupgittensory_plan_statusgittensory_miner_get_planplan-store.jsrows or the plan DAG from either toolTest 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/**, andapps/gittensory-miner-extension/**currently sit entirely outside vitest'scoverage.includeglob, socodecov/patchcannot measure changes there yet — closing that gap is exactly what #4864 and #4865 (in this same milestone) do. Any part of this change underpackages/gittensory-engine/src/**or the repo's ownsrc/**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.jsgittensory_plan_statustool (for the explicit stateless-vs-persisted distinction)