{"record":{"id":"2742d0014ff88879","repo":"paperclipai/paperclip","slug":"resolved-worktree-path-directpath-does-not-cont","errorCode":null,"errorMessage":"Resolved worktree path ${directPath} does not contain .paperclip/config.json.","messagePattern":"Resolved worktree path (.+?) does not contain \\.paperclip/config\\.json\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":3658,"sourceCode":"  const allowCurrent = opts?.allowCurrent !== false;\n  if (trimmed.length === 0) {\n    throw new Error(\"Worktree selector cannot be empty.\");\n  }\n\n  const currentEndpoint = resolveCurrentWorktreeEndpoint();\n  if (allowCurrent && trimmed === \"current\") {\n    return currentEndpoint;\n  }\n\n  const choices = toMergeSourceChoices(process.cwd());\n  const directPath = path.resolve(trimmed);\n  if (existsSync(directPath)) {\n    if (allowCurrent && directPath === currentEndpoint.rootPath) {\n      return currentEndpoint;\n    }\n    const configPath = path.resolve(directPath, \".paperclip\", \"config.json\");\n    if (!existsSync(configPath)) {\n      throw new Error(`Resolved worktree path ${directPath} does not contain .paperclip/config.json.`);\n    }\n    return {\n      rootPath: directPath,\n      configPath,\n      label: path.basename(directPath),\n      isCurrent: false,\n    };\n  }\n\n  const matched = choices.find((choice) =>\n    (allowCurrent || !choice.isCurrent)\n    && (choice.worktree === directPath\n      || path.basename(choice.worktree) === trimmed\n      || choice.branchLabel === trimmed),\n  );\n  if (!matched) {\n    throw new Error(\n      `Could not resolve worktree \"${selector}\". Use a path, a listed worktree directory name, branch name, or \"current\".`,","sourceCodeStart":3640,"sourceCodeEnd":3676,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/worktree.ts#L3640-L3676","documentation":"Identity guard in worktree endpoint resolution: the selector resolved to an existing directory, but that directory lacks a .paperclip/config.json, so it is not a Paperclip-managed worktree and cannot serve as a merge/reseed endpoint.","triggerScenarios":"Thrown at cli/src/commands/worktree.ts:2843 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Point the selector at a directory that contains .paperclip/config.json.","Run `paperclipai worktree:init` in ${directPath} to create the config first."],"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"}