meshai/work/meshai
Matt Johnson 18208d2e8f fix(dispatcher): qualify region-cooldown key by channel type
Section 1.5 (region_routes matrix branch) armed and checked the
per-region cooldown key as (toggle, category, region) with no
channel-type component. _chans always inserts mesh_broadcast before
meshcore_broadcast (insertion order in the per-cell append loop), so
for any matched cell with BOTH mt and mc populated, the mesh_broadcast
send armed the cooldown key first; the very next iteration checked
that SAME key for meshcore_broadcast and saw it as freshly cooled
down, dropping it every time. Net effect: meshcore_broadcast never
succeeded via the matrix branch whenever cooldown_seconds > 0 (true
for weather/roads/fire, all 300s), so it never armed its own
dedup/cooldown state either -- a silent, permanent MC blackout for
every region-routed family. Confirmed live: dispatcher_dedup had 555
rows, zero meshcore_broadcast; mesh_broadcasts_out was 120:4 MT:MC for
nws_alerts and 98:8 for traffic_events over 10 days (the few MC rows
that got through came from a different, non-matrix code path). fires'
98:77 near-1:1 ratio is not evidence the matrix branch worked for
fire -- those MC sends are dominated by the cooldown-exempt scheduled
reminder path (dispatch_scheduled_fire_broadcast); fire's own live
event-driven path has the identical latent bug, just masked.

Fix folds ch_type into the region string (mirrors the existing
_cd_suffix convention) so mesh_broadcast and meshcore_broadcast get
independent cooldown windows. Kept the cooldown key a 3-tuple
(instead of widening to 4) to avoid a dispatcher_cooldowns schema
migration -- _persist_cooldown() and the boot-restore SELECT are both
hard-coded to (toggle, category, region).

Verified in isolation (no live/deployed behavior change, no
transmit): a fresh Dispatcher built from the live production config
now dispatches both mesh_broadcast and meshcore_broadcast for
weather/roads/fire matched cells under a 300s cooldown. Added two
regression tests covering the gap that let this ship untested: no
existing test combined cooldown_seconds > 0 with a cell that has BOTH
mt and mc populated (test_cell_match_routes_mt_and_mc uses the
cooldown_s=0 default; test_per_region_cooldown_independence uses
cooldown_s=300 but with mc=None on every cell).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 14:59:20 +00:00
..
adapter_config feat(adapters): WZDx daily work-zone summary + FIRMS restart-safe cold-start (#108) 2026-07-09 19:13:17 -06:00
backends refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
central fix(satpass): clean broadcast format (short names, degrees, compass, friendly observers) (#76) 2026-07-06 20:44:02 -06:00
cli chore: remove legacy TUI configurator; surface last config gap in GUI (#45) 2026-07-05 16:21:32 -06:00
commands feat(phase4a): peak_compass end-to-end + repair stale satpass test suite (#35) 2026-07-05 01:06:29 -06:00
dashboard MeshCore: channel provisioning, key sharing, location-based recommendations & transport-aware identity (#113) 2026-07-10 23:30:57 -06:00
data refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
env fix(wzdx): persist current work zones to traffic_events via dedicated ingest (#109) 2026-07-09 20:08:13 -06:00
notifications fix(dispatcher): qualify region-cooldown key by channel type 2026-07-11 14:59:20 +00:00
persistence feat(context): durable SQLite-backed retention for MeshContext observations (#114) 2026-07-11 02:20:16 -06:00
scripts refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
sources refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
transport MeshCore: channel provisioning, key sharing, location-based recommendations & transport-aware identity (#113) 2026-07-10 23:30:57 -06:00
__init__.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
__main__.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
alert_engine.py Phase A — 4-section nav; move Scheduled Broadcasts + Danger Zones off Routing (#15) 2026-07-03 14:57:24 -06:00
central_normalizer.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
chunker.py feat(reply): cap interactive LLM replies to 3 mesh packets (#7) 2026-07-02 16:49:10 -06:00
config.py MeshCore: channel provisioning, key sharing, location-based recommendations & transport-aware identity (#113) 2026-07-10 23:30:57 -06:00
config_loader.py feat(generic): config-driven REST/GeoJSON source adapter (ported from Central) (#78) 2026-07-07 00:20:02 -06:00
connector.py feat(send-queue): jittered pacing (default 2.2-2.6s) per radio instead of fixed 2.0s (#95) 2026-07-08 11:12:28 -06:00
context.py feat(context): durable SQLite-backed retention for MeshContext observations (#114) 2026-07-11 02:20:16 -06:00
coverage.py feat(coverage): widen adapter fetch scope to the enclosing box of coverage areas (#71) 2026-07-06 12:51:54 -06:00
coverage_area.py feat(region-routing): tag satpass events by observer coordinates so they region-route; add satpass to VALID_TOGGLES (#90) 2026-07-07 21:43:49 -06:00
geo.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
history.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
knowledge.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
main.py fire: remove fire digest feature and drop out-of-coverage fires at ingest (#107) 2026-07-09 13:46:12 -06:00
memory.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
mesh_data_store.py refactor(danger-zones): drop min_severity + position_max_age; table snow (grayed/inert) 2026-06-21 06:56:22 +00:00
mesh_health.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
mesh_models.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
mesh_reporter.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
mesh_sources.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
meshmonitor.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
responder.py feat(transport): per-radio serialized+paced outbound send queue (#93) 2026-07-08 09:38:08 -06:00
router.py MeshCore: channel provisioning, key sharing, location-based recommendations & transport-aware identity (#113) 2026-07-10 23:30:57 -06:00
secrets_store.py feat(meshcore): route MeshCore cells to room servers (open rooms) (#110) 2026-07-09 22:14:42 -06:00
serial_ports.py fix(serial): detect passed-through /dev USB-serial nodes (container GUI detect) (#53) 2026-07-05 23:01:08 -06:00