/** * Retrieval evaluation: run gold queries through {@link searchGraph} and report * how often, and how high, the expected node shows up. * * A case passes at rank r when any hit's name or file path contains one of its * `expect` strings (case-insensitive). Substring matching keeps gold files * stable across line-number and id-scheme changes. */ import type Database from 'better-sqlite3'; import type { Embedder } from '../embeddings/store.js'; import type { GraphSearchOptions } from './hybrid-query.js'; export interface EvalCase { query: string; /** Any hit whose name or filePath contains one of these counts as found. */ expect: string[]; /** Free-form bucket for the report: exact, ambiguous, natural, doc, dependency. */ kind?: string; scope?: GraphSearchOptions['scope']; } export interface EvalCaseResult { query: string; kind: string; /** 1-based rank of the first expected hit, or null when absent from the top k. */ rank: number | null; } export interface EvalReport { k: number; cases: number; recallAtK: number; /** Mean reciprocal rank: 1/rank per case, 0 when absent. */ mrr: number; byKind: Record; results: EvalCaseResult[]; } export declare function evaluateRetrieval(db: Database.Database, cases: EvalCase[], options?: { k?: number; search?: Partial; embedder?: Embedder | null; }): Promise; //# sourceMappingURL=eval.d.ts.map