FAILURE MAP
← Case archive

FA-59872 / Inventory cost layering / Member archive

Periodic LIFO year-end layering: increment layer pricing order · case 02

The year-end LIFO increment is valued at the latest purchase prices, overstating ending inventory in inflationary years.

Member previewVariant 2 · 3 implementations · 9 checks per implementation

Case contract

Input {begin:[[qty,unit]] oldest first, purchases:[[qty,unit]] chronological, ending_qty}. Ending inventory keeps the oldest units: if ending_qty covers the base, all base layers stay and one increment layer is priced at the EARLIEST purchases of the year; otherwise the newest base layers are liquidated. ending_qty outside [0, available] returns {"error"}. Return {layers:[[qty,value]], ending_value, cogs}.

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
increment layer{"cogs": 75, "ending_value": 129, "layers": [[10, 50], [4, 24], [5, 55]]}{"cogs": 95, "ending_value": 109, "layers": [[10, 50], [4, 24], [5, 35]]}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 ↗