{"record":{"id":"7f4be5bc91621cf2","repo":"santifer/career-ops","slug":"config-profile-yml-cv-sections-lists-shown","errorCode":null,"errorMessage":"⚠️  config/profile.yml cv.sections lists \"${shown}\" more than once — keeping its first position.","messagePattern":"⚠️  config/profile\\.yml cv\\.sections lists \"(.+?)\" more than once — keeping its first position\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"generate-pdf.mjs","lineNumber":941,"sourceCode":"  const { blocks, ambiguous, unrecognized } = extractSectionBlocks(html);\n\n  const byKey = new Map();\n  for (const block of blocks) {\n    if (!byKey.has(block.key)) byKey.set(block.key, block);\n  }\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 {","sourceCodeStart":923,"sourceCodeEnd":959,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/generate-pdf.mjs#L923-L959","documentation":"While applying the cv.sections order from config/profile.yml, generate-pdf.mjs iterates the requested names and de-duplicates them. A name appearing more than once is redundant (the second occurrence has no effect), so it warns, keeps the first position, and skips the duplicate via `continue`.","triggerScenarios":"`cv.sections` in config/profile.yml lists the same section key twice, e.g. `['experience','skills','experience']`. The seen Set detects the repeat at generate-pdf.mjs:940 and emits this warning before continuing.","commonSituations":"Copy-paste editing of the sections list; merging two people's config snippets; scripted config generation appending defaults to user choices.","solutions":["Remove the duplicate entry from cv.sections, keeping one occurrence at the desired position","Re-run PDF generation; the first occurrence's position is already respected, so output will not change","If generating config programmatically, de-duplicate while preserving first-seen order (new Set(list))"],"exampleFix":"# before: config/profile.yml\ncv:\n  sections: [experience, skills, experience]\n# after\ncv:\n  sections: [experience, skills]","handlingStrategy":"validation","validationCode":"const sections = profile.cv?.sections ?? [];\nconst dupes = sections.filter((s, i) => sections.indexOf(s) !== i);\nif (dupes.length) console.warn('duplicate cv.sections entries:', [...new Set(dupes)]);","typeGuard":"const hasDuplicateSections = (order) => new Set(order).size !== order.length;","tryCatchPattern":null,"preventionTips":["De-duplicate generated section lists while preserving first-seen order (new Set)","Review profile.yml after merges or scripted edits","Keep one source of truth for the sections list"],"tags":["config","cv","pdf","duplicate"],"backgroundTag":"invalid-config-value","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"}