[object Object]

← back to Nationalrealestate

refresh-commercial: gate briefs on explicit REFRESH_BRIEFS=1 (deterministic; prod cron skips)

17cdf502d689168d141f641cff922219894bb133 · 2026-07-22 10:35:42 -0700 · Steve

Files touched

Diff

commit 17cdf502d689168d141f641cff922219894bb133
Author: Steve <steve@designerwallcoverings.com>
Date:   Wed Jul 22 10:35:42 2026 -0700

    refresh-commercial: gate briefs on explicit REFRESH_BRIEFS=1 (deterministic; prod cron skips)
---
 scripts/refresh-commercial.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/refresh-commercial.sh b/scripts/refresh-commercial.sh
index 025d107..4053ead 100755
--- a/scripts/refresh-commercial.sh
+++ b/scripts/refresh-commercial.sh
@@ -20,11 +20,11 @@ npm run ingest:commercial -- la >> "$LOG" 2>&1 \
   && echo "[ok] la commercial parcels refreshed" >> "$LOG" \
   || echo "[skip/FAIL] la commercial (sqlite may be absent on this host)" >> "$LOG"
 
-# Run briefs ONLY where the actual model is pulled. Prod's :11434 answers /api/tags with
-# an empty {"models":[]} (Ollama installed, no models), so we must grep the model NAME —
-# not just the "models" key — else /api/generate 404s. Empty/absent -> skip cleanly.
-BRIEF_MODEL="${OLLAMA_MODEL:-qwen2.5}"
-if curl -sf --max-time 3 "${OLLAMA_URL:-http://127.0.0.1:11434}/api/tags" 2>/dev/null | grep -q "$BRIEF_MODEL"; then
+# Briefs need a real local LLM. Auto-detecting :11434 is unreliable (prod answers /api/tags
+# but has no usable model, and the script's bash default can differ from briefs.ts's
+# dotenv OLLAMA_URL). So gate on an EXPLICIT opt-in: only run where REFRESH_BRIEFS=1 is set
+# (i.e. on Mac2). The prod cron never sets it -> briefs are always skipped there.
+if [ "${REFRESH_BRIEFS:-0}" = "1" ]; then
   npm run ingest:commercial-briefs >> "$LOG" 2>&1 \
     && echo "[ok] briefs regenerated (Ollama present)" >> "$LOG" \
     || echo "[FAIL] briefs" >> "$LOG"

← 701cb10 refresh-commercial: gate briefs on actual model name (prod h  ·  back to Nationalrealestate  ·  Add /api/commercial/digest — one-shot marquee+briefs/recent/ 253038d →