[object Object]

← back to Fentucci Naturals

chore: lint + light refactor (session close) — cadence.sh redirect guard, dead /api/health route removed, esc hoisted in enrich.py

1ca6211bcc6760973f1eda3205e4821b81b1033d · 2026-07-22 19:29:28 -0700 · Steve Abrams

Files touched

Diff

commit 1ca6211bcc6760973f1eda3205e4821b81b1033d
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Jul 22 19:29:28 2026 -0700

    chore: lint + light refactor (session close) — cadence.sh redirect guard, dead /api/health route removed, esc hoisted in enrich.py
---
 data/created.jsonl                                 |  75 +++++++++++++++++++++
 scripts/__pycache__/build-drafts.cpython-314.pyc   | Bin 5746 -> 5814 bytes
 scripts/__pycache__/create-drafts.cpython-314.pyc  | Bin 6961 -> 7512 bytes
 scripts/__pycache__/enrich.cpython-314.pyc         | Bin 0 -> 15088 bytes
 .../__pycache__/retown-collisions.cpython-314.pyc  | Bin 10085 -> 10430 bytes
 scripts/cadence-import.sh                          |   4 +-
 scripts/enrich.py                                  |   2 +-
 server.js                                          |   1 -
 8 files changed, 78 insertions(+), 4 deletions(-)

diff --git a/data/created.jsonl b/data/created.jsonl
index b4b01a2..4e41cef 100644
--- a/data/created.jsonl
+++ b/data/created.jsonl
@@ -49,3 +49,78 @@
 {"sku": "DWFN-100049", "product_id": 7896735744051}
 {"sku": "DWFN-100050", "product_id": 7896735776819}
 {"sku": "DWFN-100051", "product_id": 7896735809587}
+{"sku": "DWFN-100052", "product_id": 7896736071731}
+{"sku": "DWFN-100053", "product_id": 7896736137267}
+{"sku": "DWFN-100054", "product_id": 7896736170035}
+{"sku": "DWFN-100055", "product_id": 7896736202803}
+{"sku": "DWFN-100056", "product_id": 7896736235571}
+{"sku": "DWFN-100057", "product_id": 7896736301107}
+{"sku": "DWFN-100058", "product_id": 7896736366643}
+{"sku": "DWFN-100059", "product_id": 7896736399411}
+{"sku": "DWFN-100060", "product_id": 7896736497715}
+{"sku": "DWFN-100061", "product_id": 7896736563251}
+{"sku": "DWFN-100062", "product_id": 7896736596019}
+{"sku": "DWFN-100063", "product_id": 7896736628787}
+{"sku": "DWFN-100064", "product_id": 7896736661555}
+{"sku": "DWFN-100065", "product_id": 7896736694323}
+{"sku": "DWFN-100066", "product_id": 7896736727091}
+{"sku": "DWFN-100067", "product_id": 7896736792627}
+{"sku": "DWFN-100068", "product_id": 7896736825395}
+{"sku": "DWFN-100069", "product_id": 7896736858163}
+{"sku": "DWFN-100070", "product_id": 7896736890931}
+{"sku": "DWFN-100071", "product_id": 7896736956467}
+{"sku": "DWFN-100072", "product_id": 7896736989235}
+{"sku": "DWFN-100073", "product_id": 7896737054771}
+{"sku": "DWFN-100074", "product_id": 7896737087539}
+{"sku": "DWFN-100075", "product_id": 7896737153075}
+{"sku": "DWFN-100076", "product_id": 7896737185843}
+{"sku": "DWFN-100077", "product_id": 7896738824243}
+{"sku": "DWFN-100078", "product_id": 7896738857011}
+{"sku": "DWFN-100079", "product_id": 7896739381299}
+{"sku": "DWFN-100080", "product_id": 7896739774515}
+{"sku": "DWFN-100081", "product_id": 7896740266035}
+{"sku": "DWFN-100082", "product_id": 7896740692019}
+{"sku": "DWFN-100083", "product_id": 7896740921395}
+{"sku": "DWFN-100084", "product_id": 7896741118003}
+{"sku": "DWFN-100085", "product_id": 7896741609523}
+{"sku": "DWFN-100086", "product_id": 7896742002739}
+{"sku": "DWFN-100087", "product_id": 7896742428723}
+{"sku": "DWFN-100088", "product_id": 7896742920243}
+{"sku": "DWFN-100089", "product_id": 7896743247923}
+{"sku": "DWFN-100090", "product_id": 7896743510067}
+{"sku": "DWFN-100091", "product_id": 7896743968819}
+{"sku": "DWFN-100092", "product_id": 7896744394803}
+{"sku": "DWFN-100093", "product_id": 7896744919091}
+{"sku": "DWFN-100094", "product_id": 7896745377843}
+{"sku": "DWFN-100095", "product_id": 7896745869363}
+{"sku": "DWFN-100096", "product_id": 7896746393651}
+{"sku": "DWFN-100097", "product_id": 7896746590259}
+{"sku": "DWFN-100098", "product_id": 7896746983475}
+{"sku": "DWFN-100099", "product_id": 7896747442227}
+{"sku": "DWFN-100100", "product_id": 7896747933747}
+{"sku": "DWFN-100101", "product_id": 7896748458035}
+{"sku": "DWFN-100102", "product_id": 7896750948403}
+{"sku": "DWFN-100103", "product_id": 7896751079475}
+{"sku": "DWFN-100104", "product_id": 7896751308851}
+{"sku": "DWFN-100105", "product_id": 7896751407155}
+{"sku": "DWFN-100106", "product_id": 7896751538227}
+{"sku": "DWFN-100107", "product_id": 7896751702067}
+{"sku": "DWFN-100108", "product_id": 7896751833139}
+{"sku": "DWFN-100109", "product_id": 7896751931443}
+{"sku": "DWFN-100110", "product_id": 7896752160819}
+{"sku": "DWFN-100111", "product_id": 7896752521267}
+{"sku": "DWFN-100112", "product_id": 7896752947251}
+{"sku": "DWFN-100113", "product_id": 7896753176627}
+{"sku": "DWFN-100114", "product_id": 7896753307699}
+{"sku": "DWFN-100115", "product_id": 7896753504307}
+{"sku": "DWFN-100116", "product_id": 7896753635379}
+{"sku": "DWFN-100117", "product_id": 7896753766451}
+{"sku": "DWFN-100118", "product_id": 7896753897523}
+{"sku": "DWFN-100119", "product_id": 7896754028595}
+{"sku": "DWFN-100120", "product_id": 7896754192435}
+{"sku": "DWFN-100121", "product_id": 7896754356275}
+{"sku": "DWFN-100122", "product_id": 7896754487347}
+{"sku": "DWFN-100123", "product_id": 7896754651187}
+{"sku": "DWFN-100124", "product_id": 7896754815027}
+{"sku": "DWFN-100125", "product_id": 7896755011635}
+{"sku": "DWFN-100126", "product_id": 7896755142707}
diff --git a/scripts/__pycache__/build-drafts.cpython-314.pyc b/scripts/__pycache__/build-drafts.cpython-314.pyc
index 2b058e1..4c701b5 100644
Binary files a/scripts/__pycache__/build-drafts.cpython-314.pyc and b/scripts/__pycache__/build-drafts.cpython-314.pyc differ
diff --git a/scripts/__pycache__/create-drafts.cpython-314.pyc b/scripts/__pycache__/create-drafts.cpython-314.pyc
index a4795d8..4081a9f 100644
Binary files a/scripts/__pycache__/create-drafts.cpython-314.pyc and b/scripts/__pycache__/create-drafts.cpython-314.pyc differ
diff --git a/scripts/__pycache__/enrich.cpython-314.pyc b/scripts/__pycache__/enrich.cpython-314.pyc
new file mode 100644
index 0000000..1a0dc05
Binary files /dev/null and b/scripts/__pycache__/enrich.cpython-314.pyc differ
diff --git a/scripts/__pycache__/retown-collisions.cpython-314.pyc b/scripts/__pycache__/retown-collisions.cpython-314.pyc
index 098a626..d7af0e5 100644
Binary files a/scripts/__pycache__/retown-collisions.cpython-314.pyc and b/scripts/__pycache__/retown-collisions.cpython-314.pyc differ
diff --git a/scripts/cadence-import.sh b/scripts/cadence-import.sh
index cea4187..06aa9a4 100755
--- a/scripts/cadence-import.sh
+++ b/scripts/cadence-import.sh
@@ -13,12 +13,12 @@ SHOPIFY_ADMIN_TOKEN=$(grep '^SHOPIFY_ADMIN_TOKEN=' "$HOME/Projects/secrets-manag
 export SHOPIFY_ADMIN_TOKEN
 {
   echo "=== fentucci cadence tranche $(date '+%Y-%m-%d %H:%M:%S') ==="
-  created=$(wc -l < "$ROOT/data/created.jsonl" 2>/dev/null || echo 0)
+  _f="$ROOT/data/created.jsonl"; created=$([ -f "$_f" ] && wc -l < "$_f" || echo 0)
   total=$(wc -l < "$ROOT/data/shopify-drafts.jsonl")
   if [ "$created" -ge "$total" ]; then
     echo "all $total drafts created — nothing to do"
   else
     cd "$ROOT" && python3 scripts/create-drafts.py --limit 245
   fi
-  echo "=== done $(date '+%Y-%m-%d %H:%M:%S') — $(wc -l < "$ROOT/data/created.jsonl" 2>/dev/null || echo 0)/$total created ==="
+  echo "=== done $(date '+%Y-%m-%d %H:%M:%S') — $([ -f "$_f" ] && wc -l < "$_f" || echo 0)/$total created ==="
 } >> "$LOG" 2>&1
diff --git a/scripts/enrich.py b/scripts/enrich.py
index 87a8207..dfab79b 100644
--- a/scripts/enrich.py
+++ b/scripts/enrich.py
@@ -154,6 +154,7 @@ def main():
     cache, use_llm = get_pattern_copy(rows)
     print(f"pattern copy ready ({'LLM qwen3:14b' if use_llm else 'TEMPLATE fallback'}), enriching {len(rows)} rows", flush=True)
 
+    esc = lambda s: s.replace("'", "''")
     t0 = time.time()
     for i, r in enumerate(rows):
         fam = color_family(r["color_hex"], r["color_name"])
@@ -169,7 +170,6 @@ def main():
                  "sample_price": 4.25}
         hay = " ".join([desc, r["pattern_name"], r["source_category"] or "", mat])
         settle = "review" if SETTLE.search(GILDING.sub(" ", hay)) else "clear"
-        esc = lambda s: s.replace("'", "''")
         arr = "ARRAY[" + ",".join(f"'{esc(t)}'" for t in tags) + "]"
         psql(f"update tokiwa_catalog set description='{esc(desc)}', tags={arr}, "
              f"specs='{esc(json.dumps(specs))}'::jsonb, settlement_status='{settle}', "
diff --git a/server.js b/server.js
index 8c4b8f0..8e91aa7 100644
--- a/server.js
+++ b/server.js
@@ -179,7 +179,6 @@ app.get('/api/products', (_req, res) => res.json({ count: ROWS.length, products:
 app.get('/api/facets', (req, res) => {
   try { res.json(facets()); } catch (e) { res.status(500).json({ error: e.message }); }
 });
-app.get('/api/health', (_req, res) => res.json({ ok: true, service: 'fentucci-viewer', count: ROWS.length }));
 
 load().then(() => {
   app.listen(PORT, () => console.log(`fentucci-viewer on :${PORT}`));

← 9c3c6f4 auto-save: 2026-07-22T19:16:13 (1 files) — data/created.json  ·  back to Fentucci Naturals  ·  chore: v1.0.1 (session close) da9325f →