{"record":{"id":"4811e58c5f13f948","repo":"Fission-AI/OpenSpec","slug":"store-identity-mismatch","errorCode":"store_identity_mismatch","errorMessage":"Store '${id}' is missing identity metadata at ${inspection.metadataPath}. ${doctorFix(id)}","messagePattern":"Store '(.+?)' is missing identity metadata at (.+?)\\. (.+?)","errorType":"error_code","errorClass":"RootSelectionError","httpStatus":null,"severity":"error","filePath":"src/core/root-selection.ts","lineNumber":198,"sourceCode":"        .join(', ')}.`,\n      'unknown_store',\n      {\n        target: 'store.id',\n        fix: 'Pass a registered store id, or run openspec store list.',\n      }\n    );\n  }\n\n  const storeRoot = getStoreRootForBackend(entry.backend);\n  const inspection = await inspectRegisteredStore(id, storeRoot);\n\n  switch (inspection.kind) {\n    case 'metadata_error':\n      return fromStoreError(inspection.error);\n    case 'metadata_missing':\n      // The doctor pointer lives in the message because human-mode command\n      // wrappers print only the message, not the fix field.\n      throw new RootSelectionError(\n        `Store '${id}' is missing identity metadata at ${inspection.metadataPath}. ${doctorFix(id)}`,\n        'store_identity_mismatch',\n        { target: 'store.metadata', fix: doctorFix(id) }\n      );\n    case 'metadata_id_mismatch':\n      throw new RootSelectionError(\n        `Store '${id}' metadata id '${inspection.actualId}' does not match its registered id. ${doctorFix(id)}`,\n        'store_identity_mismatch',\n        { target: 'store.metadata', fix: doctorFix(id) }\n      );\n    case 'unhealthy_root':\n      throw new RootSelectionError(\n        `Store '${id}' does not have a healthy OpenSpec root at ${storeRoot}: ${inspection.problems} ${doctorFix(id)}`,\n        'unhealthy_store_root',\n        { target: 'openspec.root', fix: doctorFix(id) }\n      );\n    case 'ok':\n      return makeRoot(inspection.canonicalRoot, source, id);","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/root-selection.ts#L180-L216","documentation":"Error \"Store '${id}' is missing identity metadata at ${inspection.metadataPath}. ${doctorFix(id)}\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/root-selection.ts:198 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"}