{"record":{"id":"ef52e15fb3e12189","repo":"deepseek-ai/deepseek-harness","slug":"credentials-local-where-is-cyclic","errorCode":null,"errorMessage":"credentials-local: ${where} is cyclic","messagePattern":"credentials-local: (.+?) is cyclic","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/credentials/credentials-local/src/index.ts","lineNumber":407,"sourceCode":" * Reject a payload that cannot survive a JSON round trip, on the way in and on\n * the way out. The seam promises owners their payload comes back exactly as\n * written, and both directions can break that: a document may spell `.inf` or\n * an alias cycle, and an owner may hand over a `Date`, a class instance, or a\n * `bigint` that this document has no faithful spelling for. Neither the value\n * nor any nested value is quoted in a diagnostic.\n * @param where - the subject named in a diagnostic, already free of any value.\n * @param value - the payload or nested value to admit.\n * @param seen - objects on the current path, for cycle detection.\n * @throws TypeError naming `where` when the value cannot round-trip.\n */\nfunction assertJsonValue(where: string, value: unknown, seen: Set<object>): void {\n  if (value === null || typeof value === 'string' || typeof value === 'boolean') return\n  if (typeof value === 'number') {\n    if (Number.isFinite(value)) return\n    throw new TypeError(`credentials-local: ${where} holds a non-finite number`)\n  }\n  if (typeof value === 'object') {\n    if (seen.has(value)) throw new TypeError(`credentials-local: ${where} is cyclic`)\n    if (Object.getPrototypeOf(value) === Object.prototype || Array.isArray(value)) {\n      seen.add(value)\n      for (const nested of Object.values(value)) assertJsonValue(where, nested, seen)\n      seen.delete(value)\n      return\n    }\n  }\n  throw new TypeError(`credentials-local: ${where} holds a value JSON cannot represent`)\n}\n\n/**\n * The comment-preserving mutable tree one edit renders from. Editing the\n * parsed document rather than rebuilding it keeps comments and the formatting\n * of every untouched entry; an absent document starts a fresh one.\n * @param text - the current document text, `undefined` while the file is absent.\n * @returns the tree to edit, carrying this build's version stamp.\n */\nfunction mutableDocument(text: string | undefined): Document {","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/credentials/credentials-local/src/index.ts#L389-L425","documentation":"Cycle detection in assertJsonValue: the payload (or a nested object) references itself, directly or through an alias chain. YAML anchors can express such cycles, and the document has no faithful finite spelling for them, so admission refuses the value.","triggerScenarios":"Thrown at packages/credentials/credentials-local/src/index.ts:407 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove self-references or circular anchors from the payload","Restructure the data as a DAG with explicit ids if shared references are needed","Fix owner code that stores a cyclic object"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}