/**
 * measure-retrieval.ts
 *
 * Pure retrieval quality measurement functions.
 *
 * Evaluates retrieval quality by comparing what Sanity's text search
 * returns against the manually-annotated canonical documents for each
 * evaluation task. Produces Recall@K and NDCG@K metrics.
 *
 * This answers: "Can a retriever find the docs an LLM actually needs?"
 *
 * Migrated from lib/measure-retrieval.ts — no process.argv/process.env,
 * accepts rootDir and retriever function as parameters.
 */
export interface RetrievalResult {
    canonical_docs: string[];
    feature_area: string;
    ndcg_at_10: number;
    recall_at_5: number;
    recall_at_10: number;
    retrieved_docs: string[];
    task_id: string;
}
export interface RetrievalSummary {
    by_area: Record<string, {
        avg_recall_at_5: number;
        avg_recall_at_10: number;
        avg_ndcg_at_10: number;
        task_count: number;
    }>;
    overall: {
        avg_recall_at_5: number;
        avg_recall_at_10: number;
        avg_ndcg_at_10: number;
    };
    results: RetrievalResult[];
}
/** A retriever function: given a query and k, returns k document slugs. */
export type RetrieverFn = (query: string, k: number) => Promise<string[]>;
export declare function calculateRecall(canonical: string[], retrieved: string[], k: number): number;
export declare function calculateNDCG(canonical: string[], retrieved: string[], k: number): number;
export interface MeasureRetrievalOptions {
    /** Root directory of the eval package */
    rootDir: string;
    /** Retriever function — injected by callers for testability */
    retriever: RetrieverFn;
    /** Optional progress callback */
    onProgress?: (area: string, taskId: string, result: RetrievalResult) => void;
}
/**
 * Run retrieval quality measurement for all tasks.
 *
 * @returns A full RetrievalSummary with per-task, per-area, and overall metrics.
 */
export declare function measureRetrieval(options: MeasureRetrievalOptions): Promise<RetrievalSummary>;
/**
 * Format a retrieval summary for console display.
 */
export declare function formatRetrievalTable(summary: RetrievalSummary): string;
