Declare the PR's scope, and let CI enforce it
A section in the PR description lists the files or directories the change is meant to touch. A check fails if the diff strays outside it. The author either widens the scope, visibly, or tells the agent to drop the extra changes.
- run: git diff --name-only origin/main...HEAD | grep -v -F -f scope.txt && exit 1 || trueThe halo of "reasonable" adjacent edits mostly stops appearing, because the tool reads the failure and learns what the repository wants.
code-reviewci
Longer version: the post this came from.