Skip to content

Commit 515f6a3

Browse files
bewestCopilot
andcommitted
Patient C therapy-discussion vignette + 6 visualizations
Sample clinician/patient discussion report demonstrating the full audition matrix applied to one well-characterized case. Pulls every production audition signal + raw 180-day grid stats for patient c and emits a Stream B operational triage report. Patient C profile: GMI 7.2%, TIR 51%, CV 43%, clean carb log (95%% real meals). Four audition signals fire at P=1.00: - basal_mismatch (mult=0.0; controller suspends ~100% in fasting) - isf_over_correction - low_recovery - post_high_envelope Joint reading: coherent over-aggressive-basal cascade. Report frames 4 conversation starters for clinic review (basal trial, ISF softening, post-high investigation, site rotation) with explicit EXP-2738 safety caveat - the gap IS the EGP margin; recommended trial reduction (5-10%) is intentionally much smaller than observed multiplier. Figures: AGP, TIR bar, scheduled-vs-actual basal, carb log distribution, post-meal excursion samples, audition signal panel. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 13017b0 commit 515f6a3

8 files changed

Lines changed: 576 additions & 0 deletions

File tree

62.9 KB
Loading
25.8 KB
Loading
50.8 KB
Loading
37.3 KB
Loading
84.9 KB
Loading
52.8 KB
Loading
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
# Patient C — Therapy-Discussion Vignette (2026-04-22)
2+
3+
> **Operational triage report (Stream B).** Every recommendation is a
4+
> *conversation starter* for clinician/patient review — not an autonomous
5+
> setting change. Per the safety memory (EXP-2738): **the gap between
6+
> scheduled and delivered insulin often IS the controller's safety
7+
> margin.** Lowering settings to "match" the gap can increase
8+
> hypoglycemia.
9+
10+
## Summary
11+
12+
| Metric | Value |
13+
|--------|------:|
14+
| Observation window | 180 days |
15+
| Mean glucose | 162 mg/dL |
16+
| GMI (eA1c estimate) | **7.2 %** |
17+
| Coefficient of variation | 43% (target <36%) |
18+
| Time in range (70–180) | **51%** (target ≥70%) |
19+
| Time below range (<70) | 3.9% (target <4%) |
20+
| Time very low (<54) | 1.29% (target <1%) |
21+
| Time above range (>180) | 28% (target <25%) |
22+
| Time very high (>250) | 10% (target <5%) |
23+
| Carb-log quality | 2.2 events/day · 95% ≥10 g (**clean log**) |
24+
| Median scheduled basal | 1.40 U/h |
25+
| Median delivered basal | 0.00 U/h |
26+
27+
## Glycemic profile
28+
29+
![AGP](figures/patient-c-vignette/01_agp.png)
30+
31+
![TIR](figures/patient-c-vignette/02_tir.png)
32+
33+
**Read:** TIR is just above 50% — clinically meaningful improvement
34+
target. CV 43% (>36%) suggests glycemic instability is the
35+
dominant driver, not just elevated mean.
36+
37+
## Bootstrap-confident audition signals
38+
39+
![Audition panel](figures/patient-c-vignette/06_audition_panel.png)
40+
41+
| Signal | P | Tier | Source |
42+
|--------|--:|------|--------|
43+
| **flat_low_recovery** || high | matrix |
44+
| **isf_over_correction** || medium | matrix |
45+
| **site_degradation** || low | matrix |
46+
| **post_high_envelope** || medium | matrix |
47+
| **basal_mismatch** || high | matrix |
48+
49+
**Raw bootstrap probabilities:**
50+
51+
| Signal | P | Source |
52+
|---|---:|---|
53+
| Basal mismatch | 1.00 | EXP-2869 🔴 high |
54+
| ISF over-correction | 1.00 | EXP-2861 🔴 high |
55+
| Low recovery | 1.00 | EXP-2862 🔴 high |
56+
| Post-high envelope | 1.00 | EXP-2864 🔴 high |
57+
| Site degradation | 0.39 | EXP-2863 🟠 boundary |
58+
| ISF under-correction | 0.00 | EXP-2861 ⬜ clean |
59+
| Simpson paradox | 0.00 | EXP-2859 ⬜ clean |
60+
61+
62+
## The story (4 high-confidence signals point to one mechanism)
63+
64+
Patient C shows a **coherent over-aggressive-basal cascade**:
65+
66+
1. **Basal mismatch (P=1.00, mult=0.00):**
67+
in fasting equilibrium the controller delivers ~0% of the scheduled
68+
basal — it is suspending almost continuously to defend against the
69+
schedule.
70+
71+
2. **ISF over-correction (P=1.00):** when
72+
the controller does correct, BG drops more than the ISF predicts
73+
(over-correction). This is consistent with the basal already being
74+
"too much" — additional bolus drops too far.
75+
76+
3. **Low recovery (P=1.00):** after a low,
77+
recovery to 100 mg/dL within 60 minutes is rare — also consistent
78+
with continuous basal pressure.
79+
80+
4. **Post-high envelope (P=1.00):** after
81+
a high, BG sustains above target without a quick recovery — the
82+
wide IQR (110–203) confirms oscillation rather than tight control.
83+
84+
## Conversation starters for clinic review
85+
86+
> ⚠️ **Do not change settings autonomously.** These are hypotheses for
87+
> the clinician to discuss with the patient.
88+
89+
### 1. Review basal schedule
90+
The 4 signals above are individually noisy but jointly point to
91+
**scheduled basal being too high**. Recommended discussion:
92+
- Audit overnight TBR pattern (figure 1, hours 0–6).
93+
- Consider: was the basal schedule last reviewed? Has weight,
94+
activity, or insulin sensitivity changed?
95+
- A **conservative trial** of a 5–10% basal reduction (clinician-
96+
supervised) tests the hypothesis safely. The controller's 0%
97+
delivery suggests there is room.
98+
99+
### 2. Review ISF (correction factor)
100+
Over-correction (P=1.00) on top of an already-suppressed basal
101+
suggests ISF may be too aggressive. Discuss whether to **soften ISF
102+
by 10–15%** as a paired adjustment with #1.
103+
104+
### 3. Investigate post-high recovery
105+
P=1.00 for sustained post-high envelope. Discussion points:
106+
- Is bolus timing pre-meal (not at meal start)?
107+
- Are corrections being delivered at high BG, or is the patient
108+
waiting for the controller alone?
109+
110+
### 4. Site rotation (low-confidence)
111+
Site-degradation P=0.39 (boundary, not
112+
confirmed). Worth asking about rotation cadence but not a primary
113+
finding.
114+
115+
## Carb-log quality (no concern)
116+
117+
![Carb log](figures/patient-c-vignette/04_carb_log.png)
118+
119+
Patient C's log is clean: 95% of events ≥10 g, only 3% are <5 g
120+
(treat-of-low / noise). The audition signals are **not** confounded
121+
by data-quality issues for this patient.
122+
123+
## Basal pattern detail
124+
125+
![Basal](figures/patient-c-vignette/03_basal_schedule.png)
126+
127+
The black line is the patient's scheduled basal across the day; the
128+
red band is what the controller actually delivered (P25–P75). The
129+
controller is **continuously suppressing** delivery across all hours
130+
— most pronounced during the afternoon/evening peak hours of the
131+
schedule.
132+
133+
## Post-meal excursion examples
134+
135+
![Excursions](figures/patient-c-vignette/05_meal_excursions.png)
136+
137+
Six largest real meals in the dataset, plotted ±1 hr / +4 hr from the
138+
meal time. These illustrate the high variance in meal response that
139+
drives the wide IQR in the AGP.
140+
141+
## Methodology
142+
143+
* All audition signals computed from production loaders
144+
(`tools/cgmencode/production/*_facts_loader.py`).
145+
* Bootstrap confidence (P) computed per the EXP-2859/2861/2862/2863/
146+
2864/2869 protocols.
147+
* Carb-event quality assessed against the EXP-2866 conventions
148+
(`meal_filter.py`).
149+
* Source data: `externals/ns-parquet/training/grid.parquet`,
150+
patient_id = `c`, 51,841 rows, 180 days.
151+
152+
## Caveats
153+
154+
* **Not medical advice.** Audition signals are statistical patterns;
155+
every recommendation must be filtered through the clinician's
156+
judgment and the patient's full history.
157+
* **Stream B operational, not Stream A causal.** These signals describe
158+
*what the controller is doing*, not *what biological ISF/basal
159+
needs are*. The closed-loop system response is observed; the
160+
underlying biology is inferred only loosely.
161+
* **Per EXP-2738**: the basal-mismatch gap IS the EGP safety margin
162+
the controller needs. The recommended trial reduction (5–10%) is
163+
much smaller than the observed multiplier (~0%) because the gap is
164+
protective.

0 commit comments

Comments
 (0)