diff --git a/lib/evaluate.py b/lib/evaluate.py index 86a1f4c..8bce433 100644 --- a/lib/evaluate.py +++ b/lib/evaluate.py @@ -151,12 +151,14 @@ async def _terminate_pr(conn, pr_number: int, reason: str): ) # Tag source for re-extraction with feedback - conn.execute( + cursor = conn.execute( """UPDATE sources SET status = 'needs_reextraction', updated_at = datetime('now') WHERE path = (SELECT source_path FROM prs WHERE number = ?)""", (pr_number,), ) + if cursor.rowcount == 0: + logger.warning("PR #%d: no source_path linked — source not requeued for re-extraction", pr_number) db.audit(conn, "evaluate", "pr_terminated", json.dumps({ "pr": pr_number, "reason": reason,