Skip to content

feat(sdk): Synheart.fetchCloudHsiWindows — pull HSI from the cloud archive#57

Merged
isrugeek merged 3 commits into
mainfrom
feat/cloud-hsi-fetch
Jun 8, 2026
Merged

feat(sdk): Synheart.fetchCloudHsiWindows — pull HSI from the cloud archive#57
isrugeek merged 3 commits into
mainfrom
feat/cloud-hsi-fetch

Conversation

@isrugeek

@isrugeek isrugeek commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Binds the runtime's synheart_core_fetch_cloud_hsi FFI (synheart-core-runtime#74) so hosts can pull historical / cross-device HSI windows from the cloud archive and process them on-device.

Changes

  • FFI binding (reuses the hsi_history list C signature: (handle, i64, i64) -> char*).
  • bridge.fetchCloudHsiWindows(fromMs, toMs) → parses the JSON array; guarded so a vendored lib lacking the symbol returns empty instead of throwing.
  • Typed facade Synheart.fetchCloudHsiWindows({from, to}).

Returns full archived window payloads (any HSI version); the host parses them with the same path it uses for local windows. Empty when cloud unconfigured/unconsented or the vendored runtime predates the symbol. flutter analyze clean.

Note: the underlying FFI does the network round-trip synchronously (native block_on) like the upload flush; exposed as a Future. A fully async FFI is a follow-up.

isrugeek added 3 commits June 8, 2026 19:04
…loud

Binds the runtime's synheart_core_fetch_cloud_hsi FFI (reuses the hsi_history
list C signature) → bridge.fetchCloudHsiWindows(fromMs,toMs) → typed facade
Synheart.fetchCloudHsiWindows({from,to}). Returns version-independent HSIState
records so hosts never branch on hsi_version. Empty when cloud unconfigured/
unconsented or the vendored runtime lacks the symbol. Blocks during the round-
trip like flush (Future-wrapped); async-FFI is a follow-up.
@isrugeek isrugeek requested a review from a team as a code owner June 8, 2026 23:05
@isrugeek isrugeek merged commit a946e1a into main Jun 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant