{"record":{"id":"2539dbd86184ad45","repo":"santifer/career-ops","slug":"web-not-present-in-this-checkout-skipping-the-company-key","errorCode":null,"errorMessage":"web/ not present in this checkout — skipping the company-key parity freeze (#2666)","messagePattern":"web/ not present in this checkout — skipping the company-key parity freeze \\(#2666\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"test-all.mjs","lineNumber":16525,"sourceCode":"  //\n  // The browser cannot reach the user's checkout, so web/src/lib/core/\n  // normalize-text-key.mjs is a COPY by necessity, declared as such. A conscious\n  // copy without an assertion is exactly the failure this repo has now hit five\n  // times (states.ts, CADENCE_DEFAULTS, doctor prereqs, the #2590 cache, and the\n  // three divergent company norms of #2666 itself).\n  //\n  // Compare CORE vs MIRROR, not core vs the derived path: the derived path\n  // imports the core, so it CANNOT diverge — asserting on it would guard the one\n  // thing that cannot break while ignoring the one that can. The mirror is also\n  // the path nobody exercises in normal operation (it only runs on a partial\n  // checkout), which is precisely why it needs a test rather than usage.\n  //\n  // Expected values are DERIVED from the core, never hand-written: a hand-written\n  // expectation would freeze today's answer and stop tracking the source.\n  const corpusPath = join(ROOT, 'tests', 'fixtures', 'company-key-corpus.json');\n  const mirrorPath = join(ROOT, 'web', 'src', 'lib', 'core', 'normalize-text-key.mjs');\n  if (!existsSync(join(ROOT, 'web', 'src'))) {\n    warn('web/ not present in this checkout — skipping the company-key parity freeze (#2666)');\n  } else if (!existsSync(corpusPath) || !existsSync(mirrorPath)) {\n    // web/ IS here, so a missing file is a move, not an absence. Failing rather\n    // than skipping: a skip is how this freeze would quietly stop guarding.\n    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?)`);\n  } else {\n    try {\n      const corpus = JSON.parse(readFileSync(corpusPath, 'utf-8'));\n      const core = await import(pathToFileURL(join(ROOT, 'tracker-parse.mjs')).href);\n      const mirror = await import(pathToFileURL(mirrorPath).href);\n      const coreFn = core.normalizeTextKey, mirrorFn = mirror.normalizeTextKey;\n      if (typeof coreFn !== 'function' || typeof mirrorFn !== 'function') {\n        fail('normalizeTextKey is not exported by the core and/or the web mirror — the #2666 parity cannot verify');\n      } else {\n        // undefined cannot be written in JSON but is a real input (a missing\n        // cell), and it is half of the null/undefined bug — so it is appended here.\n        const inputs = [...corpus.cases.map((c) => c.input), undefined];\n        const drift = [];\n        for (const sep of ['', ' ']) {","sourceCodeStart":16507,"sourceCodeEnd":16543,"githubUrl":"https://github.com/santifer/career-ops/blob/e7abd431fce9348a95261acac9e0c14779c35df8/test-all.mjs#L16507-L16543","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Do nothing if the checkout is intentionally data-only — the skip is by design.","Restore web/src (checkout or clone the web tree) if key parity must be verified in this environment.","Update the check's path if web sources moved to a new root (e.g. apps/web/src in a monorepo layout).","Run the parity check separately in an environment that has web/ when working on normalize-text-key changes."],"exampleFix":"// before (monorepo move)\nif (!existsSync(join(ROOT, 'web', 'src'))) { warn(...); }\n// after\nif (!existsSync(join(ROOT, 'apps', 'web', 'src'))) { warn(...); }","handlingStrategy":"fallback","validationCode":"const webSrc = join(ROOT, 'web', 'src');\nif (!existsSync(webSrc)) { console.warn('parity check skipped — no web tree'); return; }\nconst mirror = join(webSrc, 'lib', 'core', 'normalize-text-key.mjs');\nif (!existsSync(mirror)) throw new Error('web/ exists but mirror moved');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the #2666 parity freeze in a full-checkout CI job even if local installs skip it.","Update the check whenever the web tree relocates (monorepo moves).","Keep the corpus fixture and mirror paths adjacent in one constant block."],"tags":["missing-directory","test-suite","parity-check","skip"],"backgroundTag":"missing-dependency","analyzedSha":"e7abd431fce9348a95261acac9e0c14779c35df8","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}