From f4dc6b39ce07240d84886d7ae4b84228d07cffde Mon Sep 17 00:00:00 2001 From: m3taversal Date: Fri, 13 Mar 2026 17:17:30 +0000 Subject: [PATCH] leo: warn on NULL source_path in _terminate_pr (Ganymede nit) If source_path is NULL, the source requeue silently matches nothing. Log a warning so we catch orphaned terminations in monitoring. Pentagon-Agent: Leo <294C3CA1-0205-4668-82FA-B984D54F48AD> --- lib/evaluate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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,