[object Object]

← back to Wallco Ai

Harden refresh_designs_snapshot.py summary print against None category

ff8c30c2ea5a3e1938aa877f46c1d3dfc3f646bb · 2026-06-09 12:30:30 -0700 · Steve Abrams

The post-write Categories summary crashed with TypeError when any design
had a None category (sorted() can't compare None < str). The snapshot file
itself wrote fine before the crash, but the traceback masked that. Sort
None-last so the summary always prints and real errors stay visible.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit ff8c30c2ea5a3e1938aa877f46c1d3dfc3f646bb
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Tue Jun 9 12:30:30 2026 -0700

    Harden refresh_designs_snapshot.py summary print against None category
    
    The post-write Categories summary crashed with TypeError when any design
    had a None category (sorted() can't compare None < str). The snapshot file
    itself wrote fine before the crash, but the traceback masked that. Sort
    None-last so the summary always prints and real errors stay visible.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 scripts/refresh_designs_snapshot.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/refresh_designs_snapshot.py b/scripts/refresh_designs_snapshot.py
index ed3f7e5..36522c7 100644
--- a/scripts/refresh_designs_snapshot.py
+++ b/scripts/refresh_designs_snapshot.py
@@ -387,5 +387,5 @@ _tmp = str(OUT) + '.tmp'
 open(_tmp, 'w').write(_new_blob)
 os.replace(_tmp, str(OUT))
 print(f"Wrote {len(out)} designs → {OUT}")
-print(f"  Categories: {dict((c, sum(1 for x in out if x['category']==c)) for c in sorted({x['category'] for x in out}))}")
+print(f"  Categories: {dict((c, sum(1 for x in out if x['category']==c)) for c in sorted({x['category'] for x in out}, key=lambda c: (c is None, c)))}")
 print(f"  Top saturation 3: {[(x['title'], x['saturation']) for x in sorted(out, key=lambda x: -x['saturation'])[:3]]}")

← 1d38efd stage orphan-reclaim SQL for seeds 1703852405 + 1320598381 (  ·  back to Wallco Ai  ·  generator_tick: add 15-min spawnSync timeout (was unbounded cba4529 →