FAILURE MAP
← Case archive

FA-59847 / Inventory cost layering / Member archive

FIFO perpetual issue: stock sufficiency boundary · case 02

An issue that exactly empties the warehouse is rejected as short even though every unit is on hand.

Member previewVariant 2 · 3 implementations · 8 checks per implementation

Case contract

Input {layers:[[qty,unit_cost]] oldest first, events:[["recv",qty,unit_cost]|["issue",qty]]}. Issues consume the oldest layer first; an issue larger than on-hand is rejected whole and reported as "short"; a receipt at exactly the newest layer cost merges into it; receipts of zero or negative quantity are ignored. Return {cogs:[per-issue cost or "short"], layers}.

Why this case matters

Inventory valuation and cost-of-goods decisions depend on this rule.

One recorded failure

Sample boundary fixture

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

Boundary fixtureActualExpectedOutcome
exact depletion{"cogs": ["short"], "layers": [[4, 50], [2, 70]]}{"cogs": [340], "layers": []}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 ↗