Event correlation layer (derived, rebuildable weather_events) #135
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#135
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Parent: #22.
Key finding: the correlation spine already exists
SentAlert.nws_alert_idstores the VTEC-derived lifecycle id, not the raw NWS feature URN —alert_processor.py:910assignsnws_alert_id=lifecycle_id, wherealert_lifecycle_id(app/services/alert_identity.py:9-27) buildsNWS_{office}_{phenomenon}_{significance}_{etn}from the P-VTEC.That same string is already:
nws_alert_snapshots.lifecycle_idpublic_alert_pages.lifecycle_id{lifecycle_id}__{location_id}.png)ai_summary_records.source_id = f"{product_family}:{lifecycle_id}")So the Explorer does not need a correlation layer built from nothing. It needs a grouping layer over keys that already line up. This is the single biggest de-risking of v2.0.0.
Available identifiers per product family
(product_family, product_id, day, risk_label)(SPCOutlookPageunique constraint)product_idis timestamp-derived, so it changes every reissue — no native cross-issuance id existsSPCDiscussion.product_id= the real SPC-assigned MCD number (spc.py:408)spc_outlook_risk_transitionsDesign constraint from #22
Keep raw snapshots separate from derived groupings. The grouping tables must be derived and rebuildable, never the source of truth, so the correlation algorithm can be improved and re-run without data loss.
Tasks
weather_events+weather_event_members(polymorphic member reference: kind + id), with aderivation_versioncolumn so a stale derivation can be detected and forced to rebuild.visible_location_filter(user)andcan_view_location_with_db(db, user, location)fromapp/api/permissions.pyexactly; do not reimplement the three-tier global/personal/shared check.Picking this up — unblocked by the ratified decisions on #136 (2026-08-01): cores-vs-context model,
EVENT_GAP_MINUTES = 90over W/Y/S-significance members with transitive closure andupgrade_fromalways-merge; watches/MCDs attach ascontextand never chain; watch-only and lightning-only events withevent_kind; SPC outlooks stay a day-band (no membership); per-location events; manual merge/split deferred to #167. Interval =coalesce(onset, sent_at)→coalesce(cleared_at, expires, sent_at + 6h).Implementation shape per the task list:
weather_events+weather_event_members(member_kind, member_id, role ∈ {core, context})withderivation_version = 1, a pure derivation pass, an idempotent ranged rebuild, a periodic trailing-window refresh job plus first-run backfill, and correlation-logic tests. PR to follow.