{"record":{"id":"ba34e3cf4b22fadd","repo":"santifer/career-ops","slug":"skipping-malformed-tsv-filename-parts-le","errorCode":null,"errorMessage":"⚠️  Skipping malformed TSV ${filename}: ${parts.length} fields","messagePattern":"⚠️  Skipping malformed TSV (.+?): (.+?) fields","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"merge-tracker.mjs","lineNumber":978,"sourceCode":"      date: parts[1],\n      company: parts[2],\n      role: parts[3],\n      // Write-canonical: the tracker stores scores unbolded (verify-pipeline\n      // rejects bold scores), so strip any markdown bold from the incoming cell.\n      score: resolved.score.replace(/\\*\\*/g, '').trim(),\n      status: validateStatus(resolved.status),\n      pdf: parts[6],\n      report: parts[7],\n      notes: parts[8] || '',\n    };\n    const extras = parseTsvExtras(parts, filename);\n    if (!extras) return null;\n    Object.assign(addition, extras);\n  } else {\n    // Tab-separated\n    parts = content.split('\\t');\n    if (parts.length < 8) {\n      console.warn(`⚠️  Skipping malformed TSV ${filename}: ${parts.length} fields`);\n      return null;\n    }\n\n    // Column order varies: batch TSVs write (status, score), applications.md is\n    // (score, status). Identify each by content — the score cell is recognizable\n    // by pattern, a status never is — so a reordered TSV merges correctly and an\n    // undecidable row is skipped loudly instead of merging swapped data (#1427).\n    const resolved = resolveScoreStatus(parts[4].trim(), parts[5].trim());\n    if (!resolved) {\n      console.warn(`⚠️  Skipping ${filename}: cannot tell score from status in columns 5–6 (\"${parts[4].trim()}\" | \"${parts[5].trim()}\") — refusing to merge a possible column swap`);\n      return null;\n    }\n\n    addition = {\n      num: parseTrackerNum(parts[0]),\n      date: parts[1],\n      company: parts[2],\n      role: parts[3],","sourceCodeStart":960,"sourceCodeEnd":996,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/merge-tracker.mjs#L960-L996","documentation":"The legacy headerless tab-separated path requires at least 8 fields (num, date, company, role, score, status, pdf, report). A TSV row with fewer than 8 tab-separated cells is malformed — merging it would leave later fields undefined or shifted — so the file is skipped with this warning instead.","triggerScenarios":"parseTsvContent (merge-tracker.mjs:976-979): content does not start with '|' and is not recognized as a header row, so content.split('\\t') yields parts.length < 8. E.g. a row with only the first 6-7 positional cells, often from a missing trailing tab or a truncated write.","commonSituations":"A script built the row with join('\\t') over a short array; the final tab of a row ending in an empty optional cell was stripped by a text editor or trimming (the parser splits raw content precisely to avoid this, but a genuinely short row still fails); a CSV was mis-saved as TSV so the whole row is one tab-less cell; a writer used commas instead of tabs.","solutions":["Complete the row to at least 8 tab-separated fields in the documented order: num\\tdate\\tcompany\\trole\\tscore\\tstatus\\tpdf\\treport (then notes and any via=/location/url extras).","Make sure the delimiters are real tab characters, not spaces or commas — re-save with actual tabs or use the headed form to avoid positional issues.","If the row should end with an empty optional cell, keep the trailing tab; don't let an editor trim it.","Prefer writing the headed TSV (header labels + one data row) so merge-tracker resolves every field by name.","Re-run node merge-tracker.mjs after fixing and confirm the row merges."],"exampleFix":"// before (6 fields, comma-delimited)\n42,2026-09-16,Acme,Backend Engineer,4.2/5,Evaluated\n\n// after (tab-separated, 9 fields)\n42\t2026-09-16\tAcme\tBackend Engineer\t4.2/5\tEvaluated\t❌\t[042](reports/042-acme-2026-09-16.md)\tgood fit","handlingStrategy":"validation","validationCode":"const cells = row.split('\\t');\nif (cells.length < 8) {\n  throw new Error(`${file}: TSV row needs >= 8 tab-separated fields, got ${cells.length}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build rows with an array join('\\t') over a fixed 8+ element array so the width is structural, not hand-typed.","Confirm the delimiter is a real tab character (printf '\\t'), not a space or comma — and never save the file as CSV.","Preserve trailing tabs for empty optional cells; disable editor 'strip trailing whitespace' for these files.","Prefer the headed TSV form so field resolution doesn't depend on position or width."],"tags":["tsv","parsing","merge-tracker","malformed-row"],"backgroundTag":"invalid-argument-format","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"}