Repository navigation
fix(cbio): drop the unverified mg/dL claim from the raw record - #168
shroominic wants to merge 1 commit into
Conversation
The archive divided the raw 08 field by ten and then multiplied by 18.0182 to produce an mg/dL number, and the test asserted that number as a fact. Nothing in this repository establishes that /10 is mmol/L, and no reference measurement exists for this sensor, so the accessor asserted a unit the protocol does not carry. The app rendered that number as a glucose value. Expose the raw field and its scaled value and nothing else: rawCurrentScaled is documented as an unverified engineering value with no unit, the unit-bearing accessors are gone, and a regression test fails if either name comes back. Refs #145
…andidate Reverts the merge of fix/cbio-archive-unit-claim (#168). #168 removes CbioRawGlucoseRecord.derivedMilligramsPerDecilitre and .derivedMillimolesPerLitre and leaves only an explicitly unitless rawCurrentScaled. The app-live surface still fills CgmReading.valueMgdl from the removed mg/dL accessor, so the merge leaves six analyzer errors in cgm_cbio and, fixing them, would change the number the live surface renders. That is a unit-reference decision on the product surface, not a mechanical merge, and it is the owner's to make. The lane needs an adoption change (as #192 was for #166) before this can land. Recorded as excluded in the PR body.
|
Release assembly note (0.4.0 candidate Merging it here leaves six analyzer errors in
What unblocks it is the same shape as #192 was for #166: an adoption commit on |
Adopt the archive fix from `fix/cbio-archive-unit-claim` (#168, e81e335) into the app-live lane. The record used to expose the raw `08` field three ways: `rawCurrent`, a derived mmol/L accessor (`rawCurrent / 10`) and a derived mg/dL accessor (`rawCurrent / 10 * 18.0182`). Nothing in this repository establishes that either unit belongs to the field, so the record now exposes `rawCurrent` and `rawCurrentScaled` and no unit-bearing accessor at all. The six `cgm_cbio` analyzer errors that blocked the adoption were the session and its tests still reading the removed accessors: - `_historyReadingsFor` published the mg/dL derivation into `CgmReading.valueMgdl`; it now publishes `rawCurrentScaled`, the same unit-free `/10` scale the hero already renders. - the session tests asserted the removed accessors; they now pin the scale itself and the number the session publishes (`raw 97 -> 9.7`). This changes the number a cbio record carries, so it changes what the dashboard chart plots (`raw 53`: `95` before, `5.3` now). The hero is unchanged - it already rendered `rawValue / 10` with no unit - and provisional readings stay excluded from Apple Health, so no surface claims the number as mg/dL. Documented in `docs/testing/cbio-gs1-app-live.md`. Refs #168, #145
|
Adopted into the app-live lane as RED: archive/session tests referencing Render change, documented in Closing as superseded by the lane tip; reopening would only re-add the six errors. |
|
Superseded by the app-live lane tip (adoption commit c19f68a). |
Closes #145.
The defect
CbioRawGlucoseRecorddivided the raw08field by ten, multiplied by18.0182, and exposed the result asderivedMilligramsPerDecilitre. The testpinned it as a fact (
expect(first.derivedMilligramsPerDecilitre, 141)), andthat number is what the app rendered as a glucose value.
Nothing in this repository establishes that
/10is mmol/L, and no referencemeasurement exists for this sensor. The accessor asserted a unit the protocol
does not carry, and #145 records where the rendered
101 mg/dLcame from: raw56on the shared/10scale, multiplied and labelled.The fix
derivedMillimolesPerLitreandderivedMilligramsPerDecilitreare removed.rawCurrentScaledreplaces them:rawCurrent / 10, documented as anunverified engineering value with no unit, and explicitly not mmol/L, not
mg/dL, and not renderable with a unit suffix.
isUnitVerifiedstays false, and the class doc says no accessor carries aunit in its name.
removed accessor names throw
NoSuchMethodError, so a unit-bearing gettercannot quietly come back.
Verification
packages/cgm_cbio:flutter test61 passed;dart format --set-exit-if-changed lib testclean.Note on scope
The downstream half of #145 - the app rendering
sensor raw / 10with no unitsuffix - lives in the live-session branch (#142). This PR removes the source of
the claim so nothing downstream can render it from the archive.