import type { ChatFactory } from "../llm.js"; import type { ScoredChunk } from "../rag/store.js"; import type { RubricKey, Transcript } from "../types.js"; export interface JudgeContext { transcript: Transcript; chat: ChatFactory; judgeModel: string; retrieve: ((query: string, k?: number) => Promise) | null; } export type DagState = Record; export interface Decision { score: number; passed: boolean; reason: string; evidence?: string[]; } export interface StepResult { outcome: string; evidence?: string[]; patch?: DagState; next?: string; decision?: Decision; } export interface DagEdge { label: string; to: string; } export interface DagNode { id: string; label: string; kind: "rule" | "binary" | "extract" | "leaf"; edges: DagEdge[]; score?: number; passed?: boolean; run(ctx: JudgeContext, state: DagState): Promise; } export interface Dag { rubric: RubricKey; entry: string; nodes: Record; } export interface PathStep { nodeId: string; label: string; outcome: string; } export interface DagVerdict { score: number; passed: boolean; reason: string; evidence: string[]; path: PathStep[]; } export declare function evaluateDag(dag: Dag, ctx: JudgeContext): Promise;