{"record":{"id":"fd3a6645377af067","repo":"santifer/career-ops","slug":"invalid-reportnum-entryreport-use-the-numeri","errorCode":null,"errorMessage":"invalid reportNum \"${entryReport}\" (use the numeric report number)","messagePattern":"invalid reportNum \"(.+?)\" \\(use the numeric report number\\)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"generate-pdf.mjs","lineNumber":1468,"sourceCode":"  // single render is: it is the anchor readStyleTokens() and the cv.md read\n  // already use, so one profile.yml supplies every setting.\n  const cvSectionOrder = readCvSectionOrder(resolve(workspaceRoot, 'config', 'profile.yml'));\n\n  for (let i = 0; i < manifest.length; i++) {\n    const spec = manifest[i];\n    try {\n      if (!spec || typeof spec.input !== 'string' || typeof spec.output !== 'string') {\n        throw new Error('each entry needs a string \"input\" and \"output\"');\n      }\n\n      const entryFormat = (spec.format || globals.format).toLowerCase();\n      if (!validFormats.includes(entryFormat)) {\n        throw new Error(`invalid format \"${entryFormat}\" (use: ${validFormats.join(', ')})`);\n      }\n\n      const entryReport = (spec.reportNum ?? '').toString().trim();\n      if (entryReport && !/^\\d+$/.test(entryReport)) {\n        throw new Error(`invalid reportNum \"${entryReport}\" (use the numeric report number)`);\n      }\n\n      // Resolve manifest-supplied input/output relative to the manifest's own\n      // directory, not process.cwd(), so a manifest renders identically wherever\n      // the batch is launched from. Absolute paths in the manifest still win\n      // (resolve() ignores the base when the tail is absolute).\n      const entryInput = resolve(manifestDir, spec.input);\n      const entryOutput = resolve(manifestDir, spec.output);\n\n      // Path-containment guards (realpath-based): keep the read and write inside\n      // the tracker workspace even through a symlinked ancestor. A batch\n      // manifest that escapes the workspace is malformed/tampered and is\n      // recorded as a per-entry failure rather than read or written.\n      assertInsideWorkspace(entryInput, 'input');\n      if (!isWorkspaceOutputPath(entryOutput, workspaceRoot)) {\n        throw new Error(`output escapes the tracker workspace: ${entryOutput}`);\n      }\n","sourceCodeStart":1450,"sourceCodeEnd":1486,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/generate-pdf.mjs#L1450-L1486","documentation":"generate-pdf.mjs batch rendering validates each manifest entry's optional reportNum: it must be a purely numeric report number (digits only). The throw fires when a batch manifest supplies a reportNum containing non-digit characters — e.g. a filename, a markdown link, or a '#42'-style reference — instead of the bare numeric id used across reports/ and the tracker.","triggerScenarios":"Running a batch render whose manifest entry has reportNum set to something like 'reports/042.md', '#042', '042-cv', or a slug; any whitespace-trimmed value failing /^\\d+$/ throws.","commonSituations":"Hand-authored batch manifests where the author pasted the tracker row link or the report filename into reportNum; scripts that copy the whole markdown link `[042](reports/...)` instead of extracting the number; empty string is allowed (optional field), so the error only occurs on a non-empty malformed value.","solutions":["Edit the batch manifest and set reportNum to the bare numeric id, e.g. \"042\".","If the field is not needed, remove reportNum (or set it to null/empty) — it is optional.","If generating manifests programmatically, extract digits from the tracker link before writing the field: `String(link.match(/\\d+/)?.[0] ?? '')`."],"exampleFix":"// before (manifest entry)\n{ \"input\": \"out/042.html\", \"output\": \"out/042.pdf\", \"reportNum\": \"reports/042-foo.md\" }\n// after\n{ \"input\": \"out/042.html\", \"output\": \"out/042.pdf\", \"reportNum\": \"042\" }","handlingStrategy":"validation","validationCode":"const reportNum = (spec.reportNum ?? '').toString().trim();\nif (reportNum && !/^\\d+$/.test(reportNum)) {\n  throw new Error(`reportNum must be numeric, got: ${reportNum}`);\n}","typeGuard":"const isValidReportNum = (v) => v == null || /^\\d*$/.test(String(v).trim());","tryCatchPattern":"try {\n  await runBatch(manifest);\n} catch (err) {\n  if (err.message.includes('invalid reportNum')) {\n    console.error(`Fix manifest entry ${spec.id}: ${err.message}`);\n  } else throw err;\n}","preventionTips":["Extract reportNum from tracker links with a regex on digits, never paste the whole markdown link.","Validate the whole manifest with a JSON schema before launching the batch.","Leave reportNum absent when you don't need report linkage."],"tags":["batch","validation","manifest","report-number"],"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"}