docs: sync retention/evaluator defaults to #348 values

PR #348 changed several defaults but left a handful of docs, the
docker-compose fallback, example seed files, and code docstrings stale:

- docker-compose.yml: RAW_PACKET_RETENTION_DAYS fallback 7->2 (the
  :-7 override was the most consequential — operators without the env
  var set got 7 days, contradicting the code default and .env.example)
- docs/configuration.md: route-history backfill now references the
  300 s evaluator cadence (was 60 s)
- docs/seeding.md + example/seed/routes.yaml: window_hours 48/24 -> 6
  (matches the new default; both exceeded the 12 h max)
- routes.py docstring: evaluator tick 60 s -> 300 s
- subscriber.py: raw_packet_retention_days signature defaults 7 -> 2
  (overridden at runtime by effective_raw_packet_retention_days, but
  kept consistent with the authoritative config default)
This commit is contained in:
Louis King
2026-07-25 14:52:06 +01:00
parent 7802a00db3
commit 993ba7b5b6
6 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -236,9 +236,9 @@ services:
- NODE_CLEANUP_ENABLED=${NODE_CLEANUP_ENABLED:-true}
- NODE_CLEANUP_DAYS=${NODE_CLEANUP_DAYS:-30}
# Raw packet capture (derived from FEATURE_PACKETS so one var drives both
# capture and the web Packets page). Retention defaults to 7 days.
# capture and the web Packets page). Retention defaults to 2 days.
- RAW_PACKET_CAPTURE_ENABLED=${FEATURE_PACKETS:-true}
- RAW_PACKET_RETENTION_DAYS=${RAW_PACKET_RETENTION_DAYS:-7}
- RAW_PACKET_RETENTION_DAYS=${RAW_PACKET_RETENTION_DAYS:-2}
# Observer ingestion filter (allow/deny remote observers by public key/prefix).
# Allowlist overrides denylist; both empty accepts all observers (default).
- OBSERVER_ALLOWLIST=${OBSERVER_ALLOWLIST:-}
+1 -1
View File
@@ -92,7 +92,7 @@ The collector subscribes to MQTT events and persists them to the database. For p
| --- | --- | --- |
| `CHANNEL_REFRESH_INTERVAL_SECONDS` | `300` | Seconds between channel-key refresh from the database (minimum `10`) |
| `ROUTE_EVALUATOR_INTERVAL_SECONDS` | `300` | Seconds between route health evaluations. `0` disables the background evaluator (route cards then stay `unknown`). See [routes.md](routes.md) |
| `ROUTE_HISTORY_BACKFILL_INTERVAL_SECONDS` | `3600` | Seconds between route-health history backfill sweeps (recomputes completed-day buckets for the retention window). `0` disables the backfill; the dashboard strip and `/routes/{id}/history` then only reflect the live 60 s evaluator sweeps. See [routes.md](routes.md) |
| `ROUTE_HISTORY_BACKFILL_INTERVAL_SECONDS` | `3600` | Seconds between route-health history backfill sweeps (recomputes completed-day buckets for the retention window). `0` disables the backfill; the dashboard strip and `/routes/{id}/history` then only reflect the live 300 s evaluator sweeps. See [routes.md](routes.md) |
### Observer Ingestion Filters
+1 -1
View File
@@ -126,7 +126,7 @@ routes:
description: A140 corridor route
visibility: community
match_width: 1
window_hours: 48
window_hours: 6
packet_count_threshold: 5
# clear_threshold: 15 # optional; omit/null = 3x threshold
# max_hop_span: 8 # optional; omit/null = unlimited
+1 -1
View File
@@ -17,7 +17,7 @@ routes:
description: A140 corridor route
visibility: community
match_width: 1
window_hours: 24
window_hours: 6
packet_count_threshold: 3
# clear_threshold: 10 # optional; omit/null = 2x threshold
# max_hop_span: 8 # optional; omit/null = unlimited
+1 -1
View File
@@ -426,7 +426,7 @@ def _load_recent_matches(
"""Return the route's top-3 recent matches in the ``RecentMatchPath`` shape.
Reads the normalized ``route_recent_matches`` table (populated by the
background evaluator on every 60s tick), JOINs through ``raw_packets``
background evaluator on every 300s tick), JOINs through ``raw_packets``
for the packet-level metadata, then fetches the matched hop slice from
``packet_path_hops`` in a second indexed query and slices
``[first_position .. last_position]`` per match in Python. Falls back
+3 -3
View File
@@ -52,7 +52,7 @@ class Subscriber(LetsMeshNormalizer):
node_cleanup_days: int = 90,
channel_refresh_interval_seconds: int = 300,
raw_packet_capture_enabled: bool = False,
raw_packet_retention_days: int = 7,
raw_packet_retention_days: int = 2,
observer_filter: Optional[ObserverFilter] = None,
):
"""Initialize subscriber.
@@ -903,7 +903,7 @@ def create_subscriber(
node_cleanup_days: int = 90,
channel_refresh_interval_seconds: int = 300,
raw_packet_capture_enabled: bool = False,
raw_packet_retention_days: int = 7,
raw_packet_retention_days: int = 2,
observer_filter: Optional[ObserverFilter] = None,
) -> Subscriber:
"""Create a configured subscriber instance.
@@ -989,7 +989,7 @@ def run_collector(
node_cleanup_days: int = 90,
channel_refresh_interval_seconds: int = 300,
raw_packet_capture_enabled: bool = False,
raw_packet_retention_days: int = 7,
raw_packet_retention_days: int = 2,
observer_filter: Optional[ObserverFilter] = None,
) -> None:
"""Run the collector (blocking).