← back to Wallco Ai
TODO: log designs.json dedup fix + gated prod rebuild step
8eb1bbeaaf7318c95b3550457e7b799722748700 · 2026-06-21 19:39:52 -0700 · Steve
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Files touched
Diff
commit 8eb1bbeaaf7318c95b3550457e7b799722748700
Author: Steve <steve@designerwallcoverings.com>
Date: Sun Jun 21 19:39:52 2026 -0700
TODO: log designs.json dedup fix + gated prod rebuild step
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---
TODO.md | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/TODO.md b/TODO.md
index 7795094..c519015 100644
--- a/TODO.md
+++ b/TODO.md
@@ -4,6 +4,12 @@ Surfaced to CNCP at http://localhost:3333 (via /api/tasks reading this file).
Format — `## Section` headers + `- [ ] task` / `- [x] done`. CNCP picks
up unchecked rows automatically.
+## designs.json duplicate-row defect — FIXED locally, deduped (2026-06-21, commit f55cefc, prod rebuild+deploy Steve-gated)
+- [x] Root cause: base table `all_designs` (under the `spoon_all_designs` VIEW, a plain `SELECT FROM all_designs`, no JOIN/UNION) physically stores ~2 byte-identical rows per id — 69,399 rows / 35,192 unique. Builder faithfully emitted every physical row → designs.json doubled (53,385 raw rows / 27,165 unique ids; 26,220 pure-dup rows). Safety proof: 34,207/34,207 dup ids fully identical across every column, 0 differ → dedup provably lossless.
+- [x] Fix (scripts/refresh_designs_snapshot.py): `SELECT DISTINCT ON (id)` collapses the fan-out at emission; catastrophe guard now compares UNIQUE-id coverage (not raw rows) so a legit 2x→1x dedup passes while a sparse-PG regen still aborts; byte guard now compares bytes-per-RAW-ROW (not total bytes) so dedup passes while a field-strip clobber still aborts; added WARN if any prior unique id disappears.
+- [x] Validated LOCALLY (scratch dirs only, prod designs.json untouched): 53,385→27,165 raw rows, 27,165→27,165 unique ids (0 dropped/0 added), 0 payload mismatches, published render set 6,264→6,264 unchanged. Guard regression: legit dedup PASS, sparse-PG regen ABORT, field-strip clobber ABORT.
+- [ ] **STEVE-GATED — prod rebuild + deploy.** On Mac2: `cd ~/Projects/wallco-ai && python3 scripts/refresh_designs_snapshot.py` (expect ~27k rows, no ABORT; if a stale prior trips a guard inspect `data/designs.json.rejected`), then `node -c server.js`, then `./deploy-kamatera.sh`. Post-deploy verify rows==uniq on `https://wallco.ai/api/designs`. wallpapersback carries a sibling copy of the snapshot — rebuild/deploy it the same way (or rsync the deduped designs.json into its repo + its deploy). OPTIONAL durable cleanup (separate, destructive, Steve-gated): de-dupe the `all_designs` base table + add UNIQUE/PK on id so future builds can't re-double even without DISTINCT ON.
+
## Seam joint-heal — element-copy method + four-horsemen gate (2026-06-12, DTD verdict C, Steve-gated decision)
- [x] Root cause of the rejected smudge variants CONFIRMED: old heal_band_mid AVERAGED L/R columns across the seam → blurred band = the smudge Steve rejected all session. Built scripts/element_copy_heal.py as the replacement: CRISP wrap-edge palette-reconcile (writes only dominant-palette colors on disagreeing wrap columns; NO averaging, NO drawn line). Committed 0fdef02.
- [x] First element-copy attempt (half-period-roll patch-copy) zeroed the seam scan to 0.0 PASS but VISIBLY transplanted a block / sliced the frog's face on 2766 — rejected on inspection. DTD verdict C: interior mid-lines (W/2,H/2) are arbitrary sample lines, NOT real tile joins; never heal them. Rewrote to wrap-edge-only.
← f55cefc Dedupe designs.json snapshot: DISTINCT ON (id) + dedup-aware
·
back to Wallco Ai
·
TODO: dedup deploy — wallco.ai retired, deployed+rolled-back 939dec9 →