The behavior SDK does not compute these metrics in Dart/Kotlin/Swift directly. The canonical implementation runs inside the runtime’s behavior feature deriver — the SDK ships events and the runtime returns metric bundles. Apps see the results as fields onDocumentation Index
Fetch the complete documentation index at: https://docs.synheart.ai/llms.txt
Use this file to discover all available pages before exploring further.
BehavioralMetrics inside BehaviorSessionSummary.
Window
A metric is computed either:- Over the entire session (default, returned in
BehaviorSessionSummary.behavioralMetrics). - Over an arbitrary time range when you call
calculateMetricsForTimeRange({startTimestampSeconds, endTimestampSeconds, sessionId?}).
0.0 and lists return empty.
The canonical 12
interactionIntensity
interruption_events = notification_events + call_events + app_switch_events. Range [0, 1]. Anchored so ~10 events/min reads as full intensity.
taskSwitchRate
Exponential saturation:
taskSwitchCost
BehavioralMetrics.taskSwitchCost is the millisecond form (raw int); flux internally also exposes a normalised [0, 1] version.
idleTimeRatio
activeTimeRatio
1 − idle_time_ratio — task-switch cost is also subtracted.
notificationLoad
Exponential saturation:
burstiness
Barabási burstiness over inter-event gaps:
0.0 = perfectly regular (Poisson-like), 0.5 = random / no data, 1.0 = very bursty. Flux returns 0.5 when the session has no inter-event gaps yet.
behavioralDistractionScore
Weighted composite, fixed weights:
focusHint
focusHint + distractionScore = 1.0. (Flux’s test test_focus_hint_is_inverse_of_distraction enforces this.)
fragmentedIdleRatio
1.0 on very short sessions; flux clamps at the encoding step before HSI export.
scrollJitterRate
deepFocusBlocks
Engagement segments lasting at least DEEP_FOCUS_MIN_DURATION_SEC = 120 seconds (2 minutes), fixed in flux. Each block in the SDK shape:
BehaviorSessionSummary.
Typing metrics (extension)
When a session contains typing events, the SDK addsTypingMetrics derived from typing-specific aggregations (formulas live in flux’s typing module):
| Field | JSON key | Range / units |
|---|---|---|
typingSpeed | typing_speed | taps/sec |
typingCadenceStability | typing_cadence_stability | 0–1 |
typingCadenceVariability | typing_cadence_variability | unitless (CV) |
typingActivityRatio | typing_activity_ratio | 0–1 |
typingGapRatio | typing_gap_ratio | 0–1 |
typingBurstiness | typing_burstiness | 0–1 |
typingInteractionIntensity | typing_interaction_intensity | 0–1 |
clipboardActivityRate | clipboard_activity_rate | 0–1 |
correctionRate | correction_rate | 0–1 |
behavior_gesture_detector.dart):
typing_interaction_intensity = w₁ · typing_speed_norm + w₂ · (1 − typing_gap_ratio) + w₃ · typing_cadence_stability(weights set in the runtime feature deriver).clipboard_activity_rate = (copy + paste + cut) / (typing_taps + clipboard_actions).correction_rate = (backspace + delete) / (typing_taps + backspace + delete).
NotificationSummary
| Field | Definition |
|---|---|
notificationCount | Total notifications received during session. |
notificationIgnored | Notifications with InterruptionAction.ignored. |
notificationIgnoreRate | notificationIgnored / notificationCount (0 when no notifications). |
notificationClusteringIndex | Variance-based clustering measure (Fano-factor flavor) over inter-arrival times. |
callCount, callIgnored | Same shape for incoming calls. |
Numerical stability
Flux clamps:- All bounded outputs are wrapped in
.clamp(0.0, 1.0)(or per-field bounds for raw mileage values liketask_switch_cost_mscapped at 10000). - Empty input (no events, zero duration, no scrolls, etc.) returns the safe fallback (
0.0for ratios,0.5for burstiness).
Related
- Behavior Overview — full SDK surface.
- Model Card — motion state, separate from these metrics.
- Threat Model — what’s collected and what’s not.