{"record":{"id":"7c06275b9cade989","repo":"earendil-works/pi","slug":"eval-input-must-contain-only-plain-objects-and-arr","errorCode":null,"errorMessage":"Eval input must contain only plain objects and arrays.","messagePattern":"Eval input must contain only plain objects and arrays\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/evals/src/vitest-evals/harness-table.ts","lineNumber":87,"sourceCode":"\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}\n\nfunction deriveInputKey(input: unknown): string {\n\tif (typeof input === \"object\" && input !== null && !Array.isArray(input) && \"id\" in input) {\n\t\tconst id = input.id;\n\t\tif (typeof id === \"string\" && id.trim()) return id.trim();\n\t}\n\tconst canonicalInput = JSON.stringify(canonicalizeJson(input, new WeakSet()));","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/evals/src/vitest-evals/harness-table.ts#L69-L105","documentation":"Error \"Eval input must contain only plain objects and arrays.\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/evals/src/vitest-evals/harness-table.ts:87 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"}