towerops/lib
Graham McIntire 2b50fc0732 fix agent check cascade and at-risk subscriber double-counting (#79)
## Summary

- **`list_checks_for_agent` cascade**: the agent query only matched checks with `agent_token_id` set directly on the check record — checks on devices inheriting their agent via site/org/global default were never sent to the Go agent. Now uses left joins with the full cascade (device assignment → site → org default → global default cloud poller), matching the pattern from `list_agent_polling_targets`.
- **At-risk summary double-counting**: `get_impact_summary` called `analyze_device_impact` per down AP, and each returned the full site subscriber count. With 3 APs down at a 147-sub site it showed 441 subs / $31k instead of 147 / $10k. Fixed by deduplicating impact per site. Same fix applied to `calculate_down_impact` in site impact summaries.

## Test plan

- [x] 3 new cascade tests for `list_checks_for_agent` (site, org default, global default)
- [x] 3 new tests for `get_impact_summary` (single site dedup, multi-site sum, zero case)
- [x] All 8,607 existing tests pass
- [ ] Deploy to staging, verify At Risk numbers on dashboard
- [ ] Verify Go agent receives DNS/HTTP checks via cascade

Reviewed-on: graham/towerops-web#79
2026-03-18 20:17:39 -05:00
..
mix/tasks Add GeoIP import HTTP tests 2026-03-10 16:02:49 -05:00
snmpkit chore: remove sobelow dependency 2026-03-12 16:03:08 -05:00
towerops fix agent check cascade and at-risk subscriber double-counting (#79) 2026-03-18 20:17:39 -05:00
towerops_web show decimal precision and units on graph y-axis (#76) 2026-03-18 15:49:20 -05:00
snmp_lib.ex bring in snmpkit 2026-01-23 12:52:17 -06:00
snmp_mgr.ex credo fixes 2026-01-23 14:01:52 -06:00
snmpkit.ex complete overhaul of snmp engine 2026-01-30 10:41:07 -06:00
towerops.ex init 2025-12-21 11:10:43 -06:00
towerops_native.ex Merge remote-tracking branch 'origin/main' into feature/preseem-integration 2026-02-13 09:11:45 -06:00
towerops_web.ex i18n: wrap all user-facing strings in gettext() 2026-02-14 17:44:01 -06:00