meshai/work/tests
malice 2543dfa8d1
fix(config): warn on unknown config keys; delete 7 phantom keys from the example (#146)
* fix(config): warn on unknown config keys instead of silently dropping them

_dict_to_dataclass() silently continue'd past any key not in the target
dataclass's field set -- an operator could set a config key, restart, and
have it vanish with zero feedback (config.example.yaml's phantom
mesh_intelligence keys are exactly this bug, fixed separately).

Now logs a WARNING naming the key and the dataclass, hinting at a typo or
a renamed/removed field, via the module's existing _config_logger.

Traced every dynamic/free-form config path to rule out false positives:
notifications.toggles, notifications.destinations, generic_sources,
mesh_sources, and notifications.rules all route through explicit
dict-of-dataclass or verbatim-passthrough handling and never spuriously
warn. Two legitimate legacy shapes DO hit the strict field-check path with
keys that were never (and will never be) dataclass fields:

- notifications.channels (pre-v0.5 channel list), consumed directly from
  the raw dict by _migrate_legacy_channels
- notifications.region_routes.enabled (pre mt/mc-split master switch),
  read directly by the explicit region_routes handler

Both are allowlisted in _KNOWN_LEGACY_DROP_KEYS so users mid-migration
don't get spurious noise on every load.

Added tests/test_config_loader.py coverage: unknown key warns and does
not raise, both legacy shapes stay silent, and the free-form/dynamic
sections never warn for keys valid on their real target shape.

* fix(config): remove phantom config.example.yaml keys, add missing live ones

The new unknown-key warning (previous commit) caught config.example.yaml
loading with SEVEN warnings, all real drift -- none were false positives
of the warning itself:

mesh_intelligence block shipped three keys with no MeshIntelligenceConfig
field and no implementation anywhere (git log -S confirms they were never
built, not leftovers from a removal):
  - region_radius_miles, infra_overrides, region_labels
These only made sense under an older auto-clustering design; what
actually exists is explicit region anchors (regions: list[RegionAnchor]).
Deleted from both the live block and the commented-out example above it,
and added the four fields that DO exist and are live but were missing
from the example: regions, critical_nodes, alert_channel, alert_rules.

Also fixed the now-misleading comment at
dashboard/api/mesh_routes.py:281, which referenced region_labels --
comment only, no code change.

notifications block shipped a whole quiet-hours subsystem that was
deliberately ripped out (commit b948ed77, "silent is better than ugly")
and never implemented as override_quiet -- confirmed by zero readers and
zero dataclass fields anywhere in meshai/:
  - quiet_hours_enabled, quiet_hours_start, quiet_hours_end
  - override_quiet (on 4 rule entries, including "Emergency Broadcast",
    which falsely implied emergency alerts bypass quiet hours)
Deleted; no quiet-hours feature implemented (out of scope -- product
decision for the owner).

config.example.yaml now loads with exactly zero warnings: the loader and
the example finally agree.

---------

Co-authored-by: Matt Johnson <mj@k7zvx.com>
2026-07-17 14:07:23 -06:00
..
fixtures chore: remove dead modules and orphaned fixtures (-2,952 LOC) (#142) 2026-07-17 14:06:08 -06:00
harness refactor(phase0): source-agnostic formatter/gating scaffold + harness (inert) (#28) 2026-07-04 12:55:48 -06:00
conftest.py refactor(phase0): source-agnostic formatter/gating scaffold + harness (inert) (#28) 2026-07-04 12:55:48 -06:00
test_activity_log_api.py fix(dashboard): Activity Log shows the full broadcast log (all categories, both meshes) (#75) 2026-07-06 19:36:30 -06:00
test_adapter_avalanche.py chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -06:00
test_adapter_config_api.py chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -06:00
test_adapter_config_foundation.py chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -06:00
test_adapter_ducting.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_adapter_fires.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_adapter_firms.py fix: make TomTom + FIRMS API keys optional (keyless-capable) (#137) 2026-07-15 14:04:23 -06:00
test_adapter_ipaws.py feat(ipaws): add FEMA IPAWS-OPEN civil-alert adapter (disabled by default) (#138) 2026-07-16 09:05:01 -06:00
test_adapter_nws.py refactor(phase2): migrate nws + incident/roads to formatter+decider (tier-a) (#30) 2026-07-04 18:16:34 -06:00
test_adapter_roads511.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_adapter_swpc.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_adapter_traffic.py fix: make TomTom + FIRMS API keys optional (keyless-capable) (#137) 2026-07-15 14:04:23 -06:00
test_adapter_usgs.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_adapter_usgs_quake.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_adapter_wzdx.py feat(adapters): WZDx daily work-zone summary + FIRMS restart-safe cold-start (#108) 2026-07-09 19:13:17 -06:00
test_avalanche_refactor.py chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -06:00
test_band_conditions.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_bool_roundtrip.py fire: remove fire digest feature and drop out-of-coverage fires at ingest (#107) 2026-07-09 13:46:12 -06:00
test_budget_shim.py refactor(phase0): source-agnostic formatter/gating scaffold + harness (inert) (#28) 2026-07-04 12:55:48 -06:00
test_capture_script_importable.py refactor(phase0): source-agnostic formatter/gating scaffold + harness (inert) (#28) 2026-07-04 12:55:48 -06:00
test_central_normalizer.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_channel_rendering.py feat(transport): per-radio serialized+paced outbound send queue (#93) 2026-07-08 09:38:08 -06:00
test_clock_seam.py chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -06:00
test_cold_start_grace.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_composite_transport.py feat(transport): per-radio serialized+paced outbound send queue (#93) 2026-07-08 09:38:08 -06:00
test_config_loader.py fix(config): warn on unknown config keys; delete 7 phantom keys from the example (#146) 2026-07-17 14:07:23 -06:00
test_config_partial_save_merge.py fix(config): merge partial PUT bodies instead of resetting to defaults (#155) 2026-07-17 01:28:41 -06:00
test_config_source_field.py chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -06:00
test_configurable_feed_urls.py fix: make all native feed URLs config-driven (no hardcoded upstreams) (#136) 2026-07-15 11:34:27 -06:00
test_context_hot_reload.py feat(context): GUI control for chat-context retention (days) + live apply (#20) 2026-07-03 19:03:37 -06:00
test_coverage.py fix(coverage): round derived coords to 6dp; skip roadless traffic cells (#66) 2026-07-06 11:15:56 -06:00
test_coverage_area.py fix(coverage): NWS carries its alert polygon; gate fails closed for weather (#70) 2026-07-06 12:42:27 -06:00
test_coverage_overrides.py feat(coverage): per-adapter override — exclude adapters from the coverage bbox (#64) 2026-07-06 10:11:33 -06:00
test_coverage_r3.py feat(coverage): widen adapter fetch scope to the enclosing box of coverage areas (#71) 2026-07-06 12:51:54 -06:00
test_coverage_wiring.py feat(coverage): wire quake/roads511/wzdx/avalanche to the coverage bbox (#60) 2026-07-06 08:36:25 -06:00
test_coverage_wiring_2b.py feat(coverage): wire fires/firms/ducting to the coverage bbox (#61) 2026-07-06 08:42:43 -06:00
test_coverage_wiring_2c.py fix(coverage): NWS carries its alert polygon; gate fails closed for weather (#70) 2026-07-06 12:42:27 -06:00
test_coverage_wiring_2d.py feat(coverage): wire hydro + satpass to the coverage bbox (native adapters complete) (#63) 2026-07-06 10:07:23 -06:00
test_curation.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_cutover_gate.py refactor(phase1): quake + swpc(Kp+flare) + avalanche, behind staged-cutover gate (#29) 2026-07-04 15:58:46 -06:00
test_danger_zone_correlator.py feat(transport): per-radio serialized+paced outbound send queue (#93) 2026-07-08 09:38:08 -06:00
test_dashboard_config_save.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_destinations_c1.py feat(notifications): reusable delivery destinations (additive, inline fallback) (#83) 2026-07-07 01:51:41 -06:00
test_dispatcher_persistence.py feat(dashboard): bring ipaws adapter + emergency family to full GUI parity (#158) 2026-07-17 11:36:13 -06:00
test_dynamic_family_registry.py feat(notifications): dynamic category/family registry (generic sources routable) (#80) 2026-07-07 01:16:56 -06:00
test_env_hot_reload.py feat: hot-reload the environmental config section (no restart) (#135) 2026-07-15 01:21:12 -06:00
test_env_reporter.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_env_reporter_fire_recency.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_env_reporter_llm_gaps.py feat(persistence): make satpass/avalanche/ducting LLM-queryable (#74) 2026-07-06 16:24:26 -06:00
test_fire_age_gate.py feat(danger-zones): configurable infra-node hazard correlation + fire age-gate 2026-06-21 06:33:54 +00:00
test_fire_native_growth.py fire: remove fire digest feature and drop out-of-coverage fires at ingest (#107) 2026-07-09 13:46:12 -06:00
test_fire_point_fusion.py feat(fires): fuse WFIGS incident-point layer with perimeter layer so non-perimeter fires surface (dedup by IrwinID, cold-start silent-seed) (#98) 2026-07-08 15:58:48 -06:00
test_fire_refactor.py refactor(phase3c): migrate FIRMS fusion broadcasts to formatter+decider (#34) 2026-07-04 23:18:51 -06:00
test_fire_reminder_pacing.py fix(reminders): pace the reminder roll-call so N fires don't burst (#130) 2026-07-14 10:38:07 -06:00
test_fire_reminder_region_routing.py feat(reminders): route fire reminders through per-region fire routing (#106) 2026-07-09 12:06:45 -06:00
test_fire_tracker_phase1.py fix(firms): repair the FIRMS fire-fusion Event contract (issues #117-#119) (#120) 2026-07-11 17:41:40 -06:00
test_fire_tracker_phase2.py fix(firms): repair the FIRMS fire-fusion Event contract (issues #117-#119) (#120) 2026-07-11 17:41:40 -06:00
test_fire_tracker_phase3.py fix(firms): repair the FIRMS fire-fusion Event contract (issues #117-#119) (#120) 2026-07-11 17:41:40 -06:00
test_fire_tracker_phase4.py fix(persistence): derive SCHEMA_VERSION from migrations; unbreak the red suite (#140) 2026-07-17 13:03:40 -06:00
test_firms_cluster_f3.py fix(firms): repair the FIRMS fire-fusion Event contract (issues #117-#119) (#120) 2026-07-11 17:41:40 -06:00
test_firms_fusion_event_contract.py chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -06:00
test_firms_handler.py chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -06:00
test_firms_native_fusion.py fix(firms): repair the FIRMS fire-fusion Event contract (issues #117-#119) (#120) 2026-07-11 17:41:40 -06:00
test_firms_refactor.py chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -06:00
test_fix_meshcore_save_and_llm_test.py fix(meshcore): deliver DM replies (flood/ACK), save meshcore_context, test-llm, inbound logging (#21) 2026-07-03 19:54:16 -06:00
test_formatter_scaffold.py refactor(phase3b): migrate WFIGS fire to formatter+decider (tier-a) (#33) 2026-07-04 22:51:26 -06:00
test_formatters_no_clock.py refactor(phase0): source-agnostic formatter/gating scaffold + harness (inert) (#28) 2026-07-04 12:55:48 -06:00
test_generic_http.py fix(generic): browser UA default + per-source custom headers + 403 retry (#85) 2026-07-07 02:24:27 -06:00
test_harness_selftest.py refactor(phase0): source-agnostic formatter/gating scaffold + harness (inert) (#28) 2026-07-04 12:55:48 -06:00
test_hydro_refactor.py chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -06:00
test_import_smoke.py refactor(phase0): source-agnostic formatter/gating scaffold + harness (inert) (#28) 2026-07-04 12:55:48 -06:00
test_incident_refactor.py chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -06:00
test_incident_workzone_suppression.py feat(adapters): WZDx daily work-zone summary + FIRMS restart-safe cold-start (#108) 2026-07-09 19:13:17 -06:00
test_include_roundtrip.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_ipaws_county_only_routing.py fix(ipaws): route county-only CAP alerts + auto-refresh toggles live (#159) 2026-07-17 12:08:29 -06:00
test_itd_511_work_zone.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_llm_reply_cap.py feat(reply): cap interactive LLM replies to 3 mesh packets (#7) 2026-07-02 16:49:10 -06:00
test_llm_scoping.py feat(meshcore): decouple per-mesh LLM DM gate + mesh-scoped chat context (#19) 2026-07-03 18:39:26 -06:00
test_mesh_health_recommendations_api.py feat(dashboard): serve real recommendations in Nodes & Health; give mesh_intelligence one home (#148) 2026-07-17 14:06:15 -06:00
test_mesh_reporter_recommendations.py feat(dashboard): serve real recommendations in Nodes & Health; give mesh_intelligence one home (#148) 2026-07-17 14:06:15 -06:00
test_mesh_send_api.py fix(config): merge partial PUT bodies instead of resetting to defaults (#155) 2026-07-17 01:28:41 -06:00
test_meshcore_conn_type.py feat(meshcore): opt-in telemetry auto-poll on selected contacts (#92) 2026-07-08 00:54:59 -06:00
test_meshcore_context_config.py Phase A — 4-section nav; move Scheduled Broadcasts + Danger Zones off Routing (#15) 2026-07-03 14:57:24 -06:00
test_meshcore_context_filter.py feat(meshcore): decouple per-mesh LLM DM gate + mesh-scoped chat context (#19) 2026-07-03 18:39:26 -06:00
test_meshcore_dm_delivery.py feat(meshcore): opt-in telemetry auto-poll on selected contacts (#92) 2026-07-08 00:54:59 -06:00
test_meshcore_rooms.py feat(meshcore): route MeshCore cells to room servers (open rooms) (#110) 2026-07-09 22:14:42 -06:00
test_meshcore_roster.py feat(meshcore): report the true connection + add roster/channel management (#153) 2026-07-16 22:24:49 -06:00
test_meshcore_telemetry.py feat(transport): per-radio serialized+paced outbound send queue (#93) 2026-07-08 09:38:08 -06:00
test_meshcore_transport.py fix(meshcore): ACK-confirmed DM fast path (~2s), discover only on no-ACK (#77) 2026-07-06 21:41:47 -06:00
test_native_fire_pacer.py fix(fires): wire FirePacer into the native fire broadcast path (#123) 2026-07-11 21:46:13 -06:00
test_native_hydro_gauge_alerts.py fix(hydro): restore USGS stream-gauge flood alerts (silently dead since the all-native flip) (#156) 2026-07-17 14:07:04 -06:00
test_native_severity_promotion_and_floor.py fix(region-routing): independent mt/mc region-routing enable switches (#102) 2026-07-08 23:58:09 -06:00
test_no_duplicate_methods.py fix(meshcore): un-shadow _resolve_contact; restore PR #56 refetch-on-miss (#127) (#133) 2026-07-14 10:37:26 -06:00
test_notification_toggles.py feat(transport): per-radio serialized+paced outbound send queue (#93) 2026-07-08 09:38:08 -06:00
test_nws_refactor.py chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -06:00
test_nws_zones.py feat(nws): resolve zone-only alerts to geometry via affectedZones (cached) so in-coverage zone alerts are placed + region-tagged instead of dropped (#91) 2026-07-07 22:23:19 -06:00
test_observer_locations.py fix(persistence): derive SCHEMA_VERSION from migrations; unbreak the red suite (#140) 2026-07-17 13:03:40 -06:00
test_or_arch_continuous.py feat: hot-reload the environmental config section (no restart) (#135) 2026-07-15 01:21:12 -06:00
test_persistence.py fix(persistence): derive SCHEMA_VERSION from migrations; unbreak the red suite (#140) 2026-07-17 13:03:40 -06:00
test_pipeline_digest.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_pipeline_grouper.py fix(pipeline): let wildfire_spotting skip the grouper (category-scoped) (#131) 2026-07-14 10:37:07 -06:00
test_pipeline_inhibitor_grouper.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_pipeline_persistence.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_pipeline_scheduler.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_pipeline_skeleton.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_pipeline_toggle_filter.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_quake_refactor.py chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -06:00
test_region_routing_dispatcher.py fix(dispatcher): qualify region-cooldown key by channel type (#115) 2026-07-11 09:22:54 -06:00
test_reminders.py feat(reminders): route fire reminders through per-region fire routing (#106) 2026-07-09 12:06:45 -06:00
test_renderers.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_router_env_scope.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_satpass_broadcast_safety.py fix(satpass): clean broadcast format (short names, degrees, compass, friendly observers) (#76) 2026-07-06 20:44:02 -06:00
test_satpass_command.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_satpass_compass_fallback.py fix(satpass): clean broadcast format (short names, degrees, compass, friendly observers) (#76) 2026-07-06 20:44:02 -06:00
test_satpass_event_path.py chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -06:00
test_satpass_handler.py fix(satpass): clean broadcast format (short names, degrees, compass, friendly observers) (#76) 2026-07-06 20:44:02 -06:00
test_satpass_native.py fix(satpass): clean broadcast format (short names, degrees, compass, friendly observers) (#76) 2026-07-06 20:44:02 -06:00
test_satpass_persisted_timer.py chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -06:00
test_satpass_region_tagging.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
test_satpass_registration.py chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -06:00
test_satpass_wire_fields.py chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -06:00
test_save_section_secret_preserve.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_secrets_store.py feat(secrets): GUI-managed .env secrets store — keys are config, but gitignored (#47) 2026-07-05 17:57:45 -06:00
test_send_queue.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
test_serial_ports.py fix(serial): detect passed-through /dev USB-serial nodes (container GUI detect) (#53) 2026-07-05 23:01:08 -06:00
test_shadow_inert.py refactor(phase3b): migrate WFIGS fire to formatter+decider (tier-a) (#33) 2026-07-04 22:51:26 -06:00
test_store_received_delta.py fix(wzdx): persist current work zones to traffic_events via dedicated ingest (#109) 2026-07-09 20:08:13 -06:00
test_store_wzdx_persist.py fix(wzdx): persist current work zones to traffic_events via dedicated ingest (#109) 2026-07-09 20:08:13 -06:00
test_swpc_refactor.py chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -06:00
test_tail_followups.py feat(dashboard): make the gauge-sites bulk import reachable (#149) 2026-07-17 14:07:09 -06:00
test_tle_fetch.py fix(persistence): derive SCHEMA_VERSION from migrations; unbreak the red suite (#140) 2026-07-17 13:03:40 -06:00
test_tombstone_broadcast.py test: fix 13 stale tests in the red suite, leave 6 real-bug failures (#124) (#129) 2026-07-14 10:36:19 -06:00
test_transport_abstraction.py refactor(transport): derive active transports from config, drop transport setting (#13) 2026-07-03 00:18:53 -06:00
test_uniform_sizing.py refactor(transport): derive active transports from config, drop transport setting (#13) 2026-07-03 00:18:53 -06:00
test_v052_dispatcher.py test: fix 13 stale tests in the red suite, leave 6 real-bug failures (#124) (#129) 2026-07-14 10:36:19 -06:00
test_v064_guard_commit.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_weather_v057.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_wfigs_handler.py fire: remove fire digest feature and drop out-of-coverage fires at ingest (#107) 2026-07-09 13:46:12 -06:00
test_work_zone_renderer.py refactor: move source tree into work/, multi-stage Docker build, fix satpass 2026-06-16 03:40:31 +00:00
test_wzdx_coalescing.py feat(adapters): WZDx daily work-zone summary + FIRMS restart-safe cold-start (#108) 2026-07-09 19:13:17 -06:00
test_wzdx_summary_region_routing.py feat(adapters): WZDx daily work-zone summary + FIRMS restart-safe cold-start (#108) 2026-07-09 19:13:17 -06:00