{"record":{"id":"81bd482044bddae5","repo":"diegosouzapw/OmniRoute","slug":"skill-file-paths-must-be-relative-to-the-skill-wor","errorCode":null,"errorMessage":"Skill file paths must be relative to the skill workspace","messagePattern":"Skill file paths must be relative to the skill workspace","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/skills/builtins.ts","lineNumber":69,"sourceCode":"  \"proxy-authorization\",\n]);\n\nfunction getContextId(context: { apiKeyId: string }) {\n  // Not a password hash — SHA-256 is used here only to derive a short, stable\n  // filesystem-safe key from the API key identifier for workspace isolation.\n  return createHash(\"sha256\") // lgtm[js/insufficient-password-hash]\n    .update(context.apiKeyId || \"anonymous\")\n    .digest(\"hex\")\n    .slice(0, 24);\n}\n\nfunction getWorkspaceRoot(context: { apiKeyId: string }) {\n  return path.join(resolveDataDir(), \"skills\", \"workspaces\", getContextId(context));\n}\n\nfunction resolveWorkspacePath(inputPath: string, context: { apiKeyId: string }) {\n  if (path.isAbsolute(inputPath)) {\n    throw new Error(\"Skill file paths must be relative to the skill workspace\");\n  }\n\n  const segments = inputPath.split(/[\\\\/]+/).filter(Boolean);\n  if (segments.some((segment) => FORBIDDEN_PATH_SEGMENTS.has(segment.toLowerCase()))) {\n    throw new Error(\"Skill file path contains a restricted segment\");\n  }\n\n  const root = path.resolve(getWorkspaceRoot(context));\n  const resolved = path.resolve(root, inputPath);\n  const relative = path.relative(root, resolved);\n  if (!relative || relative.startsWith(\"..\") || path.isAbsolute(relative)) {\n    throw new Error(\"Skill file path escapes the skill workspace\");\n  }\n\n  return { root, resolved, relative };\n}\n\nfunction normalizePositiveInteger(value: unknown, fallback: number, max: number) {","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/skills/builtins.ts#L51-L87","documentation":"Error \"Skill file paths must be relative to the skill workspace\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/skills/builtins.ts:69 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}