{"record":{"id":"7b5dcdf9ddb2d0d3","repo":"Fission-AI/OpenSpec","slug":"declared-in-pointer-filepath-error-message","errorCode":null,"errorMessage":"Declared in ${pointer.filePath}: ${error.message}","messagePattern":"Declared in (.+?): (.+?)","errorType":"exception","errorClass":"RootSelectionError","httpStatus":null,"severity":"error","filePath":"src/core/root-selection.ts","lineNumber":345,"sourceCode":"    );\n  }\n\n  if (pointer.value === undefined) {\n    return makeRoot(nearestRoot, 'nearest');\n  }\n\n  try {\n    return await resolveStoreRoot(pointer.value, globalDataDir, 'declared');\n  } catch (error) {\n    if (error instanceof RootSelectionError) {\n      // Rewrap with the declaration origin. The unknown-store fix is\n      // reshaped for the actual mistake: the user declared a pointer,\n      // they did not pass --store.\n      const declarationFix =\n        error.diagnostic.code === 'unknown_store'\n          ? `Register the store (openspec store register <path> --id ${pointer.value}) or edit ${pointer.filePath} to name a registered store.`\n          : error.diagnostic.fix;\n      throw new RootSelectionError(\n        `Declared in ${pointer.filePath}: ${error.message}`,\n        error.diagnostic.code,\n        {\n          ...(error.diagnostic.target ? { target: error.diagnostic.target } : {}),\n          ...(declarationFix ? { fix: declarationFix } : {}),\n        }\n      );\n    }\n    throw error;\n  }\n}\n\n/**\n * The machine-level fallback: the global `defaultStore` resolved as a root,\n * with its own provenance (`global_default`) so JSON surfaces can tell a\n * machine-wide default from a repo's `store:` pointer. Mirrors the\n * declared-pointer catch — a stale or unregistered id degrades to the\n * underlying error, reshaped to point at clearing the global default","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/root-selection.ts#L327-L363","documentation":"Error \"Declared in ${pointer.filePath}: ${error.message}\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/root-selection.ts:345 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"}