{"record":{"id":"c9805c528466c775","repo":"deepseek-ai/deepseek-harness","slug":"credentials-local-invalid-document-at-filename","errorCode":null,"errorMessage":"credentials-local: invalid document at ${filename}: ${document.errors.map(describeYamlError).join('; ')}","messagePattern":"credentials-local: invalid document at (.+?): (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/credentials/credentials-local/src/index.ts","lineNumber":196,"sourceCode":" * Parse one credentials document. Everything is rejected rather than skipped —\n * an unversioned root, an unknown top-level key, a key that is not addressable,\n * a wrong-typed value, an unknown record tag or field — because this file holds\n * nothing but credentials and a silently ignored entry reads as \"the credential\n * I stored has no effect\". Duplicate keys surface as parser errors. An empty\n * document is an empty store and needs no version.\n * @param text - the document's text.\n * @param filename - absolute path, quoted in errors.\n * @returns the parsed references and records.\n */\nexport function parseCredentialsDocument(text: string, filename: string): CredentialsDocument {\n  // `prettyErrors` is on only for `linePos`; `error.message` is never used,\n  // because the parser quotes the offending source line and in this document\n  // that line is a secret. Only the code and position leave this function, and\n  // the same rule governs every other diagnostic here — a key name is safe to\n  // print, a value is not.\n  const document = parseDocument(text, { prettyErrors: true, uniqueKeys: true })\n  if (document.errors.length > 0) {\n    throw new Error(`credentials-local: invalid document at ${filename}: ${\n      document.errors.map(describeYamlError).join('; ')}`)\n  }\n  const root: unknown = document.toJS() ?? {}\n  if (typeof root !== 'object' || root === null || Array.isArray(root)) {\n    throw new TypeError(`credentials-local: ${filename} must be a mapping`)\n  }\n  const fields = root as Record<string, unknown>\n  const keys = Object.keys(fields)\n  // An empty (or comment-only) document is the empty store and needs no\n  // version: there is nothing in it a later layout could have meant.\n  if (keys.length === 0) return { refs: new Map(), records: new Map() }\n  if (!('version' in fields)) {\n    throw new Error(\n      `credentials-local: ${filename} uses the pre-release flat layout. Add \\`version: ${DOCUMENT_VERSION}\\``\n      + ` and nest the existing ${keys.length} ${keys.length === 1 ? 'entry' : 'entries'} under \\`refs:\\`.`\n      + ' No values need to change.',\n    )\n  }","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/credentials/credentials-local/src/index.ts#L178-L214","documentation":"Error \"credentials-local: invalid document at ${filename}: ${document.errors.map(describeYamlError).join('; ')}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/credentials/credentials-local/src/index.ts:196 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":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}