{"record":{"id":"94b280f5874a0c9d","repo":"santifer/career-ops","slug":"orphan-report-no-tracker-row-references-num","errorCode":null,"errorMessage":"Orphan report — no tracker row references #${num}: reports/${name}","messagePattern":"Orphan report — no tracker row references #(.+?): reports/(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"verify-pipeline.mjs","lineNumber":361,"sourceCode":"for (const e of entries) {\n  const linkTexts = [...e.report.matchAll(/\\[(\\d+)\\]/g)];\n  const linkTargets = [...e.report.matchAll(/\\]\\(([^)]+)\\)/g)];\n  if (linkTexts.length === 0 && linkTargets.length === 0) {\n    referencedNums.add(e.num);\n    continue;\n  }\n  for (const lt of linkTexts) referencedNums.add(parseInt(lt[1], 10));\n  for (const lt of linkTargets) {\n    const m = lt[1].split(/[\\\\/]/).pop().match(/^(\\d+)-/);\n    if (m) referencedNums.add(parseInt(m[1], 10));\n  }\n}\n\nlet orphanReports = 0;\nfor (const name of reportFiles) {\n  const num = parseInt(name.match(REPORT_FILE_RE)[1], 10);\n  if (!referencedNums.has(num)) {\n    warn(`Orphan report — no tracker row references #${num}: reports/${name}`);\n    orphanReports++;\n  }\n}\nif (orphanReports === 0) ok('No orphan reports');\n\n// --- Check 11: Via channel consistency (#1596) ---\n// The Via column records the intermediary (agency/recruiter firm; `—` when the\n// application was direct). Unknown employers use the structural marker `?` in\n// Company — never a word like \"Confidential\", which is locale-dependent and can\n// collide with a real firm name.\nlet viaIssues = 0;\nconst CONFIDENTIAL_WORD_RE = /^(confidential|vertraulich|confidentiel|confidencial|riservato|gizli|機密|سري)$/i;\nfor (const e of entries) {\n  const company = String(e.company || '').trim();\n  const via = String(e.via || '').trim();\n  if (company === '?') {\n    if (COLMAP.via == null) {\n      warn(`#${e.num}: unknown employer (?) but the tracker has no Via column — add it with: node merge-tracker.mjs --migrate-via`);","sourceCodeStart":343,"sourceCodeEnd":379,"githubUrl":"https://github.com/santifer/career-ops/blob/e7abd431fce9348a95261acac9e0c14779c35df8/verify-pipeline.mjs#L343-L379","documentation":"A warning from verify-pipeline.mjs (Check 10, #1425) that a report file in reports/ has a report number no tracker row references — an 'orphan report'. Every evaluation report should be linked from a data/applications.md row (Report column: `[NNN](reports/...)`); orphans mean an evaluation happened but was never tracked, so pipeline stats and dedup miss it.","triggerScenarios":"Running `node verify-pipeline.mjs` when reports/ contains a numbered report whose number is absent from every tracker row's Report link — e.g. the tracker row was deleted, the report was written but merge-tracker.mjs never ran/failed, or the row's report link was edited away.","commonSituations":"Deleting tracker rows during manual cleanup while keeping reports/; interrupted batches (report written, TSV merge failed); backfilled tracker entries that forgot the report link; renaming report numbers by hand.","solutions":["Evaluate whether the report is still relevant: if yes, add its tracker row via the TSV-inbox (batch/tracker-additions/) and `node merge-tracker.mjs`.","If the report is obsolete, delete it or move it out of reports/ so numbering and checks stay clean.","Re-link a lost reference by restoring the `[NNN](reports/NNN-...)` markdown in the existing row's Report column.","Run `node merge-tracker.mjs` after every evaluation batch to prevent orphans from ever accumulating."],"exampleFix":"// before: row exists but Report cell empty\n| 42 | 2026-09-16 | Acme | Sr Backend | 4.5/5 | Evaluated | ❌ |  | ... |\n// after\n| 42 | 2026-09-16 | Acme | Sr Backend | 4.5/5 | Evaluated | ❌ | [42](reports/042-acme-sr-backend-2026-09-16.md) | ... |","handlingStrategy":"validation","validationCode":"const nums = new Set(reportFiles.map(n => parseInt(n.match(/^(\\d{3})-/)[1], 10)));\nconst referenced = new Set(rows.flatMap(r => r.reportNums));\nfor (const n of nums) if (!referenced.has(n)) console.warn(`orphan report #${n} — add or delete`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always run merge-tracker.mjs after writing reports so every report gets a row.","When deleting tracker rows, archive or delete their reports too.","Keep the `[NNN](reports/...)` link intact when editing the Report column."],"tags":["orphan-data","tracker","reports","pipeline-integrity"],"backgroundTag":"orphaned-record","analyzedSha":"e7abd431fce9348a95261acac9e0c14779c35df8","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}