[object Object]

← back to Dw Contact Us Pages

TK-11925: verify.mjs honesty fixes (Cody red-team) — min_order attr-syntax; json_rolls NOT-MEASURED when public .json omits available

f836f4d2df34134535580411d3a32717052f8ba4 · 2026-09-20 12:40:15 -0700 · steve

Live store verified clean (Cody SHIP IT, 8 PDPs / 4 vendors, 0 buy-box/price/Offer leaks). verify fail=0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q8HhtR5c44zRJA3DfKYTZQ

Files touched

Diff

commit f836f4d2df34134535580411d3a32717052f8ba4
Author: steve <steve@designerwallcoverings.com>
Date:   Sun Sep 20 12:40:15 2026 -0700

    TK-11925: verify.mjs honesty fixes (Cody red-team) — min_order attr-syntax; json_rolls NOT-MEASURED when public .json omits available
    
    Live store verified clean (Cody SHIP IT, 8 PDPs / 4 vendors, 0 buy-box/price/Offer leaks). verify fail=0.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01Q8HhtR5c44zRJA3DfKYTZQ
---
 data/verify-latest.json | 144 ++++++++++++++++++++++++------------------------
 scripts/verify.mjs      |  18 ++++--
 2 files changed, 86 insertions(+), 76 deletions(-)

diff --git a/data/verify-latest.json b/data/verify-latest.json
index 34d34cf..e607368 100644
--- a/data/verify-latest.json
+++ b/data/verify-latest.json
@@ -1,8 +1,8 @@
 {
-  "ts": "2026-09-20T19:25:48.165Z",
+  "ts": "2026-09-20T19:39:43.705Z",
   "verdict": "WARN",
   "fail": 0,
-  "not_measured": 20,
+  "not_measured": 30,
   "population": 1218,
   "observed": 20,
   "storefront": "https://www.designerwallcoverings.com",
@@ -56,12 +56,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
           "verdict": "NOT-MEASURED",
-          "detail": "0/0 non-sample variants available:false"
+          "detail": "sample-only product: 0 of 0"
         }
       }
     },
@@ -114,12 +114,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
           "verdict": "NOT-MEASURED",
-          "detail": "0/0 non-sample variants available:false"
+          "detail": "sample-only product: 0 of 0"
         }
       }
     },
@@ -172,12 +172,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
           "verdict": "NOT-MEASURED",
-          "detail": "0/0 non-sample variants available:false"
+          "detail": "sample-only product: 0 of 0"
         }
       }
     },
@@ -230,12 +230,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
           "verdict": "NOT-MEASURED",
-          "detail": "0/0 non-sample variants available:false"
+          "detail": "sample-only product: 0 of 0"
         }
       }
     },
@@ -288,12 +288,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
           "verdict": "NOT-MEASURED",
-          "detail": "0/0 non-sample variants available:false"
+          "detail": "sample-only product: 0 of 0"
         }
       }
     },
@@ -346,12 +346,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
-          "verdict": "PASS",
-          "detail": "1/1 non-sample variants available:false"
+          "verdict": "NOT-MEASURED",
+          "detail": "public .json omits available for 1 variant(s); authoritative check = variants_hardened (admin)"
         }
       }
     },
@@ -404,12 +404,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
-          "verdict": "PASS",
-          "detail": "1/1 non-sample variants available:false"
+          "verdict": "NOT-MEASURED",
+          "detail": "public .json omits available for 1 variant(s); authoritative check = variants_hardened (admin)"
         }
       }
     },
@@ -462,12 +462,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
-          "verdict": "PASS",
-          "detail": "1/1 non-sample variants available:false"
+          "verdict": "NOT-MEASURED",
+          "detail": "public .json omits available for 1 variant(s); authoritative check = variants_hardened (admin)"
         }
       }
     },
@@ -520,12 +520,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
-          "verdict": "PASS",
-          "detail": "1/1 non-sample variants available:false"
+          "verdict": "NOT-MEASURED",
+          "detail": "public .json omits available for 1 variant(s); authoritative check = variants_hardened (admin)"
         }
       }
     },
@@ -578,12 +578,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
-          "verdict": "PASS",
-          "detail": "1/1 non-sample variants available:false"
+          "verdict": "NOT-MEASURED",
+          "detail": "public .json omits available for 1 variant(s); authoritative check = variants_hardened (admin)"
         }
       }
     },
@@ -636,12 +636,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
-          "verdict": "PASS",
-          "detail": "1/1 non-sample variants available:false"
+          "verdict": "NOT-MEASURED",
+          "detail": "public .json omits available for 1 variant(s); authoritative check = variants_hardened (admin)"
         }
       }
     },
@@ -694,12 +694,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
-          "verdict": "PASS",
-          "detail": "1/1 non-sample variants available:false"
+          "verdict": "NOT-MEASURED",
+          "detail": "public .json omits available for 1 variant(s); authoritative check = variants_hardened (admin)"
         }
       }
     },
@@ -752,12 +752,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
-          "verdict": "PASS",
-          "detail": "1/1 non-sample variants available:false"
+          "verdict": "NOT-MEASURED",
+          "detail": "public .json omits available for 1 variant(s); authoritative check = variants_hardened (admin)"
         }
       }
     },
@@ -810,12 +810,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
-          "verdict": "PASS",
-          "detail": "1/1 non-sample variants available:false"
+          "verdict": "NOT-MEASURED",
+          "detail": "public .json omits available for 1 variant(s); authoritative check = variants_hardened (admin)"
         }
       }
     },
@@ -868,12 +868,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
-          "verdict": "PASS",
-          "detail": "1/1 non-sample variants available:false"
+          "verdict": "NOT-MEASURED",
+          "detail": "public .json omits available for 1 variant(s); authoritative check = variants_hardened (admin)"
         }
       }
     },
@@ -926,12 +926,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
           "verdict": "NOT-MEASURED",
-          "detail": "0/0 non-sample variants available:false"
+          "detail": "sample-only product: 0 of 0"
         }
       }
     },
@@ -984,12 +984,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
           "verdict": "NOT-MEASURED",
-          "detail": "0/0 non-sample variants available:false"
+          "detail": "sample-only product: 0 of 0"
         }
       }
     },
@@ -1042,12 +1042,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
           "verdict": "NOT-MEASURED",
-          "detail": "0/0 non-sample variants available:false"
+          "detail": "sample-only product: 0 of 0"
         }
       }
     },
@@ -1100,12 +1100,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
           "verdict": "NOT-MEASURED",
-          "detail": "0/0 non-sample variants available:false"
+          "detail": "sample-only product: 0 of 0"
         }
       }
     },
@@ -1158,12 +1158,12 @@
           "detail": "no Offer in JSON-LD"
         },
         "min_order_notice_hidden": {
-          "verdict": "WARN",
-          "detail": "min-order markup present (hidden by CSS only)"
+          "verdict": "PASS",
+          "detail": "no min-order markup"
         },
         "json_rolls_unavailable": {
           "verdict": "NOT-MEASURED",
-          "detail": "0/0 non-sample variants available:false"
+          "detail": "sample-only product: 0 of 0"
         }
       }
     }
diff --git a/scripts/verify.mjs b/scripts/verify.mjs
index 2de6f5f..c46ec29 100644
--- a/scripts/verify.mjs
+++ b/scripts/verify.mjs
@@ -112,7 +112,11 @@ for (const p of sample) {
     const ld = [...html.matchAll(/<script type="application\/ld\+json">([\s\S]*?)<\/script>/g)].map((m) => m[1]).join('\n');
     const hasOffer = /"@type":\s*"Offer"|"offers"\s*:/.test(ld);
     set('no_jsonld_offer', ld ? (hasOffer ? 'FAIL' : 'PASS') : 'NOT-MEASURED', ld ? (hasOffer ? 'Offer/price present in JSON-LD' : 'no Offer in JSON-LD') : 'no JSON-LD block found');
-    const minOrder = /class="min-order-notice"|data-min-order-notice/.test(html);
+    // Require ATTRIBUTE syntax, not a bare token: the bare `data-min-order-notice` matched the
+    // page's own defensive CSS selector `[data-min-order-notice]` inside <style>, firing WARN on
+    // 100% of products regardless of truth (Cody red-team 2026-09-20). Same fix already applied to
+    // no_sample_button above; a real rendered notice still carries class="…"/data-…="".
+    const minOrder = /class="[^"]*\bmin-order-notice\b|data-min-order-notice="/.test(html);
     set('min_order_notice_hidden', minOrder ? 'WARN' : 'PASS', minOrder ? 'min-order markup present (hidden by CSS only)' : 'no min-order markup');
   }
 
@@ -123,9 +127,15 @@ for (const p of sample) {
     else {
       const j = await res.json();
       const ns = (j.product?.variants || []).filter((v) => !isSampleVariant(v));
-      const avail = ns.filter((v) => v.available);
-      set('json_rolls_unavailable', ns.length === 0 ? 'NOT-MEASURED' : (avail.length ? 'FAIL' : 'PASS'),
-          `${ns.length - avail.length}/${ns.length} non-sample variants available:false`);
+      // This store's public /products/<handle>.json OMITS `available` (verified null on target AND
+      // control products, Cody red-team 2026-09-20), so a truthiness test could never FAIL — a false
+      // PASS. Report NOT-MEASURED unless `available` is a real boolean (CLAUDE.md TK-11431 #1). The
+      // authoritative unbuyable signal is `variants_hardened` above (admin API: DENY+tracked+qty<=0).
+      const measurable = ns.filter((v) => typeof v.available === 'boolean');
+      const buyable = measurable.filter((v) => v.available === true);
+      if (ns.length === 0) set('json_rolls_unavailable', 'NOT-MEASURED', 'sample-only product: 0 of 0');
+      else if (measurable.length === 0) set('json_rolls_unavailable', 'NOT-MEASURED', `public .json omits available for ${ns.length} variant(s); authoritative check = variants_hardened (admin)`);
+      else set('json_rolls_unavailable', buyable.length ? 'FAIL' : 'PASS', `${measurable.length - buyable.length}/${measurable.length} non-sample available:false (public .json)`);
     }
   } catch (e) { set('json_unavailable', 'NOT-MEASURED', String(e).slice(0, 80)); }
 

← a2b65a8 TK-11925: gate buy box (price/cart/sample/min-order) out of  ·  back to Dw Contact Us Pages  ·  auto-data-snapshot: 2026-09-26T08:50:16 (1 data files) — coh 2d2c24b →