Repository navigation
feat(push): export sleep performance and consistency in protocol 1.1 - #2715
fearthedear wants to merge 2 commits into
Conversation
Co-authored-by: fearthedear <12115297+fearthedear@users.noreply.github.com>
Co-authored-by: fearthedear <12115297+fearthedear@users.noreply.github.com>
|
Approved the workflow runs, so Android CI has now run this and is green. I diffed
The zone differs in form only, and resolves the same: the UI path uses The day attribution is the one part with no counterpart to check against
It keys on One thing worth adding while the twin is freshThe formula matches today and nothing keeps it matching. A test that runs both implementations over the same session list and asserts equality costs very little and makes the copy self-policing, so the next edit to the UI formula fails here instead of silently exporting a different number than the screen shows. The rest reads well: holding protocol 1.0's field set fixed, preferring the imported series when the latest exported day has a point, and the 0 through 100 bound tests are each the right call. The Android-specific note in the body is fair given where the sender lives. |
Summary
Extends the existing Android self-hosted push protocol 1.1 proposal with two explicit nullable fields on
dailyMetric:sleepPerformanceandsleepConsistency.sleepPerformanceremains the exact matching source/daymetricSeries.sleep_performanceprojection.sleepConsistencyuses the matching source/day importedmetricSeries.sleep_consistencyseries when the latest exported day has an imported point. Otherwise it reproduces NOOP's existing Sleep-screen bedtime-onset score from same-source sessions: trailing up-to-14 onsets, edited onset respected, local wake-day attribution, population SD mapped with100 * (1 - SD / 120), and null until three sessions exist.metricSeriesstream is added.The consistency computation is Android-specific because the current self-hosted push sender is Android-first; the wire definition is documented for future platform senders.
Verification
git diff --checkpasses.