[object Object]

← back to Designer Wallcoverings

discontinued-sweep: sitemap gate is signal-aware — explicit-text flags (live page w/ vendor discontinued note) are not skipped

3e47602950e900b7829cbde19e38ebe5c4870695 · 2026-07-02 10:58:21 -0700 · Steve Abrams

Files touched

Diff

commit 3e47602950e900b7829cbde19e38ebe5c4870695
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Jul 2 10:58:21 2026 -0700

    discontinued-sweep: sitemap gate is signal-aware — explicit-text flags (live page w/ vendor discontinued note) are not skipped
---
 scripts/discontinued-sweep/archive-discontinued.mjs | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/discontinued-sweep/archive-discontinued.mjs b/scripts/discontinued-sweep/archive-discontinued.mjs
index 45037cef..332dbf3c 100644
--- a/scripts/discontinued-sweep/archive-discontinued.mjs
+++ b/scripts/discontinued-sweep/archive-discontinued.mjs
@@ -120,8 +120,13 @@ async function main() {
 
   const eligible = [], skipped = [];
   for (const r of rows) {
-    if (r.vendor === 'thibaut' && thibautSkus.size === 0) { skipped.push([r, 'sitemap-unavailable-fail-closed']); continue; }
-    if (r.vendor === 'thibaut' && thibautSkus.has(r.mfr_sku.toUpperCase())) { skipped.push([r, 'still-in-vendor-sitemap']); continue; }
+    // Sitemap-absence gate applies ONLY to gone-page signals (confirmed-notfound /
+    // redirect class). Explicit-text flags come from a LIVE page carrying the
+    // vendor's own discontinued notice (e.g. "BOOK DISCONTINUED / NO REORDERS"),
+    // so sitemap presence is expected — the page text is the evidence.
+    const gonePageSignal = !/explicit-discontinued-(text|marker)/.test(r.signal || '');
+    if (r.vendor === 'thibaut' && gonePageSignal && thibautSkus.size === 0) { skipped.push([r, 'sitemap-unavailable-fail-closed']); continue; }
+    if (r.vendor === 'thibaut' && gonePageSignal && thibautSkus.has(r.mfr_sku.toUpperCase())) { skipped.push([r, 'still-in-vendor-sitemap']); continue; }
     const hits = sql(`SELECT shopify_id||'|'||dw_sku||'|'||status FROM shopify_products WHERE upper(mfr_sku)=upper('${r.mfr_sku.replace(/'/g, "''")}') AND status ILIKE 'active'`).split('\n').filter(Boolean);
     if (hits.length !== 1) { skipped.push([r, `resolves-to-${hits.length}-active-products`]); continue; }
     const [shopify_id, dw_sku, status] = hits[0].split('|');

← 4182db24 discontinued-sweep: archive executor (snapshot-first, fail-c  ·  back to Designer Wallcoverings  ·  discontinued-sweep: document york excluded-739 follow-up pat 6c70b553 →