{"record":{"id":"3ad2369de0c7e97c","repo":"Fission-AI/OpenSpec","slug":"artifact-artifactid-not-found-in-schema-co-3ad236","errorCode":null,"errorMessage":"Artifact '${artifactId}' not found in schema '${context.schemaName}'","messagePattern":"Artifact '(.+?)' not found in schema '(.+?)'","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/artifact-graph/instruction-loader.ts","lineNumber":341,"sourceCode":" * @returns Enriched artifact instructions\n * @throws Error if artifact not found\n */\nexport interface GenerateInstructionsOptions {\n  /** Pre-read project config; suppresses the internal read (no double read). */\n  projectConfig?: ProjectConfig | null;\n  /** Referenced-store index assembled at the command boundary. */\n  references?: ReferenceIndexEntry[];\n}\n\nexport function generateInstructions(\n  context: ChangeContext,\n  artifactId: string,\n  projectRoot?: string,\n  options: GenerateInstructionsOptions = {}\n): ArtifactInstructions {\n  const artifact = context.graph.getArtifact(artifactId);\n  if (!artifact) {\n    throw new Error(`Artifact '${artifactId}' not found in schema '${context.schemaName}'`);\n  }\n\n  const templateContent = loadTemplate(context.schemaName, artifact.template, context.projectRoot);\n  const dependencies = getDependencyInfo(artifact, context.graph, context.completed, context.skippedArtifacts);\n  const unlocks = getUnlockedArtifacts(context.graph, artifactId);\n\n  // Use projectRoot from context if not explicitly provided\n  const effectiveProjectRoot = projectRoot ?? context.projectRoot;\n\n  // Use the pre-read config when provided; otherwise read it here.\n  let projectConfig = options.projectConfig ?? null;\n  if (options.projectConfig === undefined && effectiveProjectRoot) {\n    try {\n      projectConfig = readProjectConfig(effectiveProjectRoot);\n    } catch {\n      // If config read fails, continue without config\n    }\n  }","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/artifact-graph/instruction-loader.ts#L323-L359","documentation":"Error \"Artifact '${artifactId}' not found in schema '${context.schemaName}'\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/artifact-graph/instruction-loader.ts:341 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"}