/** * Benchmark runner for dsh-eval: one fresh subprocess per case x trial. * * Each trial owns a private temp directory with a copied workspace, an * isolated DSH_HOME, and a patch overlay that forces plain-JSONL persistence * and non-interactive workspace-scoped permissions. The spawned command is * the same trusted dsh harness (credentials flow through deliberately: the * child must reach the real model API, and the session log never stores * them), so the defensive scrubbed-env rule's leak concern does not apply to * this child. Timeout kills the direct child and reports timed-out orthogonally * from its exit code; Windows descendants of a killed process may survive. * * @module dsh-eval/runner */ import type { Benchmark, EvalRun } from './types.ts'; import { type JudgeChat } from './judge.ts'; /** Runtime overrides applied to a loaded benchmark. */ export interface RunOptions { /** Override the benchmark's dsh command argv. */ command?: readonly string[]; /** Override the benchmark's spawned profile. */ profile?: string; /** Override the benchmark's trials per case. */ trials?: number; /** Override the benchmark's in-flight trial limit. */ concurrency?: number; /** Root for trial directories; defaults to the platform temp dir. */ tempRoot?: string; /** LLM-judge chat seam; required when the benchmark configures a judge. */ judgeChat?: JudgeChat; } /** * Run every case x trial through a bounded worker pool and aggregate the * completed trials. * * Trials are independent by construction — each owns a private temp directory, * workspace copy, and DSH_HOME — so the only thing serial execution buys is * determinism. The pool keeps that anyway: results land at their task index, so * the run record stays in case-then-trial order no matter how the workers * interleave. The first failure to escape `runCaseTrial` stops the remaining * workers and rejects the run, which is the same contract as the serial loop. * * @param benchmark - the loaded benchmark. * @param options - runtime overrides and test seams. * @returns the completed run record, written by the caller. */ export declare function runBenchmark(benchmark: Benchmark, options?: RunOptions): Promise;