{"record":{"id":"f1bb1d5b76bdc6c1","repo":"santifer/career-ops","slug":"label-not-found-at-path-f1bb1d","errorCode":null,"errorMessage":"⚠️   ${label} not found at: ${path}","messagePattern":"⚠️   (.+?) not found at: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"ollama-eval.mjs","lineNumber":145,"sourceCode":"\nif (!jdText) {\n  console.error('❌  No Job Description provided. Run with --help for usage.');\n  process.exit(1);\n}\n\n// ---------------------------------------------------------------------------\n// File helpers\n// ---------------------------------------------------------------------------\n/**\n * Read a file and return its trimmed contents, or a placeholder if missing.\n * Emits a console warning when the file is absent so the user knows context is incomplete.\n * @param {string} path - Absolute path to the file.\n * @param {string} label - Human-readable label used in the warning and placeholder.\n * @returns {string} File contents or a \"[label not found]\" placeholder.\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 readFileSync(path, 'utf-8').trim();\n}\n\n// ---------------------------------------------------------------------------\n// Loopback guard — cv.md + full JD are sent to this endpoint.\n// A remote URL would silently exfiltrate private data.\n// ---------------------------------------------------------------------------\n{\n  let hostname;\n  try {\n    hostname = new URL(baseUrl).hostname;\n  } catch {\n    console.error(`❌  Invalid OLLAMA_BASE_URL: \"${baseUrl}\"`);\n    process.exit(1);\n  }\n  const isLoopback = hostname === 'localhost' || hostname === '127.0.0.1' || hostname === '::1';","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/santifer/career-ops/blob/60398d6549a46f5266929538af21cfab94badc75/ollama-eval.mjs#L127-L163","documentation":"ollama-eval.mjs loads prompt-context files (modes/_shared.md, the oferta mode, cv.md, the JD) through a readFile(path, label) helper. When a file is absent it warns with the exact path and returns the placeholder '[label not found -- skipping]' instead of throwing, so the local LLM evaluation proceeds with a degraded prompt -- the run completes but scores/tailoring are produced without that context.","triggerScenarios":"Invoking ollama-eval.mjs before onboarding completed (cv.md missing); running from a directory where the resolved absolute paths do not exist; a modes/ file renamed or deleted by customization; CAREER_OPS/repo-root resolution landing on the wrong checkout.","commonSituations":"Fresh clone without running node doctor.mjs; a user-deleted or renamed mode file; CI job checking out only part of the repo; symlinks breaking path resolution.","solutions":["Run node doctor.mjs --json and complete onboarding so cv.md, config/profile.yml and modes/ files exist.","Copy the exact path from the warning and verify with ls; restore the missing file from templates/ or git.","Run the script from the career-ops repo root so path resolution matches the checkout layout."],"exampleFix":"# before\n$ node ollama-eval.mjs --url https://example.com/jobs/1\n⚠️   cv not found at: /wrong/root/cv.md\n# after\n$ node doctor.mjs --json            # see what is missing\n$ cd /path/to/career-ops && node ollama-eval.mjs --url https://example.com/jobs/1","handlingStrategy":"validation","validationCode":"// Gate the evaluator on context completeness instead of accepting a degraded prompt\nimport { existsSync } from 'node:fs';\nconst required = ['cv.md', 'modes/_shared.md', 'modes/oferta.md'];\nconst missing = required.filter(p => !existsSync(p));\nif (missing.length) {\n  console.error('Refusing to evaluate with missing context:', missing.join(', '));\n  process.exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run node doctor.mjs --json before any evaluation session; it lists exactly which context files are missing.","Always invoke the evaluator from the career-ops repo root.","Watch the 'Loading context files' block — any ⚠️ line there means the run's scores are computed without that input."],"tags":["ollama-eval","context-files","file-not-found","degraded-prompt","onboarding"],"backgroundTag":"missing-input-file","analyzedSha":"60398d6549a46f5266929538af21cfab94badc75","analyzedAt":"2026-08-20T23:00:06.764Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}