news-digest: fixes from first deploy on ana-docker

Three iterations to get end-to-end:

1. Dockerfile missed COPY run-digest.sh — cron's exec target wasn't
   in the image, every fire failed. Added COPY + chmod.

2. Jinja template used {{ list|sum(attribute='items') }} which
   sum()s lists with start=0 → TypeError int+list. Switched to
   computing reddit_total / tech_total in Python and passing as
   template args.

3. LLM defaulted to qwen3.5-35-a3b which (a) is broken in
   llama-swap (model process exits on launch), (b) when working,
   defaults to extended-thinking mode that eats the entire token
   budget without producing any visible content. Same pattern with
   qwen3.6-35-a3b. Switched default to granite-4-small — small (4B),
   fast (~1s/call), no thinking-mode pathology, returns clean JSON.
   Whole pipeline now runs in ~35s total across 8 sources.

Also hardened the LLM response parser to fall back to
reasoning_content when content is empty — catches the thinking-mode
case if anyone ever points the digest at one of those models. Plus
the deploy playbook gained DOCKER_BUILDKIT=0 because ana-docker is
on docker 20.10 which doesn't carry the buildx driver versions our
newer client expects ("client version 1.52 is too new"). Real fix is
upgrading docker on the fleet — separate workstream.
This commit is contained in:
vh
2026-04-26 13:35:37 -07:00
parent 2e80e69ef5
commit 3b2c964c2d
5 changed files with 29 additions and 9 deletions
+7 -2
View File
@@ -94,10 +94,15 @@ steps:
# /output, so the worker writes a copy of style.css into /output too.
- name: docker compose build (~2-3 min first time)
# DOCKER_BUILDKIT=0 forces the legacy build path. ana-docker is on
# docker 20.10 (Debian package) which doesn't carry the buildx
# driver versions our newer client expects → "client version 1.52
# is too new" without this fallback. Strip the noisy per-step
# download lines for log readability.
shell: |
set -o pipefail
cd {{ compose_dir }} && docker compose build --progress=plain 2>&1 \
| grep -vE '^#[0-9]+ [0-9.]+ (Downloading|Collecting|Requirement|Using cached|Installing collected|Successfully (installed|built)|Saved /|━|Resolved|Prepared|Built)'
cd {{ compose_dir }} && DOCKER_BUILDKIT=0 docker compose build 2>&1 \
| grep -vE '^Step [0-9]+/[0-9]+ : (RUN|COPY)|^Removing intermediate|^ ---> |^ ---> Running|Collecting|Downloading|Requirement|Using cached|Installing collected|Successfully (installed|built)|━'
- name: Pre-stage style.css into /output so the first page render works
# Worker writes index.html which references "style.css" (relative).