meshai/meshai
Matt Johnson (via Claude) 68dcbc74d0 feat(v0.6-3a.1): trim adapter_config registry to CONFIG-only per Matt config-vs-code rule + log-on-delete safety net for orphan cleanup
Drops 35 of the v0.6-3a-draft 77 keys + adds 1 net-new key
(firms.dedup_distance_m) for a final count of 43. The trim rules:

  CONFIG (lives in adapter_config, surfaces in the GUI):
    where we send (channels), how often (cadences/schedules),
    thresholds (magnitude floors, severity gates, distance radius,
    cooldown durations, freshness windows), curation data (which
    sites/states/codes), toggles (enabled, include_in_llm_context,
    drop_zero_magnitude).

  CODE (stays in handlers, never reaches the GUI):
    sentence templates, emoji choices, mapping/translation functions
    (TomTom icon_map, ITD sub_type_map, Central adapter_map and
    category_map), rendering logic (anchor priority order,
    expires-bucket formatting, threshold-state labels), heuristic
    logic (band_conditions Kp/SFI -> Good/Fair/Poor function).

Per-adapter outcome (kept | killed):
  wfigs              4 | 4   (cooldown_seconds, anchor_max_mi, two re-broadcast toggles)
  nws                3 | 4   (broadcast_severities, tombstone_msgtypes, warning_suffix_promotes)
  usgs_quake         6 | 3   (centroid, radius, PAGER list, 3 mag floors)
  swpc               3 | 7   (three storm-tier floors)
  usgs_nwis          2 | 4   (parameter_codes, broadcast_on_recede)
  incident           2 | 0   (freshness_seconds, broadcast_on_update)
  tomtom_incidents   2 | 1   (drop_zero_magnitude, drop_non_present)
  state_511_atis     1 | 0   (skipped_states)
  itd_511            0 | 3   (all sub_type maps/emoji/phrase = CODE)
  central            1 | 2   (severity_thresholds)
  dispatcher         4 | 0   (LRU cap, prune params, retention days)
  band_conditions    3 | 6   (SWPC freshness + HamQSL endpoint config)
  geocoder           6 | 1   (Photon endpoint + town-OSM curation + cache cap)
  firms              4 | 1*  (confidence_floor, frp_floor, bbox, dedup_distance_m)
  pipeline           2 | 0   (inhibitor TTL, grouper window)

  * firms: dedup_lat_lon_decimals is replaced by dedup_distance_m=5 per
    Matt s call (user-facing unit is meters, not decimal places; the
    handler will internally translate to quantization step in v0.6-3b).

adapter_meta stays at 15 rows -- itd_511 keeps its include_in_llm_context
toggle even with zero config keys.

Live-DB cleanup:
  meshai/adapter_config/__init__.py:prune_orphans(conn) DELETEs every
  adapter_config row whose (adapter, key) is no longer in REGISTRY. Each
  delete is INFO-logged with the prefix "adapter_config orphan removed:"
  so docker logs carry the paper trail. Called from init_db() after
  seed_defaults; idempotent (zero deletes on every subsequent boot).
  Cache is invalidated when any orphan is removed.

  adapter_meta is NOT pruned -- meta rows are cheap and useful even for
  adapters that ended up with zero config keys.

Tests (34 cases, replaces v0.6-3a 24-case set):
  - Registry count is 43; ADAPTER_META is 15
  - Seed lands every REGISTRY + ADAPTER_META row; idempotent; never
    overwrites user edits
  - prune_orphans removes a synthetic legacy row, logs at INFO with the
    exact prefix, leaves known keys untouched, leaves adapter_meta
    untouched, invalidates the accessor cache
  - Accessor returns correctly-typed values incl new
    firms.dedup_distance_m
  - Guard tests: no key in REGISTRY contains "emoji", ends with "_map",
    or contains "template" / "prefix" (catches CODE leaking back in)

Test count: 721 -> 731 (+10 net: +5 prune cases, +1 firms.dedup_distance_m,
+3 CODE-guard cases, +1 registry-count assertion).

Refs Matt s locked CONFIG-vs-CODE rule.
2026-06-05 18:09:49 +00:00
..
adapter_config feat(v0.6-3a.1): trim adapter_config registry to CONFIG-only per Matt config-vs-code rule + log-on-delete safety net for orphan cleanup 2026-06-05 18:09:49 +00:00
backends fix: Remove hard-coded token limits on LLM responses 2026-05-05 22:06:50 +00:00
central feat(v0.6-1): FIRMS handler -- storage-only, closes silent-drop on central.fire.hotspot.> 2026-06-05 15:50:33 +00:00
cli feat: Full alert engine — 17 conditions, scaling cooldown, per-condition TUI toggles 2026-05-06 05:39:11 +00:00
commands build: normalize all line endings to LF 2026-05-14 22:43:06 +00:00
dashboard feat(dashboard): v0.5.6 -- Advanced Rules editor polish (grouped categories, region_scope, name tooltip, smart activity badge) 2026-06-04 03:08:15 +00:00
env 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
notifications feat(v0.6-2): dispatcher state persistence -- cold-start, cooldowns, dedup LRU to SQLite 2026-06-05 16:35:40 +00:00
persistence feat(v0.6-3a.1): trim adapter_config registry to CONFIG-only per Matt config-vs-code rule + log-on-delete safety net for orphan cleanup 2026-06-05 18:09:49 +00:00
scripts build: normalize all line endings to LF 2026-05-14 22:43:06 +00:00
sources build: normalize all line endings to LF 2026-05-14 22:43:06 +00:00
__init__.py Initial commit: MeshAI - LLM-powered Meshtastic assistant 2025-12-15 11:53:46 -07:00
__main__.py Initial commit: MeshAI - LLM-powered Meshtastic assistant 2025-12-15 11:53:46 -07:00
alert_engine.py refactor: simplify severity to 3 levels (routine/priority/immediate) 2026-05-13 19:05:50 -06:00
central_normalizer.py feat(v0.5.10): nws + usgs_quake + swpc handlers 2026-06-05 07:27:01 +00:00
chunker.py feat: ACK-based message delivery, markdown stripping, prompt fixes 2026-05-06 04:17:44 +00:00
config.py feat(v0.5.11): band conditions scheduled broadcaster (3x/day HF propagation) 2026-06-05 07:38:51 +00:00
config_loader.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
connector.py fix: node_id int handling in connector + rule stats data path 2026-05-13 19:27:04 -06:00
context.py Add passive mesh context awareness — observe channel traffic, inject into LLM prompts 2026-02-24 22:02:42 +00:00
geo.py build: normalize all line endings to LF 2026-05-14 22:43:06 +00:00
history.py Support unlimited message history when max_messages_per_user is 0 2026-02-24 07:03:15 +00:00
knowledge.py build: normalize all line endings to LF 2026-05-14 22:43:06 +00:00
main.py feat(v0.6-3a): adapter_config foundation -- migration + defaults registry + typed accessor 2026-06-05 17:06:51 +00:00
memory.py Unify memory implementations: delete AnthropicMemory and GoogleMemory 2026-02-23 20:14:50 +00:00
mesh_data_store.py fix: notification system improvements and threshold corrections 2026-05-14 06:03:51 +00:00
mesh_health.py fix: notification system improvements and threshold corrections 2026-05-14 06:03:51 +00:00
mesh_models.py feat: Feeder-level gateway awareness from /api/packets_seen 2026-05-05 19:55:23 +00:00
mesh_reporter.py fix: notification system improvements and threshold corrections 2026-05-14 06:03:51 +00:00
mesh_sources.py build: normalize all line endings to LF 2026-05-14 22:43:06 +00:00
meshmonitor.py build: normalize all line endings to LF 2026-05-14 22:43:06 +00:00
responder.py fix: Switch to delay-based delivery — wantAck firmware retries cause duplicates 2026-05-07 21:50:09 +00:00
router.py build: normalize all line endings to LF 2026-05-14 22:43:06 +00:00
subscriptions.py build: normalize all line endings to LF 2026-05-14 22:43:06 +00:00