Skip to content

Sync upstream feat/tandem (Tandem Mobi pump support) into dev - #48

Merged
mountrcg merged 41 commits into
devfrom
sync/tandem-2026-11-20
Nov 20, 2026
Merged

mountrcg merged 41 commits into
devfrom
sync/tandem-2026-11-20

Conversation

@mountrcg

Copy link
Copy Markdown
Owner

Target: mountrcg/Tai — head branch sync/tandem-2026-11-20 (636cb48) → dev (50bf488)

Tandem Mobi pump support from upstream feat/tandem

What changed

Brings the upstream Tandem Mobi driver into the Tai fork. 13 files, +653 / −101 against
dev@50bf4889b; the branch is dev plus one merge commit (636cb48) of upstream
feat/tandem@888326d9e.

TandemKit submodule (.gitmodules, gitlink TandemKit)

url    = https://github.com/jwoglom/TandemKit.git
branch = next-dev
pin    = 781bedc9f2c3dd024723f49ccb6c015cc1818b94

TandemKit is a public community repository and is the actual driver (Bluetooth, pairing,
pump commands, history parsing); this PR only wires it into Trio. It adds two SwiftPM
dependencies of its own, pulled in through the submodule's package: Digest 1.13.0 and
SwiftECC 5.5.0 (Package.resolved), plus the ASN1 / BigInt framework links in
project.pbxproj.

Device catalog — Trio/Sources/APS/Devices/DeviceCatalog.swift

  • New DeviceManufacturer.tandem case ("Tandem") between Syai and Other Sources.
  • New PumpCatalogEntry(TandemPumpManager.self, id: "TandemPumpManager", manufacturer: .tandem, name: "Tandem", supportedModels: ["Mobi"], icon: .managerBundle(asset: "tandem_mobi"), basalCapability: TandemPumpManager.onboardingSupportedBasalRates, reportsRewindEvents: true).

Reservoir reporting — Trio/Sources/APS/DeviceDataManager.swift

  • import TandemKit, and a case let tandem as TandemPumpManager in the PumpManager
    extension that returns tandem.reservoirLevel.map { Decimal($0.unitVolume) } — the same
    place Dana, Medtronic and Omnipod already read their reservoir from.

Alert catalog — Trio/Sources/Services/Alerts/AlertCatalogRegistry.swift (+158 / −2)

  • tandemEntries added to the registry chain: ~30 entries covering TandemKit's alarms
    (occlusion, empty/removed cartridge, auto-off, battery shutdown, temperature, altitude,
    pressure, pump reset, stuck button, …) at .critical, and its alerts (low insulin, low
    pump battery, charging problem, max basal, …) at .timeSensitive / .active.
  • Entries are keyed on the TandemPumpManager plugin identifier, which is what TandemKit
    issues its alerts under, so acknowledgement reaches TandemKit's registered responder.
    TandemKit mints one identifier per notification bit (<category>.<slug>.<bit>), and the
    bit position moves between firmwares, so tandemEntry(for:) strips the trailing bit and
    matches on the stable <category>.<slug> prefix; alarm.other and malfunction act as
    category fallbacks.
  • The pump's CGM alerts are deliberately left uncatalogued (they only appear when the user
    forwards them, they duplicate Trio's own glucose alarms, and the threshold ones have no
    device concept to collapse onto).

Tests

  • TrioTests/AlertCatalogRegistryTandemTests.swift — new (128 lines), prefix matching,
    severity mapping and fallbacks.
  • TrioTests/TandemKitAlertEmissionTests.swift — rewritten (82 / −95) for the new
    bit-suffixed identifiers.
  • TrioTests/DeviceCatalogTests.swift — +10 / −3, covers the Tandem entry.

Project wiring

  • Trio.xcworkspace/contents.xcworkspacedata — TandemKit/TandemKit.xcodeproj reference.
  • Trio.xcodeproj/project.pbxproj — framework reference, link + embed (CodeSignOnCopy),
    test target sources.
  • scripts/swiftformat.sh — --exclude TandemKit.
  • TANDEM_TESTING.md — upstream's testing guide for the closed beta (unchanged from upstream).

Upstream commits

Merged from nightscout/Trio feat/tandem@888326d9e (Upstream-Trio remote):

  • 888326d9e — Merge PR #1786 feat/tandem-closed-beta
  • 04edbd7d7 — Merge branch feat/tandem into feat/tandem-closed-beta
  • a809e6f97 — Merge PR #1785 feat/tandem-closed-beta-next-dev
  • f43b68dd6 — Merge branch feat/tandem-closed-beta into feat/tandem-closed-beta-next-dev

What Tai keeps

  • Version unchanged: Config.xcconfig untouched — APP_VERSION = 1.0.2,
    APP_DEV_VERSION = 1.0.2.79. Testflight/WhatToTest.en-CA.txt still reads
    "based on Trio dev 1.0.2.79".
  • Fork identity intact: APP_DISPLAY_NAME = Tai,
    BUNDLE_IDENTIFIER = org.nightscout.$(DEVELOPMENT_TEAM).tai, COPYRIGHT_NOTICE = autoISF,
    RELEASE_NOTES_REPO = mountrcg/Tai.
  • Tai-only code intact: MedtrumKit and its device-catalog wiring, AutoISF
    (AutoISF.swift + assets), the CSF units fix in TherapySchedulePDFContent, the
    upstream-pump-availability home header fix, and the fork CI dispatcher in
    .github/workflows/ are all untouched by this merge.
  • Submodules: 16 → 17 (the existing 16 stay on their Tai pins; TandemKit is the only
    addition).
  • No feat/profiles involvement — the upstream profiles merge stays reverted on this
    branch (96a3cdd), and this sync adds none of it back.
  • Diff vetted to be exactly the upstream file set: no Tai-side resolution edits were needed.

Known upstream rough edges carried along (documented in TANDEM_TESTING.md, not blockers for
this sync): TandemKit is pinned straight at jwoglom/TandemKit while every other submodule
points at a loopandlearn fork (scripts/define_common_trio.sh does not know about it), there
is no CODEOWNERS entry, and nothing in Trio reacts to the pump's Control-IQ state. The
doc's "pinned to 960556c of main" line is upstream text; the pin actually in this branch
is 781bedc9f on next-dev.

Verification

From the review card (t_c821f4e0), verdict PASS on all five gates:

  • Merge integrity — PASS: exactly the 13 upstream files, +653 / −101.
  • Fork specifics — PASS: Tai name/bundle/version, MedtrumKit / autoISF / Garmin and all 16
    existing submodules intact.
  • feat/profiles leakage — PASS: none.
  • TandemKit gitlink — PASS: 781bedc9f unchanged and an ancestor of next-dev.
  • Build sanity — PASS: full build-for-testing → TEST BUILD SUCCEEDED on
    sync/tandem-2026-11-20 (636cb48), pbxproj object graph clean.

Not verified yet, so not claimed here:

  • The unit test suite was not run — the gate was a build, not a test run.
  • No CI run: the branch is not pushed, so no GitHub Actions results exist for it.

Checklist before merge

  • Diff is the upstream file set only, no Tai regressions (review PASS)
  • WhatToTest.en-CA.txt still "based on Trio dev 1.0.2.79"
  • TandemKit pin 781bedc9f on next-dev verified
  • jwoglom/TandemKit verified public (gh api: visibility: public) — the recursive
    actions/checkout resolves the pin over HTTPS with the default GITHUB_TOKEN, so no
    GH_PAT read scope on a private repo is needed
  • Push sync/tandem-2026-11-20 (done; CI run triggered on the fork)
  • Wait for CI green on the fork (Tai CI → unit_tests.yml: Algorithm Package + Run Unit Tests)
  • Merge into dev

dnzxy and others added 30 commits September 20, 2026 22:25
Vendors jwoglom/TandemKit (main @ 50cb9f9) and wires it into the device
catalog, the workspace and the app target, from jwoglom's feat/tandem.

Trio-side additions on top of that:
- Alert catalog resolves Tandem's <category>.<slug>.<bit> identifiers by
  slug prefix, so pump alarms reach the Critical tier and an unmapped bit
  falls back to its category instead of bypassing Device Alarms.
- Package.resolved pins the SwiftECC and Digest packages TandemKit links.
- Tests for the slug resolver, plus Tandem rows in the device catalog
  suite; the emission suite's "TandemKit issues no alerts" premise is
  rewritten, since the vendored driver does.
- SwiftFormat skips the submodule, as it does for every other kit.
- TANDEM_TESTING.md for closed-beta testers.

Co-Authored-By: James Woglom <j@wogloms.net>
Picks up multi-packet response reassembly on the notification path, the
temp-basal stop when the pump rescales on a schedule change, and history
backfill on by default. No change to the alert slugs, plugin identifier
or basal grid Trio keys on.

Co-Authored-By: James Woglom <j@wogloms.net>
GitHub's New branch dialog can branch straight from the upstream repo, so
testers no longer have to open and merge a pull request into their own
fork. Adds why the branch name must match (build_trio.yml syncs from the
upstream branch of the same name) and how to start the build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SAjYPvDm7NRwiKAJAMnkuQ
Dev added the SyaiKit CGM in the same places the Tandem wiring lives:
submodule list, workspace, SwiftFormat excludes, device catalog imports
and manufacturers, and the alert catalog's entry list. Both kits stay.
Also drops the duplicate LoopAlgorithm and RoundWhiteDiscKit package
product entries the pbxproj merge produced, keeping ASN1 and BigInt.
TandemKit's main has not moved since 18 Oct and is fully contained in
dev, which is where the driver work lands — the pin it replaces was
already a dev commit. Picks up the pairing scan following every pump it
hears, sleep schedule writes, a deleted temp's remainder across a
segment change, and the setup history load. The identifiers, slugs and
basal grid Trio keys on are unchanged.
…o feat/tandem-next-dev

# Conflicts:
#	TandemKit
Move the Tandem beta to LoopKit next-dev
jwoglom and others added 11 commits November 12, 2026 21:43
…eta-next-dev

# Conflicts:
#	.gitmodules
#	Trio/Sources/Services/Alerts/AlertCatalogRegistry.swift
TandemKit at 2bfa207a imported LoopAlgorithm and used
prepareForDeactivation, both gone from dev's LoopKit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The home screen and the Nightscout device status take the reservoir from
PumpManager.currentReservoir, which had no TandemPumpManager case, so a
Tandem pump showed no reservoir from the next-dev build on.


Claude-Session: https://claude.ai/code/session_01XhwmAX4SHZZXz9eQdp6rch

Co-authored-by: Claude <noreply@anthropic.com>
…ext-dev

Resolve .gitmodules: keep SyaiKit tracking trio-next-dev as dev does, and
TandemKit tracking next-dev, whose tip the submodule is pinned to.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XhwmAYhaDeAK4ZYD8bnza2
…-dev

Merge tandem-closed-beta-next-dev into tandem-closed-beta
Resolve project.pbxproj: add TandemKit framework, ASN1/BigInt products and
AlertCatalogRegistryTandemTests while keeping all Tai-only references; drop
upstream's BolusDisplayThreshold build file and RileyLinkKit/OmniFault entries
that Tai already carries. Package.resolved keeps the union of pins.
@mountrcg
mountrcg merged commit 501e0c9 into dev Nov 20, 2026
3 checks passed
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.

4 participants