{"record":{"id":"1c7e8ff128ea48f5","repo":"Fission-AI/OpenSpec","slug":"store-metadata-id-mismatch","errorCode":"store_metadata_id_mismatch","errorMessage":"Store metadata id '${metadata.id}' does not match requested id '${id}'.","messagePattern":"Store metadata id '(.+?)' does not match requested id '(.+?)'\\.","errorType":"error_code","errorClass":"StoreError","httpStatus":null,"severity":"error","filePath":"src/core/store/operations.ts","lineNumber":498,"sourceCode":"    );\n  }\n\n  // Stores may be Git-backed, but creating one inside an implementation\n  // repo is almost always an accidental nested-repo setup.\n  await assertSetupPathIsNotNestedInGitRepo(storeRoot, {\n    allowInsideGitRepository: input.allowInsideGitRepository,\n  });\n\n  let metadata: Awaited<ReturnType<typeof readStoreMetadataForOperation>> = null;\n  let backend: StoreGitBackendConfig | undefined;\n\n  if (kind === 'directory') {\n    assertNotConfigOnlyPointerRoot(storeRoot);\n    metadata = await readStoreMetadataForOperation(storeRoot);\n\n    if (metadata) {\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: `Use id '${metadata.id}' or choose a different setup path.`,\n          }\n        );\n      }\n      if (input.remote !== undefined) {\n        // Silent acceptance is the forbidden outcome: the identity file\n        // already exists, so --remote cannot reach the committed shape.\n        throw remoteRequiresHandEditError(id, storeRoot);\n      }\n    } else {\n      const openspecRoot = await inspectOpenSpecRoot(storeRoot);\n      const safeFreshDirectory = await isDirectoryEmpty(storeRoot) || await isGitOnlyDirectory(storeRoot);\n      if (!openspecRoot.healthy && !safeFreshDirectory) {\n        throw new StoreError(","sourceCodeStart":480,"sourceCodeEnd":516,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/store/operations.ts#L480-L516","documentation":"Thrown by prepareSetupPlan when the target directory already contains committed store metadata whose id differs from the id requested on the command line. The committed .openspec-store/store.yaml is the source of truth for identity, so setup cannot relabel an existing store.","triggerScenarios":"Thrown at src/core/store/operations.ts:498 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run setup using the committed id from the message","Pick a different setup path for the requested id"],"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"}