santifer/career-ops · warning

⚠️ ${label} not found: ${path}

Error message

  ⚠️  ${label} not found: ${path}

What it means

lib/golden-budget-analysis.mjs loads modes/_shared.md and modes/oferta.md to measure how the context-budget compressor would treat them. Its readFile() helper warns when a path is missing and substitutes the placeholder string `[<label> not found]`, so the analysis continues but its numbers describe placeholder text, not the real mode files.

Source

Thrown at lib/golden-budget-analysis.mjs:36

import { readFileSync, readdirSync, existsSync } from 'fs';
import { join, dirname } from 'path';
import { fileURLToPath } from 'url';
import { buildBudgetedPrompt, SECTION_PRIORITY } from './context-budget.mjs';

const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
const GOLDEN_DIR = join(ROOT, 'evals', 'golden');

if (!existsSync(GOLDEN_DIR)) {
  console.error('Golden directory not found:', GOLDEN_DIR);
  process.exit(1);
}

// ---------------------------------------------------------------------------
// Load context files
// ---------------------------------------------------------------------------
function readFile(path, label) {
  if (!existsSync(path)) {
    console.warn(`  ⚠️  ${label} not found: ${path}`);
    return `[${label} not found]`;
  }
  return readFileSync(path, 'utf-8').trim();
}

const sharedContent = readFile(join(ROOT, 'modes', '_shared.md'), '_shared.md');
const ofertaContent = readFile(join(ROOT, 'modes', 'oferta.md'), 'oferta.md');

const p0Keys = Object.entries(SECTION_PRIORITY)
  .filter(([, p]) => p === 0)
  .map(([k]) => k);

// ---------------------------------------------------------------------------
// Synthetic CVs — a real cv.md is 500-3000 lines of markdown.
// ---------------------------------------------------------------------------
const CV_BLURB = [
  '',
  '### Head of AI — TechCorp (2022-Present)',

View on GitHub (pinned to 60398d6549)

Solutions

  1. Restore modes/_shared.md and modes/oferta.md at the repository root the script expects
  2. Run the script from the repository root so ROOT-relative paths resolve
  3. If you intentionally use a market mode set, point the script's file paths at modes/<market>/_shared.md or copy the files into place
Defensive patterns

Strategy: validation

Validate before calling

import { existsSync } from 'node:fs';
import { join } from 'node:path';
function requireContextFiles(root) {
  const missing = ['modes/_shared.md', 'modes/oferta.md']
    .filter(rel => !existsSync(join(root, rel)));
  if (missing.length) throw new Error(`Missing context files: ${missing.join(', ')}`);
}

Prevention

When it happens

Trigger: Running the analysis from a directory where join(ROOT, 'modes', '_shared.md') or oferta.md does not exist — e.g. the modes/ dir was renamed, files were deleted, or ROOT resolution points somewhere unexpected — existsSync(path) returns false and the warning plus placeholder substitution fire.

Common situations: Running the script from a checkout missing the modes/ directory; a language market-mode layout (modes/de/...) without the English files; moved or renamed mode files during refactoring.

Related errors


AI-assisted analysis of santifer/career-ops@60398d6549 (2026-08-20). Data as JSON: /api/errors/0b7b730df0050f58. Report an issue: GitHub.