fix: restore live-decode regressions guards#15
Open
abdulsaheel wants to merge 2 commits into
Open
Conversation
Three uncommitted tweaks had crept in without justification or test coverage; reverted all three back to known-good behavior and left a comment at each site so they don't get silently re-applied: - wristOn: skinContact>50 broke the parity suite (2906/2934, all 28 misses on wrist_on) — 28 real v24 records show hr=87-97 (clearly worn) with skinContact<=50, proving skinContact is contact quality, not wear, exactly as already documented. Back to hr>0, which matches the oracle on every case. - parseRealtimeHr's RR sanity clamp (200-2500ms = 24-300bpm) had been relaxed to `v>0`, letting corrupted/out-of-range timing values straight into live RR with no guard. - _r10Motion's detrend window had been widened 9->25 with nothing backing it; ±25 approaches the 7-40 sample autocorrelation lag range it feeds, risking attenuation of genuine step periodicity. No test (parity or otherwise) exercises steps_inc/activity from R10, so there was no way to validate the change either way. dart test: 71/71 passing, including the full 2934-case parity suite.
Was the original reference the Dart decoders were ported from and kept in parity with (7 commits, right up through the latest feature work), not a one-off leftover — but decode_parity_cases.json is now the frozen, self-contained oracle dart test actually runs against, with no runtime dependency on ts/ (verified: no test/config spawns node/tsc against it). Drops the unported v25-handling WIP that was sitting in ts/live.ts uncommitted; that work is not carried over to live.dart.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
💤 Files with no reviewable changes (3)
📝 WalkthroughWalkthroughThe change documents retained realtime RR validation and live motion/contact-decoding behavior in Dart. It also removes the TypeScript live decoder, Type-24 record parser, and associated decoder test script. ChangesDecoder cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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.
Summary
parseRealtimeHr's RR sanity clamp restored to200-2500ms(24-300bpm) — a relaxation tov>0let corrupted/out-of-range timing values straight into live RR with no guard._r10Motion's detrend window restored to9— a widen to25had no test coverage and risked attenuating genuine step periodicity (the autocorrelation lag range it feeds is 7-40 samples).wristOnrestored tohr>0—skinContact>50broke the 2934-case parity suite (28 misses, all false-negative "not worn");skinContactis contact quality, not wear, exactly as already documented, and the fixture proves it (28 real v24 records with hr=87-97 clearly worn, skinContact<=50).ts/(the TypeScript reference implementation) — superseded by the frozendecode_parity_cases.jsonoracle, whichdart testalready runs against with no runtime dependency onts/.Test plan
dart test— 71/71 passing, including the full 2934-case parity suite.(Re-opened as a fresh branch/PR — the prior PR #14 covering this same work was closed without merging.)
Summary by CodeRabbit
Refactor
Chores