Files
gstack/test/eval-model.test.ts
T
Garry Tanandcapy-ai[bot] 5db285c1a4 /eval-plan refuses gpt-4o and older-generation models in every role, and asks for 100 judge labels from 2026-11-22 (GST-3384) (#4630)
/eval-plan now refuses gpt-4o and older-generation models in every role
a plan picks (arms, judge, readers, simulators) and names the
replacement; a competitor tested as its vendor ships it keeps its
built-in model on its own arm.

Why: eval numbers should come from current frontier models, and from
2026-11-22 a model judge must agree with 100 hand labels, not 40.

Nothing to do.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: lib/eval-plan-checks.ts:153:functional-contract reader=qa
Review-Finding: p1/red-team#2 reader=red-team
2026-11-21 21:33:01 +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-5-5");
expect(resolveEvalModel("distill", null, {} as never)).toBe("claude-haiku-5-5");
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();
});
});