santifer/career-ops · warning

⚠️ Skipping : invalid entry number

Error message

⚠️  Skipping ${filename}: invalid entry number

What it means

After a headed addition parses, its entry number must be a safe positive integer — parseTrackerNum returns null for a cell that is not a whole positive integer, and the check uses Number.isSafeInteger because isNaN(null) is false. A file whose num cell is missing, non-numeric, zero, or negative is skipped so a row without a usable tracker number cannot corrupt applications.md.

Solutions

  1. Set the num cell to the intended whole positive integer (the tracker entry number, zero-padded 3-digit form like 042 is fine).
  2. If no number is assigned yet, reserve one first (node reserve-report-num.mjs or the next max+1 in the tracker) and write that.
  3. Confirm you are not putting the report file number in the wrong column — num is the tracker entry number.
  4. Strip any non-numeric characters (units, dashes, notes) from the num cell.

Example fix

// before
num	date	company	role	score	status	pdf	report
TODO	2026-09-16	Acme	Backend	4.2/5	Evaluated	❌	[042](reports/042.md)

// after
num	date	company	role	score	status	pdf	report
42	2026-09-16	Acme	Backend	4.2/5	Evaluated	❌	[042](reports/042.md)
Defensive patterns

Strategy: validation

Validate before calling

const num = Number.parseInt(cells[header.indexOf('num')], 10);
if (!Number.isSafeInteger(num) || num <= 0) {
  throw new Error(`${file}: entry number must be a whole positive integer, got "${cells[header.indexOf('num')]}"`);
}

Type guard

const isValidTrackerNum = (v) => {
  const n = Number(v);
  return Number.isSafeInteger(n) && n > 0;
};

Prevention

When it happens

Trigger: parseTsvContent (merge-tracker.mjs:931): headed.num is null (parseTrackerNum failed on a non-integer string like '042a', 'N/A', ''), <= 0, or exceeds Number.MAX_SAFE_INTEGER. The header parsed fine and the row mapped, but the num cell itself is unusable.

Common situations: The num cell was left blank or filled with a placeholder like 'TODO'; a zero-padded value got mangled ('042-' with a trailing dash); the writer put the report number where the entry number belongs or vice versa; a spreadsheet exported the num column as text with formatting characters.

Understand the failure class

Background: "invalid id" errors: invalid identifier format — why libraries reject IDs before lookup, and how to fix them — this error's family across 37 libraries.

Related errors


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

Appendix: source

Thrown at merge-tracker.mjs:932

function parseTsvContent(content, filename) {
  // Split the RAW content: trimming the whole file strips the data row's
  // trailing tab, and that tab IS the final empty cell (`…\tnotes\t` for an
  // absent url). Trimming first made a row's last column disappear, so the
  // width check then read the row as one cell short of its own header.
  const rawLines = String(content ?? '').split(/\r?\n/).filter(l => l.trim() !== '');
  content = String(content ?? '').trim();
  if (!content) return null;

  // Headed additions resolve by name; everything below is the legacy positional
  // path, unchanged — it keeps parsing the trimmed content, byte-for-byte as
  // before. Detection reads only the first line.
  if (looksLikeTsvHeaderRow(splitAdditionCells(rawLines[0]))) {
    const headed = parseHeadedAddition(rawLines, filename);
    if (!headed) return null;
    // 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]

View on GitHub (pinned to aac998c7ed)