meshai/tests
Matt Johnson 7502663f21 fix(tracking): v0.5.7-tracking -- Central tracking check + categories audit
EIGHTH and FINAL family of the v0.5.7 NATS-and-categories campaign. Smallest scope of the entire campaign: zero source code changes, regression-tests only. The tracking family is a Phase 7 PLACEHOLDER -- everywhere we looked it is intentionally empty.

FIX 1 -- Central tracking adapter check: VERIFIED ABSENT in Central v0.10.0. Searched the consumer integration guide (docs/CONSUMER-INTEGRATION.md at v0.10.0-itd-511): 22 per-adapter sections in §6, none tracking-related (no APRS / ADS-B / OpenSky / aircraft / satellite). Subject prefixes in use: central.{disaster,fire,fires,hydro,meta,models,quake,space,traffic,traffic_cameras,traffic_flow,wx}.> -- no central.tracking.* / central.aprs.* / central.adsb.*. Producer source tree src/central/adapters/ has 24 adapter files; none tracking-named.

meshai already accounts for this -- _SUBJECTS_BARE has no `tracking` / `aprs` / `adsb` key; CENTRAL_ADAPTER_TO_SOURCE has no tracking entries on either side; _subjects_for("tracking", *) returns [] for any region (no key in the table). No code change needed.

FIX 2 -- ALERT_CATEGORIES tracking-family audit: VERIFIED EMPTY-BY-DESIGN. The tracking family is documented at meshai/notifications/categories.py:19 as "tracking - ADS-B, AIS, satellite passes (Phase 7)" -- a reserved-but-unimplemented family. State as of v0.5.7-tracking:

  - "tracking" in VALID_TOGGLES (the toggle name is reserved)
  - ZERO ALERT_CATEGORIES entries with toggle="tracking"
  - ZERO native adapter files in meshai/env/ (no aprs.py, adsb.py, etc.)
  - ZERO entries in _TOGGLE_PREFIX_FALLBACK routing to "tracking"
  - dashboard-frontend/src/pages/Environment.tsx FAMILIES list has the
    placeholder { key: "tracking", label: "Tracking", icon: Satellite,
    adapters: [] } -- empty adapter list

No native emissions to audit against. Every emitted = selectable is trivially satisfied: zero emissions, zero registry entries, zero gap. No code change needed.

Regression guards (the whole commit)
------------------------------------
The risk this commit guards against is: a future Phase 7 implementer adds an APRS or ADS-B adapter (or wires a tracking Central subject) without doing the family-audit shape (registry entries with required fields, composer emoji/labels, paired test refresh). That would create orphan emissions -- the exact failure mode v0.5.7 spent eight phases eliminating across the other families.

tests/test_tracking_v057.py pins ALL of the above placeholder invariants as regression guards:

  - No Central tracking-style subject prefixes anywhere in _SUBJECTS_BARE
    (sweeps every adapter sub for "tracking" / "aprs" / "adsb" / "opensky").
  - No tracking-style entries in CENTRAL_ADAPTER_TO_SOURCE on either side.
  - _subjects_for("tracking" / "aprs" / "adsb", *) returns [] for every region.
  - "tracking" reserved in VALID_TOGGLES.
  - Zero ALERT_CATEGORIES entries with toggle="tracking".
  - Zero env adapter files matching tracking-related needles.
  - Environment.tsx FAMILIES tracking entry has adapters=[] (regex-pinned).
  - No _TOGGLE_PREFIX_FALLBACK rule silently routes to tracking.

Each failure message points the future implementer at the paired changes required -- new registry entries, new composer glyphs, new env adapter file, paired test update. Phase 7 cannot ship partial.

Same outcome shape as v0.5.7-avalanche (Central has no counterpart; meshai handles it correctly already; regression-test-only commit).

Tests
-----
PYTHONPATH=. pytest -q: 450 passed (was 442; +8 net).
  - tests/test_tracking_v057.py (new): eight regression guards covering Central absence, meshai-side placeholder state, frontend placeholder, and the no-silent-routing safety.

Campaign-wide test count progression across the eight v0.5.7 families:
  v0.5.7-weather   345  (baseline 328 + 17)
  v0.5.7-traffic   366  (+21)
  v0.5.7-fire      380  (+14)
  v0.5.7-seismic   400  (+20)
  v0.5.7-water     413  (+13)
  v0.5.7-rf        431  (+18)
  v0.5.7-avalanche 442  (+11)
  v0.5.7-tracking  450  (+8)

Safe-mode preserved (master off, all family toggles off, all adapters native, central disabled). No live toggle flipped. v0.5.7 tag deferred -- waiting on explicit instruction after Matt reviews the campaign-wide summary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-04 07:00:22 +00:00
..
test_adapter_avalanche.py feat(notifications): Phase 2.10 avalanche adapter pipeline integration 2026-05-27 23:08:24 +00:00
test_adapter_ducting.py feat(notifications): Phase 2.13 ducting adapter threshold-crossing emission (severity-tiered, Option C) 2026-05-28 00:01:40 +00:00
test_adapter_fires.py feat(notifications): Phase 2.11 NIFC fires adapter pipeline integration 2026-05-27 23:33:48 +00:00
test_adapter_firms.py fix(fire): v0.5.7-fire -- FIRMS NATS pattern + WFIGS tombstone dedup + remove fire_proximity + categories audit 2026-06-04 06:25:42 +00:00
test_adapter_nws.py feat(notifications): Phase 2.6 NWS adapter pipeline integration 2026-05-15 04:47:31 +00:00
test_adapter_roads511.py feat(notifications): Phase 2.8 roads511 adapter pipeline integration 2026-05-27 21:18:21 +00:00
test_adapter_swpc.py feat(notifications): Phase 2.12 SWPC space weather adapter + dedup fix 2026-05-27 23:41:30 +00:00
test_adapter_traffic.py feat(notifications): Phase 2.7 traffic adapter pipeline integration 2026-05-27 19:17:27 +00:00
test_adapter_usgs.py feat(notifications): Phase 2.9 usgs water adapter pipeline integration 2026-05-27 21:58:13 +00:00
test_adapter_usgs_quake.py feat(notifications): Phase 2.14 USGS earthquake adapter (new) -- closes Rule 16 Seismic standalone path 2026-05-28 00:10:39 +00:00
test_avalanche_v057.py fix(avalanche): v0.5.7-avalanche -- Central avalanche check + categories audit 2026-06-04 06:55:27 +00:00
test_central_consumer.py fix(traffic): v0.5.7-traffic -- NATS pattern fix + itd_511 sub-adapter routing + categories audit 2026-06-04 06:10:12 +00:00
test_central_region_routing.py fix(water): v0.5.7-water -- USGS NWIS hydro NATS pattern + categories audit 2026-06-04 06:42:06 +00:00
test_central_sub_adapter_routing.py feat(central): v0.5.4 -- region-aware subscriptions using Central v0.9.20 regional subjects 2026-06-04 02:30:33 +00:00
test_channel_rendering.py feat(notifications): Phase 2.5b per-channel-type renderers 2026-05-15 04:25:44 +00:00
test_config_loader.py fix(notifications): Phase 2.16.1 unblock pipeline -- grouper flush + rules coercion + toggle warning 2026-05-28 00:36:13 +00:00
test_config_source_field.py feat(central): v0.4 C.1 Central connector backend (no-op until adapter source flipped) 2026-05-28 02:28:19 +00:00
test_dashboard_config_save.py fix(dashboard): v0.4 C.2.1 -- route PUT /config to multi-file save_section (Rule 17 persistence unblocked) 2026-05-28 03:17:30 +00:00
test_fire_v057.py fix(fire): v0.5.7-fire -- FIRMS NATS pattern + WFIGS tombstone dedup + remove fire_proximity + categories audit 2026-06-04 06:25:42 +00:00
test_notification_toggles.py feat(notifications): v0.5.0 -- Master Toggles UX redesign + Central Connection GUI + grouped categories + region scoping 2026-05-28 07:00:10 +00:00
test_pipeline_digest.py fix(fire): v0.5.7-fire -- FIRMS NATS pattern + WFIGS tombstone dedup + remove fire_proximity + categories audit 2026-06-04 06:25:42 +00:00
test_pipeline_grouper.py fix(notifications): Phase 2.16.1 unblock pipeline -- grouper flush + rules coercion + toggle warning 2026-05-28 00:36:13 +00:00
test_pipeline_inhibitor_grouper.py fix(notifications): Phase 2.16.1 unblock pipeline -- grouper flush + rules coercion + toggle warning 2026-05-28 00:36:13 +00:00
test_pipeline_scheduler.py feat(notifications): Phase 2.5a channel interface unification 2026-05-15 03:45:27 +00:00
test_pipeline_skeleton.py chore(meshai): v0.5.5 -- cleanup bundle (gitignore env anchor, ducting health event_count, mesh_sources secret stripping, delete unused SeverityRouter) 2026-06-04 02:50:45 +00:00
test_pipeline_toggle_filter.py fix(fire): v0.5.7-fire -- FIRMS NATS pattern + WFIGS tombstone dedup + remove fire_proximity + categories audit 2026-06-04 06:25:42 +00:00
test_renderers.py feat(notifications): Phase 2.5b per-channel-type renderers 2026-05-15 04:25:44 +00:00
test_rf_v057.py fix(rf): v0.5.7-rf -- SWPC subject validation + protons severity=0 documentation + categories audit 2026-06-04 06:49:48 +00:00
test_save_section_secret_preserve.py chore(meshai): v0.5.5 -- cleanup bundle (gitignore env anchor, ducting health event_count, mesh_sources secret stripping, delete unused SeverityRouter) 2026-06-04 02:50:45 +00:00
test_seismic_v057.py fix(seismic): v0.5.7-seismic -- USGS quake NATS pattern + severity=5 great-quake clamp + categories audit 2026-06-04 06:33:31 +00:00
test_tracking_v057.py fix(tracking): v0.5.7-tracking -- Central tracking check + categories audit 2026-06-04 07:00:22 +00:00
test_traffic_v057.py fix(traffic): v0.5.7-traffic -- NATS pattern fix + itd_511 sub-adapter routing + categories audit 2026-06-04 06:10:12 +00:00
test_v052_dispatcher.py fix(fire): v0.5.7-fire -- FIRMS NATS pattern + WFIGS tombstone dedup + remove fire_proximity + categories audit 2026-06-04 06:25:42 +00:00
test_water_v057.py fix(water): v0.5.7-water -- USGS NWIS hydro NATS pattern + categories audit 2026-06-04 06:42:06 +00:00
test_weather_v057.py fix(weather): v0.5.7-weather -- NWS HTML strip + ALERT_CATEGORIES audit (NATS pattern already valid) 2026-06-04 06:00:10 +00:00