---
title: "Discussion on \"Code Review Starts with What Must Stay True\" | Hashnode"
description: "Discussion on \"Code Review Starts with What Must Stay True\". AI writes code faster than we can review it. Explore how Laws, code observation, and mathematics help you check changes against what must remain true."
url: "https://hashnode.com/posts/code-review-starts-with-what-must-stay-true/6ade12731c09b9fd0c9f51b4"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Code Review Starts with What Must Stay True](https://blog.iroha1203.dev/code-review-starts-with-what-must-stay-true?utm_source=hashnode&utm_medium=feed)

AI writes code faster than we can review it. Explore how Laws, code observation, and mathematics help you check changes against what must remain true.

Oct 25 · 20 min read · blog.iroha1203.dev  
Read the article

-   [#ai](https://hashnode.com/tag/ai)
-   [#software-development](https://hashnode.com/tag/software-development)
-   [#math](https://hashnode.com/tag/math)
-   [#code-review](https://hashnode.com/tag/code-review)

## Written by

[Hiroyuki Nakahata](https://hashnode.com/@iroha1203)

@iroha1203 · Tokyo, Japan

  
[View profile](https://hashnode.com/@iroha1203)

Algebraic Architecture Theory

I’m a software engineer in Japan. Outside of work, I enjoy horse racing. ORCID:0009-0008-5928-0234

## Responses 7

Markdown supported · ⌘↵ to post

[Seedance AI](https://hashnode.com/@seedance-ai)

[Nov 9](https://hashnode.com/posts/code-review-starts-with-what-must-stay-true/6ade12731c09b9fd0c9f51b4/comment/6af165b568fd16fccf9c0371)

Focusing code reviews on system invariants rather than micro-formatting makes so much sense, especially as AI generates more scaffolded logic. When diffs become larger, checking whether core assumptions and boundary contracts hold is far more valuable than simply verifying style.

[Crownforge](https://hashnode.com/@thecrownforge)

[Oct 27](https://hashnode.com/posts/code-review-starts-with-what-must-stay-true/6ade12731c09b9fd0c9f51b4/comment/6ae077ca375e3174907aa712)

Can an ArchMap mark an observation as unknown when the skill cannot work out the order safely? I would want that to stop a Law from passing, rather than let a plausible guess become a checked fact

[Hiroyuki Nakahata](https://hashnode.com/@iroha1203)

[Oct 27](https://hashnode.com/posts/code-review-starts-with-what-must-stay-true/6ade12731c09b9fd0c9f51b4/comment/6ae077ca375e3174907aa712#reply-6ae091465ccc88ba74262c32)

Thanks for the comment! This has been a core concern since the beginning of ArchSig’s development: we explicitly distinguish an observed zero from something that has not been observed. If an agent cannot determine a value, it should mark it as unobserved, and the tool’s output preserves that distinction too.

[Kartik N V J K](https://hashnode.com/@kartik-nvj)

[Oct 26](https://hashnode.com/posts/code-review-starts-with-what-must-stay-true/6ade12731c09b9fd0c9f51b4/comment/6adf3fbef218f0c2c97015d7)

django-oscar #4594 reading like a pure lock-ordering fix is exactly why it tests the method well. I keep coming back to the ArchMap step, though. If the model records basket order for the sorted loop, L2 passes for the wrong reason. Who checks the ArchMap against the code before the Laws run, the reviewer or another model?

[Hiroyuki Nakahata](https://hashnode.com/@iroha1203)

[Oct 26](https://hashnode.com/posts/code-review-starts-with-what-must-stay-true/6ade12731c09b9fd0c9f51b4/comment/6adf3fbef218f0c2c97015d7#reply-6adf51c82498241548ffab31)

Thanks for the comment! That’s exactly the issue. I’m currently developing a SKILL to help agents produce more accurate ArchMaps from code. The idea is to improve accuracy by having multiple agents observe the code using that SKILL.

Problems that those observations cannot capture, such as runtime race conditions, are outside the scope of what AAT can establish from the resulting ArchMap.

[Indie Ship Log](https://hashnode.com/@indieshiplog)

[Oct 26](https://hashnode.com/posts/code-review-starts-with-what-must-stay-true/6ade12731c09b9fd0c9f51b4/comment/6adf01c5da89bc08440b9beb)

The stock allocation example is the one that stuck with me. A fix that keeps the count right but shuffles display order looks clean in a diff and still breaks a quiet invariant. Writing those two laws down before the review would have caught it faster than another pass over names. I am going to try one or two must-stay-true lines at the top of my own PRs, even when I am the only reviewer.

[Hiroyuki Nakahata](https://hashnode.com/@iroha1203)

[Oct 26](https://hashnode.com/posts/code-review-starts-with-what-must-stay-true/6ade12731c09b9fd0c9f51b4/comment/6adf01c5da89bc08440b9beb#reply-6adf522e2498241548ffadba)

Thanks for the comment! I agree. With AI writing code so quickly, I think it’s especially important to spell out the properties we want to preserve and check that they still hold.
