Scans the Socratic reflection questions Ethan has been generating (via socratic-reflection-harvester, socratic-morning-brief, socratic-echo-loop) and clusters them by theme using local Gemma, then surfaces the top 3 recurring themes as a weekly tablet card. Reveals which unresolved questions keep returning week after week — the ones his subconscious actually cares about — so he can spot patterns instead of letting each morning's reflection evaporate.
Create ~/bin/socratic-theme-heatmap as a bash script. (1) Glob all Socratic question artifacts from ~/Tablet/socratic/, ~/.claude/cache/socratic-*.txt, and harvester output from last 14 days. (2) Pipe concatenated questions to gemma-task with prompt: 'Cluster these reflection questions into 3-5 themes. For each theme: name, count, representative question, trend (rising/steady/fading).' Expect JSON back. (3) Render result as a markdown card to ~/Tablet/socratic/weekly-heatmap-$(date +%Y-W%V).md with theme name, count bar (using block chars ▇▆▅), and the most resonant question per theme. (4) Add cron entry: '0 7 * * 1 ~/bin/socratic-theme-heatmap' (Monday 7am, lands on tablet before coffee). (5) Add bats test ~/bin/socratic-theme-heatmap.test.sh that mocks gemma-task output and asserts the weekly markdown file is created with all expected sections.
**Created:**
- `~/bin/socratic-theme-heatmap` (93 lines, executable) — globs Socratic question artifacts from `~/Tablet/.socratic/*.json` and `~/.claude/cache/socratic-*.{log,txt}` (last 14 days, dedup'd, filtered by date-in-line then mtime fallback), feeds them to local `gemma --json` with a clustering prompt, parses the returned themes, renders a markdown card with `▇/▆/▅` count bars (scaled to top theme), trend label, and the representative question per theme.
- `~/bin/socratic-theme-heatmap.test.sh` (executable bats suite, 4 tests, all green): file-created, content-shape, lookback-window filter, no-questions exit.
**Wired up:**
- Cron entry installed via safe-append: `0 7 * * 1 /home/ethan/bin/socratic-theme-heatmap >> /home/ethan/.claude/cache/socratic-theme-heatmap.cron.log 2>&1`
**Verified:**
- Bats: 4/4 pass (stub via `HEATMAP_GEMMA_BIN` env override).
- Live smoke run: collected 10 questions, real gemma clustered into 3 themes, wrote `~/Tablet/socratic/weekly-heatmap-2026-W21.md`.
**Env overrides for testability:** `HEATMAP_TABLET`, `HEATMAP_CACHE`, `HEATMAP_OUT_DIR`, `HEATMAP_GEMMA_BIN`, `HEATMAP_NOW`, `HEATMAP_LOOKBACK_DAYS`, `HEATMAP_LOG`.
**Note:** current live output is heavy on commit subjects (the reflection-harvester sidecars use git commit messages as "questions"). The heatmap surfaces whatever lives in those sources — if you want it weighted toward true journal questions, the sidecar harvester is where to filter, not here.