{"record":{"id":"8da4f97a8e13f49a","repo":"Fission-AI/OpenSpec","slug":"store-root-is-not-a-directory","errorCode":null,"errorMessage":"Store root is not a directory.","messagePattern":"Store root is not a directory\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/openspec-root.ts","lineNumber":306,"sourceCode":"    kind: 'file',\n  });\n}\n\nexport interface EnsureOpenSpecRootOptions {\n  anchorEmptyDirectories?: boolean;\n}\n\nexport async function ensureOpenSpecRoot(\n  storeRoot: string,\n  options: EnsureOpenSpecRootOptions = {}\n): Promise<EnsureOpenSpecRootResult> {\n  const ledger: CreatedPathLedgerEntry[] = [];\n  const rootKind = await pathKind(storeRoot);\n\n  if (rootKind === 'missing') {\n    await fs.mkdir(storeRoot, { recursive: true });\n  } else if (rootKind !== 'directory') {\n    throw new Error('Store root is not a directory.');\n  }\n\n  await ensureDirectory(storeRoot, OPENSPEC_ROOT_DIR, ledger);\n  await ensureDirectory(storeRoot, OPENSPEC_SPECS_DIR, ledger);\n  await ensureDirectory(storeRoot, OPENSPEC_CHANGES_DIR, ledger);\n  await ensureDirectory(storeRoot, OPENSPEC_ARCHIVE_DIR, ledger);\n  await ensureDefaultConfig(storeRoot, ledger);\n\n  if (options.anchorEmptyDirectories) {\n    for (const relativeDir of ANCHORED_OPENSPEC_DIRS) {\n      await ensureDirectoryAnchor(storeRoot, relativeDir, ledger);\n    }\n  }\n\n  return {\n    inspection: await inspectOpenSpecRoot(storeRoot),\n    createdArtifacts: ledger.map((entry) => entry.relativePath),\n    createdPaths: ledger,","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/openspec-root.ts#L288-L324","documentation":"Error \"Store root is not a directory.\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/openspec-root.ts:306 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"}