Skip to content

Analytics (W3): bring #46 to main (one Rest on every surface, a Charge sheet that explains the stored Charge) - #48

Merged
ayiskakov merged 4 commits into
mainfrom
review/phase-2
Oct 9, 2026
Merged

ayiskakov merged 4 commits into
mainfrom
review/phase-2

Conversation

@ayiskakov

Copy link
Copy Markdown
Owner

Carries #46 to main. #46 merged into review/phase-2 after #43 had already merged that branch into #42's, so #42 reached main without it. No new code: the three commits are #46's, unchanged.

  • W03-028 (S2): Rest is one number on every surface. Repository.restByDay and restScore(forDay:) resolve it from the same three layers as Today's series, for the Sleep tab hero, the Sleep performance series, Coupled and the Weekly Digest.
  • W03-030 (S2): the Charge "What shaped it" sheet shows the drivers the stored Charge was scored with (IntelligenceEngine.chargeDrivers(forDay:)). Otherwise it folds baselines as the engine does, over nights strictly before the day.
  • Docs: pass 4 reproduces W03-023 and W03-024 on the 2026-09-30 backup.

Verification

Refs #46

ayiskakov and others added 4 commits October 8, 2026 10:26
The engine stores sleep_performance with the wearer's personal need and
sleep consistency, and Today reads that stored series. The Sleep tab
hero, the Sleep performance series, Coupled and the Weekly Digest each
recomputed Rest.composite(daily:) with the defaults (8 h need, neutral
consistency), while their comments said they matched Today. Any wearer
with three nights of history saw two Rest scores for one night.

Repository.restByDay is built at each refresh from the three layers
Today's exploreSeries uses (imported, stored, then the ryanbr#614
placeholder), and restScore(forDay:) is the one resolver the four
surfaces read. A test pins the map to Today's series.
…ored with (W03-030)

Since efa0bdc the engine scores each day's Charge against the nights
strictly before it. Today's and Coupled's "What shaped it" sheet folded
the baselines over the whole visible history instead, including the
scored night and every later one, and without the Charge-wide epoch on
resting HR and respiration, so its rows explained a different Charge
than the one on screen.

The sheet now shows the drivers the engine scored the day with when it
still holds them (the rows the Intelligence screen shows), and
otherwise folds as the engine does: nights before the day, with the
same epochs.
Analytics (W3): one Rest on every surface, a Charge sheet that explains the stored Charge
@ayiskakov
ayiskakov merged commit aa0ed39 into main Oct 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant