Event correlation layer: derived, rebuildable weather_events (#135) #168
No reviewers
Labels
No labels
area:ai
area:ci-cd
area:notifications
area:observability
area:public-pages
backlog
bug
duplicate
enhancement
help wanted
invalid
question
type:decision
type:feature
type:infra
type:maintenance
type:security
v1.0.1
v1.1.0
v1.2.0
v1.3.0
v2.0.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/WeatherBot!168
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/event-correlation-layer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #135. Implements the correlation rules ratified on #136 (2026-08-01).
What this adds
The first Explorer building block:
weather_events+weather_event_members— derived, rebuildable tables (never source of truth) that group raw per-product rows into per-location timeline events.Rules implemented exactly as decided on #136:
EVENT_GAP_MINUTES = 90interval-merge sweep with transitive closure;upgrade_fromlineage merges regardless of gap (union-find pass).watch_onlyevent; lightning episodes (same gap rule over cluster timestamps) attach to any overlapping event or formlightning_onlyevents.coalesce(onset, sent_at)→coalesce(cleared_at, expires, sent_at + 6h).derivation_version = 1.Pieces: pure derivation logic (unit-testable, no DB) +
rebuild_events()DB layer; migration0034; a 30-minute scheduler job rebuilding the trailing 48 h per ready location, with automatic full-history backfill on first run (empty table). No API/UI — that's #137–#139.Notable decisions (recorded here for review)
SentAlertrows are channel-only (no dashboard record), so no per-location MCD association exists to read. Comment in the module; picked up with the day view (#138).lightning_alert_radius_mi, haversine) — the only precedent in the codebase for "this location's lightning". No radius ⇒ no lightning-derived events.Review pass (two fixes over the initial implementation)
watch_onlyevents too (per the #136 rule "any overlapping event") — a storm under a watch with no warnings corroborates the watch event instead of spawning a parallel lightning-only one.Verification
ruffclean;alembic headsresolves to0034as sole head. CI's Postgres tier exercises the migration against real Postgres.🤖 Generated with Claude Code