FA-64314 / Medication dosing calculations / Member archive
Infusion bag run-out time across rate changes: alarm floor at zero · case 04
A small bag shows an alarm time before the infusion started.
Case contract
Input {bag_ml, segments [[start_min, rate_ml_h], ...] ascending from 0}. Each segment runs until the next start; the last segment is open-ended. Paused segments (rate 0) consume nothing. Return {empty_min, alarm_min = max(0, empty-30)} rounded to 0.1 min, or both None when the bag never empties.
Why this case matters
Run-out prediction walks piecewise-constant rates; segment edges, open-ended tails and unit conversion fail independently.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| small bag alarm clamps at zero | {"alarm_min": -21.4, "empty_min": 8.6} | {"alarm_min": 0.0, "empty_min": 8.6} | 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 ↗