{"id":6052,"date":"2026-10-29T17:59:50","date_gmt":"2026-10-29T17:59:50","guid":{"rendered":"https:\/\/www.aviator.co\/blog\/?p=6052"},"modified":"2026-10-29T18:01:33","modified_gmt":"2026-10-29T18:01:33","slug":"ai-code-review-invariants","status":"publish","type":"post","link":"https:\/\/www.aviator.co\/blog\/ai-code-review-invariants\/","title":{"rendered":"Write Your Engineering Standards Once. Check Every AI-Generated PR Against Them."},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Your team&#8217;s engineering standards can be checked automatically on every PR, including every PR a coding agent opens. You write each rule once. From then on, a separate agent checks every change against it and reports pass or fail, before a human ever opens the diff.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That means code that ignores how your team builds things doesn&#8217;t reach production just because it compiled, passed tests, and looked fine. And your senior engineers stop spending review time catching the same agent mistakes over and over.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In <a href=\"https:\/\/www.aviator.co\/verify\">Aviator Verify<\/a>, these rules are called <a href=\"https:\/\/docs.aviator.co\/verify\/concepts\/invariants\">Invariants<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What an Invariant is, and why you need one<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">An invariant is a rule every change must respect. Invariants address the most common category of AI slop: convention blindness, deprecated APIs, module boundaries the model doesn\u2019t know about, and security baselines that should apply everywhere. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">None of these are in the\u00a0model\u2019s training data\u00a0for your specific codebase. They live in the heads of your senior engineers and show up as recurring review comments. Invariants say what <em>every <\/em>PR should respect, for example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Writes to the users table go through UserRepository.<\/li>\n\n\n\n<li>HTTP handlers call auth middleware before any business logic.<\/li>\n\n\n\n<li>Migrations declare a down block.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">These are the rules your linter can&#8217;t express, because they&#8217;re about what the code does, not how it&#8217;s written. Today they live in senior engineers&#8217; heads and in Skills or files like CLAUDE.md. They tell an agent your rules, but nothing checks whether the agent followed them. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With Invariants, the rule is written once, stored in your Aviator account for the whole team, and checked on every matching change.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Where Invariants Come From<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Most good invariants start as a review comment someone has typed more than twice. You don&#8217;t have to write them from scratch. Verify drafts them from what your team already knows:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"650\" src=\"https:\/\/www.aviator.co\/blog\/wp-content\/uploads\/2026\/10\/invariant-sources-1024x650.png\" alt=\"\" class=\"wp-image-6054\" srcset=\"https:\/\/www.aviator.co\/blog\/wp-content\/uploads\/2026\/10\/invariant-sources-1024x650.png 1024w, https:\/\/www.aviator.co\/blog\/wp-content\/uploads\/2026\/10\/invariant-sources-300x191.png 300w, https:\/\/www.aviator.co\/blog\/wp-content\/uploads\/2026\/10\/invariant-sources-767x487.png 767w, https:\/\/www.aviator.co\/blog\/wp-content\/uploads\/2026\/10\/invariant-sources-1536x975.png 1536w, https:\/\/www.aviator.co\/blog\/wp-content\/uploads\/2026\/10\/invariant-sources-2048x1300.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">AI-drafted rules start as drafts. They don&#8217;t affect any PR until someone on your team approves them.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em><strong>See what your team&#8217;s invariants would look like.<\/strong> With a <a href=\"https:\/\/app.aviator.co\/auth\/register\">free Aviator account,<\/a> Verify generates them from your PR history and docs. You keep them even if you don&#8217;t continue with Verify.<\/em><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How it works<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Verify picks the rules that fit.<\/strong> When a PR comes in, a selector reads the change and its intent and picks the invariants that apply. Nobody tags rules by hand, and a CSS change doesn&#8217;t get checked against database rules. You can also scope a rule to certain paths or languages with <a href=\"https:\/\/docs.aviator.co\/verify\/reference\/invariant-conditions\">conditions<\/a>.<br><\/li>\n\n\n\n<li><strong>A separate agent checks them.<\/strong> Each selected invariant gets a pass or fail, with evidence pointing at the code that broke it. The verdict says what&#8217;s wrong; the author decides how to fix it. See <a href=\"https:\/\/docs.aviator.co\/verify\/concepts\/how-verification-works\">how verification works<\/a>.<br><\/li>\n\n\n\n<li><strong>Exceptions are allowed, Invariants evolve.<\/strong> Any invariant can be waived with a reason: false positive, doesn&#8217;t apply, accepted risk, or fix in a follow-up. Every waiver is logged. If one rule keeps getting waived, that&#8217;s your signal to reword it.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The full reference is in the <a href=\"https:\/\/docs.aviator.co\/verify\/concepts\/invariants\">invariants docs<\/a>, and <a href=\"https:\/\/docs.aviator.co\/verify\/setting-up-org-invariants\">setting up org invariants<\/a>. <\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em><strong>See what your team&#8217;s invariants would look like.<\/strong> With a <a href=\"https:\/\/app.aviator.co\/auth\/register\">free Aviator account,<\/a> Verify generates them from your PR history and docs. You keep them even if you don&#8217;t continue with Verify.<\/em><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Invariants are your team\u2019s engineering standards written as rules and checked automatically on every PR a coding agent opens.<\/p>\n","protected":false},"author":15,"featured_media":6053,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6052","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Write Your Engineering Standards Once. Check Every AI-Generated PR Against Them. - Aviator Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.aviator.co\/blog\/ai-code-review-invariants\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Write Your Engineering Standards Once. Check Every AI-Generated PR Against Them. - Aviator Blog\" \/>\n<meta property=\"og:description\" content=\"Invariants are your team\u2019s engineering standards written as rules and checked automatically on every PR a coding agent opens.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.aviator.co\/blog\/ai-code-review-invariants\/\" \/>\n<meta property=\"og:site_name\" content=\"Aviator Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-29T17:59:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-29T18:01:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.aviator.co\/blog\/wp-content\/uploads\/2026\/10\/invariants-blog-hero-enforced.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1256\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ankit Jain\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ankit Jain\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Write Your Engineering Standards Once. Check Every AI-Generated PR Against Them. - Aviator Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.aviator.co\/blog\/ai-code-review-invariants\/","og_locale":"en_US","og_type":"article","og_title":"Write Your Engineering Standards Once. Check Every AI-Generated PR Against Them. - Aviator Blog","og_description":"Invariants are your team\u2019s engineering standards written as rules and checked automatically on every PR a coding agent opens.","og_url":"https:\/\/www.aviator.co\/blog\/ai-code-review-invariants\/","og_site_name":"Aviator Blog","article_published_time":"2026-10-29T17:59:50+00:00","article_modified_time":"2026-10-29T18:01:33+00:00","og_image":[{"width":2400,"height":1256,"url":"https:\/\/www.aviator.co\/blog\/wp-content\/uploads\/2026\/10\/invariants-blog-hero-enforced.png","type":"image\/png"}],"author":"Ankit Jain","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ankit Jain","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.aviator.co\/blog\/ai-code-review-invariants\/#article","isPartOf":{"@id":"https:\/\/www.aviator.co\/blog\/ai-code-review-invariants\/"},"author":{"name":"Ankit Jain","@id":"https:\/\/www.aviator.co\/blog\/#\/schema\/person\/9d68a2b53b2dc04779f99ee40b3914a4"},"headline":"Write Your Engineering Standards Once. Check Every AI-Generated PR Against Them.","datePublished":"2026-10-29T17:59:50+00:00","dateModified":"2026-10-29T18:01:33+00:00","mainEntityOfPage":{"@id":"https:\/\/www.aviator.co\/blog\/ai-code-review-invariants\/"},"wordCount":558,"image":{"@id":"https:\/\/www.aviator.co\/blog\/ai-code-review-invariants\/#primaryimage"},"thumbnailUrl":"https:\/\/www.aviator.co\/blog\/wp-content\/uploads\/2026\/10\/invariants-blog-hero-enforced.png","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.aviator.co\/blog\/ai-code-review-invariants\/","url":"https:\/\/www.aviator.co\/blog\/ai-code-review-invariants\/","name":"Write Your Engineering Standards Once. Check Every AI-Generated PR Against Them. - Aviator Blog","isPartOf":{"@id":"https:\/\/www.aviator.co\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.aviator.co\/blog\/ai-code-review-invariants\/#primaryimage"},"image":{"@id":"https:\/\/www.aviator.co\/blog\/ai-code-review-invariants\/#primaryimage"},"thumbnailUrl":"https:\/\/www.aviator.co\/blog\/wp-content\/uploads\/2026\/10\/invariants-blog-hero-enforced.png","datePublished":"2026-10-29T17:59:50+00:00","dateModified":"2026-10-29T18:01:33+00:00","author":{"@id":"https:\/\/www.aviator.co\/blog\/#\/schema\/person\/9d68a2b53b2dc04779f99ee40b3914a4"},"breadcrumb":{"@id":"https:\/\/www.aviator.co\/blog\/ai-code-review-invariants\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.aviator.co\/blog\/ai-code-review-invariants\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.aviator.co\/blog\/ai-code-review-invariants\/#primaryimage","url":"https:\/\/www.aviator.co\/blog\/wp-content\/uploads\/2026\/10\/invariants-blog-hero-enforced.png","contentUrl":"https:\/\/www.aviator.co\/blog\/wp-content\/uploads\/2026\/10\/invariants-blog-hero-enforced.png","width":2400,"height":1256,"caption":"engineering-standards-ai-code"},{"@type":"BreadcrumbList","@id":"https:\/\/www.aviator.co\/blog\/ai-code-review-invariants\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.aviator.co\/blog\/"},{"@type":"ListItem","position":2,"name":"Write Your Engineering Standards Once. Check Every AI-Generated PR Against Them."}]},{"@type":"WebSite","@id":"https:\/\/www.aviator.co\/blog\/#website","url":"https:\/\/www.aviator.co\/blog\/","name":"Aviator Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.aviator.co\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.aviator.co\/blog\/#\/schema\/person\/9d68a2b53b2dc04779f99ee40b3914a4","name":"Ankit Jain","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5f573452342d650c8b94207298e386ed0c10d45a16df11bb45d80052d181765b?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5f573452342d650c8b94207298e386ed0c10d45a16df11bb45d80052d181765b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5f573452342d650c8b94207298e386ed0c10d45a16df11bb45d80052d181765b?s=96&d=mm&r=g","caption":"Ankit Jain"},"description":"Ankit Jain is a cofounder and CEO of Aviator, a developer productivity platform used by modern engineering teams to ship AI-generated code at scale. He also leads The Hangar, a community of senior DevOps and senior software engineers focused on developer experience, and Xoogler, the ex-Google alumni network.","url":"https:\/\/www.aviator.co\/blog\/author\/ankitjain\/"}]}},"_links":{"self":[{"href":"https:\/\/www.aviator.co\/blog\/wp-json\/wp\/v2\/posts\/6052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aviator.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aviator.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aviator.co\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aviator.co\/blog\/wp-json\/wp\/v2\/comments?post=6052"}],"version-history":[{"count":2,"href":"https:\/\/www.aviator.co\/blog\/wp-json\/wp\/v2\/posts\/6052\/revisions"}],"predecessor-version":[{"id":6056,"href":"https:\/\/www.aviator.co\/blog\/wp-json\/wp\/v2\/posts\/6052\/revisions\/6056"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.aviator.co\/blog\/wp-json\/wp\/v2\/media\/6053"}],"wp:attachment":[{"href":"https:\/\/www.aviator.co\/blog\/wp-json\/wp\/v2\/media?parent=6052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aviator.co\/blog\/wp-json\/wp\/v2\/categories?post=6052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aviator.co\/blog\/wp-json\/wp\/v2\/tags?post=6052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}