{"record":{"id":"0b7b730df0050f58","repo":"santifer/career-ops","slug":"label-not-found-path","errorCode":null,"errorMessage":"  ⚠️  ${label} not found: ${path}","messagePattern":"  ⚠️  (.+?) not found: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"lib/golden-budget-analysis.mjs","lineNumber":36,"sourceCode":"import { readFileSync, readdirSync, existsSync } from 'fs';\nimport { join, dirname } from 'path';\nimport { fileURLToPath } from 'url';\nimport { buildBudgetedPrompt, SECTION_PRIORITY } from './context-budget.mjs';\n\nconst ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');\nconst GOLDEN_DIR = join(ROOT, 'evals', 'golden');\n\nif (!existsSync(GOLDEN_DIR)) {\n  console.error('Golden directory not found:', GOLDEN_DIR);\n  process.exit(1);\n}\n\n// ---------------------------------------------------------------------------\n// Load context files\n// ---------------------------------------------------------------------------\nfunction readFile(path, label) {\n  if (!existsSync(path)) {\n    console.warn(`  ⚠️  ${label} not found: ${path}`);\n    return `[${label} not found]`;\n  }\n  return readFileSync(path, 'utf-8').trim();\n}\n\nconst sharedContent = readFile(join(ROOT, 'modes', '_shared.md'), '_shared.md');\nconst ofertaContent = readFile(join(ROOT, 'modes', 'oferta.md'), 'oferta.md');\n\nconst p0Keys = Object.entries(SECTION_PRIORITY)\n  .filter(([, p]) => p === 0)\n  .map(([k]) => k);\n\n// ---------------------------------------------------------------------------\n// Synthetic CVs — a real cv.md is 500-3000 lines of markdown.\n// ---------------------------------------------------------------------------\nconst CV_BLURB = [\n  '',\n  '### Head of AI — TechCorp (2022-Present)',","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/lib/golden-budget-analysis.mjs#L18-L54","documentation":"lib/golden-budget-analysis.mjs's readFile() helper checks existsSync() before reading a context file; when the file is absent it warns with the label and path and returns a placeholder string '[<label> not found]' so the analysis can proceed. The resulting analysis is computed against a missing input and its numbers will be misleading.","triggerScenarios":"Running the golden-budget analysis from a working directory or checkout where a required context file (e.g. modes/_shared.md via join(ROOT, 'modes', '_shared.md')) does not exist — fresh clone without the file, wrong ROOT resolution, or a renamed/deleted mode file.","commonSituations":"Running the script from a different repo root, a sparse/partial checkout, or after renaming modes/_shared.md; running against a fork that dropped some mode files.","solutions":["Restore the missing file at the printed path (e.g. checkout modes/_shared.md from the upstream repo)","Run the script from the repository root so ROOT resolves correctly","Check whether a market modes_dir layout moved the file and pass the right path","Treat any output produced with '[not found]' placeholders as invalid and re-run after the file exists"],"exampleFix":"// before\n$ node lib/golden-budget-analysis.mjs   # run from /tmp → modes/_shared.md missing\n// after\n$ cd /path/to/career-ops && node lib/golden-budget-analysis.mjs","handlingStrategy":"validation","validationCode":"const required = ['modes/_shared.md', 'cv.md', 'config/profile.yml'];\nfor (const f of required) {\n  if (!existsSync(join(repoRoot, f))) throw new Error('Missing required context file: ' + f);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run analysis scripts only from the repository root","Check `git status` / fresh-clone state before running golden-budget analysis","Never trust analysis output containing '[not found]' placeholder sections — re-run after restoring files"],"tags":["file-not-found","analysis","cli","missing-file"],"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"}