Prediction Obeservation Accelerometry Bundles
Prediction Observation CPM Bundles
Goal
Telemetry is a research dataset. For this version, the app sends one self-contained prediction bundle after a successful prediction during an active monitoring session. The bundle keeps heart rate as summary data and sends only the CPM values used by predictions that include cpm40Avg.
Scope
Included:
- Prediction inputs and output.
- Profile snapshot embedded in each prediction.
- Weather inputs used by the model.
- Rounded location and weather cell.
heartRate40Avgsummary only.cpm40AvgandcpmValues, the numeric CPM values available for that prediction.
Excluded:
- Raw heart-rate samples.
- Heart-rate completeness/window metadata.
- Raw accelerometry samples.
- Per-window CPM IDs, timestamps, and sample counts.
- Profile-only telemetry events.
- Session start/end telemetry events.
- Alert/risk category telemetry.
- BMI, unit system, app version, and platform in the research payload.
Bundle Rules
- Queue only during an active monitoring session.
- Queue only after a successful prediction.
- The research payload has no
typefield. - The bundle has an
eventIdfor sync identity and a separatepredictionIdfor the research observation. - If
cpm40Avgis present,cpmValuesmust contain at least one finite CPM value. - If
cpm40Avgis null,cpmValuesmust be empty. - Watch-only predictions keep
cpmValuesempty. - Phone-only and hybrid predictions include
cpmValuesbecause they usecpm40Avg. - Heart rate remains summary-only for this version.
CPM Values
cpmValues is a compact numeric array. It is intentionally not a raw-data lineage graph.
For foreground predictions, the app prefers the CPM rows already available in the 40-minute activity snapshot. For iOS recorded-background predictions, the app passes the CPM chunks returned by the recorded accelerometer query. If a prediction has a finite cpm40Avg but no per-window values are available, the client falls back to [cpm40Avg] so the prediction can still be queued without raw accelerometry.
cpmWindowTarget stays in the prediction record as research metadata. It is 40 for the current model and tells researchers whether a prediction used a full intended CPM history or a partial early-session history.
Local Storage
- CPM values remain in normal local CPM storage.
- Raw accelerometry may still be used locally where available to compute CPM.
- The iOS CPM-only background fallback writes its per-minute CPM chunks back to local CPM storage with synthetic minute timestamps.
- The research outbox stores a full self-contained JSON copy for retry.
- The queued research payload does not include raw accelerometry samples.
Server Storage
The server stores prediction rows with compact CPM values:
prediction_observations.cpm_values_json
Server behavior:
- Insert/dedupe predictions by
predictionId. - Store
cpmValuesinprediction_observations.cpm_values_json. - Do not ingest
activity_cpm_windows,accelerometry_sample_chunks, orprediction_cpm_windowsfrom new sync payloads. - Validate that
cpmValuesis non-empty only whencpm40Avgis present.
Legacy raw CPM and accelerometry tables may remain available for existing data and dashboard exports, but new prediction sync payloads do not populate them.
iOS Recorded Background Path
The iOS recorded-background path first tries to read recorded accelerometer CPM windows. When those windows are available, the prediction receives their CPM values.
If raw recorded windows are unavailable, the app falls back to the CPM-only recorded accelerometer query. That fallback writes the CPM-only chunks into local CPM storage and still queues telemetry because the sync contract only requires cpmValues, not raw accelerometry lineage.