{"record":{"id":"82464d5fe323e140","repo":"santifer/career-ops","slug":"label-not-found-at-path","errorCode":null,"errorMessage":"⚠️   ${label} not found at: ${path}","messagePattern":"⚠️   (.+?) not found at: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"gemini-eval.mjs","lineNumber":242,"sourceCode":"// ---------------------------------------------------------------------------\nconst apiKey = process.env.GEMINI_API_KEY;\nif (!apiKey) {\n  console.error(`\n❌  GEMINI_API_KEY not found.\n\n   1. Get a free key at https://aistudio.google.com/apikey\n   2. Add it to .env:   GEMINI_API_KEY=your_key_here\n   3. Or export it:     export GEMINI_API_KEY=your_key_here\n`);\n  process.exit(1);\n}\n\n// ---------------------------------------------------------------------------\n// File helpers\n// ---------------------------------------------------------------------------\nfunction readFile(path, label) {\n  if (!existsSync(path)) {\n    console.warn(`⚠️   ${label} not found at: ${path}`);\n    return `[${label} not found — skipping]`;\n  }\n  return stripBom(readFileSync(path, 'utf-8')).trim();\n}\n\nfunction validateEvaluationShape(text) {\n  const issues = [];\n  const requiredBlocks = [\n    ['A', /(?:^|\\n)#{1,3}\\s*(?:A[).:-]?|Block A\\b)/im],\n    ['B', /(?:^|\\n)#{1,3}\\s*(?:B[).:-]?|Block B\\b)/im],\n    ['C', /(?:^|\\n)#{1,3}\\s*(?:C[).:-]?|Block C\\b)/im],\n    ['D', /(?:^|\\n)#{1,3}\\s*(?:D[).:-]?|Block D\\b)/im],\n    ['E', /(?:^|\\n)#{1,3}\\s*(?:E[).:-]?|Block E\\b)/im],\n    ['F', /(?:^|\\n)#{1,3}\\s*(?:F[).:-]?|Block F\\b)/im],\n    ['G', /(?:^|\\n)#{1,3}\\s*(?:G[).:-]?|Block G\\b)/im],\n  ];\n\n  for (const [label, pattern] of requiredBlocks) {","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/gemini-eval.mjs#L224-L260","documentation":"readFile() in gemini-eval.mjs is a soft-fail helper: when the file backing a labeled input (e.g. CV, article digest) does not exist, it warns instead of throwing and returns a placeholder string '[<label> not found — skipping]' so the evaluation can proceed without that input. The message is a console.warn, not a thrown error — the pipeline deliberately degrades gracefully. It exists because the tool accepts many optional context files and missing ones should not abort a run.","triggerScenarios":"Calling readFile(path, label) when existsSync(path) is false — typically gemini-eval.mjs reading cv.md, article-digest.md, or a profile/config file at a hardcoded or configured path that is absent (typo'd path, wrong working directory, file not yet created, or the repo checked out without user data).","commonSituations":"Running gemini-eval.mjs from a different working directory than the repo root so relative paths like cv.md don't resolve; a fresh clone where the user layer files (cv.md, config/profile.yml) haven't been created yet during onboarding; a misconfigured CAREER_OPS_DATA_DIR pointing at an empty directory; renaming or moving cv.md without updating the path.","solutions":["Check the file actually exists at the printed path: ls -la <path> — fix typos or cd to the repo root first.","Create the missing input file (e.g. cv.md or config/profile.yml) — on first run, follow the tool's onboarding to generate them.","If the file lives elsewhere (custom data dir), set CAREER_OPS_ROOT / CAREER_OPS_DATA_DIR or update the configured path so it resolves.","If the input is genuinely optional and you want to skip it, do nothing — the placeholder keeps the run going, but expect lower-quality output for the missing section."],"exampleFix":"// before (file at wrong location)\nconst cv = readFile('cv.md', 'CV');\n// after (resolve relative to repo/data root)\nimport { join } from 'node:path';\nconst DATA_ROOT = process.env.CAREER_OPS_DATA_DIR || process.cwd();\nconst cv = readFile(join(DATA_ROOT, 'cv.md'), 'CV');","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs';\nif (!existsSync(cvPath)) {\n  console.error(`CV file missing: ${cvPath} — create it or fix CAREER_OPS_DATA_DIR before running.`);\n  process.exit(1);\n}","typeGuard":"const fileExists = (p) => { try { return existsSync(p) && statSync(p).isFile(); } catch { return false; } };","tryCatchPattern":null,"preventionTips":["Run the tool from the repository root, or always pass absolute paths.","Run node doctor.mjs --json before evaluations to confirm cv.md and config/profile.yml exist.","Set CAREER_OPS_ROOT / CAREER_OPS_DATA_DIR explicitly in your shell profile instead of relying on cwd.","Treat the 'not found — skipping' warning as actionable: a missing CV degrades evaluation quality silently."],"tags":["file-not-found","filesystem","nodejs","cli"],"backgroundTag":"file-not-found","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"}