FA-59979 / Inventory cost layering / Member archive
Lower of cost and net realizable value: negative nrv floor · case 04
Items that cost more to finish and sell than they fetch get a negative carrying value.
Case contract
Input {items:[{sku,qty,cost,price,complete,sell_bp,group}], prior:{sku:carrying unit}}. NRV = price - complete - round-half-up(price*sell_bp/10000), floored at 0. Carrying unit = min(original cost, NRV). Adjustment = qty*(carrying - prior carrying), prior defaulting to original cost (reversals are thereby capped at cost). Group check: write-down per group = max(0, sum qty*cost - sum qty*NRV). Return {items:[[sku,carry,adj]], group_writedown}.
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 |
|---|---|---|---|
| negative nrv | {"group_writedown": {"g2": 1242}, "items": [["C", -14, -1242]]} | {"group_writedown": {"g2": 1200}, "items": [["C", 0, -1200]]} | 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 ↗