Skip to content

fix(data): coerce whole-number judge score and threshold to number - #14

Merged
mxriverlynn merged 1 commit into
mainfrom
fix/judge-score-bigint
Sep 22, 2026
Merged

mxriverlynn merged 1 commit into
mainfrom
fix/judge-score-bigint

Conversation

@mxriverlynn

Copy link
Copy Markdown
Collaborator

Problem

Opening a test run detail page returned a 500 (SyntaxError: Unexpected token 'I', "Internal S"... is not valid JSON in the browser).

When every judge score in a batch is a whole number (for example, a perfect score of 1), the JSONL value is written without a decimal point. DuckDB then infers judge_score as BIGINT when it builds the parquet file. queryTestRunDetails returned a JS BigInt, and Hono's c.json() threw because JSON cannot serialize BigInts.

Fix

  • Convert score and threshold with Number(...) when building llmJudgeGroups. This is done in JS rather than SQL because the query uses SELECT *, and older parquet files may not have the judge columns.
  • Remove a Number(...) wrapper in an existing test that hid the bug.
  • Add a regression test with a whole-number score and threshold. It fails without the fix and passes with it.

Verification

  • make test: 1032 passed.
  • A local server run from source against real run data now returns 200 for the run that previously returned 500.

DuckDB infers BIGINT for whole-number JSON values such as a perfect judge
score of 1, so queryTestRunDetails returned a BigInt that c.json() could
not serialize, causing a 500 on the test run detail page.
@mxriverlynn
mxriverlynn marked this pull request as ready for review September 22, 2026 19:31
@mxriverlynn
mxriverlynn merged commit 0d68ea0 into main Sep 22, 2026
7 checks passed
@mxriverlynn
mxriverlynn deleted the fix/judge-score-bigint branch September 22, 2026 19:31
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