FAILURE MAP
← Case archive

FA-63990 / Medication dosing calculations / Member archive

Meal and correction insulin bolus with insulin on board: carbohydrate ratio division · case 05

A 59 g meal with a 1:10 ratio is covered with only 5 units before correction.

Member previewVariant 5 · 3 implementations · 8 checks per implementation

Case contract

Input {bg, target, isf, carbs_g, icr, iob, max_units}. Toy rule: bg < 70 returns HOLD with 0 units. correction = (bg-target)/isf; when positive, insulin on board is subtracted from it and the result floored at 0; a negative correction (bg below target) is kept and reduces the meal dose. meal = carbs_g/icr. total = max(0, meal + correction), capped at max_units, then rounded DOWN to 0.5 units. Return {action GIVE|HOLD, units}.

Why this case matters

Bolus calculators combine several unit ratios and safety rules; insulin-on-board, hypoglycaemia holds and pen resolution are separate decision points.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
high glucose with insulin on board{"action": "GIVE", "units": 10.0}{"action": "GIVE", "units": 10.5}Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗