[object Object]

← back to Wallco Ai

Add curator-excluded-ids helper — publish loop respects cactus-curator unpublish/bad takedowns

be9b2455cf6635779a43fef9f01c7d0a6c3878f2 · 2026-05-31 19:43:27 -0700 · Steve Abrams

Files touched

Diff

commit be9b2455cf6635779a43fef9f01c7d0a6c3878f2
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Sun May 31 19:43:27 2026 -0700

    Add curator-excluded-ids helper — publish loop respects cactus-curator unpublish/bad takedowns
---
 scripts/curator-excluded-ids.py | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/scripts/curator-excluded-ids.py b/scripts/curator-excluded-ids.py
new file mode 100644
index 0000000..e3a0725
--- /dev/null
+++ b/scripts/curator-excluded-ids.py
@@ -0,0 +1,33 @@
+#!/usr/bin/env python3
+"""Print comma-separated design ids whose LATEST cactus-curator decision is a
+takedown ('unpublish' or 'bad'). The drunk-animals publish loop excludes these
+so it never re-publishes a design the curator deliberately took down via
+/admin/cactus-curator (POST /api/cactus-decision/bulk). A later 'live' decision
+(re-publish via the UI) overrides the takedown — latest line wins.
+
+Reads data/cactus-decisions.jsonl (append-only {ts,id,action}). Prints '-1' when
+empty so `AND id NOT IN (-1)` stays valid SQL.
+"""
+import json, os
+
+F = os.path.join(os.path.dirname(__file__), '..', 'data', 'cactus-decisions.jsonl')
+latest = {}
+try:
+    with open(F) as fh:
+        for line in fh:
+            line = line.strip()
+            if not line:
+                continue
+            try:
+                d = json.loads(line)
+            except Exception:
+                continue
+            i, a = d.get('id'), d.get('action')
+            if i is None or not a:
+                continue
+            latest[i] = a  # append-only → last line for an id is its current decision
+except FileNotFoundError:
+    pass
+
+excl = [str(i) for i, a in latest.items() if a in ('unpublish', 'bad')]
+print(','.join(excl) if excl else '-1')

← 91d3a60 stoned-animals quality purge — unpublish 227 alert-mood desi  ·  back to Wallco Ai  ·  curator: add HSB + contrast live image-adjustment panel (non 4d9032c →