Repository navigation
Maple Review Bot / Maple / review
succeeded
Nov 16, 2026 in 4m 38s
Confidence 10/10 · No issues found
🟢 Confidence 10/10 · safe to merge. Whole diff read; range, instant, step gate, truncation, stats and escaping are each pinned by a tool test — only the MAX_STEPS boundary arithmetic is untested and harmless.
no findings · tests covered · risk medium · 1/1 new units observable
Adds the query_promql MCP tool: range or instant PromQL through PromqlQueryService, capped at 20 series and 200 points, with min/avg/max over every point. The earlier stats defect (F10) is fixed; the open McpQueryError issues in registry.ts are untouched — that file only gains a registration line.
query_promqlevaluates PromQL over a range or once at end_timedefaultStepSecondspicks the smallest round step keeping about 120 pointscapSerieskeeps the 20 highest-peak series and each one's last 200 points- PromQL parse and evaluation errors become
McpInvalidInputErroronquery
Fixed since the last review
- ✅
F10 ·statssummarises the last 200 points, not the series it reports
Production impact
Open errors in the changed files (2)
| Issue | Service | Occurrences | File |
|---|---|---|---|
| @maple/mcp/errors/McpQueryError (7 issues) | maple-ai | 30 | apps/ai/src/mcp/tools/registry.ts |
| @maple/mcp/errors/McpQueryError (3 issues) | maple-chat | 12 | apps/ai/src/mcp/tools/registry.ts |
After this merges, Maple checks whether they stop.
Telemetry this change adds and removes (3)
- ➕ span name
McpTool.queryPromql·apps/ai/src/mcp/tools/query-promql.ts:38 - ➕ attribute
maple.ai.promql.instant·apps/ai/src/mcp/tools/query-promql.ts:64 - ➕ attribute
maple.ai.promql.step_seconds·apps/ai/src/mcp/tools/query-promql.ts:65
What was checked
resolveWindowrejects width <= 0, so no reversed or zero window reaches the step maths- Series names and note text go through
tableCellin list items, pinned by thea|btest - Spans carry org id, flags, step and query length only — never the PromQL text
Observability coverage: 1 of 1 changes observable
| Change | Kind | Observable | Evidence |
|---|---|---|---|
| query_promql MCP tool handler | inbound MCP tool entrypoint | yes | Effect.fn("McpTool.queryPromql") span plus maple.ai.promql.* attributes on it, query-promql.ts:58-70 |
bb15f5f · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Loading