fix(daily): serve the briefing as it stands today on every surface

Only the digest applied briefingForToday. The dashboard snapshot (the
web dashboard, its server prefetch and the iOS cold-launch read) and
the /insights advisor payload still served an earlier day's text and
the raw model deltas ("+33.72 bpm").

The snapshot read now resolves the briefing after the cache, beside
the capability decision, from the payload's generation moment and the
snapshot's own newest reading per type; a withheld briefing reads
"preparing", never "ready" with nothing in it. The digest takes the
resolved briefing from that read on its own clock instead of resolving
again. The advisor route resolves dailyBriefing on every branch it
returns, reading the newest reading per signal type in one grouped
query only when a reading-backed signal is present; text generated on
an earlier day no longer counts as fresh on the read GET (so the warm
is enqueued) and no longer short-circuits a provider-backed POST.

The OpenAPI descriptions of both advisor responses say so.
This commit is contained in:
Marc-André Bombeck committed 2026-10-05 22:03:58 +02:00
1 parent 491d542f58
commit f6b0131731
10 files changed
+462 -91

No files matched your search

+10 -4
View File
@@ -57957,9 +57957,12 @@ components:
type: string
additionalProperties: {}
- type: "null"
description: The cached insight payload, verbatim from the account's cache row. Null when nothing is cached or the
stored row failed to parse — the two are indistinguishable here, and the second also silently enqueues a
repair.
description: "The cached insight payload from the account's cache row, with its `dailyBriefing` resolved for today: null
when the text was generated on an earlier calendar day in the account's timezone (or carries no
`briefingGeneratedAt`, the moment it was generated), otherwise without the signals of the day whose
reading-backed metric has no reading today, and with each signal delta at its metric's display precision in
the reader's number format. Null when nothing is cached or the stored row failed to parse — the two are
indistinguishable here, and the second also silently enqueues a repair."
cached:
type: boolean
description: True when a payload was served from the cache.
@@ -58037,7 +58040,10 @@ components:
propertyNames:
type: string
additionalProperties: {}
description: The insight payload, fresh or cached depending on `cached`.
description: "The insight payload, fresh or cached depending on `cached`, with its `dailyBriefing` resolved for today
exactly as on the read GET. A cached briefing generated on an earlier calendar day never short-circuits an
account with a provider: like a briefingless cache, it regenerates, and degrades to the cached payload on an
exhausted quota."
cached:
type: boolean
cachedAt: