[object Object]

← back to Wallco Ai

dogs-curator: fix greedy edges parse (split_part slurped appended settlement/canary notes into the badge)

8282219bdf6783af0f9b502fedd0884b0d47e950 · 2026-06-03 14:01:51 -0700 · Steve Abrams

/api/admin/dogs/list derived edges via split_part(notes,'DOGS_EDGES:',2) which
returned EVERYTHING after the marker — so when the settlement canary / override
processes appended audit lines to notes, the curator's edges badge rendered
multi-line garbage. Switched to regexp_match(...'(PASS|WARN|FAIL)') to extract
only the verdict token. Pure read-path fix, zero DB writes. Verified live:
438 rows → PASS 174 / WARN 34 / FAIL 29 / 201 unscanned, 0 polluted badges.

Files touched

Diff

commit 8282219bdf6783af0f9b502fedd0884b0d47e950
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Jun 3 14:01:51 2026 -0700

    dogs-curator: fix greedy edges parse (split_part slurped appended settlement/canary notes into the badge)
    
    /api/admin/dogs/list derived edges via split_part(notes,'DOGS_EDGES:',2) which
    returned EVERYTHING after the marker — so when the settlement canary / override
    processes appended audit lines to notes, the curator's edges badge rendered
    multi-line garbage. Switched to regexp_match(...'(PASS|WARN|FAIL)') to extract
    only the verdict token. Pure read-path fix, zero DB writes. Verified live:
    438 rows → PASS 174 / WARN 34 / FAIL 29 / 201 unscanned, 0 polluted badges.
---
 server.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/server.js b/server.js
index e7e4bb8..b3657db 100644
--- a/server.js
+++ b/server.js
@@ -1855,7 +1855,9 @@ app.get('/api/admin/dogs/list', (req, res) => {
     const rawJson = psqlQuery(
       "SELECT COALESCE(json_agg(t ORDER BY t.category, t.id), '[]'::json) FROM (" +
         "SELECT id, category, dominant_hex, is_published, created_at, " +
-        "COALESCE(split_part(notes,'DOGS_EDGES:',2),'') AS edges " +
+        // extract ONLY the verdict token — split_part(...,2) was greedy and slurped
+        // appended settlement/canary/override notes into the badge (fixed 2026-06-03)
+        "COALESCE((regexp_match(notes,'DOGS_EDGES:[[:space:]]*(PASS|WARN|FAIL)'))[1],'') AS edges " +
         "FROM spoon_all_designs WHERE category LIKE 'dogs · %' " +
         // exclude seam-healer derivatives (blurred seam line / fuzzy edges)
         "AND local_path NOT LIKE '%midheal_%' AND local_path NOT LIKE '%edgeheal_%' AND local_path NOT LIKE '%smartfix_%'" +

← 9952d41 backfill-rooms: idempotent free-local PIL room backfill for  ·  back to Wallco Ai  ·  designs grid: add 'Digital for Sale' bulk action (unpublish 333f44d →