FA-59898 / Inventory cost layering / Member archive
Periodic LIFO year-end layering: increment exhaustion stop · case 03
The increment layer absorbs units from every purchase even after the increment is satisfied.
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 fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| increment layer | {"cogs": 0, "ending_value": 212, "layers": [[10, 50], [4, 24], [14, 138]]} | {"cogs": 117, "ending_value": 95, "layers": [[10, 50], [4, 24], [3, 21]]} | 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 ↗