Something went wrong. Try again.
An agent harness for parametric learning.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879export type Side = "left" | "right";
export type SerializedMessage = Record<string, unknown>;
export interface StreamUpdate { text?: string; reasoning?: string; status?: string;}
export interface RunRequest { history: SerializedMessage[]; prompt: string; branchId: string; onUpdate?: (update: StreamUpdate) => void;}
export interface RunResult { branchId: string; messages: SerializedMessage[]; response: string; reasoning: string; startedAt: string; completedAt: string; model: { provider: string; id: string; checkpoint?: string; }; events: Array<Record<string, unknown>>;}
export interface BranchBackend { readonly name: string; readonly displayName: string; readonly systemPrompt: string; run(request: RunRequest): Promise<RunResult>;}
export interface ForkResult { turnId: string; createdAt: string; prompt: string; parentHistory: SerializedMessage[]; parentHistoryHash: string; left: RunResult; right: RunResult;}
export interface CandidateRecord { id: string; source: "left" | "right" | "revision"; response: string; reasoning: string; messages: SerializedMessage[]; model: RunResult["model"];}
export interface PreferenceRecord { schema: "branch-preference/v1"; id: string; createdAt: string; backend: string; systemPrompt: string; systemPromptHash: string; parentHistory: SerializedMessage[]; parentHistoryHash: string; prompt: string; candidates: CandidateRecord[]; preferredCandidateId: string; rejectedCandidateIds: string[]; selection: "left" | "right" | "revise-left" | "revise-right"; correction?: { feedback: string; originalCandidateId: string; revisionPrompt: string; };}