{"record":{"id":"fc2309003fa9ee8f","repo":"earendil-works/pi","slug":"eval-input-arrays-must-not-be-sparse","errorCode":null,"errorMessage":"Eval input arrays must not be sparse.","messagePattern":"Eval input arrays must not be sparse\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/evals/src/vitest-evals/harness-table.ts","lineNumber":80,"sourceCode":"\t}\n\treturn { schemaVersion, evalSet, groupKey, harness, baseline, candidates, repetition };\n}\n\nfunction canonicalizeJson(value: unknown, ancestors: WeakSet<object>): JsonValue {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return value;\n\tif (typeof value === \"number\") {\n\t\tif (!Number.isFinite(value)) throw new TypeError(\"Eval input must contain only finite numbers.\");\n\t\treturn value;\n\t}\n\tif (typeof value !== \"object\") throw new TypeError(\"Eval input must be JSON-serializable.\");\n\tif (ancestors.has(value)) throw new TypeError(\"Eval input must not contain circular references.\");\n\n\tancestors.add(value);\n\ttry {\n\t\tif (Array.isArray(value)) {\n\t\t\tconst result: JsonValue[] = [];\n\t\t\tfor (let index = 0; index < value.length; index += 1) {\n\t\t\t\tif (!Object.hasOwn(value, index)) throw new TypeError(\"Eval input arrays must not be sparse.\");\n\t\t\t\tresult.push(canonicalizeJson(value[index], ancestors));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\tconst prototype = Object.getPrototypeOf(value);\n\t\tif (prototype !== Object.prototype && prototype !== null) {\n\t\t\tthrow new TypeError(\"Eval input must contain only plain objects and arrays.\");\n\t\t}\n\t\tconst entries: Array<[string, unknown]> = Object.entries(value);\n\t\treturn Object.fromEntries(\n\t\t\tentries\n\t\t\t\t.sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))\n\t\t\t\t.map(([key, item]): [string, JsonValue] => [key, canonicalizeJson(item, ancestors)]),\n\t\t);\n\t} finally {\n\t\tancestors.delete(value);\n\t}\n}","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/evals/src/vitest-evals/harness-table.ts#L62-L98","documentation":"Error \"Eval input arrays must not be sparse.\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/evals/src/vitest-evals/harness-table.ts:80 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}