Skip to content

P2.5 (v1): threshold rules and alerts - #15

Merged
ocularminds merged 1 commit into
masterfrom
p2.5-rules-alerts
Aug 17, 2026
Merged

ocularminds merged 1 commit into
masterfrom
p2.5-rules-alerts

Conversation

@ocularminds

Copy link
Copy Markdown
Owner

Roadmap item

P2.5 v1 — the platform slice grows its 'so what': readings now trigger action.

What

  • Rules scope organization → site → device on a metric type with gt/lt thresholds, evaluated at ingest with at most one alert per rule per batch (a 500-reading breach doesn't page anyone 500 times).
  • Alerts persist with delivery status; delivery is a pluggable notifier — the rule's webhook (3 s timeout) or a loud console today; SMS/WhatsApp adapters slot in behind the same interface (roadmap notes the follow-up, with rate-of-change rules).
  • Admin: POST /admin/rules, GET /admin/alerts?organization=.

Verification

  • 49/49 vitest tests — alert fires with injected-notifier capture, per-batch dedupe proven (two breaches → one alert), calm batches fire nothing, delivered flag recorded and listable, device-scoped rules don't cross devices

🤖 Generated with Claude Code

- rules scope org -> site -> device on a metric type with gt/lt
  thresholds (migration 010); evaluated at ingest with at most one
  alert per rule per batch
- alerts persist with delivery status; delivery via a pluggable
  notifier — rule webhook (3s timeout) or loud console; SMS/WhatsApp
  adapters are the follow-up
- admin: POST /admin/rules (org by name, optional site/device scope),
  GET /admin/alerts?organization=

Tests: 49 — alert fires with injected-notifier capture and per-batch
dedupe, calm batch fires nothing, delivered flag recorded and listable,
device-scoped rule never fires for another device.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ocularminds
ocularminds merged commit 7440b7e into master Aug 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant