import type { ResolvedTrialPolicy } from '../benchmark/resolved-policy.js'; import { type ProposalIntent } from '../benchmark/variant-proposal.js'; import type { TrialThreadAdapterInput } from '../benchmark/trial-thread-adapter.js'; import { type CoderReviewVariant } from '../benchmark/workspace-lease.js'; import { type LocalThreadRuntimeDeps } from '../threads/local-runtime-deps.js'; interface BenchmarkThreadRequest { workspaceCwd: string; template: string; instruction: string; handoff?: string; profileName: string; rootRunId: string; trajectoryRoot: string; /** Absolute container path of the arm-resolution document the parent's `agent-run` was given. * The production route always carries it — the `/2` thread-policy document makes it structurally * required at the producer — and it is the single input the whole trial-adapter route is derived * from. It stays optional here for the same reason `trialRoot` does: the requirement belongs at * the producer, and enforcing it here would refuse the shipped policy-supplied route. * Design section 16 (16.3.2) PW1 / PW1-PLACE. */ runConfigPath?: string; /** Absolute trial root. Required for a variant that places a role in a disposable snapshot. */ trialRoot?: string; /** Fixes each role's workspace placement. Absent → every step runs in the shared workspace. */ coderReviewVariant?: CoderReviewVariant; /** The frozen trial policy this thread runs under. Absent → the shipped single-backend path. */ trialPolicy?: ResolvedTrialPolicy; limits: { maxSteps: number; maxCostUsd: number; deadlineEpochMs: number; }; signal: AbortSignal; } export interface BenchmarkThreadResult { threadId: string; state: 'completed' | 'failed' | 'cancelled' | 'timeout'; terminalReason: string | null; artifactPath: string | null; journalPath: string; manifestPath: string; /** True iff a terminal manifest was written and validated successfully. */ manifestCommitted: boolean; steps: number; costUsd: number; durationMs: number; summary: string; /** What this pipeline concluded, decided and never applied. Null for a run that declares no * coder-review variant and therefore has no verdict-speaking role. */ proposal: ProposalIntent | null; } /** * Everything the per-step trial adapter needs, derived from the two paths the request carries and * from nothing else: the compiled policy and the resolved run config from ONE call of the shipped * loader over the arm-resolution document, the pinned trial paths from the trial root, and the * supervisor from the shipped resolver. The policy is RE-COMPILED here, in the process that will * run the thread, rather than transported — which is what makes the parent role-hash equality a * comparison of two independent compiles instead of a tautology. A request that carried a * pre-built `ResolvedAgentRunConfig`, `PinnedTrialPaths` or supervisor descriptor would let a * caller supply what production must derive. Design section 16 (16.3.2) PW1 and PW2. */ export declare function trialThreadAdapterInput(runConfigPath: string, trialRoot: string): TrialThreadAdapterInput; export declare function runBenchmarkThread(request: BenchmarkThreadRequest, overrides?: Partial): Promise; export {};