Make the system portable: split config from profile, remove hard-coding
Audit found three things compiled in that shouldn't have been: the User-Agent carried the author's domain, the cluster threshold and window were module constants the pipeline never overrode, and the embedding model was pinned -- which blocked the one change most likely to be wanted, swapping in a multilingual model for native-language sources. Configuration is now three files with distinct roles: config.toml (machinery), profile.toml (who the reader is), sources.toml (what to read). All are relocatable via NEWS_CONFIG_DIR. news/*.py now contains no interest, place name, feed URL, or personal identifier. tests/test_config.py keeps it that way: it builds a configuration for an invented reader and asserts none of the author's identity or preferences reaches the running code. Writing it immediately found a real bug -- CONFIG_DIR was resolved at import time, so NEWS_CONFIG_DIR silently did nothing if set after the module was first imported. Now resolved per instantiation. Documented the coupling that portability creates: [clustering].threshold and [scoring].veto_absolute are cosine constants calibrated against one corpus with one model, so changing [embedding].model invalidates both.
This commit is contained in:
1 parent
6dc3694260
commit
863f5e20ac
8 files changed
+317
-36
No files matched your search
+5
-17
@@ -419,25 +419,13 @@ hn_min_score = 150
|
||||
# failure was collecting 32 of them, not collecting shallow ones.
|
||||
feedback_actions = ["interested", "not_interested"]
|
||||
|
||||
# Embedding stays English-only (bge-small-en-v1.5). Measured 2026-09-08: the
|
||||
# same story in Spanish and English scored 0.758 and 0.600 cosine, against a
|
||||
# random-pair p99 of 0.634 -- so one of two translation pairs was
|
||||
# indistinguishable from an unrelated article. Native-language Italian and
|
||||
# Spanish feeds would rank erratically, so Italy and Mexico are covered by
|
||||
# English-language sources (ANSA English, Mexico News Daily) instead. Revisit
|
||||
# with multilingual-e5-small only if native sources become worth re-calibrating
|
||||
# every threshold for.
|
||||
embedding_language = "en"
|
||||
# Embedding is English-only by default (see config.toml [embedding]). Measured
|
||||
# 2026-09-08: the same story in Spanish and English scored 0.758 and 0.600
|
||||
# cosine against a random-pair p99 of 0.634, so one of two translation pairs
|
||||
# was indistinguishable from an unrelated article. Italy and Mexico are
|
||||
# therefore covered by English-language sources.
|
||||
# Conflict outside categories A-D notifies only on a major development -- a new
|
||||
# offensive, a ceasefire, mass casualties, a state entering. Routine front-line
|
||||
# reporting goes to the digest.
|
||||
conflict_general_requires_importance = true
|
||||
|
||||
# =========================================================== scoring =========
|
||||
# Fitted 2026-09-08 against 3,885 items and 40 real feedback labels.
|
||||
# See profile/CALIBRATION.md.
|
||||
|
||||
[scoring]
|
||||
normalize = "zscore-per-block"
|
||||
veto_absolute = 0.60
|
||||
veto_margin_over_interest = 0.3
|
||||
Reference in new issue
Block a user