{"record":{"id":"f371a24934a09310","repo":"Fission-AI/OpenSpec","slug":"failed-to-read-template-ioerror-message","errorCode":null,"errorMessage":"Failed to read template: ${ioError.message}","messagePattern":"Failed to read template: (.+?)","errorType":"exception","errorClass":"TemplateLoadError","httpStatus":null,"severity":"error","filePath":"src/core/artifact-graph/instruction-loader.ts","lineNumber":245,"sourceCode":"      error instanceof Error ? error.message : String(error),\n      templatePathOnDisk\n    );\n  }\n\n  if (!fs.existsSync(templatePathOnDisk)) {\n    throw new TemplateLoadError(\n      `Template not found: ${templatePathOnDisk}`,\n      templatePathOnDisk\n    );\n  }\n\n  const fullPath = FileSystemUtils.canonicalizeExistingPath(templatePathOnDisk);\n\n  try {\n    return fs.readFileSync(fullPath, 'utf-8');\n  } catch (err) {\n    const ioError = err instanceof Error ? err : new Error(String(err));\n    throw new TemplateLoadError(\n      `Failed to read template: ${ioError.message}`,\n      fullPath\n    );\n  }\n}\n\n/**\n * Loads change context combining graph and completion state.\n *\n * Schema resolution order:\n * 1. Explicit schemaName parameter (if provided)\n * 2. Schema from .openspec.yaml metadata (if exists in change directory)\n * 3. Default 'spec-driven'\n *\n * @param projectRoot - Project root directory\n * @param changeName - Change name\n * @param schemaName - Optional schema name override. If not provided, auto-detected from metadata.\n * @returns Change context with graph, completed set, and metadata","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/artifact-graph/instruction-loader.ts#L227-L263","documentation":"Error \"Failed to read template: ${ioError.message}\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/artifact-graph/instruction-loader.ts:245 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"}