fix(satpass): default feed_source to native; correct misleading config comments (#139)

Central is retired -- its NATS broker (nats://central.echo6.mesh:4222) no
longer exists -- but SatpassConfig.feed_source still defaulted to "central",
overriding the _SourcedFeed mixin default of "native". A fresh install that
enabled satpass got a silently dead adapter. The dashboard reinforced it:
Environment.tsx seeded feed_source 'central' and labelled the adapter
"via Central".

Also corrects comments that documented the opposite of the code: the
adapter_config keys usgs_quake.global_mag_floor / regional_mag_floor were
labelled "CENTRAL-PATH ONLY", but notifications/gating/quake.py reads them
unconditionally in the native path. Following those comments would have led
someone to delete live config keys.

- config.py: SatpassConfig.feed_source "central" -> "native" + docstring
- adapter_config/defaults.py: correct the two "CENTRAL-PATH ONLY" comments
- Environment.tsx: seed 'native'; reword the satpass subtitle
- tests: assert the native default; pin central explicitly where a test
  exercises the central path or the feed_source flip

Suite: 2337 passed, 6 pre-existing failures (stale SCHEMA_VERSION x3,
expired TLE fixtures x2, one order-dependent), no new failures.

Co-authored-by: Matt Johnson <mj@k7zvx.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
malice 2026-07-17 14:09:24 -06:00 committed by GitHub
commit e9daabfbff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 26 additions and 21 deletions

View file

@ -114,9 +114,12 @@ def test_feed_source_flip_to_central_requires_restart_and_does_not_swap():
def test_feed_source_flip_from_central_to_native_requires_restart():
# satpass defaults feed_source="central"; flip it to native.
store = EnvironmentalStore(_cfg())
assert "satpass" not in store._adapters # central by default -> no native instance
# satpass now defaults to feed_source="native", so pin the starting state
# to "central" explicitly -- this exercises the flip, not the default.
base_cfg = _cfg()
base_cfg.satpass = dataclasses.replace(base_cfg.satpass, feed_source="central")
store = EnvironmentalStore(base_cfg)
assert "satpass" not in store._adapters # central -> no native instance
new_cfg = _cfg()
new_cfg.satpass = dataclasses.replace(

View file

@ -1,7 +1,7 @@
"""Tests for satpass adapter registration on EnvironmentalConfig.
Verifies:
- SatpassConfig exists and defaults to feed_source="central"
- SatpassConfig exists and defaults to feed_source="native"
- EnvironmentalConfig.satpass field is present and correctly typed
- _subject_owned() includes central.sat.* subjects when satpass is registered
- adapter_config REGISTRY contains satpass keys with valid types
@ -15,7 +15,7 @@ import pytest
def test_satpass_config_exists():
from meshai.config import SatpassConfig
cfg = SatpassConfig()
assert cfg.feed_source == "central"
assert cfg.feed_source == "native"
assert cfg.enabled is False
@ -37,10 +37,10 @@ def test_environmental_config_has_satpass():
assert isinstance(env.satpass, SatpassConfig)
def test_environmental_satpass_default_central():
def test_environmental_satpass_default_native():
from meshai.config import EnvironmentalConfig
env = EnvironmentalConfig()
assert env.satpass.feed_source == "central"
assert env.satpass.feed_source == "native"
# -- adapter_config REGISTRY --------------------------------------------------
@ -87,10 +87,10 @@ def test_yaml_parsing_satpass():
from meshai.config import SatpassConfig, _dict_to_dataclass, EnvironmentalConfig
import yaml
yaml_str = "environmental:\n satpass:\n enabled: true\n feed_source: central\n"
yaml_str = "environmental:\n satpass:\n enabled: true\n feed_source: native\n"
data = yaml.safe_load(yaml_str)
env = _dict_to_dataclass(EnvironmentalConfig, data["environmental"])
assert isinstance(env.satpass, SatpassConfig)
assert env.satpass.enabled is True
assert env.satpass.feed_source == "central"
assert env.satpass.feed_source == "native"