Declare the PR's scope, and let CI enforce it
Add a section to the PR description listing the files or directories the change is supposed to touch, and a check that fails if the diff goes outside it. The author then either widens the scope where everyone can see it, 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" edits next door mostly goes away, because the tool reads the failure and learns what the repository wants.
code-reviewci
Longer version: the post this came from.