Repository navigation
feat(ai): MCP tools for the Infrastructure pages (list_infra, inspect_infra) - #1387
Merged
Merged
Maple Review Bot / Maple / review
succeeded
Oct 10, 2026 in 2m 11s
Confidence 9/10 · No issues found
🟢 Confidence 9/10 · safe to merge
The one open finding is fixed and pinned by a test that fails without the namespace key; the four files changed since the last review were read in full.
quality 100/100 · no findings · tests covered · risk low · 1/1 new units observable
The last commit fixes podRestarts summing same-named pods across namespaces: the query now groups by namespace and the list keys on namespace plus pod name, with a test that fails without it. The changed files are safe to merge; none of the open registry errors touch this diff.
podRestartsQueryselects and groups byk8s.namespace.namepodKeymatches restarts to a pod by namespace and name- Infra fixture answers restarts per namespace
Fixed since the last review
- ✅
F1 ·podRestartssums restarts across namespaces by pod name
Production impact
Open errors in the changed files
| Issue | Service | Occurrences | File |
|---|---|---|---|
| @maple/api/vcs/VcsSourceRepositoryNotFoundError | maple-ai | 68 | apps/ai/src/mcp/tools/registry.ts |
| @maple/mcp/errors/McpQueryError | maple-chat | 42 | apps/ai/src/mcp/tools/registry.ts |
| @maple/mcp/errors/McpQueryError | maple-chat | 36 | apps/ai/src/mcp/tools/registry.ts |
| @maple/mcp/errors/McpQueryError | maple-ai | 18 | apps/ai/src/mcp/tools/registry.ts |
| @maple/api/vcs/GithubAppError | maple-chat | 14 | apps/ai/src/mcp/tools/registry.ts |
| @maple/http/errors/IntegrationsUpstreamError | maple-chat | 14 | apps/ai/src/mcp/tools/registry.ts |
| @maple/http/errors/IntegrationsUpstreamError | maple-chat | 11 | apps/ai/src/mcp/tools/registry.ts |
| @maple/mcp/errors/McpQueryError | maple-ai | 9 | apps/ai/src/mcp/tools/registry.ts |
| @maple/mcp/errors/McpQueryError | maple-ai | 9 | apps/ai/src/mcp/tools/registry.ts |
| @maple/mcp/errors/McpQueryError | maple-chat | 8 | apps/ai/src/mcp/tools/registry.ts |
After this merges, Maple checks whether they stop.
Production traffic of the changed files (last 7 days)
| File | Calls/day | Busiest operations |
|---|---|---|
apps/ai/src/mcp/lib/infra.ts |
58 | infraPresence 48/day, 2.4% errlistHosts 4/day, 6.7% errlistPods 3/day, 0.0% err |
apps/ai/src/mcp/lib/infra-inspect.ts |
6 | podInfraTimeseries 5/day, 0.0% errpodDetailSummary 1/day, 0.0% err |
Telemetry this change adds and removes (2)
- ➕ span name
McpTool.inspectInfra·apps/ai/src/mcp/tools/inspect-infra.ts:111 - ➕ span name
McpTool.listInfra·apps/ai/src/mcp/tools/list-infra.ts:108
What was checked
podKeyreads the samek8s.namespace.nameresource attribute as the list row (infra.ts:250,infra.ts:352)- Row schema is derived from the SELECT, so the new
namespacecolumn decodes (packages/query-engine/src/ch/queries/infra.ts:275) - The new test fails under name-only keying: the fixture answers 1 and 7 for the two namespaces (
infra-tools.test.ts:70)
Observability coverage: 1 of 1 changes observable
| Change | Kind | Observable | Evidence |
|---|---|---|---|
| pod restarts warehouse query | outbound | yes | WarehouseExecutor.compiledQuery with { profile: "aggregation", context: "podRestarts" } (apps/ai/src/mcp/lib/infra.ts:259) |
d8c5987 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Loading