Run Evals on Every Pull Request

In Pin Down a Pass-Rate Bug, you made the eval helpers trustworthy. But evals only protect the assistant when someone runs them, and a teammate changing how reports reach the model may not think to. The Hut 6 failure could come back.

In this lesson, you’ll write a check with thresholds that saves its results per commit, run it with npm run evals:pr, and see the GitHub Actions workflow that runs it on every pull request. Start with which changes should trigger it.

Decide What Runs and When

Evals cost time and money, so run them on every change that can affect an answer. Besides prompt edits, that includes a new model ID in model/config.js, a new report in data/, a change to how assistant.js builds its input, or an update to the grading in evals/.

A pull request check runs on each proposed change before it merges. To stay small and fast, it runs the twenty status dev cases three times each. A release run grades every labeled case that a judge can assess, including held-out cases, with five runs per case. Add "criteria": ["status"] to the nine held-out cases it fits, as you did for the dev cases.

The check fails on a rate, never on one answer. If 40 cases each pass 98 percent of the time, independently, all pass together only about 45 percent of the time, calculated as 0.98 to the power of 40. So one test per case would fail most unchanged builds.

Your continuous integration (CI) service checks each change and also runs npm test first. Unit tests check your eval code with no model call and no key, while evals make real calls. Here’s how the pieces fit together:

A change runs npm test, then a pull request check gated on its pass rate. A release run grades all cases. Both save a results file.
Two Eval Sets, One Gate, and a Results File per Run

Write the Pull Request Check

Floors come from a baseline: the assistant as last released at the Release v1 commit, unchanged since then. Here’s how many answers passed in each slice in twenty unchanged runs on December 1, 2026:

Slice Answers per run Unchanged runs Floor
Overall, without Hut 6 48 46 to 48 93%
Col de Fenêtre 18 17 to 18 88%
Valbrune ford 12 10 to 12 75%
Hut 6 12 3 to 10 8%

Take the ford: the worst unchanged run got 10 of 12, so its floor sits one answer lower, at 9 of 12, or 75 percent, at the price of missing smaller drops. The same rule gives 16 of 18 on the col and 45 of 48 overall. These floors are provisional, since twenty clean runs can’t guarantee an unlucky run won’t fail an unchanged build.

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.