FAILURE MAP
← Case archive

FA-59869 / Inventory cost layering / Member archive

FIFO perpetual issue: depleted layer removal · case 04

Fully consumed layers remain in the layer list with zero quantity.

Member previewVariant 4 · 3 implementations · 9 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
span two layers{"cogs": [860], "layers": [[7, 120], [0, 100]]}{"cogs": [860], "layers": [[7, 120]]}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 ↗