overreaching_conjunction: guard against quantized rhr dispersion - #73
Conversation
…sion alternating whole-bpm rhr baselines (e.g 58/59) give a small nonzero mad that isn't real dispersion, just rounding noise. illness_cusum, readiness and event_detection already guard this exact channel with dispersionBelowQuantum, this one didn't, so a 1bpm rise could clear the gate and fire the conjunction card on nothing.
There was a problem hiding this comment.
Sorry @abdulsaheel, you've used your own review budget of 250,000 diff characters for the last 7 days.
You can request another review in 6 days and 6 hours by commenting @sourcery-ai review. Upgrade to get a review now.
|
Warning Review limit reachedNext included review available in 35 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
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 |
Reviewer's GuideThe PR adds a 1 bpm dispersionBelowQuantum guard to overreaching_conjunction’s RHR gate, preventing false-positive conjunction cards from alternating whole-bpm baselines while retaining behavior for genuinely dispersed baselines. Regression tests cover both abstention and normal firing. Flow diagram for quantized RHR dispersion guardflowchart TD
A["RHR baseline window"] --> B["robustBaseline"]
B --> C["dispersionBelowQuantum(rhrBaselineWindow, 1.0)"]
C -->|true| D["gate = null"]
C -->|false| E["gate = 0.5 * scale"]
D --> F["Metric.absent"]
E --> G{"centre, gate, and base.sufficient valid?"}
G -->|no| F
G -->|yes| H["OverreachingConjunction metric"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
alternating whole-bpm rhr baselines (58/59 type) give a small nonzero mad, not real dispersion, just rounding noise. illness_cusum, readiness_composite, and event_detection already guard this exact rhr channel with dispersionBelowQuantum. overreaching_conjunction never got the same guard, so a 1bpm rise on the elevated nights could clear a ~0.25-0.5bpm gate and fire the "both facts point the same way" card on nothing.
fix mirrors event_detection's inline style: dispersionBelowQuantum(rhrBaselineWindow, 1.0) folded into the existing absent path, no new abstraction.
added a regression test: alternating 58/59 baseline abstains, real-dispersion baseline still fires normally.
Summary by Sourcery
Guard overreaching conjunction detection against false positives from unresolvable whole-bpm resting-heart-rate dispersion.
Bug Fixes:
Tests: