[object Object]

← back to Wallco Ai

restore script: generalize via CATEGORY_REGEX, hard-exclude damask, REVIEW-VISION-ERROR-only default

4a2ef63b904bbf23013731d68933ce184e6b0e5c · 2026-06-09 16:37:11 -0700 · Steve

Files touched

Diff

commit 4a2ef63b904bbf23013731d68933ce184e6b0e5c
Author: Steve <steve@designerwallcoverings.com>
Date:   Tue Jun 9 16:37:11 2026 -0700

    restore script: generalize via CATEGORY_REGEX, hard-exclude damask, REVIEW-VISION-ERROR-only default
---
 scripts/restore-verified-drunk-animals.js | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/scripts/restore-verified-drunk-animals.js b/scripts/restore-verified-drunk-animals.js
index 9c100c3..5b5450c 100644
--- a/scripts/restore-verified-drunk-animals.js
+++ b/scripts/restore-verified-drunk-animals.js
@@ -23,11 +23,21 @@ function psql(sql) {
 }
 
 // the cohort: unpublished drunk-animals carrying the sweep-trigger verdict
+// CATEGORY_REGEX selects which categories to restore (default drunk-animals).
+// damask is ALWAYS excluded (legally-sensitive — never restore via clamped local
+// vision that can't BLOCK). VERDICTS restricts which unpublish-verdicts qualify:
+// default to REVIEW-VISION-ERROR only (the clear Gemini-cap false-unpublishes);
+// drunk-animals run also swept BLOCK/NULL because those were proven clean.
+const CAT_RE = process.env.CATEGORY_REGEX || '^drunk-animals$';
+const VERDICT_CLAUSE = process.env.INCLUDE_BLOCK_NULL === '1'
+  ? `(settlement_verdict LIKE 'REVIEW-VISION-ERROR%' OR settlement_verdict='BLOCK' OR settlement_verdict IS NULL)`
+  : `settlement_verdict LIKE 'REVIEW-VISION-ERROR%'`;
 const rows = psql(`
   SELECT id, COALESCE(local_path,'')
   FROM all_designs
-  WHERE category='drunk-animals' AND COALESCE(is_published,false)=false AND COALESCE(user_removed,false)=false
-    AND (settlement_verdict LIKE 'REVIEW-VISION-ERROR%' OR settlement_verdict='BLOCK' OR settlement_verdict IS NULL)
+  WHERE category ~ '${CAT_RE}' AND category NOT LIKE 'damask%'
+    AND COALESCE(is_published,false)=false AND COALESCE(user_removed,false)=false
+    AND ${VERDICT_CLAUSE}
   ORDER BY id;`).trim().split('\n').filter(Boolean).map(l => {
   const [id, lp] = l.split('|'); return { id: +id, lp, title: 'drunk animal wallpaper' };
 });

← d2decec deploy: ship settlement vision-check + tick-guard to prod (h  ·  back to Wallco Ai  ·  fix(scripts): DB password from DATABASE_URL (.env), not empt 4e68e65 →