{"record":{"id":"31d18be9dc63a304","repo":"santifer/career-ops","slug":"skipping-file-report-reportnum-is-mark","errorCode":null,"errorMessage":"⚠️  Skipping ${file}: report #${reportNum} is marked \"failed\" in batch-state.tsv — refusing to merge a tracker line for an offer the batch runner itself recorded as failed (possible fabricated result)","messagePattern":"⚠️  Skipping (.+?): report #(.+?) is marked \"failed\" in batch-state\\.tsv — refusing to merge a tracker line for an offer the batch runner itself recorded as failed \\(possible fabricated result\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"merge-tracker.mjs","lineNumber":1401,"sourceCode":"  // The TSV convention carries a root-relative `reports/...` link; rewrite it\n  // so it resolves correctly when clicked from applications.md (see #760).\n  addition.report = normalizeReportLink(addition.report);\n\n  // Derive the key from the linked report when the TSV did not carry one, so a\n  // row added through the normal nine-column flow is born WITH its key. This\n  // must run before the dedup below reads addition.url — deriving it afterwards\n  // would populate the column while leaving Pass 0 nothing to match on, which is\n  // the original bug with extra steps.\n  if (!addition.url) addition.url = resolveReportUrl(addition.report).url;\n\n  // Check for duplicate by:\n  // 0. Exact normalized posting URL (deterministic, authoritative)\n  // 1. Exact report number match\n  // 2. Company + role fuzzy match\n  const reportNum = extractReportNum(addition.report, addition.notes);\n\n  if (reportNum && FAILED_REPORT_NUMBERS.has(reportNum)) {\n    console.warn(`⚠️  Skipping ${file}: report #${reportNum} is marked \"failed\" in batch-state.tsv — refusing to merge a tracker line for an offer the batch runner itself recorded as failed (possible fabricated result)`);\n    skipped++;\n    continue;\n  }\n\n  let duplicate = null;\n  // True only for a tier-1 match (report number + company): the one heuristic\n  // tier where the addition is provably the same evaluation as the existing\n  // row, so its role title may replace the row's. Tier-2 (entry num) and\n  // tier-3 (fuzzy role) matches keep the existing title — a fuzzy false\n  // positive that also rewrites the title destroys the evidence that two reqs\n  // were distinct. Pass 0 (URL) grants the same trust for the same reason; it\n  // tracks that separately in `dupReason`.\n  let reportNumMatched = false;\n\n  // Pass 0 — the posting URL is the stable natural key. When it hits it is\n  // authoritative and no heuristic runs. Tiers 1-3 below remain the fallback\n  // for rows with no URL yet.\n  const addUrl = normalizeUrl(addition.url);","sourceCodeStart":1383,"sourceCodeEnd":1419,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/merge-tracker.mjs#L1383-L1419","documentation":"batch-state.tsv records which batch workers failed. If a tracker addition references a report number the batch runner itself marked 'failed', the line is almost certainly a fabricated result from a hallucinating worker, so merge-tracker.mjs skips it and increments the skipped counter rather than merging a tracker row for an offer that never completed evaluation.","triggerScenarios":"extractReportNum() pulls a report number from the addition's report link or notes and that number is in FAILED_REPORT_NUMBERS (loaded from batch-state.tsv) during the dedup pass.","commonSituations":"A batch worker crashed after reserving report #042 but still wrote a tracker-additions TSV (partially hallucinated content); a worker retried and succeeded under a new number while its stale first output lingers; running merge after an aborted batch run.","solutions":["Delete or fix the offending TSV in batch/tracker-additions/ — do not merge a failed evaluation.","Re-run the failed evaluation (reserve a fresh number with node reserve-report-num.mjs) and let the new worker write a clean TSV.","Inspect the worker's output/logs to confirm whether the failure was transient before regenerating.","If batch-state.tsv's 'failed' mark is stale/incorrect (the run actually succeeded), correct batch-state.tsv, then re-merge."],"exampleFix":"# before\n$ ls batch/tracker-additions/\n042-acme.tsv        # report 042 marked failed\n$ node merge-tracker.mjs   # ⚠️ skipped\n# after\n$ rm batch/tracker-additions/042-acme.tsv\n$ node reserve-report-num.mjs --count 1   # e.g. 043\n# re-run the worker for 043, then merge","handlingStrategy":"validation","validationCode":"import { readFileSync } from 'node:fs';\nconst failed = new Set(readFileSync('batch/batch-state.tsv','utf8').split('\\n').filter(l => l.includes('failed')).map(l => l.split('\\t')[0]));\nif (failed.has(reportNum)) throw new Error(`report #${reportNum} failed in batch — do not merge`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never write tracker additions from a worker whose evaluation failed — check batch-state.tsv first.","Have workers write TSVs only on successful completion.","Clean up batch/tracker-additions/ after aborted batch runs before merging.","Cross-check report numbers against batch-state.tsv in CI."],"tags":["batch","data-integrity","anti-fabrication"],"backgroundTag":"internal-invariant-violation","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"}