climate: stop dropping the current day from the Open-Meteo bundle #92

Merged
admin_emi merged 1 commit from fix/recent-current-day into dev 2026-07-25 16:56:23 +00:00
Owner

Fixes the bug reported in #bug-reports ("Unable to select today's data"): the current day is missing from the daily strip on both beta and prod. Reporter's screenshot shows the columns running Wed 22/07, Thu 23/07, Fri 24/07, Sun 26/07, … — the 25th skipped entirely. A hole in the middle, not a stale tail.

Cause

_fetch_recent_forecast_om excluded the cell's in-progress local day, added yesterday in "Drop the in-progress local day from the Open-Meteo recent/forecast fallback". The stated premise was that Open-Meteo's daily high/low for today aggregates only the hours elapsed so far, so grading it would read a still-unfolding day as complete.

That premise holds for MET Norway — its series genuinely starts mid-day, and the diurnal-coverage gate in _metno_to_frame (#63) is the correct fix for it. It does not hold for the Open-Meteo forecast endpoint, which backfills the rest of today from the model run. The guard was generalised across by analogy and never checked against the API.

Evidence

Live API, exact request the code makes, four cells between 01:00 and 19:00 local. The reported daily max always equals the max over all 24 hourly values, and diverges from the elapsed-hours-only max wherever the day still has hours left:

cell local now daily max full-24h hourly max elapsed-only max
Los Angeles 09:16 93.9F 93.9F 76.1F
Tokyo 01:16 89.5F 89.5F 76.4F
Sydney 02:16 62.2F 62.2F 52.6F
London 17:13 84.9F 84.9F

Los Angeles is the decisive one: 10 hours elapsed, and the value reported is the whole-day 93.9F, not the 76.1F the morning had reached.

FORECAST_DAYS = 8 is commented "today + 7 days ahead", which the drop directly contradicted — the window returned 25 past + 7 forward with a gap where today belonged.

Blast radius on prod

date        cells
2026-07-24   916
2026-07-25   143   <-- today
2026-07-26   999

861 of 1004 cells had lost the 25th. Splitting by sync time: every cell synced today (00:04–14:16 UTC) has the hole; the 143 that still had today are stale caches synced before the change landed. As their 4h TTL expired, today was disappearing fleet-wide.

Change

Today is kept unconditionally. A day that truly cannot be graded — no high/low returned — is already dropped upstream by _to_frame (there is a test asserting exactly that), so no separate guard is needed here and _om_local_today has no remaining caller.

The MET Norway coverage gate is deliberately left alone: it is correct, and that path genuinely lacks whole-day coverage for today.

Also drops a verbatim duplicate of both Open-Meteo day-window tests that the main-into-dev reconciliation (#91) left in the file — the second copy shadowed the first, so only one of each was ever running.

Verification

  • make test — 429 passed, 8 skipped.
  • Fixed path exercised against the live API: contiguous 33-day windows (2026-06-30 → 2026-08-01, span 33, no gap) with today present at all three cells checked, carrying whole-day values (LA 93.9F).
Fixes the bug reported in #bug-reports ("Unable to select today's data"): the current day is missing from the daily strip on both beta and prod. Reporter's screenshot shows the columns running `Wed 22/07, Thu 23/07, Fri 24/07, Sun 26/07, …` — the 25th skipped entirely. A hole in the middle, not a stale tail. ## Cause `_fetch_recent_forecast_om` excluded the cell's in-progress *local* day, added yesterday in "Drop the in-progress local day from the Open-Meteo recent/forecast fallback". The stated premise was that Open-Meteo's daily high/low for today aggregates only the hours elapsed so far, so grading it would read a still-unfolding day as complete. That premise holds for **MET Norway** — its series genuinely starts mid-day, and the diurnal-coverage gate in `_metno_to_frame` (#63) is the correct fix for it. It does **not** hold for the Open-Meteo forecast endpoint, which backfills the rest of today from the model run. The guard was generalised across by analogy and never checked against the API. ## Evidence Live API, exact request the code makes, four cells between 01:00 and 19:00 local. The reported daily max always equals the max over all 24 hourly values, and diverges from the elapsed-hours-only max wherever the day still has hours left: | cell | local now | daily max | full-24h hourly max | elapsed-only max | |---|---|---|---|---| | Los Angeles | 09:16 | **93.9F** | 93.9F | 76.1F | | Tokyo | 01:16 | **89.5F** | 89.5F | 76.4F | | Sydney | 02:16 | **62.2F** | 62.2F | 52.6F | | London | 17:13 | **84.9F** | 84.9F | — | Los Angeles is the decisive one: 10 hours elapsed, and the value reported is the whole-day 93.9F, not the 76.1F the morning had reached. `FORECAST_DAYS = 8` is commented "today + 7 days ahead", which the drop directly contradicted — the window returned 25 past + 7 forward with a gap where today belonged. ## Blast radius on prod date cells 2026-07-24 916 2026-07-25 143 <-- today 2026-07-26 999 861 of 1004 cells had lost the 25th. Splitting by sync time: every cell synced today (00:04–14:16 UTC) has the hole; the 143 that still had today are stale caches synced before the change landed. As their 4h TTL expired, today was disappearing fleet-wide. ## Change Today is kept unconditionally. A day that truly cannot be graded — no high/low returned — is already dropped upstream by `_to_frame` (there is a test asserting exactly that), so no separate guard is needed here and `_om_local_today` has no remaining caller. The MET Norway coverage gate is deliberately left alone: it is correct, and that path genuinely lacks whole-day coverage for today. Also drops a verbatim duplicate of both Open-Meteo day-window tests that the main-into-dev reconciliation (#91) left in the file — the second copy shadowed the first, so only one of each was ever running. ## Verification - `make test` — 429 passed, 8 skipped. - Fixed path exercised against the live API: contiguous 33-day windows (2026-06-30 → 2026-08-01, span 33, no gap) with today present at all three cells checked, carrying whole-day values (LA 93.9F).
admin_emi added 1 commit 2026-07-25 16:23:30 +00:00
climate: stop dropping the current day from the Open-Meteo bundle
All checks were successful
shell-lint / shellcheck (pull_request) Successful in 11s
PR build (required check) / validate-observability (pull_request) Has been skipped
PR build (required check) / gate (pull_request) Successful in 2s
secrets-guard / encrypted (pull_request) Successful in 7s
PR build (required check) / changes (pull_request) Successful in 12s
PR build (required check) / build-frontend (pull_request) Has been skipped
PR build (required check) / build-backend (pull_request) Successful in 50s
b1e0218147
The recent+forecast bundle excluded the cell's in-progress local day, on the
premise that Open-Meteo's daily high/low for today aggregates only the hours
elapsed so far. That is true of the MET Norway series -- which starts mid-day
and is correctly gated on diurnal coverage in _metno_to_frame -- but not of the
forecast endpoint, which backfills the rest of today from the model run. The
guard was generalised across by analogy and never verified against the API.

Checked against the live API at four cells between 01:00 and 19:00 local: the
reported daily max always equals the max over all 24 hourly values, and differs
from the elapsed-hours-only max whenever the day has hours left. Los Angeles at
09:16 local reported 93.9F -- the whole-day figure -- where the hours so far
topped out at 76.1F.

The cost was a hole in the middle of every freshly-synced cell's window: a
complete yesterday, no today, a forecast tomorrow, which the daily strip renders
as a missing column. 861 of 1004 prod cells had lost the 25th by the time this
was diagnosed; the 143 that still had it were stale caches predating the change.
FORECAST_DAYS is commented "today + 7 days ahead", which the drop contradicted.

Today is kept unconditionally now. A day that truly cannot be graded, because it
came back with no high/low, is already dropped upstream by _to_frame, so the
local-today helper has no remaining caller and goes with it.

Also removes a verbatim duplicate of both Open-Meteo day-window tests, which the
main-into-dev reconciliation left in the file (the second copy shadowed the
first, so only one of each was ever running).
admin_emi merged commit d4a00099f2 into dev 2026-07-25 16:56:23 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Jinemi/thermograph#92
No description provided.