The platform for continuously improving AI agents.
// covers: console-logic
import { expect, it } from "vitest";
import type { TrainingControl } from "@/openapi";
import { controlOutcome } from "./training-agent";
const control = (fields: Partial<TrainingControl>): TrainingControl =>
({ arguments: {}, result: {}, state: "requested", step: null, ...fields }) as TrainingControl;
it("says where a change stands, with the trainer's step or reason", () => {
expect(controlOutcome(control({}))).toBe("Requested");
expect(controlOutcome(control({ state: "sent" }))).toBe("Sent to the trainer");
expect(controlOutcome(control({ state: "applied", step: 31 }))).toBe("Applied at step 31");
expect(controlOutcome(control({ result: { error: "No checkpoint" }, state: "rejected" }))).toBe(
"Not applied: No checkpoint"
);
});