Supervised source candidates: stage, list, promote, reject
- New source_candidates staging table (status suggested/quarantined/rejected/ promoted, preview_json snapshot) so untrusted/suggested feeds stay out of the real ingestion path until reviewed. - sources.py: save_candidate (re-preview never revives a curator's rejection), list_candidates, reject_candidate, promote_candidate (copies into sources, inactive by default — active on approval; never automatic). - CLI: suggest-source / list-candidates / promote-candidate / reject-candidate. - API: read-only GET /api/candidates (writes stay CLI-only — no unauthenticated public write surface yet). - Fix deprecated ElementTree truth-value test in _parse_rss. - Tests: candidate lifecycle (save/list/promote/reject, status preservation, name derivation) — 51 total. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+3
-1
@@ -321,7 +321,9 @@ def insert_article(conn: sqlite3.Connection, source: sqlite3.Row, item: FeedItem
|
||||
|
||||
|
||||
def _parse_rss(root: ET.Element) -> list[FeedItem]:
|
||||
channel = _first_child(root, "channel") or root
|
||||
channel = _first_child(root, "channel")
|
||||
if channel is None:
|
||||
channel = root
|
||||
language = _first_text(channel, "language")
|
||||
items = [element for element in root.iter() if _local_name(element.tag) == "item"]
|
||||
parsed = []
|
||||
|
||||
Reference in New Issue
Block a user