Skip to content

fix(verifier): crash and mis-parse fixes in math verification engine - #2

Open
CodeWhitaker wants to merge 1 commit into
sx4im:mainfrom
CodeWhitaker:overnight-fixes
Open

CodeWhitaker wants to merge 1 commit into
sx4im:mainfrom
CodeWhitaker:overnight-fixes

Conversation

@CodeWhitaker

Copy link
Copy Markdown

7 findings in services/verifier/ (Python/SymPy), each reproduced before fixing. The Next.js side (guards, quota reserve/refund, Lemon Squeezy HMAC) was reviewed and found solid.

Fixes

  1. [High] Tuple-shaped parse results (final_answer="2, 3") crashed verify_payload -> HTTP 500. parse_math_expression now returns None for non-Expr.
  2. [High] SymPy AttributeError inside simplify().equals() on \int_0^\infty e^{-x} dx -> HTTP 500. try/except in expressions_match; numeric fallback still applies.
  3. [Med] \sinh x was mangled to sin(h)*x. Hyperbolic functions handled + (?!h\b) guard.
  4. [Med] Lazy regex captured just \ for \to\infty/\infty bounds. Braced-group-or-bare-token bound patterns + \infty->oo mapping.
  5. [Med] Limits in variables other than x/y/z/t were silently computed in x. Symbol(var_name) fallback.
  6. [Med] Linear-system matcher false-verified "the max = 5, y = 1" (matched x= inside "max"). Leading \b added.
  7. [Low] Bare e parsed as a free symbol instead of Euler's number. "e" -> E in LOCAL_SYMBOLS.

Verification

  • 13/13 -> 23/23 verifier tests (10 new regression tests, one per fix)
  • Zero TS files touched; TS suites covered by CI

Deploy note

Redeploy the verifier service after merging. No secrets or infra changes needed.

- Tuple-shaped parse results no longer crash verify_payload (HTTP 500)
- SymPy AttributeError inside simplify().equals() caught (HTTP 500)
- sinh x no longer mangled to sin(h)*x
- Lazy regex no longer captures bare backslash for \to\infty bounds
- Limits in variables other than x/y/z/t now use the right symbol
- Linear-system matcher no longer false-verifies 'max = 5' via \bx=
- Bare e parsed as Euler's number, not a free symbol
@vercel

vercel Bot commented Sep 26, 2026

Copy link
Copy Markdown

@CodeWhitaker is attempting to deploy a commit to the Saim Shafique's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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