Repository navigation
Conversation
…late in the evening after a DST change Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…urve can be reached Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…day when a step can't be read, read the day list beside the strain Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… even when it overtook a step still loading Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…at 0, so naps no longer read "Usual range 47m–25m" Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…history happens to be Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…closes the database Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test: step fixture days by calendar day so two tests pass late in the evening after a DST change
test: wait for a screen's first load by time, not by poll count
…rdown test: wait for a background reconnect's derive write before tearDown closes the database
Usual range: start a never-negative metric's band at 0, so naps no longer read "Usual range 47m–25m"
Day strain: add the day stepper, so an earlier day's strain-by-time curve can be reached
- No baseline: when the first 120 min hold no plausible HR or RMSSD the decoder abstains and the shipped labels stay, instead of every emission going neutral and a measured night decoding as wake. - Coverage: a 30 s epoch with no plausible HR or no RMSSD keeps its shipped label rather than taking the decoder's guess. - Sparse rows: observations are placed by clock second over the window (second i is sleepOnsetSec + i). Pairing rows by index skipped every night with a gap in the substrate, and would misalign one whose lengths happened to match. - Mixed-source nights: the accounting is recomputed from the final labels by segmentSleep's own definitions (observed seconds only, WASO between first and last sleep, efficiency over observed in-bed time); figures edge does not recompute are dropped rather than left describing the old labels. The night is tagged stager_source: hmm. A shipped-stager night is stored exactly as before. - Toggle: the field moves only once the pref write is accepted, then every day still on disk is re-derived through the same forced pass a sleep correction uses. - REM -> deep is an explicit hard forbid (-infinity, commented), and a decode with no finite path returns nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
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.
Summary
Fixes for abdulsaheel's review of OpenStrap#628 (comment), ready to merge into
feat/sleep-stage-plausibility. It also merges currentmain, which OpenStrap#628 needed._classifySleepStagesHMMreturns null and the shipped labels stay.withHypnoStagesrecomputes the accounting from the final labels usingsegmentSleep's own definitions: observed seconds only, WASO between first and last sleep,efficiency_pctover observed in-bed time. The stager's interval and awakening fields, which edge doesn't recompute, are dropped instead of describing the old labels. The night carriessleep.stager_source: 'hmm'.setSleepHmmStagesmoves the field only aftersetBoolreturns true, and returns whether it saved.iissleepOnsetSec + i). Before, a night with any gap in the substrate failed thelength ==check and was silently never re-staged. A night whose lengths happened to match would have been misaligned._reanalyzeForOverride) runs over every day still on disk.log(0)double.negativeInfinity, commented as an intentional hard forbid. A decode with no finite path returns nothing, so the caller keeps the shipped labels.With the switch off, nothing changes:
stager_sourceis only written on a night the HMM actually staged, so default users' stored nights are byte-for-byte as before. NokAlgoVersionbump is needed for that path.Testing
Six new tests in
test/sleep_cycle_continuity_test.dart(PR #628 reviewgroup):tst / observed, taggedhmm. Fails on the current branch head.Also run:
whoop_freeze_golden_test, the pipeline, sleep and settings suites,settings_audit_guard_test,ui2_gallery_test. All pass.flutter analyze: no issues in tracked files.Risks and rollback
stager_sourcemakes that visible, but it can't be undone without raw data. Stopping it would need the HMM to write to a separate series rather than the immutableday_result.reanalyzingwhile it runs, so the Re-analyze button shows its spinner during that pass.Checklist
🤖 Generated with Claude Code