FA-60069 / Inventory cost layering / Member archive
First-expired-first-out lot picking: shelf-life reference date · case 04
Nearly expired lots are shipped because shelf life is compared against an absolute day number.
Case contract
Input {lots:[[lot,qty,expiry_day,unit_cost]], today, order_qty, min_shelf}. A lot is eligible when expiry_day - today >= min_shelf. Eligible lots are picked by earliest expiry, ties by lot id ascending. If eligible stock < order_qty return {"error":"insufficient","available":eligible qty}. Return {picks:[[lot,qty]], cost}.
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 |
|---|---|---|---|
| insufficient | {"cost": 99, "picks": [["B", 9]]} | {"available": 4, "error": "insufficient"} | 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 ↗