{"record":{"id":"c6d3b6553dcc4bab","repo":"santifer/career-ops","slug":"config-profile-yml-cv-sections-lists-only-d","errorCode":null,"errorMessage":"⚠️  config/profile.yml cv.sections lists only \"${displayTitle(order[0])}\". An order needs at least two sections — one name states no relationship, so nothing was changed.","messagePattern":"⚠️  config/profile\\.yml cv\\.sections lists only \"(.+?)\"\\. An order needs at least two sections — one name states no relationship, so nothing was changed\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"generate-pdf.mjs","lineNumber":916,"sourceCode":" * too, in the order they should end up in.\n *\n * Runs before validateCvSectionOrder(), so the guard still judges what will\n * actually be printed — this satisfies the guard rather than bypassing it, which\n * is what separates it from --allow-reorder.\n *\n * No `cv.sections` → the input string is returned unchanged.\n *\n * @param {string} html\n * @param {string[]} order - Canonical section keys, e.g. ['skills', 'education'].\n * @returns {string}\n */\nexport function reorderCvSections(html, order) {\n  if (!Array.isArray(order) || order.length === 0) return html;\n  if (order.length < 2) {\n    // Not an error, but not a no-op worth staying quiet about either: one name\n    // states no relationship, so there is nothing to apply and the user would\n    // otherwise be left thinking the setting took effect.\n    console.warn(`⚠️  config/profile.yml cv.sections lists only \"${displayTitle(order[0])}\". An order needs at least two sections — one name states no relationship, so nothing was changed.`);\n    return html;\n  }\n\n  // No early return on an empty block list: a CV whose sections are all\n  // ambiguous produces none, and silently doing nothing is the failure mode\n  // this feature exists to remove. The per-name loop below reports first.\n  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","sourceCodeStart":898,"sourceCodeEnd":934,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/generate-pdf.mjs#L898-L934","documentation":"generate-pdf.mjs reorderCvSections() applies a user-supplied cv.sections order from config/profile.yml to the rendered CV HTML. An order array with a single entry states no ordering relationship, so the function is a no-op — it warns instead of silently ignoring, because the user would otherwise believe the setting took effect.","triggerScenarios":"config/profile.yml contains `cv.sections:` with exactly one entry (order.length < 2) passed to reorderCvSections during PDF generation. The function returns the HTML unchanged and prints this warning.","commonSituations":"User trimming an old multi-entry sections list down to one section they care about; hand-editing profile.yml and not realizing an order needs at least two names to be meaningful.","solutions":["Add at least one more section name to cv.sections so an actual order is expressed","If you only wanted one section emphasized, list the full desired order instead (all sections in sequence)","If no reordering is desired, remove the cv.sections key entirely to silence the warning","Regenerate the PDF after fixing the config"],"exampleFix":"# before: config/profile.yml\ncv:\n  sections:\n    - experience\n# after\ncv:\n  sections:\n    - summary\n    - experience\n    - skills","handlingStrategy":"validation","validationCode":"const order = profile.cv?.sections ?? [];\nif (order.length === 1) console.warn('cv.sections needs at least two entries to express an order');","typeGuard":"const isApplicableSectionOrder = (order) => Array.isArray(order) && order.length >= 2;","tryCatchPattern":null,"preventionTips":["Only set cv.sections when you intend to express a full ordering of at least two sections","List every section you want reordered, in the complete desired sequence","Remove the cv.sections key entirely if you want default order"],"tags":["config","cv","pdf","ordering"],"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"}