(filePath, baseDir string)
| 237 | } |
| 238 | |
| 239 | func computeIncludeResolveAndSecurityBases(filePath, baseDir string) (string, string, string) { |
| 240 | githubFolder := findGitHubFolder(baseDir) |
| 241 | resolveBase := baseDir |
| 242 | securityBase := githubFolder |
| 243 | normalizedFilePath := filePath |
| 244 | if strings.HasSuffix(githubFolder, ".github") { |
| 245 | repoRoot := filepath.Dir(githubFolder) |
| 246 | filePathSlash := filepath.ToSlash(filePath) |
| 247 | if strings.HasPrefix(filePathSlash, constants.GithubDir) { |
| 248 | resolveBase = repoRoot |
| 249 | } else if stripped, ok := strings.CutPrefix(filePathSlash, "/"); ok { |
| 250 | if !strings.HasPrefix(stripped, constants.GithubDir) && !strings.HasPrefix(stripped, ".agents/") { |
| 251 | return "", "", filePath |
| 252 | } |
| 253 | normalizedFilePath = filepath.FromSlash(stripped) |
| 254 | resolveBase = repoRoot |
| 255 | if strings.HasPrefix(stripped, ".agents/") { |
| 256 | securityBase = filepath.Join(repoRoot, ".agents") |
| 257 | } else { |
| 258 | securityBase = githubFolder |
| 259 | } |
| 260 | } |
| 261 | } |
| 262 | return resolveBase, securityBase, normalizedFilePath |
| 263 | } |
| 264 | |
| 265 | func resolveAndValidateLocalIncludePath(filePath, resolveBase, securityBase string) (string, error) { |
| 266 | if stripped, ok := strings.CutPrefix(filepath.ToSlash(filePath), "/"); ok { |
no test coverage detected