{"record":{"id":"ce74bdafec715edd","repo":"deepseek-ai/deepseek-harness","slug":"credentials-local-unknown-top-level-key-key","errorCode":null,"errorMessage":"credentials-local: unknown top-level key \"${key}\" in ${filename}","messagePattern":"credentials-local: unknown top-level key \"(.+?)\" in (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/credentials/credentials-local/src/index.ts","lineNumber":223,"sourceCode":"  // 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  }\n  if (fields['version'] !== DOCUMENT_VERSION) {\n    throw new Error(\n      `credentials-local: ${filename} declares version ${JSON.stringify(fields['version'])};`\n      + ` this build reads version ${DOCUMENT_VERSION}`,\n    )\n  }\n  for (const key of keys) {\n    if (key !== 'version' && key !== 'refs' && key !== 'records') {\n      throw new Error(`credentials-local: unknown top-level key \"${key}\" in ${filename}`)\n    }\n  }\n  return { refs: parseRefs(fields['refs'], filename), records: parseRecords(fields['records'], filename) }\n}\n\n/**\n * Render the version-1 layout for a pre-release flat document, or `undefined`\n * for anything else. The flat layout is recognized exactly — a non-empty\n * top-level mapping of addressable reference names to non-empty string\n * scalars, with no `version` key and no document directives — and the rewrite\n * nests the original lines verbatim under `refs:` at two spaces' indent, so\n * comments, blank lines, and each value's spelling survive byte for byte.\n * Anything the recognizer declines keeps {@link parseCredentialsDocument}'s\n * loud rejection: a document this build cannot prove it understands is never\n * rewritten. Remove with the pre-release stance at the first tagged release.\n * @param text - the document's text.\n * @returns the migrated text, or `undefined` when the text is not the recognized flat layout.\n */","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/credentials/credentials-local/src/index.ts#L205-L241","documentation":"Error \"credentials-local: unknown top-level key \"${key}\" in ${filename}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/credentials/credentials-local/src/index.ts:223 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"}