{"record":{"id":"af3f2adda8a876e3","repo":"deepseek-ai/deepseek-harness","slug":"arrays-with-non-index-properties-are-not-json-data","errorCode":null,"errorMessage":"arrays with non-index properties are not JSON data","messagePattern":"arrays with non-index properties are not JSON data","errorType":"exception","errorClass":"MaterializeError","httpStatus":null,"severity":"error","filePath":"packages/workflow/workflow-worker-thread/src/realm.ts","lineNumber":121,"sourceCode":"    if (Array.isArray(objectValue)) return materializeArray(objectValue, path, seen)\n    return materializeObject(objectValue, path, seen)\n  } finally {\n    seen.delete(objectValue)\n  }\n}\n\nfunction materializeArray(value: unknown[], path: string, seen: Set<object>): unknown[] {\n  const out: unknown[] = []\n  for (let index = 0; index < value.length; index++) {\n    if (!(index in value)) throw new MaterializeError(`${path}[${index}]`, 'sparse arrays are not JSON data')\n    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).","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/workflow/workflow-worker-thread/src/realm.ts#L103-L139","documentation":"Error \"arrays with non-index properties are not JSON data\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/workflow/workflow-worker-thread/src/realm.ts:121 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Move non-index properties off arrays into a separate object field before returning the value."],"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"}