Files
gstack/test/eval-model.test.ts
T
garrytanandcapy-ai[bot] 4ce7f32d31 feat(evals): Opus 5.5 is the paid gate's model under test; judge stays Fable (GSTA-49 TM1)
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
2026-10-18 19:09:54 +00:00

25 lines
1.3 KiB
TypeScript

/** OV11: the host-neutral eval-model resolver's contract. */
import { describe, test, expect } from "bun:test";
import { CLAUDE_CAPTURE_EVAL_MODEL, CLAUDE_JUDGE_EVAL_MODEL, resolveEvalModel } from "../lib/eval-model";
describe("resolveEvalModel", () => {
test("explicit argument wins over everything", () => {
expect(resolveEvalModel("capture", "my-model", { GSTACK_EVAL_MODEL: "x" } as never)).toBe("my-model");
});
test("per-kind env beats the global env", () => {
expect(resolveEvalModel("warmup", null, { GSTACK_EVAL_MODEL_WARMUP: "w", GSTACK_EVAL_MODEL: "g" } as never)).toBe("w");
});
test("global env beats the default", () => {
expect(resolveEvalModel("distill", null, { GSTACK_EVAL_MODEL: "g" } as never)).toBe("g");
});
test("defaults per kind", () => {
expect(resolveEvalModel("capture", null, {} as never)).toBe(CLAUDE_CAPTURE_EVAL_MODEL);
expect(resolveEvalModel("warmup", null, {} as never)).toBe("claude-haiku-4-5");
expect(resolveEvalModel("distill", null, {} as never)).toBe("claude-haiku-4-5-20251001");
expect(resolveEvalModel("judge", null, {} as never)).toBe(CLAUDE_JUDGE_EVAL_MODEL);
});
test("unknown kind throws instead of silently defaulting", () => {
expect(() => resolveEvalModel("banana" as never, null, {} as never)).toThrow();
});
});