{"record":{"id":"5ad05eafdb67eb8c","repo":"santifer/career-ops","slug":"tracker-parse-mjs-cannot-load-tracker-aliases-jso","errorCode":null,"errorMessage":"tracker-parse.mjs: cannot load tracker-aliases.json (${e.message}). The file ships with career-ops next to tracker-parse.mjs — restore it from the repo or re-run: node update-system.mjs apply","messagePattern":"tracker-parse\\.mjs: cannot load tracker-aliases\\.json \\((.+?)\\)\\. The file ships with career-ops next to tracker-parse\\.mjs — restore it from the repo or re-run: node update-system\\.mjs apply","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"tracker-parse.mjs","lineNumber":40,"sourceCode":"/**\n * Header text (lowercased) → canonical field name. Includes ES aliases.\n * Loaded from tracker-aliases.json — the ONE shared alias table, which the web\n * read path (web/src/lib/tracker-table.mjs) also loads at runtime, so the two\n * can never drift (PR #1598 review). Add new aliases in the JSON, not here.\n *\n * A missing or corrupt JSON is a broken install (the file ships alongside this\n * module in SYSTEM_PATHS/BOOTSTRAP_PATHS): fail fast with an actionable\n * message rather than degrading silently — a quiet fallback here would\n * reintroduce exactly the reader drift the shared table exists to prevent.\n * (The web loader degrades to the legacy fixed order instead because it reads\n * the file from a user-configured root at request time.)\n */\nexport const HEADER_ALIASES = (() => {\n  const src = new URL('./tracker-aliases.json', import.meta.url);\n  try {\n    return JSON.parse(readFileSync(src, 'utf-8'));\n  } catch (e) {\n    throw new Error(\n      `tracker-parse.mjs: cannot load tracker-aliases.json (${e.message}). ` +\n      'The file ships with career-ops next to tracker-parse.mjs — restore it ' +\n      'from the repo or re-run: node update-system.mjs apply',\n    );\n  }\n})();\n\n/**\n * A score cell in the tracker: `N/5` or `N.N/5` (any precision), or the\n * sentinels `N/A` / `DUP` / `—` (em dash) / `-` (hyphen). Markdown bold is\n * stripped first. `—`/`-` mirror the tracker's own \"no data\" convention used\n * in every other column (Report, PDF, etc.) — see #1799: a backfilled entry\n * with no evaluation (e.g. a rejection for a role never run through\n * `oferta`) needs a score-cell sentinel too, not just `N/A`. A status label\n * never matches this, which is what makes it a reliable discriminator between\n * the score and status columns regardless of their order (#1427).\n */\nexport const SCORE_CELL_RE = /^\\d+(?:\\.\\d+)?\\/5$/;","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/tracker-parse.mjs#L22-L58","documentation":"At module load time, tracker-parse.mjs reads tracker-aliases.json (a SYSTEM/BOOTSTRAP file shipped alongside the module) and JSON.parse's it into HEADER_ALIASES. If the file is missing or corrupt, it throws an Error telling the user this is a broken install and to restore the file or re-run `node update-system.mjs apply`. This is deliberately fail-fast: a silent fallback would reintroduce header-alias drift across readers.","triggerScenarios":"tracker-aliases.json is absent from the module directory (deleted, never copied, or a partial update left it out); the file exists but contains invalid JSON (truncated, encoding issue, hand-edit corruption).","commonSituations":"A career-ops update (update-system.mjs) was interrupted leaving the install partial; a user manually edited or deleted tracker-aliases.json; a git operation removed the file; file-system corruption or a sync tool (Dropbox) truncated the file.","solutions":["Restore the install: node update-system.mjs apply.","Re-clone or re-pull the repo to get the original tracker-aliases.json.","Validate the file: node -e \"JSON.parse(require('fs').readFileSync('tracker-aliases.json','utf8'))\" and fix syntax errors.","If a custom install location, ensure tracker-aliases.json sits next to tracker-parse.mjs."],"exampleFix":"# the error is an install-integrity failure — no code fix, run:\nnode update-system.mjs apply\n# or restore from git:\ngit checkout HEAD -- tracker-aliases.json","handlingStrategy":"validation","validationCode":"function trackerAliasesInstalled() {\n  const p = new URL('./tracker-aliases.json', import.meta.url);\n  try {\n    JSON.parse(readFileSync(p, 'utf-8'));\n    return true;\n  } catch { return false; }\n}\nif (!trackerAliasesInstalled()) {\n  console.error('Run: node update-system.mjs apply');\n  process.exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run node update-system.mjs apply after pulling updates to keep system files intact.","Add a CI check that asserts tracker-aliases.json is present and valid JSON.","Never hand-edit or move tracker-aliases.json out of the module directory."],"tags":["install","bootstrap","tracker-parse","json","config-integrity"],"backgroundTag":null,"analyzedSha":"9b17a8ac97b398a496b38e423ae24e433b43254f","analyzedAt":"2026-08-13T00:48:39.135Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}