{"record":{"id":"b5fb987b7bc37f76","repo":"deepseek-ai/deepseek-harness","slug":"only-plain-objects-and-arrays-are-json-data-exoti","errorCode":null,"errorMessage":"only plain objects and arrays are JSON data (exotic prototype)","messagePattern":"only plain objects and arrays are JSON data \\(exotic prototype\\)","errorType":"exception","errorClass":"MaterializeError","httpStatus":null,"severity":"error","filePath":"packages/workflow/workflow-worker-thread/src/realm.ts","lineNumber":132,"sourceCode":"    out.push(materialize(value[index], `${path}[${index}]`, seen))\n  }\n  // Own enumerable props beyond the indices (e.g. `arr.total = 3`) would be\n  // silently dropped by JSON — reject them instead.\n  for (const key of Object.keys(value)) {\n    const index = Number(key)\n    if (!Number.isInteger(index) || index < 0 || index >= value.length) {\n      throw new MaterializeError(`${path}.${key}`, 'arrays with non-index properties are not JSON data')\n    }\n  }\n  if (Object.getOwnPropertySymbols(value).length > 0) {\n    throw new MaterializeError(path, 'symbol-keyed properties are not plain JSON data')\n  }\n  return out\n}\n\nfunction materializeObject(value: object, path: string, seen: Set<object>): Record<string, unknown> {\n  if (!hasPlainPrototype(value)) {\n    throw new MaterializeError(path, 'only plain objects and arrays are JSON data (exotic prototype)')\n  }\n  if (Object.getOwnPropertySymbols(value).length > 0) {\n    throw new MaterializeError(path, 'symbol-keyed properties are not plain JSON data')\n  }\n  const out: Record<string, unknown> = {}\n  // Object.keys = own enumerable string keys, matching JSON.stringify's\n  // property selection exactly (non-enumerable props never reach JSON output).\n  for (const key of Object.keys(value)) {\n    // defineProperty, never assignment: a \"__proto__\" key must become an OWN\n    // data property of the copy, not a prototype mutation.\n    Object.defineProperty(out, key, {\n      value: materialize((value as Record<string, unknown>)[key], `${path}.${key}`, seen),\n      enumerable: true,\n      writable: true,\n      configurable: true,\n    })\n  }\n  return out","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/workflow/workflow-worker-thread/src/realm.ts#L114-L150","documentation":"Error \"only plain objects and arrays are JSON data (exotic prototype)\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/workflow/workflow-worker-thread/src/realm.ts:132 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Return plain objects and arrays created with {} / [] or Object.create(null); class instances and exotic prototypes are not JSON data."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}