crossday: guard glassbox SWC gate against quantized rhr/temp - #441
Conversation
analytics#75 added GlassBoxInput.quantum to guard the SWC 'worth mentioning' gate against quantized baselines (same fix #73 already made to overreaching_conjunction on this same rhr channel). repin + wire quantum:1 on the rhr and temp _glassInput calls, matching readiness_composite's quantum:1 on the same two channels. no kAlgoVersion bump: this only changes whether a driver gets NAMED in glassBoxReadiness's deprecated narrative, not the score.
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 5 hours by commenting @sourcery-ai review. Upgrade to get a review now.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR prevents deprecated glassbox narrative drivers for rhr and temperature when baseline dispersion is only quantization noise by passing quantum 1 through crossday_pipeline and pinning the compatible analytics implementation; the headline readiness score and algorithm version remain unchanged. Sequence diagram for quantization-gated glassbox driverssequenceDiagram
participant Pipeline as crossday_pipeline
participant Input as _glassInput
participant Glassbox as glassBoxReadiness
participant Driver as NarrativeDriver
Pipeline->>Input: _glassInput('rhr', ..., quantum: 1)
Pipeline->>Input: _glassInput('temp', ..., quantum: 1)
Input->>Glassbox: GlassBoxInput(quantum: 1)
Glassbox->>Glassbox: dispersionBelowQuantum
alt quantization noise
Glassbox-->>Driver: skip rhr/temp driver
else meaningful dispersion
Glassbox-->>Driver: name narrative driver
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Review limit reachedNext included review available in 18 minutes. View limit detailsLimit details: You’ve used all 4 included reviews 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: Repository: OpenStrap/edge/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: OpenStrap/edge/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe analytics dependency is repinned to support ChangesGlassBox quantum support
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 51f6bd7 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 385675d
Suggestions up to commit c1d54dc
Suggestions up to commit 4e330d4
|
skin_temp_z is already a z-score (onehz_pipeline's skinTempZ, computed against the raw-ADC baseline with its own quantum:1 guard on that raw dispersion before the z exists) -- continuous, not integer-quantized. Applying quantum:1 again here stood the units up wrong, unlike readiness_composite's tempInput which genuinely gets the raw ADC mean. rhr stays quantum:1 (it's whole-bpm raw). caught by review on #441.
Standalone PR ReviewPR-Agent could not safely update the persistent review. This standalone result will not replace the canonical review. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
updated kAnalyticsPin/pubspec ref from the branch-head pin to the merged main sha now that analytics#75 landed. also bumping kAlgoVersion since this changes the stored readiness_glassbox drivers list for real users, even though it's narrative-only not a headline score change - caught by db_serve_version_and_reads_test's pin/version consistency check.
Standalone PR ReviewPR-Agent could not safely update the persistent review. This standalone result will not replace the canonical review. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Standalone PR ReviewPR-Agent could not safely update the persistent review. This standalone result will not replace the canonical review. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
readiness_composite and overreaching_conjunction both already skip naming a driver when the baseline's dispersion is below the input's own measurement quantum (whole-bpm rhr, integer-adc temp). glassBoxReadiness did the same 0.5*scale check on the same two channels crossday_pipeline wires in (
_glassInput('rhr', ...),_glassInput('temp', ...)) but never got that guard, so a baseline alternating between two adjacent bpm/adc values could get named a narrative driver off rounding noise.wires
quantum: 1into both_glassInputcalls, matching readiness_composite's quantum on the same channels.depends on analytics#75 (now merged) — repinned kAnalyticsPin to its merged main sha.
bumps kAlgoVersion 94 -> 95: this changes the stored readiness_glassbox drivers list for real users, so it needs one despite being narrative-only, not a headline-score change.
db_serve_version_and_reads_test.dart's pin/version consistency check caught the first version of this PR missing the bump.golden fixture regenerated, zero diff (this fixture's rhr/temp baseline doesn't hit the quantized-alternating pattern this fix targets, same as analytics#73 earlier).
Summary by Sourcery
Guard cross-day GlassBox readiness drivers against quantized resting-heart-rate measurements and update the supporting analytics revision.
Bug Fixes:
Enhancements:
Chores: