WORKFLOW · quality-cd

Workflow: evals as a required check

A GitHub Actions workflow that runs the code-graded regression eval suite whenever agent-facing configuration changes, so prompt and setup edits get the same gate as code.

✓ verified 2026-07-18 · stack: github-actions, github · source

Teams gate code with tests and then edit CLAUDE.md, hooks, and judge prompts with no gate at all, which is how an agent setup degrades without anyone being able to say when. Regression evals are the suite that answers “does everything that worked still work?”, kept at a near-100% pass rate so a decline is a signal (demystifying evals). This workflow runs them on exactly the changes that can break them, and a branch ruleset makes the job a required check.

.github/workflows/agent-evals.yml
name: agent-evals
# Regression evals gate the files that shape agent behaviour, exactly as
# unit tests gate src/. Code-graded only: cheap, deterministic, no judge
# to dispute. Wire this job into the branch ruleset as a required check.
on:
pull_request:
paths:
- "CLAUDE.md"
- ".claude/**"
- "evals/**"
- "prompts/**"
permissions:
contents: read
jobs:
regression:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
# The suite is plain node --test files under evals/regression/: each
# file runs a scenario and asserts on the outcome with code, not an
# LLM judge. Failures print the diff the reviewer needs.
- run: node --test "evals/regression/*.test.mjs"
- uses: actions/upload-artifact@v4
if: failure()
with:
name: eval-failures
path: evals/regression/output/
retention-days: 7

A minimal regression eval to seed the suite, in the shape the workflow expects:

evals/regression/claude-md-loads.test.mjs
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
// Regression: the rules the team depends on are actually present in
// context. Guards against a refactor quietly dropping a load-bearing rule.
test('CLAUDE.md still carries the load-bearing rules', () => {
const md = readFileSync('CLAUDE.md', 'utf8');
for (const rule of ['npm test', 'never edit a failing eval']) {
assert.ok(md.includes(rule), `CLAUDE.md lost the rule: ${rule}`);
}
});

What it does

  • Triggers only on pull requests touching agent-facing surfaces: CLAUDE.md, .claude/ (hooks, settings, skills), the eval suite itself, and any prompt directory. Code changes keep their own faster gates.
  • Runs the regression suite with node --test: code graders at the top of the grader hierarchy, so every verdict is a fact rather than an opinion.
  • Uploads the suite’s output directory on failure, which is where richer scenario runners should write transcripts and diffs.
  • Combined with the graduation rule, the suite grows itself: when a capability eval starts passing consistently, move its file from evals/capability/ into evals/regression/ and it is gated from then on.

Failure modes

  • The check is only required if the ruleset says so. The workflow alone is advisory; add the regression job to the branch ruleset’s required status checks or a red suite still merges.
  • Evals that call a model API cost money per PR. Keep the required tier code-graded and deterministic. Model-graded scenarios belong in a scheduled or manually dispatched capability run, not a per-PR gate.
  • Editing the eval to pass is the classic escape. Anthropic’s harness guidance: “It is unacceptable to remove or edit tests” (effective harnesses). Path-protect evals/regression/ with CODEOWNERS so eval edits need a human reviewer even inside an agent-authored PR.
  • A quiet suite is not a healthy suite. If the regression pass rate has been 100% for months and nothing new has graduated in, the capability suite has stalled, which this workflow cannot see. The graduation rule is a habit, not a mechanism.

Verified against the capability/regression split, grader hierarchy, and graduation rule at anthropic.com/engineering/demystifying-evals-for-ai-agents, 2026-07-18.