Skip to content

Commit 3dfd001

Browse files
bewestCopilot
andcommitted
EXP-2845 cluster: route hypothesis + unified triage + time-of-day refinement
Three woven deliverables closing the EXP-2843/2844 phenotype line. EXP-2845 (route hypothesis): - 17 significant patients, S0/S1 delivery decomposed by route - Loop and Trio deliver IDENTICAL total compensation in S1 (Δ=0.254 U/h both, p=0.82) but route oppositely: Loop +basal, Trio -basal +SMB - H2 PASS (p=0.032): Loop basal uplift > Trio - H3 PASS (p=0.82): total delivery similar - H1 FAIL (p=0.41): SMB share similar (~33%) - SMB *delta* differs 6× - Decisive: phenotype is controller-software route choice, not biology - chart: exp-2845_route_by_controller.png EXP-2845b (unified triage cross-tab): - Outer-join EXP-2812 + 2831 + 2844 flags into single triage table - Patient b (Loop, flat) = ONLY triple-flag in cohort (recovery=0.00, post_high=30.9%, wear delta=-31.5%) - 2 Trio patients carry double-flags (wear + post-high) - chart: triage_unified_table.png EXP-2845c (time-of-day refinement, pairs with EXP-2780): - Per-(patient, hour, state) basal aggregation, S1-S0 % delta - down_shifters cut hardest in dawn (-15%) and midday (-13%) - up_shifters raise hardest in midday (+11%) and evening (+11%) - flat phenotype is also window-flat (controller not adapting) - charts: tod_basal_heatmap_cohort.png + tod_basal_panel_by_phenotype.png Combined: profile audition recommendations must be (controller, phenotype, time-of-day) aware. Same envelope demand, same total compensation, opposite routes, localized to specific hours. All Stream B; no biology numbers; charter Appendix V compliant. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 68fc023 commit 3dfd001

8 files changed

Lines changed: 723 additions & 0 deletions
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# EXP-2845 Cluster: Route, Triage, and Time-of-Day Refinement
2+
3+
**Date**: 2026-04-22
4+
**Stream**: B (operational)
5+
**Charter**: two-stream-methodology-charter-2026-04-22.md (V1–V8)
6+
**Predecessors**: EXP-2843 (envelope coupling), EXP-2844 (phenotype split)
7+
8+
Three woven deliverables that close the EXP-2843/2844 line: route
9+
hypothesis test, unified triage cross-tab, and time-of-day refinement
10+
of the phenotype audit.
11+
12+
---
13+
14+
## EXP-2845: SMB-route hypothesis (Loop vs Trio in S1)
15+
16+
**Question**: Does Loop's "never down-shift" (0/6) and Trio's "always
17+
down-shift" (5/6) reduce to *route* of insulin delivery (basal vs SMB)
18+
rather than total quantity?
19+
20+
**Method**: For each of 17 significant patients, compute hourly delivery
21+
rate in S0 and S1 windows for: actual basal, bolus, SMB, total.
22+
Test H1 (Trio SMB share > Loop), H2 (Loop basal uplift > Trio),
23+
H3 (total delivery similar).
24+
25+
**Results**:
26+
27+
| Controller | n | Δ basal U/h | Δ SMB U/h | Δ total U/h | SMB share S1 |
28+
|------------|--:|------------:|----------:|------------:|-------------:|
29+
| Loop | 6 | **+0.084** | +0.033 | **+0.254** | 0.34 |
30+
| Trio | 6 | **−0.048** | +0.208 | **+0.254** | 0.36 |
31+
| OpenAPS | 5 | +0.024 | 0.000 | −0.019 | 0.00 |
32+
33+
| Hypothesis | Test | p | Result |
34+
|---|---|---|---|
35+
| H1 SMB share Trio > Loop | M-W (greater) | 0.41 | FAIL |
36+
| H2 Basal uplift Loop > Trio | M-W (greater) | **0.032** | **PASS** |
37+
| H3 Total delivery similar | M-W (two-sided) | **0.82** | **PASS** |
38+
39+
**Interpretation (Stream B, decisive)**: Loop and Trio deliver
40+
**identical total compensation** in S1 (0.254 U/h both, p=0.82) but
41+
**route it oppositely**: Loop pushes via basal uplift; Trio cuts basal
42+
and pushes via SMB. SMB share at S1 is ~similar (~33%) between Loop and
43+
Trio, but the *delta* in SMB is 6× larger for Trio (+0.21 vs +0.03).
44+
45+
This is the cleanest possible Stream B finding: **same envelope demand,
46+
same closed-loop net response, different controller-software route
47+
choice**. EXP-2844's phenotype split is now fully explained as a
48+
controller-route artifact, not a per-patient biological property.
49+
50+
**Audition implication**: Profile basal recommendations must be
51+
controller-aware. A "raise scheduled basal" recommendation for a Loop
52+
up-shifter and a "lower scheduled basal" recommendation for a Trio
53+
down-shifter may both be the correct way to *retire* the same envelope
54+
demand the open-loop profile is missing.
55+
56+
OpenAPS shows zero SMB delta in this cohort (5/5 patients) — likely
57+
configuration- or version-dependent; flagged for follow-up.
58+
59+
**Source**: `tools/cgmencode/exp_smb_route_2845.py`,
60+
`docs/60-research/figures/exp-2845_route_by_controller.png`.
61+
62+
---
63+
64+
## EXP-2845b: Unified triage cross-tab (flat-phenotype investigation)
65+
66+
**Question**: Does the flat phenotype (n=5, worst recovery 0.00) overlap
67+
with EXP-2812 (recovery flags) and EXP-2831 (wear flags)?
68+
69+
**Method**: Outer-join EXP-2844 phenotype × EXP-2812 recovery flags ×
70+
EXP-2831 wear flags into a unified triage table; sort by total flag
71+
count.
72+
73+
**Results** (top rows):
74+
75+
| Patient | Controller | Phenotype | Δ basal % | Recovery | Post %high | Wear Δ% | Flags |
76+
|---------|------------|-----------|----------:|---------:|-----------:|--------:|:-----:|
77+
| **b** | Loop | **flat** | +0.3 | 0.00 | 30.9 | −31.5 | **3** |
78+
| ns-d444c120c23a | Trio | down_shift | −24.8 | 0.25 | 34.7 | −14.2 | 2 |
79+
| ns-dde9e7c2e752 | Trio | up_shift | +23.6 | 0.25 | 30.9 | +16.0 | 2 |
80+
| ns-6bef17b4c1ec | Trio | down_shift | −27.7 ||| −20.6 | 1 |
81+
| i | Loop | up_shift | +15.8 ||| −44.7 | 1 |
82+
83+
**Interpretation**:
84+
- Patient `b` is the only **triple-flag** case across the entire cohort.
85+
It is also the only flat-phenotype patient with EXP-2812 transition
86+
data — combined evidence is overwhelming for site rotation/profile
87+
re-audit.
88+
- The other 4 flat patients lack S0→S1 transition data in EXP-2812
89+
(insufficient transitions ≥2). Their flat status remains a phenotype
90+
observation but cannot be cross-validated against recovery yet.
91+
- 2 Trio patients carry double-flags via wear + post-high; both have
92+
significant S1 phenotype shifts.
93+
94+
**Source**: `tools/cgmencode/viz_unified_triage.py`,
95+
`docs/60-research/figures/triage_unified_table.png`,
96+
`externals/experiments/exp-2845b_unified_triage.parquet`.
97+
98+
---
99+
100+
## EXP-2845c: Time-of-day refinement
101+
102+
**Question**: Does the S1 basal shift concentrate in particular
103+
time-of-day windows? (V8: pairs viz with EXP-2780 circadian basal.)
104+
105+
**Method**: For each (patient, hour, state), aggregate mean actual and
106+
scheduled basal. Compute hourly Δbasal% (S1 − S0 normalized to
107+
scheduled). Render cohort heatmap (24 hours × 17 patients) and
108+
phenotype-aggregated window panel.
109+
110+
**Results** (median Δbasal % by phenotype × window):
111+
112+
| Window | down_shift | flat | up_shift |
113+
|--------|----------:|-----:|---------:|
114+
| Overnight (0–3) | −9% | −2% | +6% |
115+
| **Dawn (4–9)** | **−15%** | −3% | +7% |
116+
| Midday (10–15) | −13% | −1% | **+11%** |
117+
| Evening (16–23) | −5% | +2% | **+11%** |
118+
119+
**Interpretation (Stream B)**:
120+
- **down_shift** patients: controller cuts hardest in **dawn and
121+
midday** (−15%, −13%). The open-loop profile is over-basaled in the
122+
morning hours; controller corrects by cutting.
123+
- **up_shift** patients: controller raises hardest in **midday and
124+
evening** (+11%, +11%). The open-loop profile is under-basaled in
125+
active hours; controller corrects by adding.
126+
- **flat**: window-flat as well (≤±3% in every window) — these
127+
controllers really are not adapting time-of-day demand at all.
128+
129+
**Audition implications by (phenotype, window)**:
130+
131+
| Phenotype | Dawn | Midday | Evening |
132+
|-----------|------|--------|---------|
133+
| down_shift | **lower scheduled basal here first** | also high-priority cut | mild cut |
134+
| up_shift | mild raise | **raise scheduled basal here** | **also raise** |
135+
| flat | (no signal) | (no signal) | (no signal) — investigate controller capacity |
136+
137+
**Source**: `tools/cgmencode/viz_time_of_day_audit.py`,
138+
`docs/60-research/figures/tod_basal_heatmap_cohort.png`,
139+
`docs/60-research/figures/tod_basal_panel_by_phenotype.png`,
140+
`externals/experiments/exp-2845c_tod_summary.parquet`.
141+
142+
---
143+
144+
## Combined synthesis
145+
146+
The EXP-2843/2844/2845 line now provides a complete operational story:
147+
148+
1. **Envelope state matters** (EXP-2843): 17/22 patients show
149+
significant S0/S1 basal differences.
150+
2. **Direction is a controller-route choice** (EXP-2844 + 2845):
151+
Loop routes via basal-up, Trio routes via SMB+basal-down,
152+
*same total compensation*.
153+
3. **Time-of-day localizes the recommendation** (EXP-2845c): the
154+
actionable schedule edit lives in dawn (down-shifters) or
155+
midday/evening (up-shifters).
156+
4. **Unified triage** (EXP-2845b) makes patient `b` the unambiguous
157+
highest-confidence intervention candidate (3 flags).
158+
159+
All findings are Stream B operational. No biology number is asserted
160+
anywhere in this cluster; profile-vs-actual gap is the audition unit
161+
throughout. Cohort overlays use percentile bands (V3) and "you are
162+
here" callouts (V4). Phenotype direction is foregrounded in every
163+
chart (V5). Each research question shipped with a paired chart (V8).
164+
165+
## Open follow-ups
166+
167+
- OpenAPS zero-SMB observation: configuration vs version vs cohort
168+
artifact?
169+
- Flat-phenotype patients without EXP-2812 transition coverage:
170+
back-fill with looser n_trans criterion?
171+
- Sensor-gap orthogonal Stream A test (still open from prior plan)
172+
- 24h state windows (EXP-2843b) to catch transitions earlier
86.5 KB
Loading
103 KB
Loading
58.9 KB
Loading
110 KB
Loading

0 commit comments

Comments
 (0)