import type { CapsuleAnswerGroundingPolicy, ChunkId, DocumentId, EmbeddingModelIdentity, KnowledgeCapsuleId, KnowledgeSourceId, ParsedUnit } from "@oscharko-dev/keiko-contracts";
import type { RetrievalNoEvidenceReason, RetrievalReference } from "../retrieval/types.js";
export interface EvalChunkSpec {
    readonly id: ChunkId;
    readonly text: string;
    readonly topic?: string;
    readonly parsedUnitId?: string;
}
export type EvalParsedUnitWithoutDocId = Omit<Extract<ParsedUnit, {
    kind: "page";
}>, "documentId"> | Omit<Extract<ParsedUnit, {
    kind: "section";
}>, "documentId"> | Omit<Extract<ParsedUnit, {
    kind: "json-path";
}>, "documentId"> | Omit<Extract<ParsedUnit, {
    kind: "csv-row";
}>, "documentId"> | Omit<Extract<ParsedUnit, {
    kind: "html-block";
}>, "documentId"> | Omit<Extract<ParsedUnit, {
    kind: "unsupported-media";
}>, "documentId">;
export interface EvalParsedUnitSpec {
    readonly id: string;
    readonly unit: EvalParsedUnitWithoutDocId;
}
export interface EvalDocumentSpec {
    readonly id: DocumentId;
    readonly safeDisplayName: string;
    readonly mediaType?: string;
    readonly parserId?: string;
    readonly parserVersion?: string;
    readonly parsedUnits: readonly EvalParsedUnitSpec[];
    readonly chunks: readonly EvalChunkSpec[];
}
export interface EvalSourceSpec {
    readonly id: KnowledgeSourceId;
    readonly documents: readonly EvalDocumentSpec[];
}
export interface EvalCapsuleSpec {
    readonly id: KnowledgeCapsuleId;
    readonly displayName: string;
    readonly answerGroundingPolicy: CapsuleAnswerGroundingPolicy;
    readonly embeddingModelIdentity: EmbeddingModelIdentity;
    readonly sources: readonly EvalSourceSpec[];
}
export type EvalRetrievalScope = {
    readonly kind: "capsule";
    readonly capsuleId: KnowledgeCapsuleId;
} | {
    readonly kind: "capsule-set";
    readonly capsuleSetId: string;
    readonly capsuleIds: readonly KnowledgeCapsuleId[];
};
export interface RetrievalEvalQuery {
    readonly id: string;
    readonly text: string;
    readonly topic?: string;
    readonly scope: EvalRetrievalScope;
    readonly expectedChunkIds?: readonly ChunkId[];
    readonly expectedNoEvidence?: boolean;
    readonly expectedNoEvidenceReason?: RetrievalNoEvidenceReason;
    readonly topK?: number;
    readonly contextBudgetTokens?: number;
    readonly queryEmbeddingIdentity?: EmbeddingModelIdentity;
}
export interface RetrievalEvalFixture {
    readonly id: string;
    readonly description: string;
    readonly capsules: readonly EvalCapsuleSpec[];
    readonly queries: readonly RetrievalEvalQuery[];
}
export interface RetrievalEvalDimensionScores {
    readonly recall: number;
    readonly precision: number;
    readonly sourceIsolation: number;
    readonly citationQuality: number;
    readonly noEvidenceAccuracy: number;
    readonly contextBudgetFit: number;
    readonly latencyMs: number;
}
export interface ModelJudgedRetrievalEvalInput {
    readonly fixtureId: string;
    readonly queryId: string;
    readonly queryText: string;
    readonly references: readonly RetrievalReference[];
    readonly noEvidence: boolean;
    readonly reason?: RetrievalNoEvidenceReason;
}
export interface ModelJudgedRetrievalEvalScores {
    readonly groundedness: number;
    readonly faithfulness: number;
}
export interface ModelJudgedRetrievalEvalJudge {
    readonly judge: (input: ModelJudgedRetrievalEvalInput) => Promise<ModelJudgedRetrievalEvalScores>;
}
export interface RetrievalEvalScorecard {
    readonly fixtureId: string;
    readonly runId: string;
    readonly dimensions: RetrievalEvalDimensionScores;
    readonly passed: boolean;
    readonly modelJudged?: ModelJudgedRetrievalEvalScores;
}
export interface RetrievalEvalThresholds {
    readonly recall: number;
    readonly precision: number;
    readonly sourceIsolation: number;
    readonly citationQuality: number;
    readonly noEvidenceAccuracy: number;
    readonly contextBudgetFit: number;
}
export declare const PASS_THRESHOLDS: RetrievalEvalThresholds;
//# sourceMappingURL=types.d.ts.map