Skip to content

Share outcomes with Loop developers from Current Setup - #2625

Merged
ps2 merged 2 commits into
next-devfrom
feature/share-outcomes
Oct 28, 2026
Merged

ps2 merged 2 commits into
next-devfrom
feature/share-outcomes

Conversation

@ps2

@ps2 ps2 commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

The Current Setup screen links to a new Share Outcomes screen. Sharing is available at any time; the link's footer recommends about 2 weeks without setup changes as ideal, and any changes in the shared range are in the settings history. The screen:

  • lists what's sent and what isn't, and links to the LoopKit Data Policy;
  • prepares the package and shows its size;
  • has an optional note (up to 1000 characters);
  • sends the share to ingest.loopkit.org/v1/outcomes only when the person taps Send.

Each share's receipt is kept on the device, so the share can be deleted from the server later from the same screen.

Package
The package is a zip of per-UTC-day JSON files covering the last 6 weeks: settings, glucose, carbs, doses, dosing decisions and overrides. It also holds:

  • the settings and override in effect when the range starts;
  • a manifest with the app build, the last setup change and a random per-install ID.

The device log and alerts are left out.

Records are scrubbed at the JSON level:

  • removed: the push token, device names, serial numbers, pump event bytes and descriptions, food descriptions, and the dosing decisions' historicalGlucose;
  • skipped: the updateRemoteRecommendation decisions.

On a real 6-week export, this takes the package from about 58 MB to about 15 MB.

Upload
The upload is streamed from a file, so the package is never held in memory whole. The delete token is made on the device and sent with the share, so a retry after a lost response gets back the receipt of the share already stored.

Server and viewer
The server side is deployed. Shares are visible only to members of the LoopKit developer team on GitHub, after they accept the developer terms of use.

Related
LoopKit/LoopKit#672 keeps critical event log exports valid JSON when a record fails to encode. This PR doesn't depend on it: records replaced by that placeholder are skipped here.

Testing

  • New OutcomesPackageTests (scrubber and builder) pass.
  • Shares sent end to end against the live server, including a note and a retry with the same token, then deleted.

ps2 added 2 commits October 28, 2026 15:31
Once the current setup has run for 2 weeks, the Current Setup screen links to
a Share Outcomes screen. It lists what's sent and what isn't, prepares the
package, shows its size and sends it to ingest.loopkit.org/v1/outcomes only
when the person taps Send. Each share's receipt is kept so it can be deleted
from the server later from the same screen.

The package is a zip of per-day JSON files covering the last 6 weeks:
settings, glucose, carbs, doses, dosing decisions and overrides, plus the
settings and override in effect when the range starts, and a manifest with
the app build, the last setup change and a random per-install ID. The device
log and alerts are left out. Records are scrubbed at the JSON level: push
token, device names and serial numbers, pump event bytes and descriptions,
food descriptions and the dosing decisions' historicalGlucose are removed,
and the updateRemoteRecommendation decisions are skipped. On a real 6-week
export this takes the package from about 58 MB to about 15 MB.

The delete token is made on the device and sent with the share, so a retry
after a lost response gets back the receipt of the share already stored.
Any setup changes within the shared range are in the settings history, so
they can be kept or left out in an analysis. The link no longer waits for the
setup to run 2 weeks; its footer recommends that instead.
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