{"record":{"id":"5b35e78c68a62bde","repo":"santifer/career-ops","slug":"skipping-filename-header-labels-the-same-column-twice-new","errorCode":null,"errorMessage":"⚠️  Skipping ${filename}: header labels the same column twice (${[...new Set(duplicates)].join(', ')}) — refusing to guess which one carries the value","messagePattern":"⚠️  Skipping (.+?): header labels the same column twice \\((.+?)\\) — refusing to guess which one carries the value","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"merge-tracker.mjs","lineNumber":784,"sourceCode":"\n/**\n * Parse a HEADED addition: a row of column labels followed by exactly one data\n * row. Fields resolve by NAME, so no column order is privileged and the\n * score/status pair needs no content sniffing.\n *\n * This is the form that has no undecidable case. `resolveScoreStatus` cannot\n * order a discarded, never-scored row (`—` is both a score sentinel and a\n * status meaning Discarded), so the headerless path refuses it; a header row\n * answers it outright (#3517).\n *\n * @param {string[]} lines - Non-empty lines of the addition file.\n * @param {string} filename - Source filename used in warning messages.\n * @returns {object|null} Parsed tracker addition, or null when malformed.\n */\nfunction parseHeadedAddition(lines, filename) {\n  const { map, missing, duplicates, unknown } = resolveTsvColumns(splitAdditionCells(lines[0]));\n  if (duplicates.length) {\n    console.warn(`⚠️  Skipping ${filename}: header labels the same column twice (${[...new Set(duplicates)].join(', ')}) — refusing to guess which one carries the value`);\n    return null;\n  }\n  if (missing.length) {\n    console.warn(`⚠️  Skipping ${filename}: header is missing required column(s): ${missing.join(', ')}`);\n    return null;\n  }\n  if (unknown.length) {\n    // Not fatal: an unrecognized label is a column this version has no meaning\n    // for, and dropping it loses nothing the tracker could store anyway. Say so\n    // rather than swallowing it, since the usual cause is a typo'd label.\n    console.warn(`⚠️  ${filename}: ignoring unrecognized header column(s): ${unknown.join(', ')}`);\n  }\n\n  const dataLines = lines.slice(1);\n  if (dataLines.length === 0) {\n    console.warn(`⚠️  Skipping ${filename}: header row with no data row`);\n    return null;\n  }","sourceCodeStart":766,"sourceCodeEnd":802,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/merge-tracker.mjs#L766-L802","documentation":"parseHeadedAddition() in merge-tracker.mjs resolves TSV header labels to fields via resolveTsvColumns(). If the same required/optional label appears in two columns (e.g. two 'score' headers), the value's column is undecidable, so the file is refused with this warning and nothing is merged — deliberate 'refuse to guess' behavior to avoid transposed rows.","triggerScenarios":"A batch/tracker-additions/*.tsv whose header row lists the same label twice, including alias spellings that resolve to the same field (e.g. 'company' and a synonym alias both present).","commonSituations":"Hand-building a header row and duplicating a column; template concatenation errors; adding a synonym alias column next to the canonical one.","solutions":["Remove the duplicate header column (and its value) so each label appears once","Check for alias spellings that map to the same field and keep only one","Re-run merge-tracker.mjs after fixing the header"],"exampleFix":"// before\nnum\\tdate\\tcompany\\trole\\tscore\\tstatus\\tpdf\\treport\\tscore\\tnotes\n// after\nnum\\tdate\\tcompany\\trole\\tscore\\tstatus\\tpdf\\treport\\tnotes","handlingStrategy":"validation","validationCode":"const labels = headerRow.split('\\t');\nconst dupes = labels.filter((l, i) => labels.indexOf(l) !== i);\nif (dupes.length) throw new Error('Duplicate header labels: ' + dupes.join(', '));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy the canonical header template instead of writing headers by hand","Keep one column per field — merge extra data into notes","Verify merge-tracker.mjs output for skip warnings after each batch"],"tags":["tsv","header-validation","tracker","duplicate-column"],"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"}