/** * Shared grader-label helpers. * * A stimulus can configure several instances of the same grader type (e.g. * three `output-matches` with different patterns). Their `GraderResult.name` * defaults to the type, so any breakdown keyed by name silently merges those * instances and hides which one failed. Every reporter therefore identifies * graders by POSITION within `GraderResult.details` — which is stable across * trials because graders run in configured order — and disambiguates the * display label with a `#n` suffix. * * Labels are returned raw (unsanitized): each reporter applies its own * escaping (terminal-safe, markdown cell, XML attribute). */ /** One grader position in a stimulus's grader list, tallied across trials. */ export interface GraderBreakdownEntry { /** Disambiguated display label — `name` plus a `#n` suffix when the name is * shared with another grader instance. Raw/unsanitized. */ label: string; /** Number of trials in which this grader instance passed. */ passCount: number; } /** Minimal shape a reporter's per-trial record must expose to be tallied. */ interface GradedTrial { grade?: { details?: { name: string; passed: boolean; }[]; } | null; } /** * Build display labels for a grader breakdown. Graders that share a name * (e.g. two `output-matches` without an explicit `name`) get a `#n` suffix, * numbered within each duplicate-name group in encounter order, so every row * stays distinguishable. Unique names are returned unchanged. * * Suffixes skip any value already present in the input. An explicit grader * `name` is arbitrary user text, so an author who pins `output-matches #1` — * exactly what they would copy out of a previous report — would otherwise * collide with a suffix generated for a neighbouring duplicate, recreating the * duplicate-key bug this labeling exists to prevent. */ export declare function labelGraderNames(names: string[]): string[]; /** * Tally each grader POSITION across a stimulus's trials. Trials that errored * (no grade) contribute no passes but still count toward the caller's trial * total, so `passCount < trials.length` reads true. Positions are taken from * the longest details array seen, which tolerates a trial that errored partway * through grading. */ export declare function buildGraderBreakdown(trials: readonly GradedTrial[]): GraderBreakdownEntry[]; export {}; //# sourceMappingURL=grader-labels.d.ts.map