{"record":{"id":"6ba4b22d878ea1d8","repo":"diegosouzapw/OmniRoute","slug":"local-corpus-file-type-is-not-permitted","errorCode":null,"errorMessage":"Local corpus file type is not permitted","messagePattern":"Local corpus file type is not permitted","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/localCorpus/index.ts","lineNumber":540,"sourceCode":"    results.sort(\n      (left, right) =>\n        right.score - left.score ||\n        left.relativePath.localeCompare(right.relativePath) ||\n        left.startLine - right.startLine\n    );\n\n    return { query: query.trim(), results: results.slice(0, limit), status: this.getStatus() };\n  }\n\n  async read(\n    inputPath: string,\n    options: { startLine?: number; endLine?: number } = {}\n  ): Promise<LocalCorpusReadResult> {\n    if (!inputPath || path.isAbsolute(inputPath) || hasDeniedSegment(inputPath)) {\n      throw new Error(\"Local corpus file path must be a permitted relative path\");\n    }\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) {","sourceCodeStart":522,"sourceCodeEnd":558,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/localCorpus/index.ts#L522-L558","documentation":"Error \"Local corpus file type is not permitted\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/localCorpus/index.ts:540 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"}