{"record":{"id":"4137ee23e08f9713","repo":"santifer/career-ops","slug":"local-paths-file-refusing-path-why","errorCode":null,"errorMessage":"${LOCAL_PATHS_FILE}: refusing \"${path}\" — ${why}","messagePattern":"(.+?): refusing \"(.+?)\" — (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"update-system.mjs","lineNumber":563,"sourceCode":"\n/**\n * Read + validate the local declaration file.\n *\n * Refuses rather than honours anything ambiguous: a path the system layer\n * already ships would silently stop updating, and a path that escapes the\n * checkout would widen the \"never touch\" set over files the updater does not\n * own. Both throw, naming the offending entry.\n *\n * @param {string} [root=ROOT] - Repo root to read from.\n * @returns {string[]} Extra user-layer paths. Empty when the file is absent.\n */\nexport function localUserPaths(root = ROOT) {\n  const file = join(root, LOCAL_PATHS_FILE);\n  if (!existsSync(file)) return [];\n\n  const declared = parseLocalPaths(readFileSync(file, 'utf-8'));\n  const reject = (path, why) => {\n    throw new Error(`${LOCAL_PATHS_FILE}: refusing \"${path}\" — ${why}`);\n  };\n\n  for (const path of declared) {\n    if (path === LOCAL_PATHS_FILE) {\n      reject(path, 'the declaration file cannot list itself (it is gitignored, so nothing updates it)');\n    }\n    if (path.startsWith('/') || /^[A-Za-z]:[\\\\/]/.test(path) || path.startsWith('\\\\')) {\n      reject(path, 'paths must be repo-relative, not absolute');\n    }\n    if (path.split(/[\\\\/]/).includes('..')) {\n      reject(path, 'paths must stay inside the repo');\n    }\n    // Canonical spelling, required BEFORE the collision check below.\n    //\n    // That check compares strings exactly (`path === sys`), and\n    // userLayerViolations() later compares against git's changed-path format,\n    // which is always canonical. A non-canonical spelling therefore matches\n    // NEITHER: `./merge-tracker.mjs` sails past the collision check, and is","sourceCodeStart":545,"sourceCodeEnd":581,"githubUrl":"https://github.com/santifer/career-ops/blob/e7abd431fce9348a95261acac9e0c14779c35df8/update-system.mjs#L545-L581","documentation":"localUserPaths reads the gitignored local-paths declaration file (LOCAL_PATHS_FILE) which lets an install redirect user-layer directories. The reject helper throws when a declared path is unsafe or self-contradictory — for example, when the declaration file lists itself, which is impossible to honor because the file is gitignored and would never be updated by the updater. The message includes the offending path and the reason.","triggerScenarios":"Calling localUserPaths(root) (directly or via update-system apply/check) where the LOCAL_PATHS_FILE contains an entry that equals the declaration file's own name, or another rejected path (invalid/unsafe redirect target), causing the loop to call reject(path, why).","commonSituations":"A user edited the local-paths file to redirect output directories and accidentally added the declaration file's own name to the list; a copy-pasted example included the file itself; a typo produced a path the validator refuses.","solutions":["Open the local-paths declaration file in the repo root and remove the entry that matches the file's own name (or fix the path flagged in the message).","Keep only legitimate user-layer directories (e.g. data/, documents/, output/) in the list — never the declaration file itself.","If unsure, delete the declaration file entirely: localUserPaths returns [] when it does not exist, restoring default behavior.","Re-run the update command to confirm the error is gone."],"exampleFix":"# before — .career-ops-local-paths (declaration file lists itself)\n.career-ops-local-paths\ndata\ndocuments\n\n# after\ndata\ndocuments","handlingStrategy":"validation","validationCode":"const declared = parseLocalPaths(readFileSync(localPathsFile, 'utf-8'));\nconst self = '.career-ops-local-paths'; // LOCAL_PATHS_FILE name\nif (declared.includes(self)) {\n  throw new Error(`${localPathsFile} must not list itself`);\n}","typeGuard":"function isSafeLocalPathEntry(entry, selfName) {\n  return typeof entry === 'string' && entry.length > 0 && entry !== selfName;\n}","tryCatchPattern":"try {\n  const paths = localUserPaths(root);\n} catch (err) {\n  if (err.message.startsWith(LOCAL_PATHS_FILE)) {\n    console.error(`Fix or delete ${join(root, LOCAL_PATHS_FILE)}: ${err.message}`);\n  } else throw err;\n}","preventionTips":["Never add the declaration file's own name to its path list.","Only list user-layer directories (data/, documents/, output/) in the local-paths file.","After editing the file, run the update command once to validate it before relying on it.","If in doubt, delete the file — its absence means default (repo-root) paths."],"tags":["config","update-system","validation","gitignore"],"backgroundTag":"invalid-config-value","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"}