{"record":{"id":"e7384c38ae803a52","repo":"deepseek-ai/deepseek-harness","slug":"settings-verb-for-ns-must-contain-only-jso-e7384c","errorCode":null,"errorMessage":"settings ${verb} for \"${ns}\" must contain only JSON-compatible data (found a circular reference at ${path})","messagePattern":"settings (.+?) for \"(.+?)\" must contain only JSON-compatible data \\(found a circular reference at (.+?)\\)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/settings/settings/src/index.ts","lineNumber":265,"sourceCode":" * are skipped — the same sparse-patch semantics as {@link mergeLayers} — while\n * an `undefined` array entry is rejected rather than coerced.\n * @param root - plain-object write input (caller-checked).\n * @param reject - builds the validation error from a value label and its `$`-rooted path.\n * @returns the detached JSON-compatible clone.\n */\nfunction cloneJsonShaped(\n  root: Record<string, unknown>,\n  reject: (label: string, path: string) => TypeError,\n): Record<string, unknown> {\n  const visiting = new WeakSet<object>()\n  const clone = (value: unknown, path: string): unknown => {\n    if (value === null || typeof value === 'string' || typeof value === 'boolean') return value\n    if (typeof value === 'number') {\n      if (!Number.isFinite(value)) throw reject('a non-finite number', path)\n      return value\n    }\n    if (Array.isArray(value)) {\n      if (visiting.has(value)) throw reject('a circular reference', path)\n      visiting.add(value)\n      const entries = value.map((entry, index) => clone(entry, `${path}[${index}]`))\n      // Un-mark on exit so one object referenced twice without a cycle passes.\n      visiting.delete(value)\n      return entries\n    }\n    if (isPlainObject(value)) {\n      if (visiting.has(value)) throw reject('a circular reference', path)\n      visiting.add(value)\n      // TODO(settings-json-properties): Use property-safe construction here and\n      // in mergeLayers so valid JSON keys such as \"__proto__\" remain own data.\n      const out: Record<string, unknown> = {}\n      for (const [key, entry] of Object.entries(value)) {\n        if (entry === undefined) continue\n        out[key] = clone(entry, `${path}.${key}`)\n      }\n      visiting.delete(value)\n      return out","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/settings/settings/src/index.ts#L247-L283","documentation":"Error \"settings ${verb} for \"${ns}\" must contain only JSON-compatible data (found a circular reference at ${path})\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/settings/settings/src/index.ts:265 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the circular reference from the settings payload before writing."],"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"}