Skip to content

fix: detect the Minimed Flex pump (#91) - #93

Merged
NovaLux12 merged 1 commit into
mainfrom
fix/flex-detection-91
Oct 9, 2026
Merged

NovaLux12 merged 1 commit into
mainfrom
fix/flex-detection-91

Conversation

@NovaLux12

Copy link
Copy Markdown
Owner

Summary

The Minimed Flex pump (MMT-8062/8063/8082/8083/8084/8085) is already shipping and reported live upstream (domien-f#3, where a minimal version of this fix is also proposed as upstream PR #5): silent zero-data fetch after a 780G-to-Flex upgrade.

Neither the Flex family string nor its models match anything the bridge recognises, so isBleDevice() returns false and the account falls back to monitor/data, which returns {} for BLE-era devices.

Closes #91.

  • Six Flex model prefixes, labelled INFERRED from Medtronic's portal bundle (same labelling as the Guardian 4 / Simplera system rows).
  • The FLEX family token as a deliberate substring test — unlike BLE, which is prefix-only because it is a substring of ordinary words. Audited: FLEX is not a substring of any other known family value (GUARDIAN, NGP, CGM, CC, PARADIGM, BLE_*, SIMPLERA*); the reasoning is recorded next to the code.
  • Call-site test proving a family-only Flex payload (no model — the hardest case) takes the BLE endpoint exactly once and never touches connect/data.

Verification

npx vitest run            → 246 passing / 22 files (baseline 242)
npx tsc --noEmit          → clean

Revert-verified: removing the six rows fails the model test; removing the FLEX token fails both the family test and the call-site test (which then resolves the monitor payload instead of the BLE payload — the exact upstream symptom). Both spellings INFERRED, unverified on the wire.

The Flex (MMT-8062/8063/8082-8085, "Minimed Flex") is already shipping and
reported live upstream (domien-f#3): silent zero-data fetch
after a 780G-to-Flex upgrade. Neither its family string nor its models match
anything in BLE_DEVICE_MODELS, so isBleDevice() returns false and the bridge
falls back to monitor/data, which returns {} for BLE devices.

- Six Flex model prefixes, labelled INFERRED from the vendor bundle.
- The FLEX family token as a deliberate substring test (unlike BLE, which is
  prefix-only): audited that FLEX is not a substring of any other known family
  value, with the reasoning recorded next to the code.
- Call-site test proving a family-only Flex payload takes the BLE endpoint
  and never touches connect/data (verified to fail with the token removed).

Tests: 246 passing (baseline 242). tsc --noEmit clean.
@NovaLux12
NovaLux12 force-pushed the fix/flex-detection-91 branch from 8fde156 to c93ac46 Compare October 9, 2026 12:42
@NovaLux12
NovaLux12 merged commit 79d6e5c into main Oct 9, 2026
2 checks passed
@NovaLux12
NovaLux12 deleted the fix/flex-detection-91 branch October 9, 2026 12:48
NovaLux12 added a commit that referenced this pull request Oct 9, 2026
Medtronic publishes the complete device-family vocabulary, unauthenticated,
at GET /patient/v2/configuration/public — the same host the bridge already
talks to. #93 added the six Minimed Flex model prefixes and, alongside
them, guessed the family token as a FLEX substring match.

The published document settles it.
personal.device.family.to.model.mapping lists sixteen families, and
system.settings.transfer.feature.config.device.mapping independently maps
"CC880" to the display name "MiniMed™ Flex". So CC880 is the Flex family,
and the six models #93 added do appear under it.

isBleDevice() now matches the exact published token CC880, so a family-only
payload is detected without relying on deviceModel being present. Before
this, isBleDevice('CC880', undefined) returned false — reproducing #91's
silent zero-data fetch, the failure mode a Flex user actually hits, since
monitor/data returns deviceFamily while medicalDeviceFamily is undefined
on the patient path and models are not guaranteed.

The FLEX substring match is kept as a fallback for the display-name
spelling the vendor also publishes ("Minimed™ Flex"), on the same
reasoning that SIMPLERA_SYSTEM may arrive as "Simplera™ system". Audited
against all sixteen published families: none contains FLEX, so no real
device is misrouted today, and CC880 detection never depended on it since
that token has no FLEX in it. The residual looseness — a substring match
also accepts nonsense like "REFLEX" — is documented rather than eliminated
and is deliberately not pinned as a contract, so a later contributor can
tighten the matcher without rewriting an assertion that enshrined it.

New test classifies the entire published vocabulary: all sixteen families,
each with its expected verdict and a stated reason. CC840, EAGLE, GST,
NMX7, NMX8, GM and INSTINCT are deliberately left unmatched — nothing
confirms they are BLE-paired, and routing a non-BLE device down the BLE
endpoint is its own silent failure. The table means a family Medtronic adds
later is a decision someone makes rather than a gap that surfaces weeks
later as "the bridge uploaded nothing". Its completeness check is a
self-consistency guard, not a vendor-change detector, and is labelled as
such.

Caveat: this is Medtronic's published configuration, not an observation of
a monitor/data response. It establishes the vocabulary, not which field
carries it or in what casing. #81 stays open until a token confirms.

Tests: 323 passing (baseline 298). npm run typecheck clean.
NovaLux12 added a commit that referenced this pull request Oct 9, 2026
Medtronic publishes the complete device-family vocabulary, unauthenticated,
at GET /patient/v2/configuration/public — the same host the bridge already
talks to. #93 added the six Minimed Flex model prefixes and, alongside
them, guessed the family token as a FLEX substring match.

The published document settles it.
personal.device.family.to.model.mapping lists sixteen families, and
system.settings.transfer.feature.config.device.mapping independently maps
"CC880" to the display name "MiniMed™ Flex". So CC880 is the Flex family,
and the six models #93 added do appear under it.

isBleDevice() now matches the exact published token CC880, so a family-only
payload is detected without relying on deviceModel being present. Before
this, isBleDevice('CC880', undefined) returned false — reproducing #91's
silent zero-data fetch, the failure mode a Flex user actually hits, since
monitor/data returns deviceFamily while medicalDeviceFamily is undefined
on the patient path and models are not guaranteed.

The FLEX substring match is kept as a fallback for the display-name
spelling the vendor also publishes ("Minimed™ Flex"), on the same
reasoning that SIMPLERA_SYSTEM may arrive as "Simplera™ system". Audited
against all sixteen published families: none contains FLEX, so no real
device is misrouted today, and CC880 detection never depended on it since
that token has no FLEX in it. The residual looseness — a substring match
also accepts nonsense like "REFLEX" — is documented rather than eliminated
and is deliberately not pinned as a contract, so a later contributor can
tighten the matcher without rewriting an assertion that enshrined it.

New test classifies the entire published vocabulary: all sixteen families,
each with its expected verdict and a stated reason. CC840, EAGLE, GST,
NMX7, NMX8, GM and INSTINCT are deliberately left unmatched — nothing
confirms they are BLE-paired, and routing a non-BLE device down the BLE
endpoint is its own silent failure. The table means a family Medtronic adds
later is a decision someone makes rather than a gap that surfaces weeks
later as "the bridge uploaded nothing". Its completeness check is a
self-consistency guard, not a vendor-change detector, and is labelled as
such.

Caveat: this is Medtronic's published configuration, not an observation of
a monitor/data response. It establishes the vocabulary, not which field
carries it or in what casing. #81 stays open until a token confirms.

Tests: 323 passing (baseline 298). npm run typecheck clean.
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.

Minimed Flex pump (MMT-8062 family) not BLE-detected — silent zero-data fetch, reported live upstream

1 participant