Review an agent's diff in five checks
Trace an agent patch from changed files to a failing regression test and verify the revision you intend to merge.
You asked an agent to cap page sizes at 100. It reports green tests and hands you a diff that includes a lockfile change. Before merging, trace the patch from the files it touches to the test that proves the cap.
Read the whole patch
List the paths. In an agent checkout with uncommitted changes, run these commands from the repository root.
git status --short git diff --stat HEAD git diff HEADIn a page-size patch, this might show an edit to the limit, an edit to its test, and a new fixture marked
??.The diff against HEAD shows the net tracked changes since the last commit. A staged edit and a working-tree edit that reverses it can cancel out in that diff. If status shows both, inspect
git diff --cachedandgit diffto see each patch.Open the untracked fixture from the status output too. If the agent committed the work, compare the branch against its merge base with the target branch, then inspect any remaining working-tree changes.
Tie each change to the request. For the cap, look for the code that parses the request and the code that uses the parsed number. If the patch changes dependencies or renames an unrelated module, ask which piece of the cap needs that change. Review the lockfile alongside the dependency manifest so you can see whether a declared dependency changed.
Make the test earn its green result
Read the assertion before running it. A test for this cap should send a value above 100 through the real parsing function and assert that the result is 100. Check that the cap runs against the original input. A mock that returns 100 or an assertion that checks only the type can pass with the old behavior.
Run the named test yourself. Get the exact command and the test name from the agent. Read the runner's output for the number of tests that ran and the number skipped. A test that was renamed, excluded by a filter, or marked skipped can leave the rest of the file green.
Watch it fail at the boundary. In a disposable copy, leave the new test in place and restore the old limit behavior. Run the same command. Look for the case that passes in 150 and expects 100 to fail with 150. If it stays green, follow the import from that test until you find which implementation it exercises.
Restore the patch in the disposable copy and rerun the case. Review the full suite result against that same revision before merging.