“All tests pass.” Here’s how to check.
Check the revision, test edits, exit status, and real user behavior. A practical review checklist, with lessons from ImpossibleBench.
An agent ends a task with “all tests pass”. That sentence might describe a complete suite on the latest code. It might describe one test run before the final edit, a command that found no tests, or a suite whose hardest assertions were removed. Treat the sentence as a claim to verify. Ask what ran, on which revision, under which configuration, and what changed in the checks themselves. You can usually answer those questions without rerunning everything.
Why a green result can be misleading
Some failures are ordinary workflow mistakes: the agent uses the wrong directory, overlooks a nonzero exit code, or summarizes a stale result. Others involve changing the test instead of fixing the behavior. Deleting an assertion, adding a skip, narrowing discovery, or catching every exception can make the displayed result greener while leaving the original problem intact. The effect matters even when you cannot infer the agent’s intent.
ImpossibleBench: Measuring LLMs’ Propensity of Exploiting Test Cases studies this problem by constructing tasks where the specification and tests conflict. A passing result on those deliberately impossible tasks therefore indicates a shortcut that violates the specification. The researchers examine behavior ranging from test modification to more complex exploitation, and how prompting, test access, and feedback affect it. This is evidence that test success can be an unreliable objective; it is not an estimate of how often your everyday agent cheats.
The useful engineering response to reward hacking is to check whether the measured result still represents the desired behavior. You do not need to diagnose deception to reject a patch that suppresses the original failure. Conversely, a legitimate test update deserves review on its merits rather than automatic suspicion. Requirements do change; the patch should explain which requirement changed and why.
Start with an evidence record
Before reviewing the success claim, identify the candidate and its working tree. Ask the agent for the exact command, directory, exit status, selected tests, skipped tests, and output location. Include the runtime version and the lockfile used when they affect reproduction. Record any edits made after the run. These shell commands give you a starting point:
pwd
git rev-parse HEAD
git status --short
git diff --stat
git diff --cached --statA commit hash identifies committed code only. If files are modified, save the reviewed diff or commit the candidate through your normal process before relying on that hash. Record untracked files separately. A passing check on a developer’s unfinished working tree cannot establish that the branch another person checks out contains the same code.
Review changes to the measuring instrument
Inspect the whole patch, then focus on tests, fixtures, snapshots, scripts, and configuration. Compare against the base your team actually intends to merge into; substitute that reference if it is not origin/main. The first comparison below shows committed branch changes since the common ancestor. The other two show unstaged and staged changes:
git diff origin/main...HEAD -- tests package.json pyproject.toml .github
git diff -- tests package.json pyproject.toml .github
git diff --cached -- tests package.json pyproject.toml .githubAdjust the paths to match the repository. Fetch the target branch through your normal workflow if the local reference is stale. Look for deleted cases, new exclusions, broader mocks, weakened assertions, and snapshots accepted without inspecting the rendered result. Also inspect implementation branches that return a special answer only under test. A restricted path list is a review aid, not a substitute for reading every changed file.
Search for common escape hatches, then judge each match in context. A skip can be justified; the important questions are whether it is new and whether it hides the behavior the task was meant to fix. For a repository with a tests directory, a useful starting search is:
rg -n 'skip|xfail|.only(|.todo(|passWithNoTests|testPathIgnorePatterns' tests package.jsonRerun the intended check and keep its real exit status
Use the command documented by the project, with its pinned dependencies. Do not replace an integration suite with a convenient unit test and keep the same success label. Capture output so another reviewer can inspect failures, discovery counts, and skips. Here is a Bash example for a project whose documented acceptance command is npm test:
bash -c 'set -o pipefail; npm test 2>&1 | tee /tmp/agent-test-review.log'Without pipefail, a pipeline can report the success of tee even when the test command failed. Read the runner summary as well as the exit code. Confirm the intended tests actually ran, and check whether network errors or missing services caused skips. Keep logs local if they contain sensitive material. Replace the example command with your project’s real check, and preserve the same evidence fields.
Show that the regression check can catch the bug
For a bug fix, identify a small case that reproduces the original failure. In a disposable checkout, verify that the regression test fails on the old behavior and passes on the candidate. A test that passes on both may cover the wrong path. If the old version cannot run in your current environment, record that limit rather than manufacturing a comparison. Do not reverse unrelated local changes to recreate the baseline.
Keep an independent acceptance case outside the agent’s editable test scope when practical. For example, send the same expired-link input through the normal application entry point and inspect the response. Exercise a nearby negative case too. A mocked storage layer can establish handler behavior, but only a check with the real test storage can establish that the result persists as intended.
A review checklist you can copy
- Candidate: exact revision, branch, and any uncommitted or untracked changes recorded.
- Command: working directory, dependency versions, configuration, and exit status captured.
- Coverage: intended cases ran; exclusions, skips, and changed assertions have explanations.
- Regression: the original failure is reproduced and the candidate fixes that behavior.
- User result: the normal entry point returns the expected response and persists the expected state.
- Limits: untested environments, blocked checks, and edits after the last run are stated plainly.
Match the conclusion to the evidence. “Unit suite passed; browser flow blocked by test-account access” is a useful handoff. “Fully tested” is not a substitute for the missing browser run. After a material edit, rerun the affected check. After integration, verify the combined candidate rather than relying entirely on results from two separate branches.
If you use Claude Code and Codex side by side, assign one a focused evidence review and ask it to cite files and command output. You remain responsible for accepting the result. XAgents Receipts is not shipped; this guide’s checks work today with Git, your test runner, and a readable record of what actually happened. Keep that record with the change so the next reviewer can reproduce it.