[object Object]

← back to Wallco Ai

promote gate: require fuzzy_seam_scan PASS in addition to edges-agent

7d932a60bea42242f49dac4bf53475a5a683ffa9 · 2026-05-27 08:09:46 -0700 · Steve Abrams

Root cause of the 2026-05-26 fuzzy-cross incident: both promote_edge_heal scripts
gated only on edges-agent, which measures discontinuity (a hard ΔE jump) and is
BLIND to a smeared blur band (a blur is smooth → low ΔE → falsely PASSES). 4,022
blur-band designs went live on that false pass.

Now a row is promotable only if it passes BOTH gates: edges-agent PASS AND
fuzzy_seam_scan PASS. Verified live on a 300-candidate sample — 171 designs that
PASS edges-agent are correctly blocked by the new gate; only 10 pass both.
Dry-run-by-default + deploy still Steve-gated are unchanged.

Files touched

Diff

commit 7d932a60bea42242f49dac4bf53475a5a683ffa9
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed May 27 08:09:46 2026 -0700

    promote gate: require fuzzy_seam_scan PASS in addition to edges-agent
    
    Root cause of the 2026-05-26 fuzzy-cross incident: both promote_edge_heal scripts
    gated only on edges-agent, which measures discontinuity (a hard ΔE jump) and is
    BLIND to a smeared blur band (a blur is smooth → low ΔE → falsely PASSES). 4,022
    blur-band designs went live on that false pass.
    
    Now a row is promotable only if it passes BOTH gates: edges-agent PASS AND
    fuzzy_seam_scan PASS. Verified live on a 300-candidate sample — 171 designs that
    PASS edges-agent are correctly blocked by the new gate; only 10 pass both.
    Dry-run-by-default + deploy still Steve-gated are unchanged.
---
 scripts/promote_edge_heal.py  | 29 +++++++++++++++++++++++------
 scripts/promote_edge_heals.py | 29 ++++++++++++++++++++++-------
 2 files changed, 45 insertions(+), 13 deletions(-)

diff --git a/scripts/promote_edge_heal.py b/scripts/promote_edge_heal.py
index 908fa4f..1291a4e 100644
--- a/scripts/promote_edge_heal.py
+++ b/scripts/promote_edge_heal.py
@@ -1,11 +1,17 @@
 #!/usr/bin/env python3
-"""promote_edge_heal — promote edge-heal copies that pass a FRESH edges-agent scan.
+"""promote_edge_heal — promote edge-heal copies that pass a FRESH scan on BOTH gates.
 
 Safe by design:
   - DRY-RUN by default. Prints what it WOULD promote. Flips nothing.
   - --apply is required to actually set is_published=TRUE.
-  - Re-scans every candidate live (does NOT trust a stale verdict) — only a
-    fresh edges-agent PASS gets promoted, per "only clean designs welcome".
+  - Re-scans every candidate live (does NOT trust a stale verdict). A row is
+    promotable ONLY if it passes BOTH gates, per "only clean designs welcome":
+      1. edges-agent      PASS — no hard ΔE discontinuity at edges/midlines, AND
+      2. fuzzy_seam_scan  PASS — no SMEARED blur band at the midlines.
+    Gate #2 is mandatory because edges-agent measures discontinuity and is BLIND
+    to a blur band (a blur is smooth → low ΔE → it falsely PASSES edges-agent).
+    That false pass is exactly what put 4,022 fuzzy-cross designs live on
+    2026-05-26 (see memory feedback_wallco_heal_blur_band_edges_agent_blind).
   - Excludes any row whose self OR parent carries a BLEED_GHOST flag (a clean
     edge feather can't fix a ghost source).
   - Never deploys. After --apply it PRINTS the two commands Steve runs next
@@ -24,6 +30,9 @@ from pathlib import Path
 
 sys.path.insert(0, str(Path.home() / '.claude/skills/edges-agent/scripts'))
 import scan as edges
+# fuzzy_seam_scan lives alongside this script — the blur-band gate edges-agent can't see
+sys.path.insert(0, str(Path(__file__).resolve().parent))
+import fuzzy_seam_scan as fss
 
 
 def psql(sql):
@@ -68,17 +77,25 @@ def main():
     print(f"candidates (pil-edge-heal, unpublished, non-ghost): {len(cands)}", flush=True)
 
     passed = []
+    blocked_fuzzy = 0      # edges-agent PASS but fuzzy_seam_scan caught a blur band
     for i, (rid, path) in enumerate(cands, 1):
         try:
             res = edges.scan_path(Path(path))
             if res.get('ok') and res['verdict'] == 'PASS':
-                passed.append(rid)
+                # Gate #2: reject any smeared blur band edges-agent is blind to.
+                fz = fss.scan(path)
+                if fz['verdict'] == 'PASS':
+                    passed.append(rid)
+                else:
+                    blocked_fuzzy += 1
         except Exception:
             pass
         if i % 200 == 0 or i == len(cands):
-            print(f"  re-scanned {i}/{len(cands)}  PASS so far={len(passed)}", flush=True)
+            print(f"  re-scanned {i}/{len(cands)}  both-PASS so far={len(passed)}  "
+                  f"blocked-by-fuzzy={blocked_fuzzy}", flush=True)
 
-    print(f"\nfresh-scan PASS (promotable): {len(passed)}")
+    print(f"\nblocked by fuzzy-seam gate (edges-agent PASS but blur band present): {blocked_fuzzy}")
+    print(f"fresh-scan PASS on BOTH gates (promotable): {len(passed)}")
     if not passed:
         print("nothing to promote"); return
 
diff --git a/scripts/promote_edge_heals.py b/scripts/promote_edge_heals.py
index 3665f22..c42a5be 100644
--- a/scripts/promote_edge_heals.py
+++ b/scripts/promote_edge_heals.py
@@ -20,6 +20,13 @@ spec = importlib.util.spec_from_file_location('edges_scan', ROOT / 'scripts' / '
 es = importlib.util.module_from_spec(spec)
 spec.loader.exec_module(es)
 
+# fuzzy_seam_scan = the blur-band gate edges-agent is BLIND to (a smooth blur scores
+# low ΔE → falsely PASSES edges-agent; that's what put 4,022 fuzzy-cross designs live
+# 2026-05-26, see memory feedback_wallco_heal_blur_band_edges_agent_blind). A row is
+# only promotable if it passes BOTH gates.
+sys.path.insert(0, str(ROOT / 'scripts'))
+import fuzzy_seam_scan as fss
+
 # DB url from .env
 def db_url():
     for line in (ROOT / '.env').read_text().splitlines():
@@ -36,6 +43,7 @@ print(f"cohort: {len(rows)} pil-edge-heal rows")
 
 counts = {'PASS': 0, 'WARN': 0, 'FAIL': 0, 'ERROR': 0}
 pass_ids, fail_detail = [], []
+blocked_fuzzy = 0      # edges-agent PASS but fuzzy_seam_scan caught a blur band
 for i, (did, lp) in enumerate(rows):
     if not lp or not Path(lp).exists():
         counts['ERROR'] += 1
@@ -45,17 +53,24 @@ for i, (did, lp) in enumerate(rows):
         v = r.get('verdict', 'ERROR')
         counts[v] = counts.get(v, 0) + 1
         if v == 'PASS':
-            pass_ids.append(did)
+            # Gate #2: reject any smeared blur band edges-agent is blind to.
+            if fss.scan(lp)['verdict'] == 'PASS':
+                pass_ids.append(did)
+            else:
+                blocked_fuzzy += 1
     except Exception as e:
         counts['ERROR'] += 1
     if (i + 1) % 300 == 0:
-        print(f"  ...{i+1}/{len(rows)}  PASS={counts['PASS']} WARN={counts['WARN']} FAIL={counts['FAIL']}")
+        print(f"  ...{i+1}/{len(rows)}  edgesPASS={counts['PASS']} WARN={counts['WARN']} "
+              f"FAIL={counts['FAIL']} blocked-by-fuzzy={blocked_fuzzy}")
 
 print(f"\n=== RESULTS ===")
-print(f"  PASS  : {counts['PASS']}")
-print(f"  WARN  : {counts['WARN']}")
-print(f"  FAIL  : {counts['FAIL']}")
-print(f"  ERROR : {counts['ERROR']}")
+print(f"  edges-agent PASS          : {counts['PASS']}")
+print(f"  WARN                      : {counts['WARN']}")
+print(f"  FAIL                      : {counts['FAIL']}")
+print(f"  ERROR                     : {counts['ERROR']}")
+print(f"  blocked by fuzzy-seam gate: {blocked_fuzzy}  (edges PASS but blur band present)")
+print(f"  promotable (BOTH gates)   : {len(pass_ids)}")
 
 (ROOT / 'data' / 'edge-heal-pass-ids.json').write_text(json.dumps(pass_ids))
 print(f"  wrote {len(pass_ids)} PASS ids → data/edge-heal-pass-ids.json")
@@ -63,7 +78,7 @@ print(f"  wrote {len(pass_ids)} PASS ids → data/edge-heal-pass-ids.json")
 if APPLY and pass_ids:
     ids_csv = ','.join(str(i) for i in pass_ids)
     cur.execute(f"UPDATE all_designs SET is_published=TRUE, "
-                f"notes = coalesce(notes,'') || ' | EDGE_HEAL_PROMOTED 2026-05-26 (fresh edges-agent PASS)' "
+                f"notes = coalesce(notes,'') || ' | EDGE_HEAL_PROMOTED (fresh edges-agent + fuzzy-seam BOTH PASS)' "
                 f"WHERE id IN ({ids_csv}) AND generator='pil-edge-heal';")
     conn.commit()
     print(f"  APPLIED: flipped {cur.rowcount} PASS rows is_published=TRUE")

← fbc35e7 Add cactus curator: ranked grid + density slider + 4-verdict  ·  back to Wallco Ai  ·  retire pil-mid-heal + pil-edge-heal: delete generators, prom 9d836cf →