Context
collectPortfolioDashboard() in packages/gittensory-miner/lib/portfolio-dashboard.js is already built and tested, and gittensory-miner queue dashboard --json already prints its output locally: per-repo backlog counts by status, oldest-queued age, and totals. None of this is reachable remotely today. This is distinct from Wave 5's miner-ui dashboard views (#4846/#4855/#4856) and miner-ui live fetch (#4859), which are the webapp's own UI/API layer, not an MCP tool for remote/agent-facing introspection.
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.
Requirements
- Add a new tool (e.g.
gittensory_miner_get_portfolio_dashboard) to the AMS MCP server.
- Call the existing
collectPortfolioDashboard() aggregator directly from packages/gittensory-miner/lib/portfolio-dashboard.js — no new aggregation logic, no reimplementation of counting/aging logic.
- Return the same metadata already produced by the aggregator: per-repo backlog counts by status, oldest-queued age, and totals.
- The tool must be strictly read-only — it must not mutate the queue/backlog in any way, and must have no side effects beyond invoking the existing pure aggregator.
- Do not add new output fields beyond what
collectPortfolioDashboard() already returns; if filtering or additional shaping is needed later, that's a separate follow-up issue.
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 the tool's success path (multiple repos with backlog items) and failure/edge paths (empty queue, single repo, missing repo data), (2) an invariant test asserting the MCP tool's output is structurally identical to collectPortfolioDashboard()'s direct return value — the wrapper introduces no aggregation drift, 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 gets remote, agent-facing introspection into per-repo backlog health — the same data queue dashboard --json shows locally — without needing miner-ui or local CLI access.
Links & Resources
Context
collectPortfolioDashboard()in packages/gittensory-miner/lib/portfolio-dashboard.js is already built and tested, andgittensory-miner queue dashboard --jsonalready prints its output locally: per-repo backlog counts by status, oldest-queued age, and totals. None of this is reachable remotely today. This is distinct from Wave 5's miner-ui dashboard views (#4846/#4855/#4856) and miner-ui live fetch (#4859), which are the webapp's own UI/API layer, not an MCP tool for remote/agent-facing introspection.Dependencies
Requires the MCP scaffold issue in this same batch (
gittensory-miner-mcpbin entry) to land first — this tool is added onto that server.Requirements
gittensory_miner_get_portfolio_dashboard) to the AMS MCP server.collectPortfolioDashboard()aggregator directly from packages/gittensory-miner/lib/portfolio-dashboard.js — no new aggregation logic, no reimplementation of counting/aging logic.collectPortfolioDashboard()already returns; if filtering or additional shaping is needed later, that's a separate follow-up issue.Deliverables / Acceptance Criteria
collectPortfolioDashboard()with no new aggregation logicgittensory-miner queue dashboard --jsonoutputTest 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 (multiple repos with backlog items) and failure/edge paths (empty queue, single repo, missing repo data), (2) an invariant test asserting the MCP tool's output is structurally identical to
collectPortfolioDashboard()'s direct return value — the wrapper introduces no aggregation drift, 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/**, 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 an MCP-connected agent gets remote, agent-facing introspection into per-repo backlog health — the same data
queue dashboard --jsonshows locally — without needing miner-ui or local CLI access.Links & Resources