8000 feat(core): add evidence-linked meal response analytics by shroominic · Pull Request #67 · shroominic/OpenGlucose · GitHub
[go: up one dir, main page]

Skip to content

feat(core): add evidence-linked meal response analytics - #67

Open
shroominic wants to merge 2 commits into
mainfrom
feature/deterministic-evidence-foundation
Open

shroominic wants to merge 2 commits into
mainfrom
feature/deterministic-evidence-foundation

Conversation

@shroominic
@shroominic shroominic commented Aug 23, 2026 •
Copy link
Copy Markdown
Owner

Summary

  • add a pure-Dart meal-response analytics foundation with source-record evidence
  • fail closed for sparse, gapped, duplicate, provisional, future, and mixed-source data
  • document the calculation, evidence, and integration boundary
  • qualify accepted display-provisional input as provisionalReadings, which is never sufficient
  • record provisional and future exclusions separately for each meal baseline and response window

Partially addresses #90. This is a narrow analytics-contract slice. It does not close #90 and does not add UI, persistence, platform imports, network calls, or AI generation.

Risk and accountability

  • Risk class: R2. This code derives wellness-facing observations from health-adjacent glucose and meal timing data.
  • Accountable owner: @shroominic.
  • Safety boundary: Results are local observations only. They do not establish causality and are not medical advice, diagnosis, treatment, dosing, or an emergency signal.
  • Device evidence: Not applicable. This PR is deterministic pure-Dart code and does not alter the sensor journey.

Public contract

  • Additive cgm_core export: MealResponseAnalytics and its versioned result/evidence types.
  • Inputs must use non-empty, unique selected meal and glucose-record IDs.
  • A response with any accepted display-provisional sample returns provisionalReadings and cannot expose qualified derived metrics.
  • Evidence exposes accepted-provisional counts plus baseline/post-meal provisional and future exclusion counts.
  • No serialized format, storage schema, package dependency, platform behavior, or release artifact changes.
  • A minor package version bump remains required before any independent package publication.

Rollback and recovery

Revert this PR or the follow-up qualification commit. There is no persistence, migration, generated artifact, external service, or sensor-state change to recover. Existing data remains unchanged.

Validation

  • dart format lib/src/meal_response.dart test/meal_response_test.dart
  • dart analyze lib/src/meal_response.dart test/meal_response_test.dart
  • dart test test/meal_response_test.dart
  • dart test in packages/cgm_core
  • make format-check
  • make lint
  • make test-unit
  • make check

This branch has not been deployed

No deployments
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.

[Feature] Deterministic metabolic observations and evidence model

1 participant

0