{"record":{"id":"4ccf551ffc9d7c50","repo":"deepseek-ai/deepseek-harness","slug":"credentials-local-name-in-filename-must-b","errorCode":null,"errorMessage":"credentials-local: \"${name}\" in ${filename} must be a mapping","messagePattern":"credentials-local: \"(.+?)\" in (.+?) must be a mapping","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/credentials/credentials-local/src/index.ts","lineNumber":323,"sourceCode":" * @param record - the api-key record a mutation returned.\n */\nfunction assertStorableApiKey(key: CredentialKey, record: ApiKeyRecord): void {\n  if (record.key !== undefined && record.key.length === 0) {\n    throw new TypeError(`credentials-local: record \"${key}\" has an empty key; omit the field instead`)\n  }\n  for (const [name, value] of Object.entries(record.env ?? {})) {\n    credentialRef(name)\n    if (value.length === 0) {\n      throw new TypeError(`credentials-local: record \"${key}\" env \"${name}\" must be a non-empty string`)\n    }\n  }\n}\n\n/** One section of the document as a plain mapping; absent and null both mean empty. */\nfunction asSection(section: unknown, name: string, filename: string): Record<string, unknown> {\n  if (section === undefined || section === null) return {}\n  if (typeof section !== 'object' || Array.isArray(section)) {\n    throw new TypeError(`credentials-local: \"${name}\" in ${filename} must be a mapping`)\n  }\n  return section as Record<string, unknown>\n}\n\n/** Admit one record entry, rejecting an unknown tag or field rather than dropping it. */\nfunction parseRecord(key: string, value: unknown, filename: string): CredentialRecord {\n  if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n    throw new TypeError(`credentials-local: record \"${key}\" in ${filename} must be a mapping`)\n  }\n  const fields = value as Record<string, unknown>\n  const kind = fields['kind']\n  if (kind === 'api-key') {\n    assertFields(key, fields, ['kind', 'key', 'env'], filename)\n    const apiKey = fields['key']\n    if (apiKey !== undefined && (typeof apiKey !== 'string' || apiKey.length === 0)) {\n      throw new TypeError(`credentials-local: record \"${key}\" in ${filename} has a non-string or empty key`)\n    }\n    const env = parseRecordEnv(key, fields['env'], filename)","sourceCodeStart":305,"sourceCodeEnd":341,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/credentials/credentials-local/src/index.ts#L305-L341","documentation":"Error \"credentials-local: \"${name}\" in ${filename} must be a mapping\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/credentials/credentials-local/src/index.ts:323 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"}