[object Object]

← back to Wallco Ai

generator: read-only /api/generator/digest — curator-queue snapshot (generated_today / settlement_ok / awaiting_review / published / removed) so the review backlog is visible

f127079a082e1d1450b9ecc258d555eae34d0c66 · 2026-05-31 21:24:25 -0700 · Steve Abrams

Files touched

Diff

commit f127079a082e1d1450b9ecc258d555eae34d0c66
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Sun May 31 21:24:25 2026 -0700

    generator: read-only /api/generator/digest — curator-queue snapshot (generated_today / settlement_ok / awaiting_review / published / removed) so the review backlog is visible
---
 server.js | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/server.js b/server.js
index 1f88e21..abf0752 100644
--- a/server.js
+++ b/server.js
@@ -20965,6 +20965,28 @@ app.get('/api/generator/palette', (_req, res) => {
   } catch (e) { res.status(500).json({ error: e.message }); }
 });
 
+// Curator-queue digest — one read-only snapshot of where generator output sits
+// in the pipeline, so the curator backlog is visible at a glance. Counts only
+// machine-generated designs (generator NOT NULL). 'awaiting_review' is the
+// settlement-ungated, not-removed, unpublished pool a human still has to judge.
+app.get('/api/generator/digest', (req, res) => {
+  if (!isAdmin(req)) return res.status(404).json({ error: 'not found' });
+  try {
+    const raw = psqlQuery(`SELECT row_to_json(t) FROM (
+      SELECT
+        count(*) FILTER (WHERE created_at::date = now()::date)                                              AS generated_today,
+        count(*) FILTER (WHERE settlement_verdict = 'OK')                                                   AS settlement_ok,
+        count(*) FILTER (WHERE is_published = false AND user_removed IS NOT TRUE AND settlement_verdict IS NULL) AS awaiting_review,
+        count(*) FILTER (WHERE is_published = true)                                                         AS published,
+        count(*) FILTER (WHERE user_removed IS TRUE)                                                        AS removed,
+        count(*)                                                                                            AS total
+      FROM spoon_all_designs
+      WHERE generator IS NOT NULL
+    ) t;`);
+    res.json(JSON.parse(raw || '{}'));
+  } catch (e) { res.status(500).json({ error: e.message }); }
+});
+
 app.post('/api/generator/cron', (req, res) => {
   const { action } = req.body || {};
   const plist = `${require('os').homedir()}/Library/LaunchAgents/com.steve.wallco-generator.plist`;

← a607731 settlement integrity canary 2026-06-01: Mac2+prod clean, 0 B  ·  back to Wallco Ai  ·  generator: read-only /api/generator/cooldowns — surfaces whi 5024636 →