/** * Implementations of the `harness_benchmark` actions, split out of * `tool-benchmark.ts` (2026-09-29): the tool surface declares and dispatches, * this module owns the per-action work. * @module dsh-continual-harness */ import type { Context } from '@deepseek-ai/cordis'; import type { Agent } from '@deepseek-ai/dsh-agent'; import type { BenchmarkCriterion } from './benchmark.ts'; import type { HarnessStore } from './store.ts'; import type { BenchmarkToolOptions } from './tool-benchmark.ts'; /** Initialize the benchmark store directory. */ export declare function actionNew(store: HarnessStore): { action: string; ok: boolean; benchmark_dir: string; }; /** Add a draft case and persist the cases file atomically. */ export declare function actionAddCase(store: HarnessStore, args: Record): { action: string; ok: boolean; case: CaseOutput; }; /** Freeze a draft case in place. */ export declare function actionFreeze(store: HarnessStore, args: Record): { action: string; ok: boolean; case: CaseOutput; }; /** The execution slice the benchmark actions need: the live agent and the abort signal. */ interface BenchmarkExecution { agent?: Agent; signal?: AbortSignal; } /** Capture the merged local/global state BEFORE a refinement is applied and persist it. */ export declare function actionCaptureReference(store: HarnessStore, args: Record, exec: BenchmarkExecution): { action: string; ok: boolean; snapshot_id: string; state_hash: string; captured_at: string; }; /** List cases, persisted snapshots, and recent run records. */ export declare function actionStatus(store: HarnessStore): { action: string; ok: boolean; cases: Array<{ id: string; title: string; state: 'draft' | 'frozen'; }>; snapshots: SnapshotSummary[]; recent_runs: RunSummary[]; }; /** * Run the A/B benchmark for one named refinement against a captured reference. * The candidate is derived from the reference state plus the refinement's * recorded applied edits (never from the possibly-drifted live store), and * `validateCandidateDelta` must prove the candidate is reference plus exactly * that refinement — otherwise the run refuses with a structured error before * any evaluation. Both sides evaluate the same frozen cases in stored order * with the same iterations/provider/model, the decision is code-aggregated via * `src/score.ts`, and the full record (cells with executor evidence + decision) * is appended to `benchmark/runs.jsonl`. */ export declare function actionRun(ctx: Context, store: HarnessStore, args: Record, exec: BenchmarkExecution, options: BenchmarkToolOptions): Promise<{ action: string; ok: boolean; run_id: string; refinement_id: string; status: 'ACCEPTED' | 'REJECTED' | 'INCONCLUSIVE'; /** Why the run could not decide; `null` unless `status` is INCONCLUSIVE. */ inconclusive_reason: string | null; /** Largest per-case spread of the paired differences; `null` when unestimable. */ noise_floor: number | null; /** Mean paired difference (candidate − reference); the decision's statistic. */ paired_delta: number | null; /** Iterations scored on both sides — the decision's real sample size. */ pairs: number; reference_overall: number | null; candidate_overall: number | null; regression_cases: string[]; failed_cells: number; feedback: string[]; auto_rollback: boolean; runs: number; cells: number; }>; /** One status-listing entry for a persisted snapshot. */ interface SnapshotSummary { snapshot_id: string; refinement_id?: string; captured_at: string; state_hash: string; } /** One status-listing entry for a recent run record. */ interface RunSummary { run_id: string; refinement_id: string; status: 'ACCEPTED' | 'REJECTED' | 'INCONCLUSIVE'; reference_overall: number | null; candidate_overall: number | null; created_at: string; } /** The output projection of a case: snake_case keys with optional fields omitted. */ interface CaseOutput { id: string; title: string; statement: string; rubric: string; capability?: string; criteria?: BenchmarkCriterion[]; state: 'draft' | 'frozen'; created_at: string; frozen_at?: string; } /** Structured tool error: `benchmark::: `. */ export declare function benchmarkError(code: string, message: string): Error; export {}; //# sourceMappingURL=benchmark-actions.d.ts.map