Repository navigation
fix(biometrics): register sensHealth, frzWater, and lps as known record types - #872
Conversation
|
@onemec is attempting to deploy a commit to the therealng's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Register dialect record types modules/common/dialect.py, modules/common/test_dialect.py |
The known-type registry and its test now include sensHealth, frzWater, lps, tap-gesture, and alarm-info. |
Define TypeScript sensor frame types src/hooks/useSensorStream.ts, src/demo/sensorFrames.ts |
The stream type definitions include FrzWaterFrame and SensHealthFrame. Sensor lists and the SensorFrame union include frzWater and sensHealth. |
Recognize types in subscriptions src/streaming/piezoStream.ts, src/streaming/tests/piezoStream.test.ts |
The stream recognizes frzWater and sensHealth. The test checks subscription acknowledgements, frame delivery, and warning behavior for both types. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: ng
Merge Risk: 
Minimal · up to 02eee
-
The new types are recognized and can reach subscribers on the inspected paths. No merge-blocking issue is established.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title accurately describes the core change: registering sensor record types as known types. It names three affected types and remains concise, although it does not mention
tap-gesture,alarm-info, or the TypeScript updates.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 6 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · 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.
Comment @coderabbitai help to get the list of available commands.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Future Feature OpportunitiesBy registering and typing Keeping this PR strictly scoped to type registration and log-warning suppression (
|
Summary
Following recent STM32 microcontroller firmware upgrades (cover sensor STM32G0 to
v5.5.22.0and freezer thermal controller STM32 tov1.6.114), the firmware emits three telemetry record types over NATS JetStream:sensHealth: Cover sensor health and link connectivity (left.connected,right.connected,version: 1).frzWater: Water level, capacitive reading, and priming status (isPriming,hasWater,capValid,capLevel,needsPriming).lps: Linear Pressure Sensor raw load-cell samples (200 Hz binary waveform buffers).In
modules/common/dialect.py,KNOWN_RECORD_TYPESis an allowlist intended to surface genuinely unknown firmware types once on startup while quietly ignoring known telemetry belonging to other subsystems. Because these types were missing,sleep-detector(and other biometrics daemons) logged startup warnings for each type.Additionally, in the TypeScript WebSocket streaming server (
src/streaming/piezoStream.ts),ALL_SENSOR_TYPESflaggedfrzWaterandsensHealthwith[sensorStream] unknown sensor frame type ....This PR:
"sensHealth","frzWater","lps","tap-gesture", and"alarm-info"toKNOWN_RECORD_TYPESinmodules/common/dialect.py.modules/common/test_dialect.pyto assert these types are recognized.'frzWater'and'sensHealth'toALL_SENSOR_TYPESinsrc/streaming/piezoStream.ts,src/hooks/useSensorStream.ts, andsrc/demo/sensorFrames.ts.FrzWaterFrameandSensHealthFrameTypeScript interfaces, added to theSensorFrameunion.src/streaming/tests/piezoStream.test.tsverifying subscriptions tofrzWaterandsensHealthfunction cleanly without unknown-type warnings.Verification
Automated Tests
modules/common:Live Hardware Verification (Pod 3 Hub)
Tested live on a physical Pod 3 Hub (MediaTek MT8365 Pumpkin, running frankenfirmware
3c552d6, cover sensorv5.5.22.0, thermal controllerv1.6.114).Before (startup warnings in systemd journal):
journalctl -u sleepypod-sleep-detector:journalctl -u sleepypod(Next.js server):After (updated
dialect.pydeployed to/opt/sleepypod/modules/common/dialect.pyand services restarted):journalctl -u sleepypod-sleep-detector -b --since "1 minute ago":systemctl status sleepypod-sleep-detector:All three daemons (
sleepypod-sleep-detector,sleepypod-piezo-processor,sleepypod-environment-monitor) ingest frames cleanly with zero unknown record warnings.Summary by CodeRabbit
frzWaterandsensHealthsensor data.lps,tap-gesture, andalarm-info.