The selector reads the graph, and run-affected.sh runs the tests, from the working tree, so a --base/--head range is only right with the head checked out. The CI image is built from the merged tree, so an ENV CI_ONLY in its Dockerfile would make the gate partial; test_affected_tests.py now fails on it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>