Skip to content

test(alarms): cover missing branches from alarm fixes - #779

Merged
ng merged 7 commits into
devfrom
test/pr766-codecov
Oct 5, 2026
Merged

ng merged 7 commits into
devfrom
test/pr766-codecov

Conversation

@ng

@ng ng commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • 250 focused tests pass.
  • Typecheck, ESLint, both Drizzle schema checks, and all 185 pre-push related tests pass.
  • Full suite: 4,977 passed, one skipped, one pre-existing failure in src/demo/tests/coverage.test.ts because the demo lacks system.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-update instead; it's on disk and opens WAN as its first step.

🔄 Already on a sleepypod (most common — review a PR on a running pod):

sudo sp-update test/pr766-codecov

🚀 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:

curl -fsSL https://raw.githubusercontent.com/sleepypod/core/2acb87881523536ef43e13b904e7710ca6980672/scripts/install \
  | sudo bash -s -- \
      --branch test/pr766-codecov \
      --artifact-url 'https://nightly.link/sleepypod/core/actions/runs/37367050613/sleepypod-core.zip'

🧊 Artifact: sleepypod-core · self-destructs in 30 days 💥

ng and others added 3 commits October 3, 2026 23:17
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]>
@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sleepypod-demo Ignored Ignored Preview Oct 5, 2026 8:28pm UTC

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cefd91e1-0f2a-4abe-802b-3e1cf7abb4b5
📥 Commits

Reviewing files that changed from the base of the PR and between 698a579 and 57af258.

📒 Files selected for processing (12)
  • .github/workflows/build.yml
  • docs/nats-frame-readers.md
  • src/components/Schedule/tests/AlarmSection.test.tsx
  • src/demo/handlers/system.ts
  • src/demo/tests/schedules.test.ts
  • src/hardware/tests/alarmPersistence.test.ts
  • src/hardware/tests/alarmState.test.ts
  • src/hardware/tests/gestureActionHandler.deps.test.ts
  • src/scheduler/tests/jobManager.test.ts
  • src/scheduler/tests/wakeWindow.test.ts
  • src/server/routers/system.ts
  • src/server/routers/tests/system.test.ts
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ng
ng enabled auto-merge October 5, 2026 04:09
@ng ng mentioned this pull request Oct 5, 2026
1 of 2 tasks
@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.95652% with 3 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/demo/handlers/system.ts 40.00% 2 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@ng

ng commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Scope: full branch at 853b3cda, with final integration verified at 2acb87881523536ef43e13b904e7710ca6980672, against dev.

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.

@ng
ng added this pull request to the merge queue Oct 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 5, 2026
@ng
ng added this pull request to the merge queue Oct 5, 2026
Merged via the queue into dev with commit 0e5d4c4 Oct 5, 2026
10 of 14 checks passed
@ng
ng deleted the test/pr766-codecov branch October 5, 2026 21:36
ng added a commit that referenced this pull request Oct 8, 2026
…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.
ng added a commit to ng/core that referenced this pull request Oct 10, 2026
## 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant