{"record":{"id":"e41d738d38832654","repo":"Fission-AI/OpenSpec","slug":"store-register-root-unhealthy","errorCode":"store_register_root_unhealthy","errorMessage":"Store register requires an existing healthy OpenSpec root. ${problems}${emptyCloneHint}","messagePattern":"Store register requires an existing healthy OpenSpec root\\. (.+?)(.+?)","errorType":"error_code","errorClass":"StoreError","httpStatus":null,"severity":"error","filePath":"src/core/store/operations.ts","lineNumber":778,"sourceCode":"        fix: 'Pass an existing store directory.',\n      }\n    );\n  }\n\n  assertNotConfigOnlyPointerRoot(storeRoot);\n  const openspecRoot = await inspectOpenSpecRoot(storeRoot);\n  if (!openspecRoot.healthy) {\n    const problems =\n      openspecRoot.diagnostics.map((diagnostic) => diagnostic.message).join(' ') ||\n      'The OpenSpec root is missing or incomplete.';\n    const isEmptyCloneSuspect =\n      (await isGitRepositoryAtRoot(storeRoot)) &&\n      (await gitHasCommits(storeRoot)) === false;\n    const emptyCloneHint = isEmptyCloneSuspect\n      ? ' This folder is a Git repository with no commits — if it is a clone, the origin store needs an initial commit before the clone has any files.'\n      : '';\n\n    throw new StoreError(\n      `Store register requires an existing healthy OpenSpec root. ${problems}${emptyCloneHint}`,\n      'store_register_root_unhealthy',\n      {\n        target: 'openspec.root',\n        fix: isEmptyCloneSuspect\n          ? 'If this is a store clone: commit and push the origin store, pull it into this clone, then rerun register.'\n          : 'Run openspec store setup for a new store, or point register at a checkout whose openspec/ files are present.',\n      }\n    );\n  }\n\n  const metadata = await readStoreMetadataForOperation(storeRoot);\n  const explicitId = input.id !== undefined ? validateStoreId(input.id) : undefined;\n\n  if (metadata && explicitId !== undefined && metadata.id !== explicitId) {\n    // The fix must account for whether the metadata id is already registered,\n    // so following it never lands on the already-registered error.\n    const currentRegistry = await readStoreRegistryState();","sourceCodeStart":760,"sourceCodeEnd":796,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/store/operations.ts#L760-L796","documentation":"Error \"Store register requires an existing healthy OpenSpec root. ${problems}${emptyCloneHint}\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/store/operations.ts:778 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"}