towerops/test/towerops_web
Graham McIntire 4804dfea5b feat(insights): UpstreamDegradation multi-AP correlation rule
When 50%+ of the access points at one site simultaneously have
Preseem QoE score <60, root cause is almost always a shared upstream
problem (backhaul, transit, DNS, DHCP) — not per-AP RF. This rule
emits one site-level insight that points the operator at the right
investigation layer instead of letting them chase per-AP RF
symptoms across many APs at the same site.

- Towerops.Recommendations.Rules.UpstreamDegradation — single query
  pulls all matched Preseem APs grouped by site_id. Critical when
  100% of APs at the site are degraded; warning otherwise. Lists
  every degraded AP with its QoE score in metadata.
- Insight.@valid_types extended with upstream_degradation.
- LLM prompt hint tells the model to instruct the operator to
  investigate upstream FIRST and to NOT chase per-AP RF symptoms.
- UI: indigo card with degraded/total AP counts, an "Investigate
  upstream first" badge, and a clickable list of affected APs.
- Wired into RecommendationsRunWorker FIRST in the @rules list so
  the upstream signal surfaces before per-AP RF rules.

Also fixes two flakes:
- device_live/show_test.exs is now async: false. It inserts to
  InterfaceStat which is a TimescaleDB hypertable; concurrent inserts
  deadlock on chunk-table locks under parallel SQL-sandbox tests
  (ERROR 40P01 deadlock_detected in setup).
- Cleared an unused-variable warning in device_overheating_test.exs.

8 new tests for UpstreamDegradation.
2026-05-09 17:51:41 -05:00
..
channels update 2026-05-09 15:24:00 -05:00
components test: lift coverage from 85.84% → 86.28% 2026-05-08 17:44:18 -05:00
controllers update 2026-05-09 15:24:00 -05:00
endpoint test: add LiveView tests following testing-liveview patterns 2026-05-07 12:55:39 -05:00
graphql test: GraphQL.Resolvers.Schedule and Device coverage 2026-05-09 14:16:21 -05:00
helpers test: lift coverage from 85.84% → 86.28% 2026-05-08 17:44:18 -05:00
integration Merge remote-tracking branch 'origin/main' into feature/preseem-integration 2026-02-13 09:11:45 -06:00
live feat(insights): UpstreamDegradation multi-AP correlation rule 2026-05-09 17:51:41 -05:00
plugs test(agent_channel): cover assignment-disabled, missing-check, wrong-org branches 2026-05-09 13:38:35 -05:00
changelog_parser_test.exs remove-gleam (#218) 2026-03-29 11:03:20 -05:00
graphql_socket_test.exs add mobile token auth to GraphQL endpoint (#48) 2026-03-16 15:23:07 -05:00
permissions_test.exs fix snmp v3 test 2026-02-06 10:21:54 -06:00
plug_exceptions_test.exs handle exceptions gracefully on api endpoints 2026-02-04 12:18:14 -06:00
remote_ip_test.exs dialyzer: replace suppressions with real fixes where possible 2026-04-21 11:01:30 -05:00
telemetry_filter_test.exs Add GeoIP import HTTP tests 2026-03-10 16:02:49 -05:00
telemetry_test.exs feat(llm): per-insight-type prompt hints + flake fixes 2026-05-09 17:36:07 -05:00
user_auth_test.exs perf(tests): remove/reduce Process.sleep calls for faster tests 2026-03-06 07:57:30 -06:00