{"record":{"id":"e9d81cdfdaebc921","repo":"santifer/career-ops","slug":"config-profile-yml-cv-sections-lists-shown-e9d81c","errorCode":null,"errorMessage":"⚠️  config/profile.yml cv.sections lists \"${shown}\", which is not a CV section — ignoring it. Recognized: ${CV_SECTION_KEYS.join(', ')}.","messagePattern":"⚠️  config/profile\\.yml cv\\.sections lists \"(.+?)\", which is not a CV section — ignoring it\\. Recognized: (.+?)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"generate-pdf.mjs","lineNumber":783,"sourceCode":"  }\n\n  const chosen = [];\n  const unresolved = [];\n  const seen = new Set();\n  for (const name of order) {\n    // `name` comes from a config file and is quoted straight into console\n    // output, so it gets the same treatment as a rendered title: displayTitle()\n    // strips C0/C1 controls and bidi overrides (either can repaint a terminal\n    // line so a warning appears to say something the tool never printed) and\n    // bounds the length so one long entry cannot bury the message.\n    const shown = displayTitle(name);\n    if (seen.has(name)) {\n      console.warn(`⚠️  config/profile.yml cv.sections lists \"${shown}\" more than once — keeping its first position.`);\n      continue;\n    }\n    seen.add(name);\n    if (!CV_SECTION_KEYS.includes(name)) {\n      console.warn(`⚠️  config/profile.yml cv.sections lists \"${shown}\", which is not a CV section — ignoring it. Recognized: ${CV_SECTION_KEYS.join(', ')}.`);\n      continue;\n    }\n    const block = byKey.get(name);\n    if (block) {\n      chosen.push(block);\n    } else if (ambiguous.has(name)) {\n      // Present, but its markup doesn't stand on its own — it opens or closes\n      // elements outside itself, so moving it would leave tags unbalanced.\n      // Reported rather than skipped quietly: the section stays where the\n      // template put it, and the user would otherwise see a setting that\n      // silently does nothing.\n      console.warn(`⚠️  config/profile.yml cv.sections lists \"${shown}\", but this CV's markup does not enclose that section on its own — leaving it in place, because moving it would leave tags unbalanced.`);\n    } else {\n      // Recognized and unambiguous but with no block. Ordinarily that just means\n      // the section isn't in this CV (an optional one with no entries is\n      // stripped before the PDF step), which is not worth a warning on its own.\n      unresolved.push(name);\n    }","sourceCodeStart":765,"sourceCodeEnd":801,"githubUrl":"https://github.com/santifer/career-ops/blob/60398d6549a46f5266929538af21cfab94badc75/generate-pdf.mjs#L765-L801","documentation":"Each name in cv.sections must be one of the canonical section keys (CV_SECTION_KEYS, derived from the SECTION_ALIASES table in generate-pdf.mjs). A name not in that set is ignored with this warning, and the message lists the recognized keys so the fix is mechanical.","triggerScenarios":"Putting a display title or invented key in cv.sections — e.g. `sections: [tech-stack, experience]` where 'tech-stack' is not a canonical key — fails the CV_SECTION_KEYS.includes(name) check and is dropped from the reorder.","commonSituations":"User writes the human-readable heading ('Tech Stack') instead of the canonical key ('skills'); renaming a section in cv.md and assuming the config follows; typos like 'eductaion'.","solutions":["Replace the unrecognized name with a canonical key from the list printed in the warning itself","Print the full accepted set with `node -e \"import('./generate-pdf.mjs').then(m=>console.log(m.CV_SECTION_KEYS.join(', ')))\"` and pick from it","If the section genuinely needs a new canonical key, add an alias entry to SECTION_ALIASES in generate-pdf.mjs"],"exampleFix":"# before (config/profile.yml)\ncv:\n  sections: [tech-stack, experience, education]\n\n# after\ncv:\n  sections: [skills, experience, education]","handlingStrategy":"validation","validationCode":"// Canonical keys are exported from generate-pdf.mjs (derived from SECTION_ALIASES)\n// so the checker and the tool cannot drift:\nimport { CV_SECTION_KEYS } from './generate-pdf.mjs';\nconst bad = order.filter(name => !CV_SECTION_KEYS.includes(name));\nif (bad.length) throw new Error(`Unknown cv.sections names: ${bad.join(', ')}`);","typeGuard":"/** @param {string} name */\nfunction isCanonicalSectionKey(name, keys) {\n  return keys.includes(name);\n}","tryCatchPattern":null,"preventionTips":["Copy canonical keys from the warning's own 'Recognized:' list or CV_SECTION_KEYS, never from heading titles in the PDF","After renaming sections in cv.md, grep config/profile.yml for the old names"],"tags":["cli","config","unknown-key","cv-generation","warning"],"backgroundTag":"unknown-config-key","analyzedSha":"60398d6549a46f5266929538af21cfab94badc75","analyzedAt":"2026-08-20T23:00:06.764Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}