{"record":{"id":"aacfe94902f4142b","repo":"paperclipai/paperclip","slug":"invalid-config-at-filepath-formatvalidatione","errorCode":null,"errorMessage":"Invalid config at ${filePath}: ${formatValidationError(parsed.error)}","messagePattern":"Invalid config at (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/config/store.ts","lineNumber":98,"sourceCode":"      .map((issue) => {\n        const pathParts = Array.isArray(issue.path) ? issue.path.map(String) : [];\n        const issuePath = pathParts.length > 0 ? pathParts.join(\".\") : \"config\";\n        const message = typeof issue.message === \"string\" ? issue.message : \"Invalid value\";\n        return `${issuePath}: ${message}`;\n      })\n      .join(\"; \");\n  }\n  return err instanceof Error ? err.message : String(err);\n}\n\nexport function readConfig(configPath?: string): PaperclipConfig | null {\n  const filePath = resolveConfigPath(configPath);\n  if (!fs.existsSync(filePath)) return null;\n  const raw = parseJson(filePath);\n  const migrated = migrateLegacyConfig(raw);\n  const parsed = paperclipConfigSchema.safeParse(migrated);\n  if (!parsed.success) {\n    throw new Error(`Invalid config at ${filePath}: ${formatValidationError(parsed.error)}`);\n  }\n  return parsed.data;\n}\n\nfunction effectiveConfig(config: PaperclipConfig): Record<string, unknown> {\n  const meta = { ...config.$meta } as Record<string, unknown>;\n  delete meta.updatedAt;\n  delete meta.source;\n  return {\n    ...config,\n    $meta: meta,\n  };\n}\n\nfunction syncDirectory(directoryPath: string): void {\n  let directoryDescriptor: number | null = null;\n  try {\n    directoryDescriptor = fs.openSync(directoryPath, \"r\");","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/config/store.ts#L80-L116","documentation":"readConfig parsed the JSON config against paperclipConfigSchema and validation failed; the message lists the offending field paths and reasons.","triggerScenarios":"Thrown at cli/src/config/store.ts:98 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the invalid fields listed in the validation error at ${filePath}.","Regenerate the config by removing the file and re-running setup."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}