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.
  • heartRate40Avg summary only.
  • cpm40Avg and cpmValues, 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 type field.
  • The bundle has an eventId for sync identity and a separate predictionId for the research observation.
  • If cpm40Avg is present, cpmValues must contain at least one finite CPM value.
  • If cpm40Avg is null, cpmValues must be empty.
  • Watch-only predictions keep cpmValues empty.
  • Phone-only and hybrid predictions include cpmValues because they use cpm40Avg.
  • 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 cpmValues in prediction_observations.cpm_values_json.
  • Do not ingest activity_cpm_windows, accelerometry_sample_chunks, or prediction_cpm_windows from new sync payloads.
  • Validate that cpmValues is non-empty only when cpm40Avg is 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.