FAILURE MAP
← Case archive

FA-59879 / Inventory cost layering / Member archive

Periodic LIFO year-end layering: liquidation direction · case 04

A LIFO liquidation keeps the newest base layers and discards the oldest, so the surviving layers carry recent prices.

Member previewVariant 4 · 3 implementations · 8 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
liquidation{"cogs": 57, "ending_value": 59, "layers": [[4, 24], [7, 35]]}{"cogs": 60, "ending_value": 56, "layers": [[10, 50], [1, 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 ↗