Skip to content

Run the authoring evals on a schedule and gate on the pass rate - #108

Merged
jimhoyd merged 3 commits into
mainfrom
claude/issue-104-scheduled-evals
Sep 18, 2026
Merged

jimhoyd merged 3 commits into
mainfrom
claude/issue-104-scheduled-evals

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • benchmarks/agent/adapters/anthropic.ts: a real model adapter for the harness. An agentic loop over the Messages API using Node's global fetch (no new dependency), reading ANTHROPIC_API_KEY and the model from URLCODE_BENCHMARK_MODEL. Five tools (list_files, read_file, write_file, run_command, finish); every path is checked to stay inside the workspace (including through symlinks), and run_command has a per-arm allow-list (urlcode validate|test|context|routes|explain|audit|permissions for the URLCode arm; node <file> / npm install|ci|test|run for the conventional arm) with a timeout and no model-supplied project paths. Token counts come from the API's usage fields; turns are API calls; retries are 429/5xx/network retries with backoff. Hard caps on turns (40), wall time (20 min) and bytes written (512 KiB) end the run as a generation failure. The URLCode arm's system prompt carries the skill, the recipes and the YAML reference (prompt-cached); the conventional arm gets nothing URLCode-specific. Refusals are surfaced and server-side fallbacks are requested by default. selectAdapter accepts anthropic; stub is unchanged and remains the default.
  • .github/workflows/evals.yml: weekly schedule plus workflow_dispatch, pinned actions, npm ci. When secrets.ANTHROPIC_API_KEY is empty it writes "no credential; evals skipped" to the step summary and exits 0. Otherwise it runs npm run benchmark:agent -- --evals --adapter anthropic with vars.URLCODE_BENCHMARK_MODEL, uploads benchmarks/agent/runs/ and the runner output as an artifact, and runs the gate.
  • benchmarks/agent/gate.ts: parses the runner's JSON lines, writes the pass rate and per-criterion table to $GITHUB_STEP_SUMMARY, and fails when the rate is below runs/baseline.json, when any generation failed, or when no records were produced. --write-baseline stores a new baseline. A baseline with stub: true (the committed one, from the stub run) is treated as "no baseline yet"; comparisons are only made within the same harnessVersion.
  • Docs: the benchmark README documents the variable, the secret, the cost (stated as an estimate) and what a drop means; CONTRIBUTING gets one line.

Validation

  • npm run lint, npm run typecheck, npm run check: clean.
  • npm test: 505 tests, 0 failures. New tests drive the adapter with a fake fetch replaying canned responses and a fake command runner (retry on 529, workspace escapes and disallowed commands returned as tool errors, usage accounting, turn/byte/wall-time caps, refusal, 401/429 handling, missing key) and the gate (stub baseline, drop, broken run, harness-version mismatch, rendering). No test touches the network.
  • The stub path still works: npm run benchmark:agent -- --evals is unchanged; the committed runs/baseline.json was produced from it via the gate's --write-baseline.
  • --adapter anthropic without a key exits 2 with a clear message.

Closes #104

🤖 Generated with Claude Code

https://claude.ai/code/session_01AQ3ZGqNtWviSYfUMsxU54E


Generated by Claude Code

Adds a real model adapter for the agent benchmark harness
(benchmarks/agent/adapters/anthropic.ts): an agentic loop over the Messages
API with Node's global fetch, a bounded tool set that never leaves the
workspace, per-arm command allow-lists, the API's own usage fields for token
accounting, and hard caps on turns, wall time and bytes written. It is
unit-tested against a fake fetch and a fake command runner; no test touches
the network. The stub adapter is unchanged and still the default.

Adds .github/workflows/evals.yml (weekly schedule and workflow_dispatch,
pinned actions) that skips with a summary line when ANTHROPIC_API_KEY is not
configured, otherwise runs the evals with the model from the
URLCODE_BENCHMARK_MODEL repository variable, uploads benchmarks/agent/runs/
as an artifact, writes the pass rate to the job summary and fails through
benchmarks/agent/gate.ts when the rate is below runs/baseline.json. The
committed baseline comes from the stub run and carries stub: true, which
the gate treats as "no baseline yet".

The benchmark README documents the variable, the secret, the cost estimate
and what a drop means; CONTRIBUTING gets one line.

Closes #104

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AQ3ZGqNtWviSYfUMsxU54E
@jimhoyd
jimhoyd merged commit 0d28ea6 into main Sep 18, 2026
12 checks passed
@jimhoyd
jimhoyd deleted the claude/issue-104-scheduled-evals branch September 18, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run the authoring evals on a schedule and gate on the pass rate

2 participants