thermograph/templates
Emi Griffith 63ba5ab44e Stop the records strip showing stale readings as "right now" (#185)
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.
2026-07-18 08:58:34 +00:00
..
about.html.j2 Give climate/city/record pages full header parity + working °F/°C (#124) 2026-07-16 17:48:30 +00:00
base.html.j2 Rebuild the homepage as a distribution landing; add an SMTP seam (#178) 2026-07-18 07:39:47 +00:00
city.html.j2 Give climate/city/record pages full header parity + working °F/°C (#124) 2026-07-16 17:48:30 +00:00
glossary.html.j2 SEO: crawlable programmatic climate pages + technical hygiene (#96) 2026-07-15 23:53:11 +00:00
glossary_term.html.j2 SEO: crawlable programmatic climate pages + technical hygiene (#96) 2026-07-15 23:53:11 +00:00
home.html.j2 Stop the records strip showing stale readings as "right now" (#185) 2026-07-18 08:58:34 +00:00
hub.html.j2 Climate hub: client-side search + alphabetical results (#110) 2026-07-16 04:44:18 +00:00
month.html.j2 Mobile hamburger nav; crisp SVG logo; month travel-note callout (#117) 2026-07-16 05:42:59 +00:00
privacy.html.j2 Rebuild the homepage as a distribution landing; add an SMTP seam (#178) 2026-07-18 07:39:47 +00:00
records.html.j2 Give climate/city/record pages full header parity + working °F/°C (#124) 2026-07-16 17:48:30 +00:00