Repository navigation
fix(alerts): previewing or testing a rule needs read scopes for its telemetry - #2507
Merged
Merged
Maple Review Bot / Maple / review
succeeded
Nov 11, 2026 in 1m 8s
Confidence 10/10 · No issues found
🟢 Confidence 10/10 · safe to merge. A scope tightening whose mapping is unit-tested per branch and pinned over HTTP; the managed-signal and MCP paths are ruled out by reading them.
no findings · tests covered · risk high
Gates the two v2 alert routes that run a rule's query and return what it measured behind the telemetry read scopes that query needs. The signal-to-family mapping is unit-tested branch by branch, refusals are pinned over HTTP without touching the warehouse, and the earlier findings on managed signals and the test endpoint are fixed.
ruleReadFamiliesmaps each rule signal to the telemetry its query readsrequireRuleReadScopesrefuses preview and test with 403 before any query runsuptimeandslo_burn_rateneed no telemetry scopes;raw_queryneeds all three- Both endpoint descriptions document the added read scopes
Fixed since the last review
- ✅
F2 ·uptimeandslo_burn_ratedemand telemetry reads they never make - ✅
F3 · Thetestendpoint's new scope gate is untested
What was checked
previewRulerefuses managed signals innormalizeRulebefore any warehouse call (AlertsService.ts:2048)- Scoped keys cannot reach
preview_alert_ruleover MCP;mcpScopeAccessalready demands every investigation read (resolve-tenant.ts:95) - Session and legacy keys carry null scopes, so
scopeAllowsshort-circuits true (auth.ts:176)
4ca4b35 · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Loading