FAILURE MAP
← Case archive

FA-60210 / Inventory cost layering / Member archive

Inter-warehouse transfer of cost layers: destination layer placement · case 05

Transferred stock becomes the oldest stock at the destination and ships before local receipts.

Member previewVariant 5 · 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
span layers{"dst": [[3, 206], [3, 151], [2, 90]], "src": [[2, 104]]}{"dst": [[2, 90], [3, 151], [3, 206]], "src": [[2, 104]]}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 ↗