From 013af2ab62b9a6297fa98f7c43d7d0c2263cc3e9 Mon Sep 17 00:00:00 2001 From: OliverGiertz Date: Thu, 26 Mar 2026 07:22:47 +0000 Subject: [PATCH] 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 --- backend/app/pipeline.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/app/pipeline.py b/backend/app/pipeline.py index e85f944..6753491 100644 --- a/backend/app/pipeline.py +++ b/backend/app/pipeline.py @@ -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