feat(spam): retune default scoring config and add v0.15 upgrade notes

Adjust the default spam-scoring knobs across Python settings, SpamConfig,
docker-compose, .env.example and docs to reduce false positives on chatty
legitimate users:

  SPAM_MIN_PATH_HOPS   5  -> 3
  SPAM_PATH_THRESHOLD  5  -> 6
  SPAM_NAME_THRESHOLD  5  -> 10
  SPAM_WEIGHT_PATH     0.7 -> 0.75
  SPAM_WEIGHT_NAME     0.3 -> 0.25
  SPAM_SCORE_THRESHOLD 0.6 -> 0.65

Also document the spam-detection feature and the pull_policy change in a
new v0.15.0 section of docs/upgrading.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Louis King
2026-06-23 08:40:01 +01:00
parent fa9e4c811a
commit caaecfb3c2
8 changed files with 88 additions and 33 deletions
+6 -6
View File
@@ -298,16 +298,16 @@ DATA_RETENTION_INTERVAL_HOURS=24
# Score at/above which a message is treated as likely spam (hidden by default in
# the API, logged at WARNING by the collector). Read by the collector + api.
# SPAM_SCORE_THRESHOLD=0.6
# SPAM_SCORE_THRESHOLD=0.65
# Scoring tuning (collector only; only consulted when detection is enabled).
# SPAM_WINDOW_SECONDS=300 # sliding window for frequency counts
# SPAM_PATH_HOPS=3 # leading origin-side hops that form the prefix
# SPAM_MIN_PATH_HOPS=5 # min path_len before the path signal applies
# SPAM_PATH_THRESHOLD=5 # joint path+sender count that saturates the path signal
# SPAM_NAME_THRESHOLD=5 # sender count that saturates the name signal
# SPAM_WEIGHT_PATH=0.7 # weight of the path signal
# SPAM_WEIGHT_NAME=0.3 # weight of the name signal
# SPAM_MIN_PATH_HOPS=3 # min path_len before the path signal applies
# SPAM_PATH_THRESHOLD=6 # joint path+sender count that saturates the path signal
# SPAM_NAME_THRESHOLD=10 # sender count that saturates the name signal
# SPAM_WEIGHT_PATH=0.75 # weight of the path signal
# SPAM_WEIGHT_NAME=0.25 # weight of the name signal
# SPAM_RESCORE_INTERVAL_SECONDS=120 # background re-scoring sweep cadence (0 disables)
# -------------------