Commit 4c1d0f61c80 for woocommerce

commit 4c1d0f61c8063dc7ebe5b24339f5b184620e2bc7
Author: Jamel Noel Reid <MrJnrman@users.noreply.github.com>
Date:   Mon Oct 12 17:39:07 2026 +0200

    Make the AI reviewer check every caller when a return value widens (#69717)

    [DEVPROD-1254] Check every caller when a return widens

diff --git a/.ai/review/guidelines/missing-object-deref.md b/.ai/review/guidelines/missing-object-deref.md
index e3999782dda..0e5f626b1e7 100644
--- a/.ai/review/guidelines/missing-object-deref.md
+++ b/.ai/review/guidelines/missing-object-deref.md
@@ -10,12 +10,16 @@
 - #69231: null where a post was expected.
 - #58487 (9.9.2): a `WC_Email` child without `template_html` fatalled.
 - #64410, #53762 (9.5.1).
-- Earlier review findings: `get_country_locale()['default']` read unguarded.
+- #68573: `get_country_locale()` could now return an empty array. The PR guarded `OrderController` but
+  not `WC_Customer::has_full_shipping_address()`, which still read `['default']`. Fixed in #69108.

 **What broke:** Code dereferenced a lookup that returned false or null, or an object missing expected properties. Most often a deleted product, parent, or attribute still referenced by an order or a filter.

 **Pattern to catch:** `wc_get_product()` / `wc_get_order()` / `get_post()` / `get_term()` / `->get_product()` results, or objects from a filter, dereferenced without a falsy or `instanceof` check. Also iterating `WC_Email` subclasses (or any registry of extension classes) and reading properties they may not set, and unguarded array keys.

+Also the producer side: a function that can now return empty, `null` or `false`. Every caller that
+reads into the result needs the same guard, including callers in files the diff does not touch.
+
 **How to confirm:** Find the lookup and check for `if ( ! $x )` or `instanceof`. Ask whether the ID can point at a trashed or deleted entity. Orders keep their line items after the product is deleted.

 **Don't flag when:** The object comes from a constructor in the same scope, or the path is behind an earlier guard you can quote.
diff --git a/.ai/review/personas/regression.md b/.ai/review/personas/regression.md
index 68f61b3d15b..d1e433fe0f6 100644
--- a/.ai/review/personas/regression.md
+++ b/.ai/review/personas/regression.md
@@ -70,6 +70,12 @@ out", "guarded elsewhere" (unread), and "couldn't verify" are not proof. A mitig
 you Read the line that enforces it for the exact input in question. If the concern is real and you
 can't settle it, report it at `medium` severity with `low` or `medium` confidence.

+**7. When a return value widens, check every caller.** If a hunk lets a function return something it
+didn't before (an empty array, `null`, `false`, a missing key), or guards one caller against such a
+value, Grep every other caller of that function and Read how each uses the result. A caller that
+still assumes the old shape is a finding, even when its file is not in the diff. Name the caller's
+file and line, and point at the guard the PR added elsewhere as the fix.
+
 ## Woo invariants

 **Sessions and users.** A session and a `WP_User` are not 1:1. User switching, B2B portals, and
diff --git a/ai-review-config.json b/ai-review-config.json
index 6b6d33ed75b..e1772bdb91d 100644
--- a/ai-review-config.json
+++ b/ai-review-config.json
@@ -389,7 +389,12 @@
 				"template_html",
 				"woocommerce_email_classes",
 				"get_variation_attributes",
-				"get_attribute_taxonomies"
+				"get_attribute_taxonomies",
+				"get_country_locale",
+				"get_address_fields",
+				"return array();",
+				"return [];",
+				"?? null"
 			],
 			"personas": [
 				"regression"