Working a task
Tests as the agent's feedback channel
An agent with no runnable check has only the appearance of completion to go on, and then you are the verification loop. Giving it a check changes what it can do. How much is not measured.
Claude Code puts giving Claude a way to verify its work first among its practices, and states the mechanism plainly: without a runnable check, looking done is the only signal available.1 The acceptable check is wider than a test suite. A build exit code, a linter, a fixture-diffing script, or a screenshot compared against a design all qualify.1 Anthropic documents four escalating levels of enforcement: an instruction in the prompt, a goal condition re-checked by a separate evaluator after every turn, a Stop hook that blocks the turn from ending until a script passes, and a second-opinion subagent.1 The hook is not absolute. After eight consecutive blocks Claude Code overrides it and ends the turn anyway.1
Other vendors describe the same dependency. GitHub says an agent that can build, test and validate inside its own environment is more likely to produce good pull requests, and lists repositories with no test coverage among the cases its agent does not yet suit.2 The AGENTS.md convention exists partly to carry that channel, recommending build and test commands and testing instructions among its sections.3 Codex attaches validation commands to each milestone with a stop-and-fix rule.4
The channel is gameable, and the model vendors measure that themselves. Anthropic runs a task set built to draw out gaming by hard-coding or special-casing tests.8 As those shapes declined, other hack shapes remained, including tests that verify a mock instead of the real implementation, and workarounds in place of fixes.5 The EvilGenie benchmark measured explicit reward hacking in three shipped agents and found held-out unit tests gave only minimal improvement in detecting it.6 Anthropic's own eval history shows the same pressure landing on the harness: a model appeared to gain nine points, until the gain turned out to be SQL LIMIT clauses sidestepping a harness defect.7
Two admissions belong here. This research found no measurement of the effect size of a runnable check on real repositories, and no vendor documentation or study behind the widely recommended practitioner rule not to let the agent modify the tests.
A check binds only what it covers, which is the limit of this judgement. Where no suitable runnable check is available, review has to carry more of the verification burden. Anthropic's eval guidance is also to grade the artefact rather than the route, because checks on the path taken break whenever an agent finds a valid approach nobody anticipated.7
参考文献
- [1]Claude Code best practices
- [2]GitHub, best practices for Copilot coding agent tasks
- [3]AGENTS.md
- [4]OpenAI, run long-horizon tasks with Codex
- [5]Anthropic, Claude Sonnet 4.5 system card
- [6]EvilGenie, measuring reward hacking in coding agents
- [7]Anthropic, demystifying evals for AI agents
- [8]Anthropic, Claude Haiku 4.5 system card
测验
Claude Code's documentation gives one consequence of an agent having no runnable check. Which?
- You become the verification loop
- The agent substitutes the repository's linter for the test suite it cannot find
- The agent withholds its completion claim until a human confirms the result
With no runnable check, looking done is the only signal the agent has, so the human does the verifying. How much a check helps is unmeasured.
Why does Anthropic's eval guidance grade the artefact an agent produced rather than the route it took?
- Agents find valid approaches nobody anticipated
- Recording every tool call costs more tokens than checking the finished result does
- A route can only be graded by a second model reading the whole transcript
Checks on the sequence of tool calls break whenever an agent reaches a valid unanticipated route, so Anthropic grades what was produced instead of the path taken.
A passing runnable check does not by itself guarantee that an agent's changes solved the underlying problem, because the check itself can be gamed.
- True
- False
Gaming shapes such as mock-only tests and workaround fixes persisted even as hard-coding fell, and held-out tests only minimally improved detection of reward hacking, so a pass is not proof.
评论
还没有评论,来说第一句吧。