Repository navigation
test(alarms): cover missing branches from alarm fixes - #779
Conversation
The Settings → Device card polls system.getSensorSource every 10 s, and each poll spawned systemctl three times plus mountpoint and read two files to re-detect firmware that cannot change while the core is running. Memoize the probe for the process lifetime and keep only the stream fields live; a service restart re-detects. Co-Authored-By: Claude Fable 5.1 <[email protected]>
… source A probe killed by its 3 s timeout says nothing about the firmware, so it is served once but not memoized (CodeRabbit on #770). The demo coverage test has been red on dev since #765 and #769 landed together because no demo handler answered system.getSensorSource. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
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 13 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (12)
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❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Scope: full branch at Full-depth adversarial review (build workflow change): two independent Optimizers followed by two independent Skeptics, using the inherited GPT-6 runtime because the skill’s legacy models are unavailable. No cross-provider comparison was requested. No actionable introduced findings. Both Skeptics agree (90–95% confidence). Build-time in-memory database settings are confined to the build step; alarm regressions and test cleanup match the production paths. No consensus source fixes, disputed findings, lower-confidence findings or pre-existing blockers retained. Integrated #770 and retained its demo sensor handler exactly, removing the duplicate that a clean Git merge would otherwise create. Independent post-integration review verified all four imported files against #770 and the remaining eight #779 files against the reviewed head. Verification: 262 tests, typecheck and lint passed before integration; 330 focused tests, typecheck and lint passed afterward. Pre-push validation passed both Drizzle schema checks and 433 related tests. The original head’s source build passed; fresh final-head CI is pending. Recommendation: approve contingent on required checks and final feedback state. No device deployment performed. |
…tions, 3D temperature Stage and experimental Base (#783) Promote `dev` to `main`: power-off and alarm fixes, hardware recovery and diagnostics, a 24-hour time option, keeping temperature after a schedule ends, a 3D temperature Stage, hosted demo mode, and experimental adjustable-base controls. OFF now clears the side's active firmware timer before resetting its temperature level, and reports a failure if the timer cannot be cleared (#713). This addresses the hub continuing to regulate after OFF. ## Release scope - **Alarms:** fix snooze, the wake window and warm-up (#766, #779). A snooze is no longer lost when the firmware write that confirms a tap fails (#790). - **Hardware:** DAC connections recover after firmware restarts (#782); pump stalls are no longer reported falsely during startup (#786); the installer separates socket discovery from hardware identity (#785). - **Settings:** a pod-wide 12-hour / 24-hour time format, used by every clock, chart and time editor (#788). Solo bed setup is now separate from partner away mode (#767). - **Schedules:** "After schedule ends" can keep the final temperature instead of turning the Pod off. There is a device default and a per-curve choice, and the setting is available over REST/tRPC and MCP (#789). - **Temperature:** a 3D thermal bed, a temperature Stage view and a sweep-mode piezo waveform (#787). - **Performance and diagnostics:** piezo vitals are suppressed while the bed reads empty; the temperature controller does less work; the firmware probe is cached; V8 and native memory counters are reported (#768, #772, #770, #773). - **Demo:** a hosted demo mode (#765, #781). - **Base (experimental):** controls, presets, schedules and a 3D bed view with a 2D fallback (#780, #784). Physical movement is unverified, and independent per-side movement stays locked until the firmware is validated. - **Tests:** coverage for the Stage, ThermalBed, Base and piezo views (#790), plus automation and sensor-stream tests. **Database migrations:** - `0017_majestic_enchantress` - `0018_amazing_captain_marvel` - `0019_closed_psynapse` - `0020_mature_puff_adder`: schedule end action, which defaults to `turn_off` - `0021_device_time_format`: `time_format`, which defaults to `12h` The iOS companion change for end actions is sleepypod/ios#51. It should be merged after this deploy.
## Summary sleepypod#769 added `system.getSensorSource` (used by `SensorSourceCard`) but no demo handler, so `src/demo/tests/coverage.test.ts` fails on `dev` and blocks every PR (e.g. sleepypod#779, the sleepypod#768 merge-queue run). Adds a demo handler that reports NATS firmware with a fresh piezo frame, reusing `FIRMWARE_LABELS` and `DEMO_UPTIME_START`. ## Test plan - [x] `vitest run src/demo` — 77 passed (coverage + contract tests) - [ ] CI green 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Adds 21 behavioral tests for the coverage gaps reported on #766: gesture alarm wiring, alarm persistence/state failures, wake-window polling and callbacks, overlapping alarm warm-ups, alarm-card details, and demo schedule defaults.
The local coverage audit finds no uncovered changed statements or branches in the seven files flagged by Codecov. Production code is unchanged.
Validation:
src/demo/tests/coverage.test.tsbecause the demo lackssystem.getSensorSource.Coverage report: #766 (comment)
🛏️ Beam this PR onto a sleepypod ✨
Pick the snippet that matches your pod. Already-installed pods can't use the curl bootstraps below — sleepypod's egress firewall DROPs github.com, and the script that knows how to unblock WAN is the very file curl is trying to fetch. Use
sp-updateinstead; it's on disk and opens WAN as its first step.🔄 Already on a sleepypod (most common — review a PR on a running pod):
🚀 Fresh pod / first install — bootstraps from GitHub, rebuilds every push:
curl -fsSL https://raw.githubusercontent.com/sleepypod/core/test/pr766-codecov/scripts/install \ | sudo bash -s -- --branch test/pr766-codecov🎯 Pin to this exact build (run 37367050613 ·
2acb878) — fresh-pod path, locked to one CI artifact for reproducible review:🧊 Artifact:
sleepypod-core· self-destructs in 30 days 💥