{"record":{"id":"2876524e6c4ddc37","repo":"diegosouzapw/OmniRoute","slug":"local-corpus-root-must-point-to-a-directory","errorCode":null,"errorMessage":"Local corpus root must point to a directory","messagePattern":"Local corpus root must point to a directory","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/localCorpus/index.ts","lineNumber":282,"sourceCode":"  const suffix = end < content.length ? \"…\" : \"\";\n  return `${prefix}${content.slice(start, end).trim()}${suffix}`;\n}\n\nexport async function canonicalizeLocalCorpusRoot(inputPath: string): Promise<string> {\n  if (!path.isAbsolute(inputPath)) {\n    throw new Error(\"Local corpus root must be an absolute directory path\");\n  }\n\n  let canonical: string;\n  let stat;\n  try {\n    canonical = await fs.realpath(path.resolve(inputPath));\n    stat = await fs.stat(canonical);\n  } catch {\n    throw new Error(\"Local corpus root is not accessible\");\n  }\n  if (!stat.isDirectory()) {\n    throw new Error(\"Local corpus root must point to a directory\");\n  }\n  return canonical;\n}\n\nexport class LocalCorpusIndex {\n  private readonly configuredRoot: string;\n  private readonly limits: ResolvedLimits;\n  private canonicalRoot: string | null = null;\n  private files = new Map<string, IndexedCorpusFile>();\n  private lastIndexedAt: number | null = null;\n  private truncated = false;\n  private refreshPromise: Promise<LocalCorpusRefreshResult> | null = null;\n\n  constructor(rootPath: string, limits: LocalCorpusLimits = {}) {\n    this.configuredRoot = rootPath;\n    this.limits = resolveLimits(limits);\n  }\n","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/localCorpus/index.ts#L264-L300","documentation":"Error \"Local corpus root must point to a directory\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/localCorpus/index.ts:282 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"}