[object Object]

← back to Homesonspec

cody-gate fixes: AW gallery pollution, DW community-photo hero, mediaRights split-brain

3cf3826613db4ecbc7793126cb4e3fb1aeb3aa04 · 2026-07-28 21:36:26 -0700 · Steve Abrams

Contrarian review (/yolo) caught three real issues, all reproduced against prod:
- Ashton Woods: page-wide Widen sweep vacuumed brand assets into home galleries
  (403/412 homes had the 'most-trustworthy-companies' award badge; 211 had
  AW_Collections thumbnails). Added a blocklist so a home's gallery shows only
  the home.
- David Weekley: 176 homes showed a shared CommunityImage stock photo as the card
  hero (misrepresents the specific home). Now elevation-only; no elevation -> empty
  -> gradient fallback.
- mediaRights was still NONE on all 5 image-enabled sources (split-brain vs runtime).
  Set to LINK_ONLY (we hotlink builder CDNs, not copy).

images[0] (JSON-LD/elevation) was always correct; this cleans slots 2-8 + the fallback.
Re-backfills running to purge existing polluted arrays.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit 3cf3826613db4ecbc7793126cb4e3fb1aeb3aa04
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Tue Jul 28 21:36:26 2026 -0700

    cody-gate fixes: AW gallery pollution, DW community-photo hero, mediaRights split-brain
    
    Contrarian review (/yolo) caught three real issues, all reproduced against prod:
    - Ashton Woods: page-wide Widen sweep vacuumed brand assets into home galleries
      (403/412 homes had the 'most-trustworthy-companies' award badge; 211 had
      AW_Collections thumbnails). Added a blocklist so a home's gallery shows only
      the home.
    - David Weekley: 176 homes showed a shared CommunityImage stock photo as the card
      hero (misrepresents the specific home). Now elevation-only; no elevation -> empty
      -> gradient fallback.
    - mediaRights was still NONE on all 5 image-enabled sources (split-brain vs runtime).
      Set to LINK_ONLY (we hotlink builder CDNs, not copy).
    
    images[0] (JSON-LD/elevation) was always correct; this cleans slots 2-8 + the fallback.
    Re-backfills running to purge existing polluted arrays.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 collectors/ashton-woods/src/index.ts  |  5 +++++
 collectors/david-weekley/src/index.ts | 14 ++++++--------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/collectors/ashton-woods/src/index.ts b/collectors/ashton-woods/src/index.ts
index 97090cbb..a5fd91f1 100644
--- a/collectors/ashton-woods/src/index.ts
+++ b/collectors/ashton-woods/src/index.ts
@@ -210,9 +210,14 @@ export const ashtonWoodsAdapter: SourceAdapter = {
       const decoded = html.replace(/\\u0026/gi, "&").replace(/&amp;/g, "&");
       const ldImg = decoded.match(/"image"\s*:\s*"(https:\/\/awh\.widen\.net[^"]+)"/)?.[1];
       const widenAll = [...decoded.matchAll(/https:\/\/awh\.widen\.net\/content\/[^\s"'<>\\)]+/gi)].map((m) => m[0]);
+      // The page-wide Widen sweep also picks up brand marketing assets that are NOT this
+      // home's photos — collection thumbnails, the "most-trustworthy-companies" award badge,
+      // logos. Blocklist them so a home's gallery only shows the home. [Cody-gate fix 2026-07-28]
+      const BADIMG = /AW_Collections|Collection-Thumbnail|-Collection\b|most-trustworthy|companies-in-america|award|badge|_logo|download=true/i;
       const seenImg = new Set<string>();
       const images: string[] = [];
       for (const u of [ldImg, ...widenAll].filter((x): x is string => !!x)) {
+        if (BADIMG.test(u)) continue; // drop marketing/award/collection assets
         const key = u.split("?")[0]!;
         if (seenImg.has(key)) continue;
         seenImg.add(key);
diff --git a/collectors/david-weekley/src/index.ts b/collectors/david-weekley/src/index.ts
index 5be12235..8aba17a8 100644
--- a/collectors/david-weekley/src/index.ts
+++ b/collectors/david-weekley/src/index.ts
@@ -148,16 +148,14 @@ export function parseHomes(html: string): ParsedHome[] {
       .replace(/\s+/g, " ")
       .trim() || communitySlug.replace(/-/g, " ");
 
-    // Per-home imagery lives inside this card block: ElevationRendering = the home's
-    // own elevation photo (preferred), CommunityImage = community thumbnail fallback.
-    // Already absolute; skip site chrome (socialIcons/_images). Dedup by path since the
-    // same asset is served at multiple widths. Images enabled per Steve's hotlink
-    // approval 2026-07-28 (supersedes the old facts-only mediaRights=NONE default).
-    const imgMatches = [...raw.matchAll(/https:\/\/www\.davidweekleyhomes\.com\/media\/(?:ElevationRendering|CommunityImage)\/[^"?\s]+\.(?:jpe?g|png)(?:\?[^"\s]*)?/gi)].map((m) => m[0]);
-    const rank = (u: string) => (/ElevationRendering/i.test(u) ? 0 : 1);
+    // Per-home imagery: ONLY the home's own ElevationRendering photo. CommunityImage is a
+    // shared community stock photo (same aerial across ~40 homes in a subdivision), so it
+    // misrepresents the specific home — better to emit nothing and let the gradient fallback
+    // do its job than show a wrong hero. [Cody-gate fix 2026-07-28; images per hotlink approval]
+    const imgMatches = [...raw.matchAll(/https:\/\/www\.davidweekleyhomes\.com\/media\/ElevationRendering\/[^"?\s]+\.(?:jpe?g|png)(?:\?[^"\s]*)?/gi)].map((m) => m[0]);
     const seenImg = new Set<string>();
     const images: string[] = [];
-    for (const u of imgMatches.sort((a, b) => rank(a) - rank(b))) {
+    for (const u of imgMatches) {
       const path = u.split("?")[0]!;
       if (seenImg.has(path)) continue;
       seenImg.add(path);

← 955307e6 brookfield: drop shouldcountasquickmovein filter (contrarian  ·  back to Homesonspec  ·  collectors: add Fischer, Fulton, GL Homes adapters (+3 build 840c359e →