Overview
The Breathing module wraps the runtimeβs breathing-compliance detector. Every R-R interval pushed viaCoreRuntimeBridge.pushRr (raw beat data from BLE chest straps and equivalent sources) automatically feeds the detector β this module only configures the target rate / population / window and reads back the verdict.
A βcomplianceβ verdict has four pillars (peak frequency match, coherence, RSA amplitude, relative power) and a confidence score in [0, 1]. The detector returns one of three verdicts:
- Compliant β user is meeting the target; metrics included
- NotCompliant β user is breathing but off-target; reason explains why (frequency, depth, regularity, no breathing signature) β feed into coaching copy
- Insufficient β not enough raw R-R data yet; reason explains whatβs missing
Configuration
Evaluate
Call once per UI frame (or at whatever cadence you render coaching):Metrics
BreathingMetrics (present on Compliant / NotCompliant, nil on Insufficient):
NonComplianceReason
Structured reason types β render coaching copy from these instead of free-text from the engine:BreathingGuidanceCopy.localize is a swappable function for the default English coaching strings β override globally to ship in a different language or tone.
InsufficientReason
Population profile
Adjusts the per-pillar thresholds:Cross-language parity
Identical wire format across Flutter / Kotlin / Swift:- Flutter:
lib/src/modules/breathing/{breathing_module,breathing_compliance_result,breathing_guidance_copy}.dart - Kotlin:
synheart-core/src/main/kotlin/ai/synheart/core/modules/breathing/{BreathingModule,BreathingComplianceResult,BreathingGuidanceCopy}.kt - Swift:
SynheartCore/Modules/Breathing/{BreathingModule,BreathingComplianceResult,BreathingGuidanceCopy}.swift
Related
- Synheart Core overview
- Baselines β the same RR stream feeds longitudinal baselines