/** * Search-result compression: say the path once, not on every line. * * FOUND BY THE BENCHMARK, NOT BY DESIGN. The code-search workload -- the one * HeadRoom reports their largest number on, 92% -- scored 0.0% here for every * strategy including the CCR control, because grep output is not code, not a * log, and not prose. It is a fifth content type that none of the engines * recognised, and no unit test would have noticed since a hand-written fixture * would have been code. * * The redundancy is glaring once the content is real. Ripgrep prefixes EVERY * line with its path and line number: * * hooks-core/derive.mjs:1204: export function commandOperand(command) { * hooks-core/derive.mjs:1205: const tokens = commandBody(command) * * On this repository that prefix averages a third of the line. Stating it once * per contiguous hunk removes all of it: * * hooks-core/derive.mjs:1204-1205 * export function commandOperand(command) { * const tokens = commandBody(command) * * COMPLETELY LOSSLESS, which is what makes it the best trade in the whole * module: line N is the header's start plus the offset, so the original can be * reconstructed exactly from the output with no lookup, no spill and no path to * follow. Nothing is elided at all -- this is pure redundancy removal. */ import type { CompressionResult, EngineContext } from './types.js'; /** Detects ripgrep/grep-style output. */ export declare function looksLikeSearchResults(text: string): boolean; /** * Groups contiguous same-file lines into hunks with one header each. * * A gap in line numbers starts a new hunk, because a header claiming * `file:10-90` for lines that skip 40 of those would be a lie the reader cannot * detect. */ export declare function compressSearchResults(text: string, _ctx?: EngineContext): CompressionResult; //# sourceMappingURL=search.d.ts.map