mirror of
https://github.com/zvx-echo6/central.git
synced 2026-06-10 11:54:37 +02:00
v0.10.9: widen monitoring-area default to cover all of Idaho (49.0N) (#97)
v0.10.2's migration 030 set monitor_north=44.5 as the schema default. Idaho extends to 49.0N -- the original default cut off the entire northern panhandle (Coeur d'Alene, Lewiston, Sandpoint, Moscow, McCall). Tonight's investigation caught the impact at scale: supervisor's publish-time bbox filter was dropping ~56 itd_511 events per 60-second poll (~5,376/day), the entire north half of Idaho's roadwork, closures, and incidents. NWS Idaho UGC-zone alerts in the panhandle were similarly dropped (closes the v0.10.7 PR #95 followup-ticket-(b)). Three changes: 1. sql/migrations/034: ALTER COLUMN SET DEFAULT 49.0 for fresh installs, plus an idempotent UPDATE ... WHERE monitor_north = 44.5 that bumps existing deployments still at the dev value. The WHERE 44.5 guard preserves any operator who deliberately narrowed -- those rows are untouched. 2. src/central/gui/routes.py: _DEFAULT_MONITOR["north"] 44.5 -> 49.0 for the Python-level fallback when no system row exists. 3. tests/test_monitoring_area.py: new TestDefaultMonitoringAreaCoversIdaho class with 9 Idaho sentinel cities spread panhandle-to-south, west-to-east. Three tests: (a) every sentinel is in-bounds against the current default; (b) belt-and-suspenders corner-value assertions; (c) anti-regression test using the OLD v0.10.2 narrow bbox documenting that it would reject the panhandle. Phase 1 (immediate, no-PR): the production row was UPDATEd from 44.5 to 49.0 directly via psql before this PR. Drop counter verified to stop incrementing for itd_511 within one refresh cycle; first post-fix panhandle publish landed at seq 80741 (Coeur d'Alene closure at lat=47.7N) at 07:35:33 UTC. published_ids count went from 145 to 201 per poll, no longer dropping the 56-event panhandle batch. This PR ensures the new code's default is consistent with the live config row and that future fresh installs don't reintroduce the narrow bound. Existing IDAHO test fixtures (test_archive_bbox_filter, test_supervisor_ publish_filter, test_fire_fused, test_monitoring_area) still use the narrow 44.5 value; those are testing bbox behavior with arbitrary inputs not the production default, so leaving them alone keeps this PR focused on the production default fix. A separate cosmetic cleanup could update the IDAHO fixtures if desired. Full sweep: 1031 passed (+3 from this PR), ruff clean. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
81a2c30fdb
commit
6cbb9378d6
3 changed files with 89 additions and 1 deletions
|
|
@ -0,0 +1,23 @@
|
|||
-- Migration 034: widen monitoring-area default to cover all of Idaho (v0.10.9)
|
||||
--
|
||||
-- v0.10.2's migration 030 set monitor_north=44.5 as the default. Idaho actually
|
||||
-- extends to 49.0N (Canadian border), so the original default cut off the entire
|
||||
-- panhandle -- Coeur d'Alene, Lewiston, Sandpoint, Moscow, and the McCall region.
|
||||
-- Tonight's investigation (v0.10.9 ticket) caught the impact at scale: the
|
||||
-- supervisor's publish-time bbox filter was dropping ~56 itd_511 events per
|
||||
-- 60-second poll (~5,376/day), the entire northern half of Idaho's roadwork,
|
||||
-- closures, and incidents. The NWS adapter was also losing Idaho UGC zone
|
||||
-- alerts north of 44.5 for the same reason (v0.10.7 followup-ticket (b)).
|
||||
--
|
||||
-- This migration does two things:
|
||||
-- 1. ALTER COLUMN ... SET DEFAULT 49.0 -- so fresh installs get the full
|
||||
-- Idaho extent baked in.
|
||||
-- 2. UPDATE ... WHERE monitor_north = 44.5 -- so existing deployments still
|
||||
-- at the v0.10.2 dev value get bumped. The WHERE 44.5 guard preserves
|
||||
-- any operator who deliberately narrowed (e.g. set north=44.0 for a
|
||||
-- regional test) -- those rows are untouched.
|
||||
--
|
||||
-- Idempotent: running again is a no-op on both statements once row is at 49.0.
|
||||
|
||||
ALTER TABLE config.system ALTER COLUMN monitor_north SET DEFAULT 49.0;
|
||||
UPDATE config.system SET monitor_north = 49.0 WHERE monitor_north = 44.5;
|
||||
Loading…
Add table
Add a link
Reference in a new issue