{"record":{"id":"faaef8786a5d84f4","repo":"santifer/career-ops","slug":"unknown-template-kind-kind","errorCode":null,"errorMessage":"Unknown template kind: ${kind}","messagePattern":"Unknown template kind: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cv-templates.mjs","lineNumber":207,"sourceCode":"// rather than settled by a precedence rule.\n//\n// Precedence would have to pick a winner while both files exist and both look\n// correct — during a migration from a flat template to a pack, say — and the\n// loser would simply stop being rendered, silently, with nothing in the output\n// naming the file that won. Failing at discovery costs one clear error and\n// makes the ambiguity impossible to ship past.\nfunction assertNoCollision(name, a, b, dir) {\n  const rel = (p) => p.slice(dir.length + 1) || p;\n  const [x, y] = [rel(a), rel(b)].sort();\n  throw new Error(\n    `Template name \"${name}\" is claimed by two files: ${x} and ${y}. `\n      + `A name must resolve to one template — rename one, or remove the one you no longer use.`\n  );\n}\n\nexport function listTemplates(kind, { dir = DEFAULT_TEMPLATES_DIR, format = 'html' } = {}) {\n  const cfg = KINDS[kind];\n  if (!cfg) throw new Error(`Unknown template kind: ${kind}`);\n  assertFormat(format);\n  return [...discover(kind, { dir, format }).values()].sort((a, b) => a.name.localeCompare(b.name));\n}\n\nexport function validateTemplate(path, kind) {\n  const cfg = KINDS[kind];\n  if (!cfg) throw new Error(`Unknown template kind: ${kind}`);\n  const text = readFileSync(path, 'utf-8');\n  const missing = cfg.required.filter((ph) => !text.includes(`{{${ph}}}`));\n  return { ok: missing.length === 0, missing };\n}\n\nexport function loadProfileDefault(kind, { profilePath = DEFAULT_PROFILE_PATH } = {}) {\n  const cfg = KINDS[kind];\n  if (!cfg) throw new Error(`Unknown template kind: ${kind}`);\n  if (!existsSync(profilePath)) return null;\n  let doc;\n  try {","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/cv-templates.mjs#L189-L225","documentation":"Generic kind guard in cv-templates.mjs template discovery: listTemplates was called with a template kind that has no configured directory/prefix mapping, so it cannot know where to look or what file prefix to match. The interpolated value is the unrecognized kind string — the caller passed something other than the known kinds (e.g. cv). It fires before any filesystem scan, so no files are consulted.","triggerScenarios":"Thrown at cv-templates.mjs:207 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the spelling/casing of the kind argument at the call site — it must be one of the kinds with an entry in the kind config map","Extend the kind config map in cv-templates.mjs if a genuinely new template category is being added"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aac998c7ed7248ea853b720ceeb1fdbeb322fc5d","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}