santifer/career-ops · warning

web/ not present in this checkout — skipping the…

Error message

web/ not present in this checkout — skipping the company-key parity freeze (#2666)

What it means

A warning from test-all.mjs's company-key parity freeze (#2666) when web/src does not exist. The check derives expected normalization keys from the core corpus (tests/fixtures/company-key-corpus.json) and compares them against the web mirror web/src/lib/core/normalize-text-key.mjs. Without the web tree there is nothing to compare, so the freeze is skipped with this warning; expected on data-only installs.

Solutions

  1. Do nothing if the checkout is intentionally data-only — the skip is by design.
  2. Restore web/src (checkout or clone the web tree) if key parity must be verified in this environment.
  3. Update the check's path if web sources moved to a new root (e.g. apps/web/src in a monorepo layout).
  4. Run the parity check separately in an environment that has web/ when working on normalize-text-key changes.

Example fix

// before (monorepo move)
if (!existsSync(join(ROOT, 'web', 'src'))) { warn(...); }
// after
if (!existsSync(join(ROOT, 'apps', 'web', 'src'))) { warn(...); }
Defensive patterns

Strategy: fallback

Validate before calling

const webSrc = join(ROOT, 'web', 'src');
if (!existsSync(webSrc)) { console.warn('parity check skipped — no web tree'); return; }
const mirror = join(webSrc, 'lib', 'core', 'normalize-text-key.mjs');
if (!existsSync(mirror)) throw new Error('web/ exists but mirror moved');

Prevention

When it happens

Trigger: Running `node test-all.mjs` in a checkout where web/src is missing — data-only installs, partial clones, or after web/src was moved/renamed in a refactor.

Common situations: Server/data-only deployments of career-ops; sparse CI checkouts excluding web/; mid-migration branches where web sources were relocated; contributors testing core changes without the web tree.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of santifer/career-ops@e7abd431fc (2026-09-16). Data as JSON: /api/errors/2539dbd86184ad45. Report an issue: GitHub.

Appendix: source

Thrown at test-all.mjs:16525

  //
  // The browser cannot reach the user's checkout, so web/src/lib/core/
  // normalize-text-key.mjs is a COPY by necessity, declared as such. A conscious
  // copy without an assertion is exactly the failure this repo has now hit five
  // times (states.ts, CADENCE_DEFAULTS, doctor prereqs, the #2590 cache, and the
  // three divergent company norms of #2666 itself).
  //
  // Compare CORE vs MIRROR, not core vs the derived path: the derived path
  // imports the core, so it CANNOT diverge — asserting on it would guard the one
  // thing that cannot break while ignoring the one that can. The mirror is also
  // the path nobody exercises in normal operation (it only runs on a partial
  // checkout), which is precisely why it needs a test rather than usage.
  //
  // Expected values are DERIVED from the core, never hand-written: a hand-written
  // expectation would freeze today's answer and stop tracking the source.
  const corpusPath = join(ROOT, 'tests', 'fixtures', 'company-key-corpus.json');
  const mirrorPath = join(ROOT, 'web', 'src', 'lib', 'core', 'normalize-text-key.mjs');
  if (!existsSync(join(ROOT, 'web', 'src'))) {
    warn('web/ not present in this checkout — skipping the company-key parity freeze (#2666)');
  } else if (!existsSync(corpusPath) || !existsSync(mirrorPath)) {
    // web/ IS here, so a missing file is a move, not an absence. Failing rather
    // than skipping: a skip is how this freeze would quietly stop guarding.
    fail(`web/ exists but ${!existsSync(corpusPath) ? 'tests/fixtures/company-key-corpus.json' : 'web/src/lib/core/normalize-text-key.mjs'} is missing — the #2666 key parity cannot verify (moved?)`);
  } else {
    try {
      const corpus = JSON.parse(readFileSync(corpusPath, 'utf-8'));
      const core = await import(pathToFileURL(join(ROOT, 'tracker-parse.mjs')).href);
      const mirror = await import(pathToFileURL(mirrorPath).href);
      const coreFn = core.normalizeTextKey, mirrorFn = mirror.normalizeTextKey;
      if (typeof coreFn !== 'function' || typeof mirrorFn !== 'function') {
        fail('normalizeTextKey is not exported by the core and/or the web mirror — the #2666 parity cannot verify');
      } else {
        // undefined cannot be written in JSON but is a real input (a missing
        // cell), and it is half of the null/undefined bug — so it is appended here.
        const inputs = [...corpus.cases.map((c) => c.input), undefined];
        const drift = [];
        for (const sep of ['', ' ']) {

View on GitHub (pinned to e7abd431fc)