Curation logic decentralized across adapters #7
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Category: Maintainability · Priority: MED
Status: Scoped for narrow cut (confirmed 2026-07-10). Defer adapter-manifest / result-schema to #6.
Problem (verified against code)
Curation state is scattered and already drifting:
hackernews.py:AI_KEYWORDS= plain substrings (~40 entries).rss_feeds.py: separateAI_KEYWORDS=\b-wrapped regex — different syntax from HN's.arxiv.py:DEFAULT_CATEGORIES = ["cs.AI","cs.LG","cs.CL"].reddit.py:DEFAULT_SUBREDDITS = ["MachineLearning","artificial","LocalLLaMA","Startups"].hackernews._is_ai_relevant()does NOT use the classAI_KEYWORDS— it hardcodes a near-duplicate "unambiguous" list inline (lines 81-91). Two keyword lists in one file, already diverged.reddit_proof.py(repo root):SUBREDDITS= byte-identical duplicate ofreddit.DEFAULT_SUBREDDITS.Why it matters
Adding a theme means editing 4+ files; HN/RSS already use different keyword formats; HN alone maintains two lists. Drift compounds.
Decision (confirmed): per-adapter blocks in ONE file — NOT monolithic
Six sources have genuinely different query semantics (arXiv=categories, Reddit=subreddits, HN/RSS=keywords, GitHub=search terms). Force-flattening into one schema is wrong. Use
config/queries.yamlwith per-source blocks:Narrow cut (do now)
config/queries.yamlwith per-adapter blocks above.\bfor HN + RSS (RSS already there; convert HN's substrings)._is_ai_relevant()referencesAI_KEYWORDSfrom YAML instead of the inline duplicate list.reddit_proof.py: standalone PoC v5 at repo root, its ownmain()+init_db()+ directINSERT OR REPLACE INTO entries(line 223). NOT in cron, NOT imported anywhere → dead code. Delete it outright (also removes the byte-duplicateSUBREDDITS). NOTE: it bypasses SourceAdapter + PR #12's retry/failure_class— if ever revived it needs a full adapter rewrite, not a merge.None-fallback to class default for safety during rollout).Explicitly DEFERRED (to #6, not here)
Verification
python3 pipeline.py --dry-runstill fetches all 6 sources post-refactor.grep -rn "AI_KEYWORDS\|DEFAULT_SUBREDDITS\|DEFAULT_CATEGORIES" adapters/→ only YAML loads remain; no inline duplicates.reddit_proof.pygone;git ls-filesconfirms removal.Related
This issue tracks centralizing the keyword list and categories, and adapter manifests outside of the python and into a central configuration mechanism - .yaml recommended. The final implementation needs to -
Worth discussing (feature creep) - within the Adapter class, this file can have a section detailing how results are returned and processed into the data / infra. Is just the title retrieved? Abstract? metadata about author/date published/etc? This question really asks how data is collected, field mapped, normalized during ingestion, and indexed. within that scope, should the YAML include schema to define it. having this discussion now is important because you need to decide if there is one monolithic YAML for all, or a per-adapter YAML design - both have trade offs.