feat: atomic extract-and-connect + stale PR monitor + response audit #4
1 changed files with 3 additions and 1 deletions
|
|
@ -151,12 +151,14 @@ async def _terminate_pr(conn, pr_number: int, reason: str):
|
||||||
)
|
)
|
||||||
|
|
||||||
# Tag source for re-extraction with feedback
|
# Tag source for re-extraction with feedback
|
||||||
conn.execute(
|
cursor = conn.execute(
|
||||||
"""UPDATE sources SET status = 'needs_reextraction',
|
"""UPDATE sources SET status = 'needs_reextraction',
|
||||||
updated_at = datetime('now')
|
updated_at = datetime('now')
|
||||||
WHERE path = (SELECT source_path FROM prs WHERE number = ?)""",
|
WHERE path = (SELECT source_path FROM prs WHERE number = ?)""",
|
||||||
(pr_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({
|
db.audit(conn, "evaluate", "pr_terminated", json.dumps({
|
||||||
"pr": pr_number, "reason": reason,
|
"pr": pr_number, "reason": reason,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue