/** * prompt-grader — independent LLM-as-judge grader. * * Evaluates a single trajectory against user-provided rubric criteria. * Uses a structured JSON response from the LLM with per-criterion scores * and reasoning, then maps to the standard GraderResult interface. */ import type { Grader, GraderInput, GraderMetadata, GraderResult, GraderComparisonInput, GraderComparisonResult } from "../types.js"; import type { LlmClient, PromptGraderConfig, ResolvedRubric } from "./types.js"; import { type ResolvedLlmEvidence } from "./evidence.js"; import { type JudgeEvidenceFile } from "./judge-workspace.js"; import type { Trajectory } from "../../trajectory/types.js"; /** Config schema for the `prompt` grader in eval.yaml. All fields optional. */ export type Config = PromptGraderConfig; /** * Resolve the rubric for a stimulus, falling back to the default when it is * missing *or empty*. An empty rubric would leave the judge with no criteria, * yet the response schema requires at least one entry — which invites tool-call * failures — so treat `[]` the same as absent. * * The `source` is reported as `rubric_source` in grader metadata, since the * default criteria read plausibly enough that a fallback otherwise goes unseen. */ export declare function resolveRubric(stimulus: GraderInput["stimulus"]): ResolvedRubric; export declare class PromptGrader implements Grader { metadata: GraderMetadata; private client; constructor(client: LlmClient); /** * `prompt "did it use bicep"` — the rubric distinguishes instances. Double * quotes signal prose (a judge question) rather than a literal to match. * Optional: the grader falls back to the stimulus rubric, in which case * there is nothing to discriminate on and the bare type is right. */ defaultName(config: Record): string; grade(input: GraderInput): Promise; /** * Comparison mode: judge a baseline trajectory head-to-head against a * treatment for the same stimulus, against the same rubric. Uses * position-swap debiasing (forward + reverse) and maps the verdict onto the * signed, treatment-relative {@link ComparisonMagnitude} scale. * * v1 supports only `baseline-relative` topology; `n-way` is reserved. */ compare(input: GraderComparisonInput): Promise; private compareOnce; } export declare function buildUserMessage(input: GraderInput, rubric: string[], customPrompt?: string, resolvedEvidence?: ResolvedLlmEvidence, nonce?: string): string; export declare function buildWorkspaceSystemMessage(systemMessage: string, files: readonly JudgeEvidenceFile[], workingDirectory: string): string; export declare function buildComparisonUserMessage(trajectoryA: Trajectory, trajectoryB: Trajectory, taskPrompt: string | undefined, rubric: string[], customPrompt?: string, nonce?: string): string; //# sourceMappingURL=prompt-grader.d.ts.map