{"record":{"id":"62d7374626768f76","repo":"santifer/career-ops","slug":"skipping-malformed-pipe-delimited-filename","errorCode":null,"errorMessage":"⚠️  Skipping malformed pipe-delimited ${filename}: ${parts.length} fields","messagePattern":"⚠️  Skipping malformed pipe-delimited (.+?): (.+?) fields","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"merge-tracker.mjs","lineNumber":947,"sourceCode":"    // Number.isSafeInteger rather than isNaN: parseTrackerNum returns null for a\n    // cell that is not a whole positive integer, and isNaN(null) is false.\n    if (!Number.isSafeInteger(headed.num) || headed.num <= 0) {\n      console.warn(`⚠️  Skipping ${filename}: invalid entry number`);\n      return null;\n    }\n    return headed;\n  }\n\n  let parts;\n  let addition;\n\n  // Detect pipe-delimited (markdown table row)\n  if (content.startsWith('|')) {\n    parts = content.split('|').map(s => s.trim());\n    if (parts[0] === '') parts.shift();\n    if (parts[parts.length - 1] === '') parts.pop();\n    if (parts.length < 8) {\n      console.warn(`⚠️  Skipping malformed pipe-delimited ${filename}: ${parts.length} fields`);\n      return null;\n    }\n    // Format: num | date | company | role | score | status | pdf | report | notes [| location]\n    // Identify score vs status by content, not position, so a swapped row can't\n    // merge silently (#1427).\n    const resolved = resolveScoreStatus(parts[4], parts[5]);\n    if (!resolved) {\n      console.warn(`⚠️  Skipping ${filename}: cannot tell score from status in columns 5–6 (\"${parts[4]}\" | \"${parts[5]}\") — refusing to merge a possible column swap`);\n      return null;\n    }\n    addition = {\n      num: parseTrackerNum(parts[0]),\n      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(),","sourceCodeStart":929,"sourceCodeEnd":965,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/merge-tracker.mjs#L929-L965","documentation":"The legacy headerless parser accepts pipe-delimited Markdown table rows, but a row must carry at least 8 fields (num, date, company, role, score, status, pdf, report; notes and location are optional extras). A pipe row with fewer than 8 cells after trimming the leading/trailing empties is malformed and skipped rather than merged with shifted columns.","triggerScenarios":"parseTsvContent (merge-tracker.mjs:946-948): content starts with '|', so it splits on '|', trims and strips the boundary empties, and parts.length < 8. E.g. a row like | 42 | 2026-09-16 | Acme | Backend | 4.2/5 | Evaluated | ❌ | with the report cell missing.","commonSituations":"A markdown table row was copied from applications.md but truncated; cells were dropped when a note containing a pipe character split incorrectly; a writer used the 8-column form but lost a trailing cell to an unescaped pipe in notes; hand-editing removed a column.","solutions":["Complete the row to at least 8 pipe-delimited fields in order: num | date | company | role | score | status | pdf | report [| notes [| location]].","Escape or remove literal '|' characters inside notes (or move such notes out of the TSV) so they don't inflate or corrupt the cell count.","Prefer the headed TSV form (header labels + one tab-separated data row) — it resolves fields by name and avoids positional ambiguity entirely.","Re-run node merge-tracker.mjs after fixing and confirm the row merges."],"exampleFix":"// before (7 fields — report missing)\n| 42 | 2026-09-16 | Acme | Backend Engineer | 4.2/5 | Evaluated | ❌ |\n\n// after\n| 42 | 2026-09-16 | Acme | Backend Engineer | 4.2/5 | Evaluated | ❌ | [042](reports/042-acme-2026-09-16.md) | good fit |","handlingStrategy":"validation","validationCode":"if (row.startsWith('|')) {\n  const cells = row.split('|').map(s => s.trim()).filter((s, i, a) => !(i === 0 && s === '') && !(i === a.length - 1 && s === ''));\n  if (cells.length < 8) throw new Error(`${file}: pipe row needs >= 8 fields, got ${cells.length}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer the headed tab-separated TSV over markdown pipe rows — name-based resolution avoids positional fragility.","Escape or strip literal '|' characters in notes before emitting a pipe-delimited row.","Copy markdown rows from the tracker only with all columns intact; verify the cell count after pasting.","Keep a canonical row template with all 9-10 fields and fill it rather than deleting columns."],"tags":["tsv","parsing","merge-tracker","markdown-table"],"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"}