{"record":{"id":"bce3bc9e9bc9839c","repo":"Fission-AI/OpenSpec","slug":"store-remove-metadata-missing","errorCode":"store_remove_metadata_missing","errorMessage":"Store remove refuses to delete a folder without store metadata.","messagePattern":"Store remove refuses to delete a folder without store metadata\\.","errorType":"error_code","errorClass":"StoreError","httpStatus":null,"severity":"error","filePath":"src/core/store/operations.ts","lineNumber":927,"sourceCode":"\n  if (kind === 'missing') {\n    return { exists: false };\n  }\n\n  if (kind !== 'directory') {\n    throw new StoreError(\n      `Store path is not a directory: ${storeRoot}`,\n      'store_remove_path_not_directory',\n      {\n        target: 'store.root',\n        fix: 'Run \"openspec store unregister <id>\" if you only want to forget this local registry entry.',\n      }\n    );\n  }\n\n  const metadata = await readStoreMetadataForOperation(storeRoot);\n  if (!metadata) {\n    throw new StoreError(\n      'Store remove refuses to delete a folder without store metadata.',\n      'store_remove_metadata_missing',\n      {\n        target: 'store.metadata',\n        fix: 'Run \"openspec store unregister <id>\" if you only want to forget this local registry entry.',\n      }\n    );\n  }\n\n  if (metadata.id !== id) {\n    throw new StoreError(\n      `Store metadata id '${metadata.id}' does not match requested id '${id}'.`,\n      'store_metadata_id_mismatch',\n      {\n        target: 'store.metadata',\n        fix: 'Repair the registry or run store unregister instead of deleting this folder.',\n      }\n    );","sourceCodeStart":909,"sourceCodeEnd":945,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/store/operations.ts#L909-L945","documentation":"Safety guard in assertSafeToDeleteStoreRoot: the path is a directory but contains no store metadata (readStoreMetadataForOperation returned nothing), so it does not look like a store created by openspec. Removal is refused to avoid deleting an unrelated folder; the input at fault is the registered store root directory lacking store metadata.","triggerScenarios":"Thrown at src/core/store/operations.ts:927 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["If you only want to forget the store, run 'openspec store unregister <id>'","If the folder is a genuine store with damaged metadata, restore its metadata file (e.g. from version control) and retry 'openspec store remove'","If it is an unrelated directory, remove it manually with rm -rf and unregister the entry"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","contentChangedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}