{"record":{"id":"078a489386a3dea5","repo":"diegosouzapw/OmniRoute","slug":"local-corpus-path-must-point-to-a-regular-file","errorCode":null,"errorMessage":"Local corpus path must point to a regular file","messagePattern":"Local corpus path must point to a regular file","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/localCorpus/index.ts","lineNumber":556,"sourceCode":"    }\n    if (!isAllowedExtension(inputPath, this.limits.allowedExtensions)) {\n      throw new Error(\"Local corpus file type is not permitted\");\n    }\n\n    const root = await this.getRoot();\n    const resolved = path.resolve(root, inputPath);\n    if (!isContained(root, resolved)) {\n      throw new Error(\"Local corpus file path escapes the configured root\");\n    }\n\n    let linkStat;\n    try {\n      linkStat = await fs.lstat(resolved);\n    } catch {\n      throw new Error(\"Local corpus file is not accessible\");\n    }\n    if (linkStat.isSymbolicLink() || !linkStat.isFile()) {\n      throw new Error(\"Local corpus path must point to a regular file\");\n    }\n    if (linkStat.size > this.limits.maxFileBytes) {\n      throw new Error(\"Local corpus file exceeds the configured read limit\");\n    }\n\n    let canonicalFile: string;\n    try {\n      canonicalFile = await fs.realpath(resolved);\n    } catch {\n      throw new Error(\"Local corpus file is not accessible\");\n    }\n    if (!isContained(root, canonicalFile)) {\n      throw new Error(\"Local corpus file path escapes the configured root\");\n    }\n\n    let content: string;\n    try {\n      content = await fs.readFile(canonicalFile, \"utf8\");","sourceCodeStart":538,"sourceCodeEnd":574,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/localCorpus/index.ts#L538-L574","documentation":"Error \"Local corpus path must point to a regular file\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/localCorpus/index.ts:556 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"}