A card read "Shanghai · 30°C · Near Record hot · Low temp · 99th pct" while the
Day page for the same cell said 26°C, 66th pct, Above Normal. Both were right
about the climatology — the normals matched exactly — but the strip was grading
a reading from several days earlier and presenting it as current.
Two causes, both mine:
- load_cached_recent_forecast deliberately ignores how stale the file is, and
_grade_city took the newest row <= today with no age check at all.
- Nothing keeps that cache current for the tracked cities. warm_cities.py skips
any city whose archive is already cached, so it never re-fetches their forecast
bundle, and the notifier only touches subscribed cells. So "zero upstream
calls" was satisfied by reading a cache nothing refreshes.
Fixes:
- Drop readings older than MAX_OBSERVATION_AGE_DAYS (1) instead of ranking them.
Cities span a day of timezones, so a current observation can still be dated
yesterday in UTC — hence 1 rather than 0.
- Top up the stalest cells' recent/forecast each pass, oldest first and capped
(THERMOGRAPH_HOMEPAGE_REFRESH, default 40), the same shape as the notifier's
archive-fetch budget. This is a real change: the sweep is no longer zero-cost
upstream, because it cannot be and still say "right now". Documented in
DEPLOY.md, and refresh(fetch=0) keeps a strictly cache-only rebuild.
- Rank over the top THERMOGRAPH_HOMEPAGE_CITIES (250) rather than all ~1000. The
strip shows ~12 cards; a smaller genuinely-fresh set beats a large stale one.
- Show the observation date on a card when it isn't today's, so a yesterday
reading can't silently pass for current.