{"record":{"id":"2799d74bb715eaf4","repo":"paperclipai/paperclip","slug":"source-and-target-databases-do-not-share-a-company","errorCode":null,"errorMessage":"Source and target databases do not share a company id. Pass --company explicitly once both sides match.","messagePattern":"Source and target databases do not share a company id\\. Pass --company explicitly once both sides match\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":3155,"sourceCode":"  const targetById = new Map(targetCompanies.map((company) => [company.id, company]));\n  const shared = sourceCompanies.filter((company) => targetById.has(company.id));\n  const selector = nonEmpty(input.selector);\n  if (selector) {\n    const matched = shared.find(\n      (company) => company.id === selector || company.issuePrefix.toLowerCase() === selector.toLowerCase(),\n    );\n    if (!matched) {\n      throw new Error(`Could not resolve company \"${selector}\" in both source and target databases.`);\n    }\n    return matched;\n  }\n\n  if (shared.length === 1) {\n    return shared[0];\n  }\n\n  if (shared.length === 0) {\n    throw new Error(\"Source and target databases do not share a company id. Pass --company explicitly once both sides match.\");\n  }\n\n  const options = shared\n    .map((company) => `${company.issuePrefix} (${company.name})`)\n    .join(\", \");\n  throw new Error(`Multiple shared companies found. Re-run with --company <id-or-prefix>. Options: ${options}`);\n}\n\nfunction renderMergePlan(plan: Awaited<ReturnType<typeof collectMergePlan>>[\"plan\"], extras: {\n  sourcePath: string;\n  targetPath: string;\n  unsupportedRunCount: number;\n}): string {\n  const terminalWidth = Math.max(60, process.stdout.columns ?? 100);\n  const oneLine = (value: string) => value.replace(/\\s+/g, \" \").trim();\n  const truncateToWidth = (value: string, maxWidth: number) => {\n    if (maxWidth <= 1) return \"\";\n    if (value.length <= maxWidth) return value;","sourceCodeStart":3137,"sourceCodeEnd":3173,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/worktree.ts#L3137-L3173","documentation":"Cross-database company resolution failure: the source and target databases share zero company ids, so there is no company whose history could be merged; the operator must make both sides contain the company first.","triggerScenarios":"Thrown at cli/src/commands/worktree.ts:2340 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Seed or create matching companies on both sides, then pass --company explicitly."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}