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