← back to Wallco Ai
drunk-curator: sort by triage instance-count desc (AUTO_HOT_N=<n>) so strongest dense candidates surface first
beb0d0bbf17bfaf9d45a48ddd9295098b3da469c · 2026-05-28 05:34:32 -0700 · Steve Abrams
Files touched
M scripts/auto-decide-drunk.jsM server.js
Diff
commit beb0d0bbf17bfaf9d45a48ddd9295098b3da469c
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Thu May 28 05:34:32 2026 -0700
drunk-curator: sort by triage instance-count desc (AUTO_HOT_N=<n>) so strongest dense candidates surface first
---
scripts/auto-decide-drunk.js | 6 ++++--
server.js | 6 +++++-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/scripts/auto-decide-drunk.js b/scripts/auto-decide-drunk.js
index 5cd1bac..cd127d9 100644
--- a/scripts/auto-decide-drunk.js
+++ b/scripts/auto-decide-drunk.js
@@ -81,8 +81,10 @@ function log(o) { try { fs.appendFileSync(LEDGER, JSON.stringify({ t: new Date()
if (g.ok) { // dense all-over → HOT CANDIDATE (flag, do NOT auto-publish)
// Triage only: flag for Steve's one-click publish in the curator. Auto-
// publishing thousands to the live catalog is gated — the human keeps the
- // publish decision; the loop just surfaces the dense winners.
- exec(`UPDATE all_designs SET notes = COALESCE(notes,'') || ' | AUTO_HOT_CANDIDATE' WHERE id=${d.id} AND (notes IS NULL OR notes NOT LIKE '%AUTO_HOT_CANDIDATE%');`);
+ // publish decision; the loop just surfaces the dense winners. Storing
+ // instance_count in notes (AUTO_HOT_N=<n>) so the curator can sort by it.
+ const n = Math.max(0, Math.min(99, r.instance_count|0));
+ exec(`UPDATE all_designs SET notes = COALESCE(notes,'') || ' | AUTO_HOT_CANDIDATE | AUTO_HOT_N=${n}' WHERE id=${d.id} AND (notes IS NULL OR notes NOT LIKE '%AUTO_HOT_CANDIDATE%');`);
log({ id: d.id, verdict: 'hot_candidate', n: r.instance_count, see: r.what_you_see }); hot++;
} else { // single-hero / sparse / large-void → NOT → registry (kept)
const dtype = g.reason === 'large-empty-void' ? 'auto_decide_open_space' : 'auto_decide_single_hero';
diff --git a/server.js b/server.js
index 11f916c..2546cff 100644
--- a/server.js
+++ b/server.js
@@ -1172,9 +1172,13 @@ app.get('/api/admin/drunk/list', (req, res) => {
const where = cat
? `category ILIKE '%${cat}%' AND is_published=FALSE AND (user_removed IS NULL OR user_removed=FALSE) AND needs_fixing_at IS NULL AND local_path IS NOT NULL`
: `(category LIKE 'drunk-animals-sample%' OR category='drunk-animals-replfast' OR ((category LIKE 'drunk%' OR category LIKE 'stoned%') AND notes LIKE '%AUTO_HOT_CANDIDATE%')) AND is_published=FALSE AND (user_removed IS NULL OR user_removed=FALSE) AND needs_fixing_at IS NULL AND local_path IS NOT NULL`;
+ // Sort: triage instance-count DESC (the auto-decider's AUTO_HOT_N=<n> note)
+ // surfaces the strongest dense all-overs first, so Steve's hot-or-not works
+ // top-down through the best candidates. Unflagged items (NULL n) sort last.
const rawJson = psqlQuery(
- "SELECT COALESCE(json_agg(t ORDER BY t.id), '[]'::json) FROM (" +
+ "SELECT COALESCE(json_agg(t ORDER BY t.auto_hot_n DESC NULLS LAST, t.id DESC), '[]'::json) FROM (" +
"SELECT id, category, generator, left(prompt,260) AS prompt, created_at, room_mockups, " +
+ "NULLIF(substring(notes from 'AUTO_HOT_N=([0-9]+)'),'')::int AS auto_hot_n, " +
"(SELECT be.boxes FROM bad_examples be WHERE be.design_id=all_designs.id LIMIT 1) AS annotations " +
"FROM all_designs WHERE " + where +
" AND local_path NOT LIKE '%midheal_%' AND local_path NOT LIKE '%edgeheal_%' AND local_path NOT LIKE '%smartfix_%'" +
← 6eda7cc designs.json refresh: allowlist svg-% generators + ship 11 n
·
back to Wallco Ai
·
seam-defect localizer + /admin/seam-debug viewer (per-row/pe a55e2ac →