{"record":{"id":"9904ea5a658ae5c3","repo":"coleam00/Archon","slug":"path-is-not-a-directory-resolvedpath","errorCode":null,"errorMessage":"Path is not a directory: ${resolvedPath}","messagePattern":"Path is not a directory: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/handlers/clone.ts","lineNumber":525,"sourceCode":"  // `canonicalizeProjectPath` is the one canonicalizer for `default_cwd`; the CLI\n  // gate, `archon doctor` and `/register-project` all resolve through it, so a\n  // symlinked root (macOS `/tmp` → `/private/tmp`) or a Windows 8.3 short path\n  // registers under exactly the string those lookups will ask for (#2927). Repo\n  // projects are immune because git canonicalizes the repo root on both sides.\n  const resolvedPath = await canonicalizeProjectPath(localPath);\n\n  // The stat below is the existence gate: canonicalization is fail-safe and\n  // returns the unresolved path, so a missing/unreadable path surfaces here with\n  // its real errno rather than being registered. It also rejects a symlink to a\n  // file, which realpath resolves happily (no git check on this path).\n  let isDirectory = false;\n  try {\n    isDirectory = (await stat(resolvedPath)).isDirectory();\n  } catch (error) {\n    throw pathValidationError(resolvedPath, error as Error);\n  }\n  if (!isDirectory) {\n    throw new Error(`Path is not a directory: ${resolvedPath}`);\n  }\n\n  // Already registered by path — return the existing record unchanged.\n  const existing = await codebaseDb.findCodebaseByDefaultCwd(resolvedPath);\n  if (existing) {\n    return {\n      codebaseId: existing.id,\n      name: existing.name,\n      repositoryUrl: existing.repository_url,\n      defaultCwd: existing.default_cwd,\n      defaultBranch: existing.default_branch ?? null,\n      commandCount: 0,\n      alreadyExisted: true,\n    };\n  }\n\n  const projectName = name?.trim() || basename(resolvedPath);\n  const slug = slugifyFolderName(projectName);","sourceCodeStart":507,"sourceCodeEnd":543,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/core/src/handlers/clone.ts#L507-L543","documentation":"Error \"Path is not a directory: ${resolvedPath}\" thrown in coleam00/Archon.","triggerScenarios":"Thrown at packages/core/src/handlers/clone.ts:525 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":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}