Repository navigation
Analytics (W3): bring #46 to main (one Rest on every surface, a Charge sheet that explains the stored Charge) - #48
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Carries #46 to
main. #46 merged intoreview/phase-2after #43 had already merged that branch into #42's, so #42 reachedmainwithout it. No new code: the three commits are #46's, unchanged.Repository.restByDayandrestScore(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.IntelligenceEngine.chargeDrivers(forDay:)). Otherwise it folds baselines as the engine does, over nights strictly before the day.Verification
review/phase-2merges intomainwith no conflicts, and the merged tree is byte-identical to3d97cd4b(Analytics (W3): one Rest on every surface, a Charge sheet that explains the stored Charge #46's head), which passed StrandTests 2,147 on 2026-10-08.Strandbuilds.NOOPiOSbuilds without the watch app; this Mac has no watchOS runtime.Refs #46