{"record":{"id":"a3e861d9f9b59474","repo":"diegosouzapw/OmniRoute","slug":"unknown-stage-stage","errorCode":null,"errorMessage":"Unknown stage: ${stage}","messagePattern":"Unknown stage: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/domain/prompts.ts","lineNumber":97,"sourceCode":" * @returns Interpolated string\n */\nexport function interpolate(template: string, variables: Record<string, string>): string {\n  return template.replace(/\\{(\\w+)\\}/g, (match, key) => {\n    return key in variables ? variables[key] : match;\n  });\n}\n\n/**\n * Render a stage prompt with the given variables.\n *\n * @param stage - The pipeline stage name\n * @param variables - Variable values for interpolation\n * @returns Rendered system and user prompt strings\n */\nexport function renderPrompt(stage: StageName, variables: Record<string, string>): StagePrompt {\n  const template = STAGE_PROMPTS[stage];\n  if (!template) {\n    throw new Error(`Unknown stage: ${stage}`);\n  }\n  return {\n    system: interpolate(template.system, variables),\n    user: interpolate(template.user, variables),\n  };\n}\n","sourceCodeStart":79,"sourceCodeEnd":104,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/domain/prompts.ts#L79-L104","documentation":"renderPrompt looked up STAGE_PROMPTS[stage] and found no template for the given pipeline stage name, meaning an unknown/typo'd StageName was passed. The prompt pipeline cannot render system/user prompts for a stage that has no registered template.","triggerScenarios":"Thrown at src/domain/prompts.ts:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Constrain the stage parameter to the StageName type to catch typos at compile time","Add the missing stage to STAGE_PROMPTS if it is a new pipeline stage","List known stages in the error message for faster diagnosis"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}