/** * Race phase — first **successful** branch wins (not first-settled). */ import type { Phase } from "../../schema.ts"; import type { RunResult } from "../../runner-core.ts"; import type { PhaseState } from "../../store.ts"; export interface RaceBranch { agent: string; task: string; } export interface RaceRunOne { (agent: string, task: string, signal?: AbortSignal): Promise; } export interface RaceIsFailed { (r: RunResult): boolean; } /** * First **successful** branch wins. Failed settles do not terminate the race. * If all fail → race fails. cancelLosers aborts others after a success (best-effort). * Final usage aggregates every branch result. A non-cooperative branch that * ignores abort is bounded by a finite accounting deadline; if it remains * outstanding the race fails closed with budgetTruncated so no downstream * phase can run against an incomplete usage snapshot. */ export declare function executeRaceBranches(phase: Phase, branches: RaceBranch[], runOne: RaceRunOne, isFailed: RaceIsFailed, opts: { inputHash: string; parseJson: boolean; readRefs?: PhaseState["reads"]; parentSignal?: AbortSignal; }): Promise; //# sourceMappingURL=race.d.ts.map