{"record":{"id":"afe390b14a4976e6","repo":"Fission-AI/OpenSpec","slug":"schema-normalizedname-not-found-available-sc","errorCode":null,"errorMessage":"Schema '${normalizedName}' not found. Available schemas: ${availableSchemas.join(', ')}","messagePattern":"Schema '(.+?)' not found\\. Available schemas: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/artifact-graph/resolver.ts","lineNumber":189,"sourceCode":" * 2. User override: ${XDG_DATA_HOME}/openspec/schemas/<name>/schema.yaml\n * 3. Package built-in: <package>/schemas/<name>/schema.yaml\n *\n * When projectRoot is not provided, only user override and package built-in are checked\n * (backward compatible behavior).\n *\n * @param name - Schema name (e.g., \"spec-driven\")\n * @param projectRoot - Optional project root directory for project-local schema resolution\n * @returns The resolved schema object\n * @throws Error if schema is not found in any location\n */\nexport function resolveSchema(name: string, projectRoot?: string): SchemaYaml {\n  // Normalize name (remove .yaml extension if provided)\n  const normalizedName = name.replace(/\\.ya?ml$/, '');\n\n  const schemaDir = getSchemaDir(normalizedName, projectRoot);\n  if (!schemaDir) {\n    const availableSchemas = listSchemas(projectRoot);\n    throw new Error(\n      `Schema '${normalizedName}' not found. Available schemas: ${availableSchemas.join(', ')}`\n    );\n  }\n\n  const schemaPath = path.join(schemaDir, 'schema.yaml');\n\n  // Load and parse the schema\n  let content: string;\n  try {\n    content = fs.readFileSync(schemaPath, 'utf-8');\n  } catch (err) {\n    const ioError = err instanceof Error ? err : new Error(String(err));\n    throw new SchemaLoadError(\n      `Failed to read schema at '${schemaPath}': ${ioError.message}`,\n      schemaPath,\n      ioError\n    );\n  }","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/artifact-graph/resolver.ts#L171-L207","documentation":"Error \"Schema '${normalizedName}' not found. Available schemas: ${availableSchemas.join(', ')}\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/artifact-graph/resolver.ts:189 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"}