FAILURE MAP
← Case archive

FA-64182 / Medication dosing calculations / Member archive

Patient-controlled analgesia lockout and hourly limit: rolling hour window edge · case 02

A delivery exactly one hour old still counts against the hourly limit.

Member previewVariant 2 · 3 implementations · 7 checks per implementation

Case contract

Input {presses (ascending seconds), dose_mg, lockout_min, hour_limit_mg}. A press less than 2 s after the previous press (delivered or not) is a switch bounce and ignored entirely. Otherwise it is denied for lockout when less than lockout_min*60 s have passed since the last DELIVERED dose, denied for limit when (deliveries in the preceding 3600 s + 1)*dose exceeds hour_limit_mg, else delivered. Return {delivered, denied_lockout, denied_limit, total_mg}.

Why this case matters

PCA pumps enforce lockout and rolling-hour limits on a stream of button presses; reference points and window edges are distinct defects.

One recorded failure

Sample boundary fixture

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

Boundary fixtureActualExpectedOutcome
delivery exactly one hour old expires{"delivered": [0, 1200, 2400], "denied_limit": 1, "denied_lockout": 0, "total_mg": 3.0}{"delivered": [0, 1200, 2400, 3600], "denied_limit": 0, "denied_lockout": 0, "total_mg": 4.0}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 ↗