Skip to content

Preserve mathematical backslashes in reviewer JSON - #426

Merged
Vilin97 merged 1 commit into
mainfrom
fix/review-json-backslashes
Sep 13, 2026
Merged

Vilin97 merged 1 commit into
mainfrom
fix/review-json-backslashes

Conversation

@Vilin97

@Vilin97 Vilin97 commented Sep 13, 2026 •

Copy link
Copy Markdown
Collaborator

The full-source re-review of #395 failed after a model call because the JSON string contained an invalid backslash escape in its evidence. Preserve such literal Lean/LaTeX backslashes while decoding the inner review JSON. Valid JSON escapes remain unchanged, and other malformed JSON still fails.

Validation: all 379 Python tests pass; Ruff check/format and diff checks pass. Regressions cover mixed literal/valid escapes, Unicode, and malformed structure. The standalone Azure worker is deployed with the same source hash, and the decoder regression passes on the VM.

@Vilin97
Vilin97 merged commit 84c96f4 into main Sep 13, 2026
9 checks passed
@greptile-apps

greptile-apps Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

Advisory cross-file review against Lean Pool's supervisory rubric. This is not by itself a significance, source-verification, or merge verdict.

Retrigger

The PR is not safe to merge until common LaTeX commands such as \frac, eq, and \underbrace are preserved rather than decoded as control characters or rejected.

Findings

  1. P1 Common LaTeX escapes still break ▶

Summary

  • Valid JSON is decoded normally.
  • Invalid non-JSON escapes are doubled before one parsing retry.
  • Structural and selected malformed inputs remain rejected.
  • The repair remains incomplete for common LaTeX commands whose prefixes overlap JSON escapes.

Reviews (1) · Last reviewed commit: "Preserve literal mathematical backslashe..."

Comment on lines +213 to +218
try:
return json.loads(source)
except json.JSONDecodeError as error:
if error.msg != "Invalid \\escape":
raise
# Consume valid escape pairs intact, including already escaped backslashes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Common LaTeX escapes still break

When review evidence contains common literal LaTeX commands, this decoder can still corrupt or reject it. Commands such as \frac, \neq, \rightarrow, and \times begin with valid JSON escape letters, so the first json.loads succeeds and converts them into control characters before the repair runs. Commands such as \underbrace and \uparrow instead produce an Invalid \uXXXX escape, which this handler does not repair. As a result, ordinary mathematical evidence can still be changed or cause the full-source review to fail. The related tests cover \lambda and \set, but not these cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant