santifer/career-ops · warning

⚠️ Skipping malformed pipe-delimited

Error message

⚠️  Skipping malformed pipe-delimited ${filename}: ${parts.length} fields

What it means

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.

Solutions

  1. Complete the row to at least 8 pipe-delimited fields in order: num | date | company | role | score | status | pdf | report [| notes [| location]].
  2. 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.
  3. Prefer the headed TSV form (header labels + one tab-separated data row) — it resolves fields by name and avoids positional ambiguity entirely.
  4. Re-run node merge-tracker.mjs after fixing and confirm the row merges.

Example fix

// before (7 fields — report missing)
| 42 | 2026-09-16 | Acme | Backend Engineer | 4.2/5 | Evaluated | ❌ |

// after
| 42 | 2026-09-16 | Acme | Backend Engineer | 4.2/5 | Evaluated | ❌ | [042](reports/042-acme-2026-09-16.md) | good fit |
Defensive patterns

Strategy: validation

Validate before calling

if (row.startsWith('|')) {
  const cells = row.split('|').map(s => s.trim()).filter((s, i, a) => !(i === 0 && s === '') && !(i === a.length - 1 && s === ''));
  if (cells.length < 8) throw new Error(`${file}: pipe row needs >= 8 fields, got ${cells.length}`);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of santifer/career-ops@aac998c7ed (2026-09-16). Data as JSON: /api/errors/62d7374626768f76. Report an issue: GitHub.

Appendix: source

Thrown at merge-tracker.mjs:947

    // Number.isSafeInteger rather than isNaN: parseTrackerNum returns null for a
    // cell that is not a whole positive integer, and isNaN(null) is false.
    if (!Number.isSafeInteger(headed.num) || headed.num <= 0) {
      console.warn(`⚠️  Skipping ${filename}: invalid entry number`);
      return null;
    }
    return headed;
  }

  let parts;
  let addition;

  // Detect pipe-delimited (markdown table row)
  if (content.startsWith('|')) {
    parts = content.split('|').map(s => s.trim());
    if (parts[0] === '') parts.shift();
    if (parts[parts.length - 1] === '') parts.pop();
    if (parts.length < 8) {
      console.warn(`⚠️  Skipping malformed pipe-delimited ${filename}: ${parts.length} fields`);
      return null;
    }
    // Format: num | date | company | role | score | status | pdf | report | notes [| location]
    // Identify score vs status by content, not position, so a swapped row can't
    // merge silently (#1427).
    const resolved = resolveScoreStatus(parts[4], parts[5]);
    if (!resolved) {
      console.warn(`⚠️  Skipping ${filename}: cannot tell score from status in columns 5–6 ("${parts[4]}" | "${parts[5]}") — refusing to merge a possible column swap`);
      return null;
    }
    addition = {
      num: parseTrackerNum(parts[0]),
      date: parts[1],
      company: parts[2],
      role: parts[3],
      // Write-canonical: the tracker stores scores unbolded (verify-pipeline
      // rejects bold scores), so strip any markdown bold from the incoming cell.
      score: resolved.score.replace(/\*\*/g, '').trim(),

View on GitHub (pinned to aac998c7ed)