{"record":{"id":"a64058eefa199f17","repo":"santifer/career-ops","slug":"label-not-found-at-path-a64058","errorCode":null,"errorMessage":"⚠️   ${label} not found at: ${path}","messagePattern":"⚠️   (.+?) not found at: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"openai-tailor.mjs","lineNumber":174,"sourceCode":"❌  No API key for ${endpointHost}.\n   Set one and re-run: OPENAI_API_KEY=your_key node openai-tailor.mjs ...\n`);\n    process.exit(1);\n  }\n}\n\nconst endpoint = `${baseUrl}/chat/completions`;\n\n// ---------------------------------------------------------------------------\n// File helpers\n// ---------------------------------------------------------------------------\nfunction readFile(path, label, required = false) {\n  if (!existsSync(path)) {\n    if (required) {\n      console.error(`❌  Required context file not found: ${label} at ${path}`);\n      process.exit(1);\n    }\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// Load context files\n// ---------------------------------------------------------------------------\nconsole.log('\\\\n📂  Loading context files...');\n\nconst sharedContext  = readFile(PATHS.shared, 'modes/_shared.md', false);\n// Writing guardrails (Voice DNA / Writing Style / Professional Writing) live in\n// _writing.md since #1710 — a CV-tailoring script needs them, unlike the eval\n// engines that read the eval-core _shared.md alone.\nconst writingContext = readFile(PATHS.writing, 'modes/_writing.md', false);\nconst pdfModeLogic   = readFile(PATHS.pdfMode, 'modes/pdf.md', false);\nconst cvContent      = readFile(PATHS.cv, 'cv.md', true);\nconst profileContent = readFile(PATHS.profile, 'config/profile.yml', true);","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/santifer/career-ops/blob/60398d6549a46f5266929538af21cfab94badc75/openai-tailor.mjs#L156-L192","documentation":"openai-tailor.mjs's readFile takes a `required` flag: required files (process exits 1 with ❌) versus optional context files, where absence only warns and yields '[label not found -- skipping]'. This warning is the optional path -- e.g. voice/writing guardrail files like voice-dna.md -- so tailoring runs but without those style constraints.","triggerScenarios":"Optional style/guardrail files (voice-dna.md, modes/_profile.md extras) not created by the user; running the tailor step before personalization files exist; paths customized to files later deleted.","commonSituations":"Skipping optional personalization steps during setup; deleting voice-dna.md after deciding not to use it; CI running the tailor on a minimal checkout.","solutions":["Decide whether the missing file matters for output quality; if yes, create it (e.g. voice-dna.md) at the path shown in the warning.","If intentionally absent, ignore the warning -- output is still generated, just unstyled by that file.","Pass required=true in code paths where tailoring without the file is worse than failing."],"exampleFix":"// before: optional guardrail silently absent from the prompt\nconst voice = readFile(PATHS.voice, 'voice-dna');\n// after: fail fast when voice shaping is required for this run\nconst voice = readFile(PATHS.voice, 'voice-dna', /* required */ true);","handlingStrategy":"validation","validationCode":"// Distinguish optional from load-bearing context before tailoring\nimport { existsSync } from 'node:fs';\nconst optionalButLoadBearing = ['voice-dna.md'];\nfor (const p of optionalButLoadBearing) {\n  if (!existsSync(p)) console.warn(`${p} absent — output will ship without voice constraints`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Create voice-dna.md and modes/_profile.md during onboarding so tailoring always has style guardrails.","For CI or scripted tailoring, pass required=true for files whose absence would invalidate the output.","Treat this warning as a quality signal for user-facing documents, not a runtime fault."],"tags":["openai-tailor","context-files","file-not-found","optional-inputs","voice-guardrails"],"backgroundTag":"missing-input-file","analyzedSha":"60398d6549a46f5266929538af21cfab94badc75","analyzedAt":"2026-08-20T23:00:06.764Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}