{"record":{"id":"494755b975eda6dc","repo":"Egonex-AI/Understand-Anything","slug":"repository-path-is-not-a-directory-repovalue","errorCode":null,"errorMessage":"Repository path is not a directory: ${repoValue}","messagePattern":"Repository path is not a directory: (.+?)","errorType":"validation","errorClass":"CliUsageError","httpStatus":null,"severity":"error","filePath":"scripts/lib/large-repo-benchmark.mjs","lineNumber":260,"sourceCode":"    }\n    repoValue = arg;\n  }\n\n  if (help) return { help: true };\n  if (!repoValue) throw new CliUsageError('A repository path is required');\n  if (outputValue === null || outputValue.trim() === '') {\n    throw new CliUsageError('--output is required and must be non-empty');\n  }\n  if (!Number.isInteger(concurrency) || concurrency < 1 || concurrency > 32) {\n    throw new CliUsageError('--concurrency must be an integer between 1 and 32');\n  }\n\n  const repoRoot = resolve(cwd, repoValue);\n  if (!existsSync(repoRoot)) {\n    throw new CliUsageError(`Repository path does not exist: ${repoValue}`);\n  }\n  if (!statSync(repoRoot).isDirectory()) {\n    throw new CliUsageError(`Repository path is not a directory: ${repoValue}`);\n  }\n\n  const outputPath = resolve(cwd, outputValue);\n  const markdownPath = resolve(\n    cwd,\n    outputPath.toLowerCase().endsWith('.json')\n      ? `${outputPath.slice(0, -'.json'.length)}.md`\n      : `${outputPath}.md`,\n  );\n  if (isPathInsideOrEqual(repoRoot, outputPath)) {\n    throw new CliUsageError('--output must be outside the subject repository');\n  }\n  if (isPathInsideOrEqual(repoRoot, markdownPath)) {\n    throw new CliUsageError('Markdown report path must be outside the subject repository');\n  }\n\n  return {\n    help: false,","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/Egonex-AI/Understand-Anything/blob/32944829e7a63a9fa9c55d811d7f98a9530c6a6a/scripts/lib/large-repo-benchmark.mjs#L242-L278","documentation":"CliUsageError thrown by parseArgs when the resolved repository path exists but statSync reports it is not a directory. The benchmark needs to walk a directory tree, so a file, device, or symlink-to-file is rejected.","triggerScenarios":"Passing a path to a file (e.g. a .git file instead of the working tree), a broken symlink, a special file, or a path that resolves to a regular file via a symlink.","commonSituations":"Pointing at a file inside the repo rather than the repo root; a symlink that resolves to a file; copying a path from documentation that referred to a file; misinterpreting a submodule pointer.","solutions":["Point at the repository root directory (the working tree), not a file within it.","Resolve symlinks to confirm the target is a directory.","Use an absolute path to the directory to avoid ambiguity.","If the repo is a submodule, ensure the path is the checked-out working tree."],"exampleFix":"# before\nnode benchmark-large-repo.mjs /abs/repo/README.md --output out.json\n# after\nnode benchmark-large-repo.mjs /abs/repo --output out.json","handlingStrategy":"validation","validationCode":"import { statSync } from 'node:fs';\nif (!statSync(resolve(cwd, repoValue)).isDirectory()) { /* reject early */ }","typeGuard":null,"tryCatchPattern":"try { const opts = parseArgs(argv); } catch (e) { if ((e as Error).name === 'CliUsageError') { console.error(e.message); process.exit(2); } throw e; }","preventionTips":["Point at the repository working-tree directory, not a file inside it.","Resolve symlinks to confirm the target is a directory."],"tags":["benchmark","cli","filesystem","path"],"backgroundTag":null,"analyzedSha":"32944829e7a63a9fa9c55d811d7f98a9530c6a6a","analyzedAt":"2026-08-12T10:25:44.261Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}