Repository navigation
test(hooks): kill useSensorStream surviving mutants (#591 hit list) - #776
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]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe demo system handler now returns sensor-source firmware and stream metadata. The sensor-stream test suite adds WebSocket mock support and coverage for snapshot timestamps, waveform requests, demo-socket selection, and seek behavior. ChangesDemo sensor source
Sensor-stream hook tests
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Other Merge Risk: ⚪ Minimal · up to The existing test covers stale replies after go-live, and the new demo sensor-source response fits the Device settings contract. No actionable merge-blocking issue remains. Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to The new response supplies simulated diagnostics within demo mode. It does not contact a real device, change access controls, or modify persistent state. No material security risk was identified in the reviewed changes. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
Mutation test report
Full HTML reports: |
…ettings → Device UI Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
Scope: full branch at Standard-depth adversarial review complete: independent Optimizer followed by Skeptic, using the inherited GPT-6 runtime because the skill’s legacy models are unavailable. Reviewed both the hook regression tests and demo No actionable introduced findings. Skeptic agrees with confidence 94/100. No consensus fixes, disputed items, lower-confidence findings, or pre-existing findings retained. Exact-head CI lint, typecheck, both builds and unit tests passed. Locally, 84 hook tests and the demo coverage/contract tests passed. Required |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Integration follow-up at 219 focused integration tests, TypeScript and ESLint pass. Pre-push checks also passed both Drizzle schema checks and 433 related tests. New-head CI is pending; merge remains gated on those checks. |
Summary
Weekly mutation hit list (#591, scheduled run 37119263099, commit
3cbbc1b):src/hooks/useSensorStream.tswas the top surviving file with 38 mutants. This PR adds 11 tests that kill the 23 actionable ones. No source changes.>=→>, cond →false(snapshot frame replaces previous)filterremoved, arrow → undefined, cond true/false,!==→===,* 1000→/ 1000)lastSensorTimeis newest non-deviceStatus measurement in ms; deviceStatus-only snapshot leaves it nullMath.max→Math.min<→<=sliceremoved,filterremoved, cond → true,>=→>)=== '1'→ false /'1'→""NEXT_PUBLIC_DEMO === '1'(module mock)""+= 1→-= 1++→--'get_waveform'→""true+= 1→-= 1isSeeking: false→trueEach mutation was hand-applied locally and confirmed to fail the suite (23/23).
The useSensorStream artifact reports 263 killed, 15 surviving, 1 uncovered, 1 timeout, and 114 compile-error mutants (plus 12 ignored). The remaining survivors are outside the targeted behavioral changes or the previously identified equivalent cases; this PR does not claim a perfect mutation score.
Test plan
pnpm exec vitest run src/hooks/tests/useSensorStream.test.ts— 84 passedeslintclean on the test file🤖 Generated with Claude Code
🛏️ 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/useSensorStream-mutants-591/scripts/install \ | sudo bash -s -- --branch test/useSensorStream-mutants-591🎯 Pin to this exact build (run 37405779525 ·
78de3b3) — fresh-pod path, locked to one CI artifact for reproducible review:🧊 Artifact:
sleepypod-core· self-destructs in 30 days 💥Summary by CodeRabbit