← System Design Process Playbook

Device Alert Rules — Lean Spec

DD-2026-041 · worked example · format per 2026 SDD practice (Spec Kit · Kiro · Linear): one page, tables over prose, agent-readable
StatusApproved-with-changes · M · DRI Dana (BE) · 48h review · 1 blocking → resolved
Sign-offsPM ✓ · BE TL ✓ · FE TL ✓ · UX ✓ · DevOps TL ✓ · Platform TL ✓
LinksBrief · Figma · Prototype · Tasks (placeholders)

Why numbers

Problem
No alerting
issues found by looking
Success
≥60%
pilots create a rule, week 1
Time-to-ack
<30 min
baseline ~4h
NFR
<90s
p95 · <$400/mo

What it does table

TriggerBehavior
Threshold crossednotify rule's channels (email · Slack · webhook) <90s p95
Heartbeat missed"agent offline" alert
Data missingno fire — never a false "CPU 0%"
Repeat / stormcooldown per device+rule · 500/h tenant cap → one summary
Delivery fails3× retry → in-app banner + digest

How diagram + 1 line of text

Agents metrics / 60s Ingest API existing Kafka device.metrics Rules Evaluator NEW · own consumer group Notification service email · Slack · webhook ClickHouse alert_events · 90d Web app rule builder UI Rules API CRUD + validate Postgres alert_rules rules.changed
One decision: server-side streaming eval, own consumer group — can't slow ingest, agents untouched (Client: N/A v1). Spike-proven at 55k msg/s/pod.

Build plan table

One line each — details live in the linked tasks
APICRUD /v1/alert-rules + /v1/alert-events history · additive-only until v2
Dataalert_rules (Postgres) · alert_events (ClickHouse, 90d) · additive migration
FErule builder stepper + history views per Figma · empty/error states designed
Securitytenant-scoped · alerts:manage role · secrets in vault · no PII in payloads
Rolloutflag alert_rules_v1 · 5-tenant pilot, 2 cycles → GA · lag+failure dashboard day 1
Rollbackflag off + scale to 0 — offsets retained, nothing lost
Verifyedge table = unit cases · load 50k msg/s, p95 < 90s · success metric wired day 1

Q&A — product & technical clarifications table

Anyone asks by commenting on the doc (shaping → discussion). The answer is written into the spec — the "folded into" column proves it. This table is the log, so the same question is never asked twice.
QuestionFrom → ToAnswerFolded into
Threshold per device or per tenant? BE → PMper-rule, applies to all matched devices; per-device overrides = v2✓ What it does
Who can create rules? FE → PMAdmin + Technician roles only (alerts:manage)✓ Build plan
Does "agent offline" need agent-side changes? Client → PMno — server-side heartbeat detection is enough for v1✓ How
Notification cost ceiling per tenant? DevOps → PMinside the $400/mo total; no per-tenant billing in v1✓ Why (NFR)
Ship default starter rules enabled? UX → PMopen — PM decides from pilot data, due end of pilot◌ backlog

Function feedback & sign-off table

Every function leaves a row — even "no concerns". Comment types per the playbook: [blocking] must be resolved · [suggestion] author's call · [question] answered in the doc.
FunctionFeedbackOutcome
PMscope creep risk — cap v1 to 4 metric types✓ taken — What it does trimmed
BE TL[suggestion] conditions[] array now for future compound rulesdeclined — additive in v2, logged in backlog
FE TLevents list needs cursor pagination for 90d history✓ taken — Build plan (API row)
Client TLno concerns — confirms agents untouched in v1✓ signed off (N/A is a reviewed claim)
DevOps TL[blocking] no consumer-lag alert; downtime behavior undefined✓ resolved — Rollout rows added, §-only re-review same day
UX[question] what does the user see when all channels fail?✓ answered in doc — banner behavior + Figma updated

Decisions table

Record
Rejectedpolling (too slow) · agent-side eval (v2) · buy PagerDuty (core value; webhooks bridge instead)
v2 backlogescalation policies · quiet hours · compound rules · per-site grouping · default starter rules (open Q&A)

Format reference — each component's type & purpose

ComponentTypePurposeRule
Headermetadata tablethe decision record: status, tier, DRI, sign-offs — and links to where the depth lives (brief, Figma, prototype, tasks)pointers only, never content · 3–4 rows
Whystat tilesthe problem and the measurable targets everyone must remembernumbers only — if it needs a sentence, it's not a target yet
What it doestrigger → behavior tablethe testable behavior contract; each row becomes a test an agent can verifyone behavior per row · no paragraphs
Howdiagram + 1 lineboth on purpose: the diagram carries structure (what talks to what, where the new piece sits) — text can't; the one line carries the decision (why this shape, what it trades) — boxes can'ttext budget = 1 line; more than that belongs in Decisions, or the design is too big → split the doc
Build planper-function tablewho builds what — the entry point for the decomposition workshopone row per function · details live in the tasks, not here
Q&Aquestion log tablehow engineers ask product (and each other) anything: comment on the doc during shaping/discussion; PM or the owning function answers; the answer is folded into the spec section it affectsevery answered row names where it was folded in · open rows have an owner + due · the thread is the log, the spec is the truth
Function feedbacksign-off tablewhere BE / FE / Client / DevOps / UX / PM feedback lands, with its disposition — visible proof every function reviewedone row per function, even "no concerns" · [blocking] resolved before approval · silence ≠ sign-off
Decisionstablethe doc's memory: rejected alternatives (with reasons) and the v2 backlogone line per decision · abandoned ideas are kept, never deleted