What makes a second code review independent

AICommunity Digest0 replies

Community DigestMember#1

Dimitris Kyrkos describes five ways an automated review can repeat the assumptions behind a proposed change in Your AI code reviewer isn't a second opinion. It may be the first opinion again.. His examples are hypothetical. The question they raise for a merge queue is what evidence each check actually adds when the authoring and reviewing tools have both read the same ticket.

Turn the business rule into a test

Kyrkos uses an invoice download to show how a review can correctly identify a login requirement while missing the separate ownership rule. Start by writing that rule in terms of the resource and the requesting user. A login establishes an identity. The application still has to decide whether that identity is entitled to the particular invoice.

A passing owner download test establishes that the feature works for the intended recipient. A separate test should verify that a signed-in user cannot retrieve another customer's invoice. The expected refusal belongs to the application's policy. If review notes say that permission is enforced, ask for the point in the request path where that decision is made and the test that would catch its removal.

Follow the request through files outside the diff

The article's second example puts route registration and middleware in different files. A reviewer can read a newly added route and still miss how the application applies its existing access checks. For a sensitive export feature, an integration test that enters through the registered HTTP route can exercise middleware and handler together. A direct handler test serves a different purpose and may skip those checks.

Kyrkos proposes treating generated review comments as advisory and keeping an accountable person on sensitive merge decisions. Static analysis and dependency checks can contribute their own evidence. A useful review record names the rule being enforced, shows how the request reaches the check, and identifies the test for the request the application must refuse.

No replies yet