{"record":{"id":"1c6fb67c9ad9bfaf","repo":"diegosouzapw/OmniRoute","slug":"local-corpus-endline-must-be-greater-than-or-equal","errorCode":null,"errorMessage":"Local corpus endLine must be greater than or equal to startLine","messagePattern":"Local corpus endLine must be greater than or equal to startLine","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/localCorpus/index.ts","lineNumber":587,"sourceCode":"      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\");\n    } catch {\n      throw new Error(\"Local corpus file is not accessible\");\n    }\n    if (content.includes(\"\\0\")) throw new Error(\"Local corpus file is not valid text\");\n\n    const lines = content.split(/\\r?\\n/);\n    const requestedStart = positiveInteger(options.startLine, 1);\n    const requestedEnd = positiveInteger(\n      options.endLine,\n      requestedStart + this.limits.maxReadLines - 1\n    );\n    if (requestedEnd < requestedStart) {\n      throw new Error(\"Local corpus endLine must be greater than or equal to startLine\");\n    }\n\n    const startLine = Math.min(requestedStart, Math.max(lines.length, 1));\n    const endLine = Math.min(lines.length, requestedEnd, startLine + this.limits.maxReadLines - 1);\n    return {\n      relativePath: normalizeRelativePath(path.relative(root, canonicalFile)),\n      content: lines.slice(startLine - 1, endLine).join(\"\\n\"),\n      startLine,\n      endLine,\n      totalLines: lines.length,\n      truncated: startLine > 1 || endLine < lines.length,\n    };\n  }\n}\n\nexport function getDefaultLocalCorpusStatus(): LocalCorpusStatus {\n  const limits = resolveLimits({});\n  return {","sourceCodeStart":569,"sourceCodeEnd":605,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/localCorpus/index.ts#L569-L605","documentation":"Error \"Local corpus endLine must be greater than or equal to startLine\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/localCorpus/index.ts:587 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"}