Skip to content

Emit the SensorKit Structured Summaries and Declared Payload Formats - #69

Merged
PSchmiedmayer merged 43 commits into
feature/grove-fhir-0.2-healthkitfrom
feature/grove-fhir-0.2-sensorkit
Aug 23, 2026
Merged

Emit the SensorKit Structured Summaries and Declared Payload Formats#69
PSchmiedmayer merged 43 commits into
feature/grove-fhir-0.2-healthkitfrom
feature/grove-fhir-0.2-sensorkit

Conversation

@PSchmiedmayer

@PSchmiedmayer PSchmiedmayer commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

♻️ Current situation & Problem

Three SensorKit streams had structured profiles; the rest were admitted only as opaque recordings. A receiver could store the bytes but could not tell how many samples arrived, over what interval, or in what format — the recording DocumentReference carried a media type and nothing else, so application/json could have been any shape at all.

⚙️ Release Notes

  • Emit the six new platform-exclusive structured summaries the v0.3.0 guide publishes: messages usage, phone usage, keyboard metrics, sleep session, accelerometer, and photoplethysmography. Each carries content-free counts and durations only; no typed content, contact identity, or sentiment is ever represented.
  • Require a declared registry payload format on every recording document. content.format now names the exact registry entry, is validated against the formats its stream admits, and an unregistered code fails closed.
  • Mandate the native recording where a summary is lossy (keyboard metrics, accelerometer, PPG) and leave it optional where the summary is complete.
  • Carry rawFormats through the generated contract so a producer reads the registry code from the catalog rather than hardcoding it.
  • Give the sleep session the exact length of its own interval. The profile previously forbade both a value and a data-absent reason while inheriting the shared rule that a mobile Observation must carry one of them, so it could never validate. SensorKit publishes only the session bounds, so the length of those bounds is the one result available without inventing a stage or a quality score.
  • Identify the conformance corpus with Grove testing naming systems instead of study.example.org, which the official Validator rejects outside published examples.
  • Re-pin to the v0.3.0 guide cut and regenerate.

📚 Documentation

The payload formats are specified in the sensor guide's Recording formats page, generated from the machine registry; the structured profiles are published in the SensorKit guide.

✅ Testing

  • One conversion test per new stream covering profiles, components, effective periods, derivedFrom wiring, output identity, and format codings, plus fail-closed tests for zero durations, negative counts, and unregistered formats.
  • Identity vectors extended with the six new output discriminators; the fixture corpus grew to 12 bundles.
  • swift build, SwiftLint strict, the package test suite, and the generator --check gates pass, along with the HealthKit suite carried in by the merge.

Copilot AI lite review requested due to automatic review settings August 20, 2026 22:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 089ad708-e8b6-4ee2-9df8-61e50a37facb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@PSchmiedmayer
PSchmiedmayer force-pushed the feature/grove-fhir-0.2-healthkit branch from fa4f839 to b93798d Compare August 20, 2026 22:58
@PSchmiedmayer
PSchmiedmayer force-pushed the feature/grove-fhir-0.2-sensorkit branch from bcdbe25 to 04ab3b9 Compare August 20, 2026 22:58
…' into feature/grove-fhir-0.2-sensorkit

# Conflicts:
#	Scripts/validate-fhir-conformance.sh
@PSchmiedmayer PSchmiedmayer changed the title Implement the Grove FHIR 0.2 SensorKit Producer Emit the SensorKit Structured Summaries and Declared Payload Formats Aug 22, 2026


/// Builds source-neutral R4 graphs for sampled data, ECG, and native recordings.
public struct GroveSensorFHIRConverter: Sendable {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo the naming here (ie, on this particular type, and also in the rest of the file and the PR) is too specific. we're in the Grove target already, so imo we should drop the Grove prefix from the types and call it eg just SensorFHIRConverter

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most of the types in this file feel like they should be nested elsewhere? (eg the Context, the Conversion, the ConversionError, ...)

@PSchmiedmayer
PSchmiedmayer merged commit b8f786e into feature/grove-fhir-0.2-healthkit Aug 23, 2026
34 of 127 checks passed
@PSchmiedmayer
PSchmiedmayer deleted the feature/grove-fhir-0.2-sensorkit branch August 23, 2026 01:49
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.

3 participants