{"record":{"id":"e9b3d2880f26fbac","repo":"ruvnet/ruflo","slug":"permission-denied","errorCode":"PERMISSION_DENIED","errorMessage":"Invalid ${type} name: must be a non-empty string","messagePattern":"Invalid (.+?) name: must be a non-empty string","errorType":"validation","errorClass":"TeammateError","httpStatus":null,"severity":"error","filePath":"v3/plugins/teammate-plugin/src/teammate-bridge.ts","lineNumber":158,"sourceCode":"  return 0;\n}\n\nfunction ensureDirectory(dirPath: string): void {\n  if (!fs.existsSync(dirPath)) {\n    fs.mkdirSync(dirPath, { recursive: true, mode: 0o700 }); // Secure permissions\n  }\n}\n\n// ============================================================================\n// Security Functions\n// ============================================================================\n\n/**\n * Validate and sanitize team/teammate names to prevent path traversal\n */\nfunction validateName(name: string, type: 'team' | 'teammate'): string {\n  if (!name || typeof name !== 'string') {\n    throw new TeammateError(\n      `Invalid ${type} name: must be a non-empty string`,\n      TeammateErrorCode.PERMISSION_DENIED\n    );\n  }\n\n  const trimmed = name.trim();\n\n  if (trimmed.length === 0) {\n    throw new TeammateError(\n      `Invalid ${type} name: cannot be empty`,\n      TeammateErrorCode.PERMISSION_DENIED\n    );\n  }\n\n  if (trimmed.length > MAX_NAME_LENGTH) {\n    throw new TeammateError(\n      `Invalid ${type} name: exceeds maximum length of ${MAX_NAME_LENGTH}`,\n      TeammateErrorCode.PERMISSION_DENIED","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/teammate-plugin/src/teammate-bridge.ts#L140-L176","documentation":"validateName() rejected a team or teammate name because it was empty, undefined, or not a string. This is the first step of the path-traversal defense: names become directory path components, so only non-empty strings pass to the character sanitization stage.","triggerScenarios":"Thrown at v3/plugins/teammate-plugin/src/teammate-bridge.ts:158 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-empty string name; trim whitespace and reject blank values at the boundary."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}