From 87cce0048db4064899a56e6dc58e57ca02464b4a Mon Sep 17 00:00:00 2001 From: "Matt Johnson (via Claude)" Date: Sat, 6 Jun 2026 18:34:15 +0000 Subject: [PATCH] fix(dispatcher): disable staleness filter for fire events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fire events are always relevant regardless of age (a wildfire burning for 9 hours is not stale — it's ongoing). The staleness filter was designed for incidents with time_validity semantics, not persistent fire state. - defaults.py: add wfigs.freshness_seconds = 0 (disabled) - dispatcher.py: for fire toggle family, read from adapter_config instead of toggle; skip staleness check when freshness_s == 0 Fixes Blue Ridge fire being dropped after LAST_PER_SUBJECT replay. Co-Authored-By: Claude Opus 4.5 --- meshai/adapter_config/defaults.py | 5 +++++ meshai/notifications/pipeline/dispatcher.py | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/meshai/adapter_config/defaults.py b/meshai/adapter_config/defaults.py index b5d783a..32678db 100644 --- a/meshai/adapter_config/defaults.py +++ b/meshai/adapter_config/defaults.py @@ -61,6 +61,11 @@ REGISTRY: dict[tuple[str, str], dict[str, Any]] = { "type": "bool", "description": "Re-broadcast when containment percent increases (forward-only).", }, + ("wfigs", "freshness_seconds"): { + "default": 0, + "type": "int", + "description": "Staleness gate for wfigs events (0 = disabled). Fire events are always relevant regardless of age.", + }, # ================================================================= # NWS -- 3 settings (severity gate, tombstone msgTypes, suffix-promote toggle) diff --git a/meshai/notifications/pipeline/dispatcher.py b/meshai/notifications/pipeline/dispatcher.py index ae620a1..d6ee8e0 100644 --- a/meshai/notifications/pipeline/dispatcher.py +++ b/meshai/notifications/pipeline/dispatcher.py @@ -340,7 +340,11 @@ class Dispatcher: # inner Event.timestamp; for native adapters it's the upstream API's # timestamp. Receive-time is NOT used (it's meshai-side and tells us # nothing about how stale the underlying alert is). - freshness_s = int(getattr(tog, "freshness_seconds", 600) or 600) + # v0.6-3b: fire toggle uses wfigs adapter_config freshness (0 = disabled) + if fam == "fire": + freshness_s = int(adapter_config.wfigs.freshness_seconds) + else: + freshness_s = int(getattr(tog, "freshness_seconds", 600) or 600) if event.timestamp and freshness_s > 0: age = time.time() - event.timestamp if age > freshness_s: