{"record":{"id":"ea9a4f106f0eb1d7","repo":"santifer/career-ops","slug":"fact-check-failed-options-label-for-options","errorCode":null,"errorMessage":"Fact check failed${options.label ? ` for ${options.label}` : ''}: ${details.join('; ')}","messagePattern":"Fact check failed(.+?)` : ''\\}: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"verify-cv-facts.mjs","lineNumber":876,"sourceCode":"    forbidden,\n    warnings,\n    coverage,\n    // Deliberately outside the verdict: no config is a normal state, not a\n    // finding. It rides along so a caller can say the phrase lists were never\n    // loaded instead of printing a clean result the reader takes for \"checked\".\n    configMissing,\n  };\n}\n\n/** Verify a document and throw when it contains a blocking unsupported claim. */\nexport function assertFacts(targetText, options = {}) {\n  const result = verifyFacts(targetText, options);\n  if (result.verdict === 'block') {\n    const details = [];\n    if (result.invented.length) details.push(`metric-like claims absent from sources: ${result.invented.join(', ')}`);\n    if (result.unsupportedFacts.length) details.push(`non-metric facts absent from sources: ${result.unsupportedFacts.map(({ kind, value }) => `${kind}=${value}`).join(', ')}`);\n    if (result.forbidden.length) details.push(`forbidden phrases found: ${result.forbidden.join(', ')}`);\n    throw new Error(`Fact check failed${options.label ? ` for ${options.label}` : ''}: ${details.join('; ')}`);\n  }\n  return result;\n}\n\n/** Parse the fact-validator command-line arguments. */\nfunction parseCliArgs(args) {\n  const sourcePaths = [];\n  let targetArg = '';\n  let configPath = DEFAULT_CONFIG;\n  let json = false;\n  for (let i = 0; i < args.length; i++) {\n    const arg = args[i];\n    if (arg === '--source' || arg === '--config') {\n      if (!args[i + 1]) throw new Error(`${arg} requires a path`);\n      if (arg === '--source') sourcePaths.push(args[++i]);\n      else configPath = args[++i];\n    } else if (arg === '--help' || arg === '-h') {\n      return { help: true };","sourceCodeStart":858,"sourceCodeEnd":894,"githubUrl":"https://github.com/santifer/career-ops/blob/e7abd431fce9348a95261acac9e0c14779c35df8/verify-cv-facts.mjs#L858-L894","documentation":"This error is the blocking verdict of the CV fact-checker in verify-cv-facts.mjs: when verifyFacts() returns verdict 'block', the wrapper aggregates all violations (invented metric-like claims, non-metric facts absent from sources, forbidden phrases) into one message and throws. It fires only when the generated CV text contains claims not traceable to the supplied source files.","triggerScenarios":"Running the fact validator on CV/cover-letter text that includes metrics, facts, or phrases missing from the --source documents, or containing configured forbidden_phrases.","commonSituations":"An LLM-generated CV embellished numbers not in cv.md; leftover template metrics; phrases blacklisted in the config (e.g. 'team player'); tailored CV that invented a scale figure ('managed 50 engineers').","solutions":["Read the details after 'Fact check failed' — each ';'-separated clause names the offending claims/phrases","Remove or correct every metric-like claim that does not appear verbatim in the source documents","Remove or rewrite any non-metric fact flagged as unsupported by the sources","Replace forbidden phrases with allowed wording, then re-run the check"],"exampleFix":"// before (CV text)\n\"Cut infra costs by 43% while leading 30 engineers\"\n// after\n\"Cut infra costs by 40% while leading the platform team\" // figures now match cv.md sources","handlingStrategy":"validation","validationCode":"const result = verifyFacts(text, { sources });\nif (result.verdict === 'block') {\n  console.error('Blocked claims:', [...result.invented, ...result.unsupportedFacts.map(f => f.value), ...result.forbidden]);\n  process.exit(1);\n}","typeGuard":null,"tryCatchPattern":"try {\n  ensureFactsPass(text, options);\n} catch (err) {\n  if (err.message.startsWith('Fact check failed')) {\n    console.error(err.message); // each ';'-separated clause is one fix\n    process.exit(1);\n  }\n  throw err;\n}","preventionTips":["Generate CV content only from cv.md / article-digest.md facts; never invent metrics","Run the fact check on every generated document before sending it","Keep forbidden_phrases/warn_phrases configs up to date with your style rules","When tailoring a CV to a JD, re-verify every new number against sources"],"tags":["validation","cv","content-policy"],"backgroundTag":"schema-validation-failed","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"}