{"record":{"id":"7282a82085ea6c17","repo":"earendil-works/pi","slug":"eval-input-must-not-contain-circular-references","errorCode":null,"errorMessage":"Eval input must not contain circular references.","messagePattern":"Eval input must not contain circular references\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/evals/src/vitest-evals/harness-table.ts","lineNumber":73,"sourceCode":"\t\ttypeof harness !== \"string\" ||\n\t\ttypeof baseline !== \"string\" ||\n\t\t!Array.isArray(candidates) ||\n\t\t!candidates.every((name): name is string => typeof name === \"string\") ||\n\t\ttypeof repetition !== \"number\"\n\t) {\n\t\treturn undefined;\n\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","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/evals/src/vitest-evals/harness-table.ts#L55-L91","documentation":"Error \"Eval input must not contain circular references.\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/evals/src/vitest-evals/harness-table.ts:73 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"}