meshai/work/tests
malice d7913fddaa
feat(dashboard): serve real recommendations in Nodes & Health; give mesh_intelligence one home (#148)
* refactor(mesh_reporter): expose recommendations as list[str]

Add recommendations_list(scope, scope_value) as the canonical source of
recommendation text. build_recommendations() now just joins that list with
the historical "OPTIMIZATION RECOMMENDATIONS:" header/bullet format it
always used.

router.py:1145 injects build_recommendations()'s output into the LLM system
prompt on the live mesh-DM path — verified byte-identical before/after
across mesh/region/node/missing/empty scopes via a synthetic fixture, and
pinned with a literal-string regression test so a future refactor can't
silently change that prompt text.

This unblocks wiring recommendations into the dashboard, which previously
only reached mesh DMs.

* feat(dashboard): serve real recommendations from /api/health

mesh_reporter was never on app.state — add it alongside health_engine etc.
in server.py's existing pattern. mesh_routes.py's health endpoint now
returns mesh_reporter.recommendations_list("mesh") instead of a hardcoded
[] TODO stub.

Add recommendations_available: bool alongside recommendations: string[] so
"the engine ran and found nothing" (healthy mesh) is never indistinguishable
from "the engine couldn't run" (unwired reporter, or an exception — logged
via logger.exception and swallowed so the rest of the health response still
serves). A crashed recommendations engine must not read as "mesh is
healthy" to an operator.

Also delete main.py's phantom `getattr(mh, "recommendations", [])` on the
websocket health_update push: nothing ever set .recommendations on the
mesh_health object (always []), and no frontend consumer reads it — the
REST endpoint above is the supported path.

* feat(dashboard-frontend): render recommendations in Nodes & Health

Meshtastic → Nodes & Health → Health tab used to be a duplicate
mesh_intelligence config editor (the same MeshIntelligenceSection also
edited from Settings → Intelligence, a stale-tab-overwrite hazard). Replace
it with a real operational view: fetch /api/health and render its
recommendations list.

Three states, matching visual conventions from Dashboard.tsx's alerts list
and MeshCoreRouting.tsx's cross-link note:
- recommendations present → Lightbulb list, one card per item
- empty + recommendations_available → "No recommendations — mesh is
  healthy" (CheckCircle)
- recommendations_available === false → amber warning, not the healthy
  state (AlertTriangle) — a crashed backend must not look healthy

mesh_intelligence config now has exactly one home: Settings. The Health tab
points there via the existing /config?section= deep-link pattern instead of
duplicating the editor. Config.tsx itself is untouched.

MeshHealth.recommendations/.recommendations_available are optional in the
type: the websocket health_update push doesn't include them (REST-only).

---------

Co-authored-by: Matt Johnson <mj@k7zvx.com>
2026-07-17 14:06:15 -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 feat(dashboard): MeshCore transport + per-family routing GUI controls (#10) 2026-07-02 16:49:59 -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_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 chore: excise the dead Central NATS consumer path (-11,328 LOC) (#144) 2026-07-17 14:03:40 -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