Repository navigation
Run the authoring evals on a schedule and gate on the pass rate - #108
Merged
Merged
Conversation
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
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01AQ3ZGqNtWviSYfUMsxU54E
This was referenced Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
benchmarks/agent/adapters/anthropic.ts: a real model adapter for the harness. An agentic loop over the Messages API using Node's globalfetch(no new dependency), readingANTHROPIC_API_KEYand the model fromURLCODE_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), andrun_commandhas a per-arm allow-list (urlcode validate|test|context|routes|explain|audit|permissionsfor the URLCode arm;node <file>/npm install|ci|test|runfor the conventional arm) with a timeout and no model-supplied project paths. Token counts come from the API'susagefields; 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.selectAdapteracceptsanthropic;stubis unchanged and remains the default..github/workflows/evals.yml: weeklyscheduleplusworkflow_dispatch, pinned actions,npm ci. Whensecrets.ANTHROPIC_API_KEYis empty it writes "no credential; evals skipped" to the step summary and exits 0. Otherwise it runsnpm run benchmark:agent -- --evals --adapter anthropicwithvars.URLCODE_BENCHMARK_MODEL, uploadsbenchmarks/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 belowruns/baseline.json, when any generation failed, or when no records were produced.--write-baselinestores a new baseline. A baseline withstub: true(the committed one, from the stub run) is treated as "no baseline yet"; comparisons are only made within the sameharnessVersion.Validation
npm run lint,npm run typecheck,npm run check: clean.npm test: 505 tests, 0 failures. New tests drive the adapter with a fakefetchreplaying 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.npm run benchmark:agent -- --evalsis unchanged; the committedruns/baseline.jsonwas produced from it via the gate's--write-baseline.--adapter anthropicwithout a key exits 2 with a clear message.Closes #104
🤖 Generated with Claude Code
https://claude.ai/code/session_01AQ3ZGqNtWviSYfUMsxU54E
Generated by Claude Code