{"record":{"id":"12843bf20d3ae5e8","repo":"santifer/career-ops","slug":"message-proceeding-allow-reorder-set","errorCode":null,"errorMessage":"⚠️  ${message} (proceeding — --allow-reorder set)","messagePattern":"⚠️  (.+?) \\(proceeding — --allow-reorder set\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"generate-pdf.mjs","lineNumber":488,"sourceCode":"  if (findOrderDivergence(renderedComparable, sourcePositions) === -1) return;\n\n  // Diverges from cv.md — but that alone isn't damning: it's also what every\n  // CV tailored per modes/pdf.md's documented order looks like. Only treat it\n  // as a real problem if it ALSO fails to match that canonical order.\n  const canonicalComparable = rendered.filter(section => CANONICAL_TAILORED_POSITIONS.has(section.key));\n  if (canonicalComparable.length >= 2\n      && findOrderDivergence(canonicalComparable, CANONICAL_TAILORED_POSITIONS) === -1) {\n    return;\n  }\n\n  const renderedOrder = renderedComparable.map(section => section.title).join(' -> ');\n  const sourceOrder = source\n    .filter(section => renderedComparable.some(renderedSection => renderedSection.key === section.key))\n    .map(section => section.title)\n    .join(' -> ');\n  const message = `CV section order diverges from cv.md: rendered ${renderedOrder}; cv.md ${sourceOrder}`;\n  if (allowReorder) {\n    console.warn(`⚠️  ${message} (proceeding — --allow-reorder set)`);\n    return;\n  }\n  throw new Error(message);\n}\n\n/**\n * Every canonical section key the alias table can produce, in template order.\n * Derived from the table rather than restated so the two cannot drift.\n */\nexport const CV_SECTION_KEYS = [...new Set(SECTION_ALIASES.values())];\n\n// The all-caps comments the templates use to delimit sections, matched exactly\n// as cv-sections-core.mjs matches them when stripping empty sections.\nconst SECTION_MARKER_RE = /<!--\\s+[A-Z][A-Z ]*-->/g;\nconst SECTION_TITLE_RE = /class=[\"'][^\"']*\\bsection-title\\b[^\"']*[\"'][^>]*>([\\s\\S]*?)<\\/[^>]+>/gi;\n\nconst DISPLAY_TITLE_MAX = 60;\n","sourceCodeStart":470,"sourceCodeEnd":506,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/generate-pdf.mjs#L470-L506","documentation":"validateCvSectionOrder() in generate-pdf.mjs compares the section order of the rendered CV against the canonical order in cv.md. On divergence it throws unless --allow-reorder was passed, in which case it prints this warning and continues. The guard exists so CV sections never silently get reordered away from the user's authored source; --allow-reorder is the explicit opt-out.","triggerScenarios":"Calling validateCvSectionOrder (indirectly via generate-pdf.mjs / the pdf mode) with allowReorder=true when the rendered section sequence differs from the cv.md source sequence — e.g. the template or tailoring step emits Summary/Education before Experience while cv.md lists them in another order, or a section is rendered in a different position than authored.","commonSituations":"Tailored CVs where an earlier step reorders sections to match a job posting; hand-edited cv.md after the template was customized with a fixed section order; adding a new section to cv.md that the template places in a different slot; running with --allow-reorder intentionally during template experimentation.","solutions":["If the reorder is unintended, align one side: either reorder sections in cv.md to match the template, or update templates/cv-template.html to render in cv.md's order.","If the reorder is intended, keep passing --allow-reorder (the warning is informational and the render proceeds).","Inspect renderedOrder vs sourceOrder printed in the message to see exactly which sections moved, then fix that specific section's position.","If a recent edit to cv.md caused it, diff cv.md against the last known-good version to find the section move."],"exampleFix":"// before (suppressing the guard every run)\nnode generate-pdf.mjs --allow-reorder\n// after (fix the source order to match intent)\n# cv.md\n## Summary\n## Experience\n## Education\n# template renders in the same sequence, no flag needed\nnode generate-pdf.mjs","handlingStrategy":"validation","validationCode":"const authoredOrder = [...cvMd.matchAll(/^##\\s+(.+)$/gm)].map(m => m[1].trim());\nconst templateOrder = ['Summary', 'Experience', 'Education', 'Skills']; // whatever the template renders\nconst same = JSON.stringify(authoredOrder) === JSON.stringify(templateOrder);\nif (!same) console.warn('Section order mismatch — fix cv.md or template before generating PDF');","typeGuard":null,"tryCatchPattern":"try {\n  await generatePdf({ sections });\n} catch (err) {\n  if (err.message.includes('section order diverges')) {\n    console.error('Reorder sections in cv.md to match the template, or re-run with --allow-reorder');\n  }\n  throw err;\n}","preventionTips":["Keep cv.md's '##' section order in sync with templates/cv-template.html after any template customization.","Diff cv.md after hand edits to catch accidental section moves.","Use --allow-reorder only deliberately (tailored reorderings), not to silence recurring warnings.","Read the rendered-vs-source order in the warning message to pinpoint exactly which section moved."],"tags":["validation","ordering","cv","cli"],"backgroundTag":"schema-validation-failed","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"}