{"record":{"id":"08b713dfe92fae9f","repo":"Fission-AI/OpenSpec","slug":"parent-path-is-not-a-directory-candidate","errorCode":null,"errorMessage":"Parent path is not a directory: ${candidate}","messagePattern":"Parent path is not a directory: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/github-copilot/cloud-agent.ts","lineNumber":359,"sourceCode":"  if (isCurrentCopilotCloudFile(relPath, existingContent)) {\n    return false;\n  }\n  if (!isLegacyCopilotCloudFile(relPath, existingContent)) {\n    return false;\n  }\n\n  await FileSystemUtils.writeFile(fullPath, currentContent);\n  return true;\n}\n\nasync function assertCreatableFilePath(filePath: string): Promise<void> {\n  let candidate = path.dirname(filePath);\n\n  while (true) {\n    try {\n      const stats = await fs.stat(candidate);\n      if (!stats.isDirectory()) {\n        throw new Error(`Parent path is not a directory: ${candidate}`);\n      }\n      return;\n    } catch (error) {\n      if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {\n        throw error;\n      }\n    }\n\n    const parent = path.dirname(candidate);\n    if (parent === candidate) {\n      throw new Error(`Cannot resolve a directory ancestor for: ${filePath}`);\n    }\n    candidate = parent;\n  }\n}\n\nasync function assertMissingOrRegularFile(filePath: string): Promise<void> {\n  try {","sourceCodeStart":341,"sourceCodeEnd":377,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/github-copilot/cloud-agent.ts#L341-L377","documentation":"Error \"Parent path is not a directory: ${candidate}\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/github-copilot/cloud-agent.ts:359 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":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-08-25T16:17:27.014Z"}