{"record":{"id":"8e9f135e2baf0f19","repo":"Fission-AI/OpenSpec","slug":"relativepath-exists-but-is-not-a-directory","errorCode":null,"errorMessage":"${relativePath}/ exists but is not a directory.","messagePattern":"(.+?)/ exists but is not a directory\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/openspec-root.ts","lineNumber":238,"sourceCode":"  inspection.healthy =\n    inspection.present === true &&\n    inspection.config.present === true &&\n    inspection.diagnostics.length === 0;\n\n  return inspection;\n}\n\nasync function ensureDirectory(\n  storeRoot: string,\n  relativePath: string,\n  ledger: CreatedPathLedgerEntry[]\n): Promise<void> {\n  const absolutePath = path.join(storeRoot, relativePath);\n  const kind = await pathKind(absolutePath);\n\n  if (kind === 'directory') return;\n  if (kind !== 'missing') {\n    throw new Error(`${relativePath}/ exists but is not a directory.`);\n  }\n\n  await fs.mkdir(absolutePath, { recursive: true });\n  ledger.push({\n    relativePath: relativeArtifact(relativePath, 'directory'),\n    absolutePath,\n    kind: 'directory',\n  });\n}\n\nasync function ensureDefaultConfig(\n  storeRoot: string,\n  ledger: CreatedPathLedgerEntry[]\n): Promise<void> {\n  const configYamlPath = path.join(storeRoot, OPENSPEC_CONFIG_YAML);\n  const configYmlPath = path.join(storeRoot, OPENSPEC_CONFIG_YML);\n  const yamlKind = await pathKind(configYamlPath);\n  const ymlKind = await pathKind(configYmlPath);","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/openspec-root.ts#L220-L256","documentation":"Error \"${relativePath}/ exists but is not a directory.\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/openspec-root.ts:238 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"}