Hsv struct emitted by the Synheart Runtime’s inference engine.
Pipeline placement
Hsv is what the Synheart Runtime emits per inference head. Flux consumes InferenceOutput (or &[Hsv]) and produces an HSI payload via HsiBuilder::build_from_output(...).
The seven canonical heads
HsvType enum (all caps on the wire, snake_case in JSON):
| Head | Group | Output shape |
|---|---|---|
Emotion (EMOTION) | Primary cognitive | Multiscalar — typically [("valence", v), ("arousal", a)]. |
Focus (FOCUS) | Primary cognitive | Scalar in [0, 1]. |
Capacity (CAPACITY) | Primary cognitive | Scalar in [0, 1]. |
Sleep (SLEEP) | Physiological context | Scalar plus optional breakdown (SleepScore.components). |
Recovery (RECOVERY) | Physiological context | Scalar. |
Strain (STRAIN) | Physiological context | Scalar. |
MotionState (MOTION_STATE) | Behavioral context | Multiscalar indicator + notes carrying LAYING / SITTING / STANDING / MOVING / UNKNOWN. |
Hsv struct
HSV invariants
Hsv::validate() enforces:
confidence ∈ [0, 1].- Every scalar value in
value(whetherScalaror each entry ofMultiscalar) is in[0, 1]. window.end_ms > window.start_ms.
focus where higher means more focus, it cannot flip semantics.
Tier-capped confidence
The inference engine capsconfidence by signal fidelity tier so proxy signals never over-report certainty:
| Tier | Source | Max confidence |
|---|---|---|
| Tier 1 | Native RR ground truth | ≤ 1.0 |
| Tier 2 | Vendor HRV (RMSSD/SDNN/stress/recovery) | ≤ 0.9 |
| Tier 3 | HR series | ≤ 0.7 |
| Tier 4 | HR snapshot | ≤ 0.5 |
| Tier 0 | No physiological signal | (head-dependent; typically rulepack only) |
TierBundle is the canonical 1.3 carrier; the source_tier field on Hsv mirrors its physiological entry for convenience.
64D Johnson-Lindenstrauss embedding
InferenceOutput.embedding carries a 64-dimensional, L2-normalized, deterministic, non-invertible projection of the HSVs:
- Always 64 dims.
- Always L2-normalized to unit norm.
- Deterministic — identical HSVs produce byte-identical vectors.
- Privacy-preserving — Johnson-Lindenstrauss random projection is non-invertible: you cannot reconstruct the underlying HSVs from the embedding.
HsiBuilder::build_from_output(InferenceOutput). The fallback path HsiBuilder::build(&[Hsv]) recomputes the embedding from HSVs — same result, just an extra projection step.
When the embedding reaches the HSI payload, capability level + HSI version control whether it appears in the output.
InferenceOutput
| Method | Purpose |
|---|---|
StateRuntime::infer(features, baseline_present) | HSV-only inference; returns Vec<Hsv>. |
StateRuntime::infer_with_embedding(features, baseline_present) | Returns InferenceOutput (HSV + 64D embedding). |
StateRuntime::infer_with_personalization(features, ctx) | HSV inference with personalization context. |
StateRuntime::infer_with_embedding_personalization(...) | Both, with personalization. |
StateRuntime::infer_head(head, features, baseline_present) | Single-head inference. |
HSV → HSI mapping (Flux)
HsiBuilder (in the flux engine component):
- Takes
&[Hsv]plus the embedding vector + optional integrity tag. - Maps each HSV onto an HSI axis reading via
flux::export::map_axes(hsvs, window_ids, default_source_ids). - Writes
evidence_source_idsfromhsv.providers(or the builder’s defaults when providers is empty). - Forwards
breakdownentries as one HSIaxis_readingper component. - Forwards
notestoaxis_reading.notes. - Carries the 64D embedding into
embeddings[]if capability/policy permits. - Stamps
source_tierandtiersinto the HSI envelope. - Returns a validated
HsiPayload.
| Method | Purpose |
|---|---|
build(&[Hsv]) | Compute embedding + build HSI. |
build_from_output(&InferenceOutput) | Preferred. Use the pre-computed embedding from the inference engine. |
build_json(&[Hsv]) / build_json_from_output(...) | Same, plus pretty-printed JSON. |
Why HSV exists alongside HSI
| Layer | Type | Optimised for |
|---|---|---|
HSV (Hsv) | in-process, typed, head-shaped | Fast, deterministic, type-safe inference inside the Synheart Runtime; downstream in-runtime consumers (personalization, scoring) consume Hsv directly without going through JSON. |
| HSI 1.3 | JSON wire format, multi-language, version-stable | Cross-process, cross-platform, cross-vendor interchange; canonical contract per hsi repo. |
What the Synheart Core SDK exposes
The SDK does not exposeHsv directly to host code (Dart/Kotlin/Swift). It exposes:
- The HSI JSON via
Synheart.onHSIUpdate— what flux emitted. - Typed
HSIState(axes, modalities, tiers) viaSynheart.onStateUpdate— parsed from the HSI JSON; see HSI in Synheart Core.
Hsv access integrate at the runtime / engine level — typically only research-tier integrations.
Related
- HSI in Synheart Core — the wire contract HSV is packed into.
- Architecture — full pipeline diagram.
- HSI overview — canonical HSI spec.