From 517e9884ccabbdb04a41f4472bf677e8bee28099 Mon Sep 17 00:00:00 2001 From: m3taversal Date: Thu, 7 May 2026 18:33:08 -0400 Subject: [PATCH] fix(substantive_fixer): WARN on corrupt eval_issues JSON MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Third silent return path in substantive_fix_cycle — JSON-decode except at the eval_issues parse drops rows that don't reach skipped_no_tags or substantive_rows. If all 3 LIMIT-3 candidates have corrupt JSON, cycle returns 0,0 with no log entry. WARN level (not INFO): corrupt JSON is abnormal (post-merge column drift, hand-edited DB row, partial write during crash). If this fires, ops want to chase the upstream column-write path. If it never fires, baseline noise stays at zero. Closes the visibility gap on ALL silent returns in this function, not just the two patched in 3f8666e. Co-Authored-By: Claude Opus 4.7 (1M context) --- lib/substantive_fixer.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/substantive_fixer.py b/lib/substantive_fixer.py index 4d6dcd5..9bc7dbc 100644 --- a/lib/substantive_fixer.py +++ b/lib/substantive_fixer.py @@ -544,6 +544,14 @@ async def substantive_fix_cycle(conn, max_workers=None) -> tuple[int, int]: try: issues = json.loads(row["eval_issues"] or "[]") except (json.JSONDecodeError, TypeError): + # Corrupt JSON in eval_issues is abnormal (post-merge column drift, + # hand-edited row, partial write during crash). WARN so ops can chase + # the upstream column-write path. Without this, the row drops out of + # both substantive_rows and skipped_no_tags — the third silent path. + logger.warning( + "PR #%d: corrupt eval_issues JSON — skipping in substantive fix cycle", + row["number"], + ) continue if set(issues) & (FIXABLE_TAGS | CONVERTIBLE_TAGS | UNFIXABLE_TAGS): substantive_rows.append(row)