FAILURE MAP
← Case archive

FA-60212 / Inventory cost layering / Member archive

Inter-warehouse transfer of cost layers: exhausted layer test · case 02

A zero-cost free-goods layer is dropped from the source after a partial draw, losing units.

Member previewVariant 2 · 3 implementations · 8 checks per implementation

Case contract

Layers are [qty, total value]. A transfer of qty draws FIFO from src; a partial draw takes floor(t*value/qty) and leaves the residue in src; a layer is removed when its quantity reaches zero. Freight is split across the drawn pieces by quantity (floor), residual cents to the first piece, and each piece is appended to dst in draw order as the newest layers. qty<=0 or qty above src stock returns {"error"}. Return {src, dst}.

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
free goods layer{"dst": [[1, 10], [2, 9]], "src": [[2, 40]]}{"dst": [[1, 10], [2, 9]], "src": [[3, 0], [2, 40]]}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 ↗