fix(pipeline): set warning-zone articles to review status to prevent re-warnings

Articles scoring between warn and auto threshold stayed in "new" status,
causing repeated warning notifications on every /run call. Now they are
set to "review" status after the first warning is sent.

The override callback already resets status to "new" before processing,
so the existing flow works correctly. Also include "review" articles in
/rejected command output so they can be acted on.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OliverGiertz 2026-03-26 07:22:47 +00:00
parent a64bf31ff6
commit 013af2ab62

View file

@ -266,7 +266,13 @@ def _process_article(article: dict[str, Any], stats: PipelineStats, settings: An
stats.rejected_articles.append(updated)
elif score < settings.pipeline_relevance_auto:
# Warning zone: inform user, don't auto-process
# Warning zone: set status to "review" so repeated /run calls don't re-warn
update_article_status(
article_id,
"review",
actor="pipeline",
note=f"Niedrige Relevanz: Score {score}/100 — {reason}",
)
stats.warnings += 1
try:
tg.notify_relevance_warning(article, score, reason)
@ -382,7 +388,7 @@ def get_recently_rejected(days: int = 3) -> list[dict[str, Any]]:
"""
SELECT id, title, meta_json, source_url, created_at
FROM articles
WHERE status = 'error'
WHERE status IN ('error', 'review')
AND json_extract(meta_json, '$.relevance.score') IS NOT NULL
AND date(updated_at) >= date('now', ?)
ORDER BY updated_at DESC