santifer/career-ops · error
Fact check failed ` : ''}
Error message
Fact check failed${options.label ? ` for ${options.label}` : ''}: ${details.join('; ')} What it means
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.
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
Example fix
// before (CV text) "Cut infra costs by 43% while leading 30 engineers" // after "Cut infra costs by 40% while leading the platform team" // figures now match cv.md sources
Defensive patterns
Strategy: validation
Validate before calling
const result = verifyFacts(text, { sources });
if (result.verdict === 'block') {
console.error('Blocked claims:', [...result.invented, ...result.unsupportedFacts.map(f => f.value), ...result.forbidden]);
process.exit(1);
} Try / catch
try {
ensureFactsPass(text, options);
} catch (err) {
if (err.message.startsWith('Fact check failed')) {
console.error(err.message); // each ';'-separated clause is one fix
process.exit(1);
}
throw err;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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').
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- CV section order diverges from cv.md: rendered
- ⚠️ (proceeding — --allow-reorder set)
- 4dayweek: invalid URL
- 4dayweek: URL must use HTTPS
- a 40-hex commit --sha is required
AI-assisted analysis of santifer/career-ops@e7abd431fc (2026-09-16).
Data as JSON: /api/errors/ea9a4f106f0eb1d7.
Report an issue: GitHub.
Appendix: source
Thrown at verify-cv-facts.mjs:876
forbidden,
warnings,
coverage,
// Deliberately outside the verdict: no config is a normal state, not a
// finding. It rides along so a caller can say the phrase lists were never
// loaded instead of printing a clean result the reader takes for "checked".
configMissing,
};
}
/** Verify a document and throw when it contains a blocking unsupported claim. */
export function assertFacts(targetText, options = {}) {
const result = verifyFacts(targetText, options);
if (result.verdict === 'block') {
const details = [];
if (result.invented.length) details.push(`metric-like claims absent from sources: ${result.invented.join(', ')}`);
if (result.unsupportedFacts.length) details.push(`non-metric facts absent from sources: ${result.unsupportedFacts.map(({ kind, value }) => `${kind}=${value}`).join(', ')}`);
if (result.forbidden.length) details.push(`forbidden phrases found: ${result.forbidden.join(', ')}`);
throw new Error(`Fact check failed${options.label ? ` for ${options.label}` : ''}: ${details.join('; ')}`);
}
return result;
}
/** Parse the fact-validator command-line arguments. */
function parseCliArgs(args) {
const sourcePaths = [];
let targetArg = '';
let configPath = DEFAULT_CONFIG;
let json = false;
for (let i = 0; i < args.length; i++) {
const arg = args[i];
if (arg === '--source' || arg === '--config') {
if (!args[i + 1]) throw new Error(`${arg} requires a path`);
if (arg === '--source') sourcePaths.push(args[++i]);
else configPath = args[++i];
} else if (arg === '--help' || arg === '-h') {
return { help: true };View on GitHub (pinned to e7abd431fc)