Repository navigation
fix(training): preview candidates safely and preserve Watch label gaps - #866
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 54 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Oct 24, 2026
ng
added a commit
that referenced
this pull request
Oct 30, 2026
…RV and breathing references, and schedule library (#878) Promotes `dev` to `main` with personal sleep-stage models, a heart-rate estimator that stops guessing on weak signal, beat-to-beat heartbeat detection, Watch HRV and breathing references, a schedule library, and the Next.js 16.4.3 security upgrade. ## Changes - Personal sleep-stage models: train off the pod from the phone's feature contracts, run them on the pod, keep several per side, upload a `candidate.json` from Settings, and stage a side's nights with its model when switched on. Includes MCP tools (#855, #857–#860, #864, #866). - Biometrics calibration on one page, with frozen dataset export and profile fitting on a laptop (#836, #837, #841). - Heart rate: windows scoring below `heart_rate.minimumPeakScore` (default 0.4) now report no heart rate instead of a guess. In local replay this cut Watch HR error from 5.2 to 1.75 bpm on tuning nights and from 4.3 to 3.1 bpm on held-back nights, at about 75% coverage (#840). - Beat-to-beat heartbeat detection in the piezo-processor, stored per minute in a new `heartbeats` table. Vitals are unchanged. Heartbeat retries now use bounded, ordered backoff (#848, #865). - Apple Watch references: import breathing rate and HRV (SDNN), add a pod-vs-Watch deviation report with night-by-night charts on the calibration page, render Watch-only nights, and archive pod biometrics off the pod for long-term comparison (#842, #844, #845, #847, #867). - Read-only analysis snapshot export (DB backup + RAW window) and MCP tool. Health export uploads are no longer truncated at 10 MB (#843, #839). - Schedule library with switchable curves, alarm snooze length with Snooze taper, and independent tap actions for normal and while-ringing (#835, #861, #849). - Storage: eMMC endurance card, RAM-only journal, and flash write insights with recording controls (#838, #854). - Surface the frzWater tank level and sensHealth cover disconnects, and register `sensHealth`, `frzWater` and `lps` as known record types (#872, #877). - Fix the internet access toggle after a reboot and the false "firewall rules missing" notice. Also fix false high TEC and slow fan warnings on an idle pod, and grant the service user journal read access (#856, #809, #801). - Security: upgrade Next.js to 16.4.3 for three advisories and require patched Node.js in development and pod installs (#870, #868). - Add the Europe/Bucharest timezone, update dependencies, fix the Renovate config, and kill surviving mutants (#874, #851, #853, #875, #852). ## Migrations - Configuration DB: schedule library, stale gesture alarm field cleanup, side stage models and the active model, and alarm snooze (0028–0034). - Biometrics DB: reference samples, heartbeats, and 0031 (0031–0033). ## Deploy note #840 bumps the biometrics manifest to 1.1.0. Profile revisions pinned to the old manifest will report `PROFILE_INCOMPATIBLE` and must be re-proposed against the new one. ## Test plan - [x] GitHub checks on the `dev` head (`1fbb953f`): CI, Build & Package, Dev Release, Publish OpenAPI Spec, Ref Collision Check. - [ ] After merge, wait for "Analyze & Release" on the `main` merge commit, then `sudo sp-update main` once on a pod and confirm the service starts and migrations apply. - [ ] Re-propose any active biometric profile against manifest 1.1.0 and confirm it applies. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
The personal-model training command stores a candidate with POST /sleep-stages/models and prints an inline-model preview. Selection requires --select (inactive) or --activate (active), after successful preview; conflicting flags are rejected. The README explains that the singular PUT replaces the selection, preserves activation, and archives both models.
Explicit unlabeled rows break Watch label segments even when the next labeled row has the same stage. Training PR sleepypod/training#11 vendors the reviewed helper byte-for-byte.
Validation: 66 script tests plus 3 subtests passed; the focused 9-test suite covers request methods/bodies, selection flags, failed preview, HTTP errors, command defaults, cleanup, and label gaps. Training-command line coverage is 98.9%; the changed label function is fully covered (the entire research helper is 19.1% in this focused suite). Both synthetic training parity pipelines pass. No model was uploaded or activated on a pod.
Mirror review: ng#34. Full review completed with no remaining findings. Merged through the dev queue.