{"abstract":"The receipt joins a nearby bin with a distant expiry while a bin with a matching expiry is available.","category":"Warehouse slotting and bin packing","checks":8,"contract":"bins [[bin, sku|None, lot, expiry_day, qty, capacity, distance]]; receipt [sku, lot, expiry_day, qty]. A bin is empty when sku is None or qty is 0. Preference: (1) non-empty bin with same sku and lot and room (capacity-qty >= receipt qty), nearest then id; (2) same sku, different lot, expiry within 30 days either way, room; smallest expiry gap, nearest, id; (3) empty bin with capacity >= qty, nearest then id; else \"HOLD\".","evaluation_group":"w2-warehouse-slotting-fefo-putaway","failed_approach":"Keeping the expiry gap but skipping distance picks a farther bin on expiry ties.","family":"w2-warehouse-slotting-fefo-putaway-mixed-lot-rank","id":"FA-95051","implementations":{"attempt":{"sha256":"591e9ffd2d4462cdbe867e8b1f80b9730b36d2476052ea246fc68062b8169b76","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(bins, receipt):\n    sku, lot, exp, q = receipt\n    def room(b):\n        return b[5] - b[4] >= q\n    def empty(b):\n        return b[1] is None or b[4] == 0\n    same_lot = [b for b in bins if not empty(b) and b[1] == sku and b[2] == lot and room(b)]\n    if same_lot:\n        return min(same_lot, key=lambda b: (b[6], b[0]))[0]\n    mixed = [b for b in bins if not empty(b) and b[1] == sku and b[2] != lot and abs(b[3] - exp) <= 30 and room(b)]\n    if mixed:\n        return min(mixed, key=lambda b: (abs(b[3] - exp), b[0]))[0]\n    free = [b for b in bins if empty(b) and b[5] >= q]\n    if free:\n        return min(free, key=lambda b: (b[6], b[0]))[0]\n    return 'HOLD'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['generated mix 17', [[['B0', 'S2', 'L2', 120, 0, 20, 8], ['B1', 'S1', 'L2', 131, 5, 40, 3], ['B2', 'S2', 'L2', 100, 10, 20, 8], ['B3', 'S2', 'L2', 100, 10, 60, 6], ['B4', 'S1', 'L3', 100, 30, 40, 3], ['B5', 'S1', 'L1', 145, 10, 60, 5]], ['S1', 'L4', 150, 20]], 'B5'], ['generated mix 1', [[['B0', 'S1', 'L2', 130, 5, 40, 9], ['B1', 'S1', 'L2', 160, 10, 60, 9], ['B2', 'S1', 'L2', 130, 10, 40, 2], ['B3', 'S2', 'L1', 120, 0, 40, 3], ['B4', 'S2', 'L2', 130, 30, 20, 6], ['B5', 'S2', 'L3', 130, 40, 20, 3], ['B6', 'S2', 'L2', 130, 30, 20, 8]], ['S1', 'L1', 130, 10]], 'B2'], ['same lot preferred', [[['A', 'S1', 'L1', 100, 10, 40, 9], ['B', 'S1', 'L2', 100, 0, 40, 1]], ['S1', 'L1', 100, 20]], 'A'], ['expiry 30 days later', [[['A', 'S1', 'L2', 130, 10, 60, 5], ['E', None, None, 0, 0, 60, 1]], ['S1', 'L1', 100, 20]], 'A'], ['residual label empty', [[['R', 'S9', 'L7', 50, 0, 60, 2], ['E', None, None, 0, 0, 60, 4]], ['S1', 'L1', 100, 20]], 'R'], ['nothing', [[['X', 'S2', 'L1', 100, 5, 10, 1]], ['S1', 'L1', 100, 20]], 'HOLD'], ['room exact', [[['A', 'S1', 'L1', 100, 20, 40, 9], ['E', None, None, 0, 0, 40, 1]], ['S1', 'L1', 100, 20]], 'A'], ['generated mix 7', [[['B0', 'S1', 'L1', 130, 10, 40, 3], ['B1', 'S2', 'L3', 160, 30, 20, 2], ['B2', 'S1', 'L2', 145, 0, 20, 1]], ['S2', 'L4', 130, 20]], 'B2']], [['generated mix 52', [[['B0', None, None, 0, 0, 20, 9], ['B1', 'S1', 'L3', 120, 10, 60, 1], ['B2', 'S1', 'L3', 120, 40, 20, 9], ['B3', 'S1', 'L2', 100, 40, 60, 4]], ['S1', 'L4', 100, 10]], 'B3'], ['generated mix 1', [[['B0', 'S1', 'L2', 130, 5, 40, 9], ['B1', 'S1', 'L2', 160, 10, 60, 9], ['B2', 'S1', 'L2', 130, 10, 40, 2], ['B3', 'S2', 'L1', 120, 0, 40, 3], ['B4', 'S2', 'L2', 130, 30, 20, 6], ['B5', 'S2', 'L3', 130, 40, 20, 3], ['B6', 'S2', 'L2', 130, 30, 20, 8]], ['S1', 'L1', 130, 10]], 'B2'], ['expiry 31 days', [[['A', 'S1', 'L2', 131, 10, 60, 5], ['E', None, None, 0, 0, 60, 1]], ['S1', 'L1', 100, 20]], 'E'], ['lot code on other sku', [[['X', 'S2', 'L1', 100, 5, 60, 1], ['E', None, None, 0, 0, 60, 4]], ['S1', 'L1', 100, 20]], 'E'], ['same lot preferred', [[['A', 'S1', 'L1', 100, 10, 40, 9], ['B', 'S1', 'L2', 100, 0, 40, 1]], ['S1', 'L1', 100, 20]], 'A'], ['expiry 30 days later', [[['A', 'S1', 'L2', 130, 10, 60, 5], ['E', None, None, 0, 0, 60, 1]], ['S1', 'L1', 100, 20]], 'A'], ['generated mix 10', [[['B0', 'S2', 'L2', 145, 5, 20, 4], ['B1', 'S1', 'L2', 120, 5, 40, 1], ['B2', None, None, 0, 0, 40, 5]], ['S1', 'L4', 150, 30]], 'B1'], ['generated mix 18', [[['B0', None, None, 0, 0, 60, 7], ['B1', 'S1', 'L2', 145, 5, 60, 3], ['B2', 'S1', 'L2', 120, 40, 40, 7], ['B3', None, None, 0, 0, 20, 9], ['B4', None, None, 0, 0, 20, 9]], ['S1', 'L4', 130, 10]], 'B1']], [['generated mix 75', [[['B0', 'S1', 'L1', 120, 30, 60, 8], ['B1', None, None, 0, 0, 40, 8], ['B2', 'S1', 'L3', 130, 10, 60, 2]], ['S1', 'L4', 100, 30]], 'B0'], ['generated mix 1', [[['B0', 'S1', 'L2', 130, 5, 40, 9], ['B1', 'S1', 'L2', 160, 10, 60, 9], ['B2', 'S1', 'L2', 130, 10, 40, 2], ['B3', 'S2', 'L1', 120, 0, 40, 3], ['B4', 'S2', 'L2', 130, 30, 20, 6], ['B5', 'S2', 'L3', 130, 40, 20, 3], ['B6', 'S2', 'L2', 130, 30, 20, 8]], ['S1', 'L1', 130, 10]], 'B2'], ['nothing', [[['X', 'S2', 'L1', 100, 5, 10, 1]], ['S1', 'L1', 100, 20]], 'HOLD'], ['room exact', [[['A', 'S1', 'L1', 100, 20, 40, 9], ['E', None, None, 0, 0, 40, 1]], ['S1', 'L1', 100, 20]], 'A'], ['expiry 31 days', [[['A', 'S1', 'L2', 131, 10, 60, 5], ['E', None, None, 0, 0, 60, 1]], ['S1', 'L1', 100, 20]], 'E'], ['lot code on other sku', [[['X', 'S2', 'L1', 100, 5, 60, 1], ['E', None, None, 0, 0, 60, 4]], ['S1', 'L1', 100, 20]], 'E'], ['generated mix 21', [[['B0', 'S1', 'L3', 130, 40, 60, 3], ['B1', 'S1', 'L3', 145, 30, 40, 7], ['B2', 'S1', 'L2', 130, 40, 60, 4], ['B3', 'S2', 'L2', 120, 30, 40, 3], ['B4', 'S1', 'L3', 160, 30, 60, 2], ['B5', 'S1', 'L3', 160, 40, 40, 7]], ['S2', 'L4', 150, 10]], 'B3'], ['generated mix 29', [[['B0', None, None, 0, 0, 60, 5], ['B1', 'S1', 'L3', 100, 0, 60, 7], ['B2', 'S2', 'L2', 160, 40, 60, 7], ['B3', 'S1', 'L3', 131, 30, 60, 3], ['B4', 'S1', 'L1', 145, 10, 20, 4], ['B5', 'S2', 'L1', 130, 5, 40, 3], ['B6', 'S2', 'L2', 160, 40, 60, 5]], ['S1', 'L2', 100, 30]], 'B0']], [['generated mix 39', [[['B0', 'S1', 'L2', 120, 30, 20, 3], ['B1', 'S1', 'L3', 145, 0, 20, 4], ['B2', None, None, 0, 0, 40, 6], ['B3', 'S1', 'L3', 131, 30, 60, 9], ['B4', 'S1', 'L1', 100, 5, 60, 7], ['B5', None, None, 0, 0, 40, 4], ['B6', 'S2', 'L2', 100, 30, 60, 6]], ['S1', 'L4', 130, 10]], 'B3'], ['generated mix 1', [[['B0', 'S1', 'L2', 130, 5, 40, 9], ['B1', 'S1', 'L2', 160, 10, 60, 9], ['B2', 'S1', 'L2', 130, 10, 40, 2], ['B3', 'S2', 'L1', 120, 0, 40, 3], ['B4', 'S2', 'L2', 130, 30, 20, 6], ['B5', 'S2', 'L3', 130, 40, 20, 3], ['B6', 'S2', 'L2', 130, 30, 20, 8]], ['S1', 'L1', 130, 10]], 'B2'], ['expiry 30 days later', [[['A', 'S1', 'L2', 130, 10, 60, 5], ['E', None, None, 0, 0, 60, 1]], ['S1', 'L1', 100, 20]], 'A'], ['residual label empty', [[['R', 'S9', 'L7', 50, 0, 60, 2], ['E', None, None, 0, 0, 60, 4]], ['S1', 'L1', 100, 20]], 'R'], ['nothing', [[['X', 'S2', 'L1', 100, 5, 10, 1]], ['S1', 'L1', 100, 20]], 'HOLD'], ['room exact', [[['A', 'S1', 'L1', 100, 20, 40, 9], ['E', None, None, 0, 0, 40, 1]], ['S1', 'L1', 100, 20]], 'A'], ['generated mix 32', [[['B0', 'S1', 'L3', 145, 40, 40, 7], ['B1', None, None, 0, 0, 40, 3]], ['S2', 'L4', 150, 20]], 'B1'], ['generated mix 41', [[['B0', 'S1', 'L2', 160, 30, 60, 7], ['B1', 'S1', 'L2', 160, 40, 60, 3], ['B2', 'S1', 'L3', 100, 0, 60, 7], ['B3', 'S2', 'L2', 130, 10, 60, 9], ['B4', 'S1', 'L2', 160, 0, 20, 4], ['B5', 'S2', 'L2', 100, 30, 40, 4]], ['S2', 'L1', 130, 30]], 'B3']], [['generated mix 56', [[['B0', 'S2', 'L3', 120, 40, 20, 4], ['B1', 'S1', 'L3', 131, 0, 20, 8], ['B2', 'S1', 'L1', 130, 30, 40, 1], ['B3', 'S1', 'L1', 131, 5, 40, 7], ['B4', 'S2', 'L3', 160, 5, 20, 1], ['B5', 'S1', 'L3', 100, 10, 40, 7]], ['S1', 'L4', 100, 10]], 'B5'], ['generated mix 1', [[['B0', 'S1', 'L2', 130, 5, 40, 9], ['B1', 'S1', 'L2', 160, 10, 60, 9], ['B2', 'S1', 'L2', 130, 10, 40, 2], ['B3', 'S2', 'L1', 120, 0, 40, 3], ['B4', 'S2', 'L2', 130, 30, 20, 6], ['B5', 'S2', 'L3', 130, 40, 20, 3], ['B6', 'S2', 'L2', 130, 30, 20, 8]], ['S1', 'L1', 130, 10]], 'B2'], ['lot code on other sku', [[['X', 'S2', 'L1', 100, 5, 60, 1], ['E', None, None, 0, 0, 60, 4]], ['S1', 'L1', 100, 20]], 'E'], ['same lot preferred', [[['A', 'S1', 'L1', 100, 10, 40, 9], ['B', 'S1', 'L2', 100, 0, 40, 1]], ['S1', 'L1', 100, 20]], 'A'], ['expiry 30 days later', [[['A', 'S1', 'L2', 130, 10, 60, 5], ['E', None, None, 0, 0, 60, 1]], ['S1', 'L1', 100, 20]], 'A'], ['residual label empty', [[['R', 'S9', 'L7', 50, 0, 60, 2], ['E', None, None, 0, 0, 60, 4]], ['S1', 'L1', 100, 20]], 'R'], ['generated mix 43', [[['B0', 'S1', 'L1', 120, 30, 40, 4], ['B1', None, None, 0, 0, 20, 9]], ['S1', 'L4', 130, 10]], 'B0'], ['generated mix 51', [[['B0', 'S2', 'L3', 130, 40, 60, 6], ['B1', 'S1', 'L1', 130, 40, 40, 1], ['B2', 'S1', 'L1', 100, 30, 40, 8], ['B3', 'S1', 'L1', 145, 0, 20, 2]], ['S2', 'L1', 100, 30]], 'HOLD']]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"33def7f567dd9cd87d618bb13e0953878576caeba6f5e1d66040892523cb44e3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(bins, receipt):\n    sku, lot, exp, q = receipt\n    def room(b):\n        return b[5] - b[4] >= q\n    def empty(b):\n        return b[1] is None or b[4] == 0\n    same_lot = [b for b in bins if not empty(b) and b[1] == sku and b[2] == lot and room(b)]\n    if same_lot:\n        return min(same_lot, key=lambda b: (b[6], b[0]))[0]\n    mixed = [b for b in bins if not empty(b) and b[1] == sku and b[2] != lot and abs(b[3] - exp) <= 30 and room(b)]\n    if mixed:\n        return min(mixed, key=lambda b: (b[6], b[0]))[0]\n    free = [b for b in bins if empty(b) and b[5] >= q]\n    if free:\n        return min(free, key=lambda b: (b[6], b[0]))[0]\n    return 'HOLD'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['generated mix 17', [[['B0', 'S2', 'L2', 120, 0, 20, 8], ['B1', 'S1', 'L2', 131, 5, 40, 3], ['B2', 'S2', 'L2', 100, 10, 20, 8], ['B3', 'S2', 'L2', 100, 10, 60, 6], ['B4', 'S1', 'L3', 100, 30, 40, 3], ['B5', 'S1', 'L1', 145, 10, 60, 5]], ['S1', 'L4', 150, 20]], 'B5'], ['generated mix 1', [[['B0', 'S1', 'L2', 130, 5, 40, 9], ['B1', 'S1', 'L2', 160, 10, 60, 9], ['B2', 'S1', 'L2', 130, 10, 40, 2], ['B3', 'S2', 'L1', 120, 0, 40, 3], ['B4', 'S2', 'L2', 130, 30, 20, 6], ['B5', 'S2', 'L3', 130, 40, 20, 3], ['B6', 'S2', 'L2', 130, 30, 20, 8]], ['S1', 'L1', 130, 10]], 'B2'], ['same lot preferred', [[['A', 'S1', 'L1', 100, 10, 40, 9], ['B', 'S1', 'L2', 100, 0, 40, 1]], ['S1', 'L1', 100, 20]], 'A'], ['expiry 30 days later', [[['A', 'S1', 'L2', 130, 10, 60, 5], ['E', None, None, 0, 0, 60, 1]], ['S1', 'L1', 100, 20]], 'A'], ['residual label empty', [[['R', 'S9', 'L7', 50, 0, 60, 2], ['E', None, None, 0, 0, 60, 4]], ['S1', 'L1', 100, 20]], 'R'], ['nothing', [[['X', 'S2', 'L1', 100, 5, 10, 1]], ['S1', 'L1', 100, 20]], 'HOLD'], ['room exact', [[['A', 'S1', 'L1', 100, 20, 40, 9], ['E', None, None, 0, 0, 40, 1]], ['S1', 'L1', 100, 20]], 'A'], ['generated mix 7', [[['B0', 'S1', 'L1', 130, 10, 40, 3], ['B1', 'S2', 'L3', 160, 30, 20, 2], ['B2', 'S1', 'L2', 145, 0, 20, 1]], ['S2', 'L4', 130, 20]], 'B2']], [['generated mix 52', [[['B0', None, None, 0, 0, 20, 9], ['B1', 'S1', 'L3', 120, 10, 60, 1], ['B2', 'S1', 'L3', 120, 40, 20, 9], ['B3', 'S1', 'L2', 100, 40, 60, 4]], ['S1', 'L4', 100, 10]], 'B3'], ['generated mix 1', [[['B0', 'S1', 'L2', 130, 5, 40, 9], ['B1', 'S1', 'L2', 160, 10, 60, 9], ['B2', 'S1', 'L2', 130, 10, 40, 2], ['B3', 'S2', 'L1', 120, 0, 40, 3], ['B4', 'S2', 'L2', 130, 30, 20, 6], ['B5', 'S2', 'L3', 130, 40, 20, 3], ['B6', 'S2', 'L2', 130, 30, 20, 8]], ['S1', 'L1', 130, 10]], 'B2'], ['expiry 31 days', [[['A', 'S1', 'L2', 131, 10, 60, 5], ['E', None, None, 0, 0, 60, 1]], ['S1', 'L1', 100, 20]], 'E'], ['lot code on other sku', [[['X', 'S2', 'L1', 100, 5, 60, 1], ['E', None, None, 0, 0, 60, 4]], ['S1', 'L1', 100, 20]], 'E'], ['same lot preferred', [[['A', 'S1', 'L1', 100, 10, 40, 9], ['B', 'S1', 'L2', 100, 0, 40, 1]], ['S1', 'L1', 100, 20]], 'A'], ['expiry 30 days later', [[['A', 'S1', 'L2', 130, 10, 60, 5], ['E', None, None, 0, 0, 60, 1]], ['S1', 'L1', 100, 20]], 'A'], ['generated mix 10', [[['B0', 'S2', 'L2', 145, 5, 20, 4], ['B1', 'S1', 'L2', 120, 5, 40, 1], ['B2', None, None, 0, 0, 40, 5]], ['S1', 'L4', 150, 30]], 'B1'], ['generated mix 18', [[['B0', None, None, 0, 0, 60, 7], ['B1', 'S1', 'L2', 145, 5, 60, 3], ['B2', 'S1', 'L2', 120, 40, 40, 7], ['B3', None, None, 0, 0, 20, 9], ['B4', None, None, 0, 0, 20, 9]], ['S1', 'L4', 130, 10]], 'B1']], [['generated mix 75', [[['B0', 'S1', 'L1', 120, 30, 60, 8], ['B1', None, None, 0, 0, 40, 8], ['B2', 'S1', 'L3', 130, 10, 60, 2]], ['S1', 'L4', 100, 30]], 'B0'], ['generated mix 1', [[['B0', 'S1', 'L2', 130, 5, 40, 9], ['B1', 'S1', 'L2', 160, 10, 60, 9], ['B2', 'S1', 'L2', 130, 10, 40, 2], ['B3', 'S2', 'L1', 120, 0, 40, 3], ['B4', 'S2', 'L2', 130, 30, 20, 6], ['B5', 'S2', 'L3', 130, 40, 20, 3], ['B6', 'S2', 'L2', 130, 30, 20, 8]], ['S1', 'L1', 130, 10]], 'B2'], ['nothing', [[['X', 'S2', 'L1', 100, 5, 10, 1]], ['S1', 'L1', 100, 20]], 'HOLD'], ['room exact', [[['A', 'S1', 'L1', 100, 20, 40, 9], ['E', None, None, 0, 0, 40, 1]], ['S1', 'L1', 100, 20]], 'A'], ['expiry 31 days', [[['A', 'S1', 'L2', 131, 10, 60, 5], ['E', None, None, 0, 0, 60, 1]], ['S1', 'L1', 100, 20]], 'E'], ['lot code on other sku', [[['X', 'S2', 'L1', 100, 5, 60, 1], ['E', None, None, 0, 0, 60, 4]], ['S1', 'L1', 100, 20]], 'E'], ['generated mix 21', [[['B0', 'S1', 'L3', 130, 40, 60, 3], ['B1', 'S1', 'L3', 145, 30, 40, 7], ['B2', 'S1', 'L2', 130, 40, 60, 4], ['B3', 'S2', 'L2', 120, 30, 40, 3], ['B4', 'S1', 'L3', 160, 30, 60, 2], ['B5', 'S1', 'L3', 160, 40, 40, 7]], ['S2', 'L4', 150, 10]], 'B3'], ['generated mix 29', [[['B0', None, None, 0, 0, 60, 5], ['B1', 'S1', 'L3', 100, 0, 60, 7], ['B2', 'S2', 'L2', 160, 40, 60, 7], ['B3', 'S1', 'L3', 131, 30, 60, 3], ['B4', 'S1', 'L1', 145, 10, 20, 4], ['B5', 'S2', 'L1', 130, 5, 40, 3], ['B6', 'S2', 'L2', 160, 40, 60, 5]], ['S1', 'L2', 100, 30]], 'B0']], [['generated mix 39', [[['B0', 'S1', 'L2', 120, 30, 20, 3], ['B1', 'S1', 'L3', 145, 0, 20, 4], ['B2', None, None, 0, 0, 40, 6], ['B3', 'S1', 'L3', 131, 30, 60, 9], ['B4', 'S1', 'L1', 100, 5, 60, 7], ['B5', None, None, 0, 0, 40, 4], ['B6', 'S2', 'L2', 100, 30, 60, 6]], ['S1', 'L4', 130, 10]], 'B3'], ['generated mix 1', [[['B0', 'S1', 'L2', 130, 5, 40, 9], ['B1', 'S1', 'L2', 160, 10, 60, 9], ['B2', 'S1', 'L2', 130, 10, 40, 2], ['B3', 'S2', 'L1', 120, 0, 40, 3], ['B4', 'S2', 'L2', 130, 30, 20, 6], ['B5', 'S2', 'L3', 130, 40, 20, 3], ['B6', 'S2', 'L2', 130, 30, 20, 8]], ['S1', 'L1', 130, 10]], 'B2'], ['expiry 30 days later', [[['A', 'S1', 'L2', 130, 10, 60, 5], ['E', None, None, 0, 0, 60, 1]], ['S1', 'L1', 100, 20]], 'A'], ['residual label empty', [[['R', 'S9', 'L7', 50, 0, 60, 2], ['E', None, None, 0, 0, 60, 4]], ['S1', 'L1', 100, 20]], 'R'], ['nothing', [[['X', 'S2', 'L1', 100, 5, 10, 1]], ['S1', 'L1', 100, 20]], 'HOLD'], ['room exact', [[['A', 'S1', 'L1', 100, 20, 40, 9], ['E', None, None, 0, 0, 40, 1]], ['S1', 'L1', 100, 20]], 'A'], ['generated mix 32', [[['B0', 'S1', 'L3', 145, 40, 40, 7], ['B1', None, None, 0, 0, 40, 3]], ['S2', 'L4', 150, 20]], 'B1'], ['generated mix 41', [[['B0', 'S1', 'L2', 160, 30, 60, 7], ['B1', 'S1', 'L2', 160, 40, 60, 3], ['B2', 'S1', 'L3', 100, 0, 60, 7], ['B3', 'S2', 'L2', 130, 10, 60, 9], ['B4', 'S1', 'L2', 160, 0, 20, 4], ['B5', 'S2', 'L2', 100, 30, 40, 4]], ['S2', 'L1', 130, 30]], 'B3']], [['generated mix 56', [[['B0', 'S2', 'L3', 120, 40, 20, 4], ['B1', 'S1', 'L3', 131, 0, 20, 8], ['B2', 'S1', 'L1', 130, 30, 40, 1], ['B3', 'S1', 'L1', 131, 5, 40, 7], ['B4', 'S2', 'L3', 160, 5, 20, 1], ['B5', 'S1', 'L3', 100, 10, 40, 7]], ['S1', 'L4', 100, 10]], 'B5'], ['generated mix 1', [[['B0', 'S1', 'L2', 130, 5, 40, 9], ['B1', 'S1', 'L2', 160, 10, 60, 9], ['B2', 'S1', 'L2', 130, 10, 40, 2], ['B3', 'S2', 'L1', 120, 0, 40, 3], ['B4', 'S2', 'L2', 130, 30, 20, 6], ['B5', 'S2', 'L3', 130, 40, 20, 3], ['B6', 'S2', 'L2', 130, 30, 20, 8]], ['S1', 'L1', 130, 10]], 'B2'], ['lot code on other sku', [[['X', 'S2', 'L1', 100, 5, 60, 1], ['E', None, None, 0, 0, 60, 4]], ['S1', 'L1', 100, 20]], 'E'], ['same lot preferred', [[['A', 'S1', 'L1', 100, 10, 40, 9], ['B', 'S1', 'L2', 100, 0, 40, 1]], ['S1', 'L1', 100, 20]], 'A'], ['expiry 30 days later', [[['A', 'S1', 'L2', 130, 10, 60, 5], ['E', None, None, 0, 0, 60, 1]], ['S1', 'L1', 100, 20]], 'A'], ['residual label empty', [[['R', 'S9', 'L7', 50, 0, 60, 2], ['E', None, None, 0, 0, 60, 4]], ['S1', 'L1', 100, 20]], 'R'], ['generated mix 43', [[['B0', 'S1', 'L1', 120, 30, 40, 4], ['B1', None, None, 0, 0, 20, 9]], ['S1', 'L4', 130, 10]], 'B0'], ['generated mix 51', [[['B0', 'S2', 'L3', 130, 40, 60, 6], ['B1', 'S1', 'L1', 130, 40, 40, 1], ['B2', 'S1', 'L1', 100, 30, 40, 8], ['B3', 'S1', 'L1', 145, 0, 20, 2]], ['S2', 'L1', 100, 30]], 'HOLD']]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"a0b11f0aa422151899e07d80c377982c4c92d1efd1e1ecd0c9674b8499006e8b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(bins, receipt):\n    sku, lot, exp, q = receipt\n    def room(b):\n        return b[5] - b[4] >= q\n    def empty(b):\n        return b[1] is None or b[4] == 0\n    same_lot = [b for b in bins if not empty(b) and b[1] == sku and b[2] == lot and room(b)]\n    if same_lot:\n        return min(same_lot, key=lambda b: (b[6], b[0]))[0]\n    mixed = [b for b in bins if not empty(b) and b[1] == sku and b[2] != lot and abs(b[3] - exp) <= 30 and room(b)]\n    if mixed:\n        return min(mixed, key=lambda b: (abs(b[3] - exp), b[6], b[0]))[0]\n    free = [b for b in bins if empty(b) and b[5] >= q]\n    if free:\n        return min(free, key=lambda b: (b[6], b[0]))[0]\n    return 'HOLD'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['generated mix 17', [[['B0', 'S2', 'L2', 120, 0, 20, 8], ['B1', 'S1', 'L2', 131, 5, 40, 3], ['B2', 'S2', 'L2', 100, 10, 20, 8], ['B3', 'S2', 'L2', 100, 10, 60, 6], ['B4', 'S1', 'L3', 100, 30, 40, 3], ['B5', 'S1', 'L1', 145, 10, 60, 5]], ['S1', 'L4', 150, 20]], 'B5'], ['generated mix 1', [[['B0', 'S1', 'L2', 130, 5, 40, 9], ['B1', 'S1', 'L2', 160, 10, 60, 9], ['B2', 'S1', 'L2', 130, 10, 40, 2], ['B3', 'S2', 'L1', 120, 0, 40, 3], ['B4', 'S2', 'L2', 130, 30, 20, 6], ['B5', 'S2', 'L3', 130, 40, 20, 3], ['B6', 'S2', 'L2', 130, 30, 20, 8]], ['S1', 'L1', 130, 10]], 'B2'], ['same lot preferred', [[['A', 'S1', 'L1', 100, 10, 40, 9], ['B', 'S1', 'L2', 100, 0, 40, 1]], ['S1', 'L1', 100, 20]], 'A'], ['expiry 30 days later', [[['A', 'S1', 'L2', 130, 10, 60, 5], ['E', None, None, 0, 0, 60, 1]], ['S1', 'L1', 100, 20]], 'A'], ['residual label empty', [[['R', 'S9', 'L7', 50, 0, 60, 2], ['E', None, None, 0, 0, 60, 4]], ['S1', 'L1', 100, 20]], 'R'], ['nothing', [[['X', 'S2', 'L1', 100, 5, 10, 1]], ['S1', 'L1', 100, 20]], 'HOLD'], ['room exact', [[['A', 'S1', 'L1', 100, 20, 40, 9], ['E', None, None, 0, 0, 40, 1]], ['S1', 'L1', 100, 20]], 'A'], ['generated mix 7', [[['B0', 'S1', 'L1', 130, 10, 40, 3], ['B1', 'S2', 'L3', 160, 30, 20, 2], ['B2', 'S1', 'L2', 145, 0, 20, 1]], ['S2', 'L4', 130, 20]], 'B2']], [['generated mix 52', [[['B0', None, None, 0, 0, 20, 9], ['B1', 'S1', 'L3', 120, 10, 60, 1], ['B2', 'S1', 'L3', 120, 40, 20, 9], ['B3', 'S1', 'L2', 100, 40, 60, 4]], ['S1', 'L4', 100, 10]], 'B3'], ['generated mix 1', [[['B0', 'S1', 'L2', 130, 5, 40, 9], ['B1', 'S1', 'L2', 160, 10, 60, 9], ['B2', 'S1', 'L2', 130, 10, 40, 2], ['B3', 'S2', 'L1', 120, 0, 40, 3], ['B4', 'S2', 'L2', 130, 30, 20, 6], ['B5', 'S2', 'L3', 130, 40, 20, 3], ['B6', 'S2', 'L2', 130, 30, 20, 8]], ['S1', 'L1', 130, 10]], 'B2'], ['expiry 31 days', [[['A', 'S1', 'L2', 131, 10, 60, 5], ['E', None, None, 0, 0, 60, 1]], ['S1', 'L1', 100, 20]], 'E'], ['lot code on other sku', [[['X', 'S2', 'L1', 100, 5, 60, 1], ['E', None, None, 0, 0, 60, 4]], ['S1', 'L1', 100, 20]], 'E'], ['same lot preferred', [[['A', 'S1', 'L1', 100, 10, 40, 9], ['B', 'S1', 'L2', 100, 0, 40, 1]], ['S1', 'L1', 100, 20]], 'A'], ['expiry 30 days later', [[['A', 'S1', 'L2', 130, 10, 60, 5], ['E', None, None, 0, 0, 60, 1]], ['S1', 'L1', 100, 20]], 'A'], ['generated mix 10', [[['B0', 'S2', 'L2', 145, 5, 20, 4], ['B1', 'S1', 'L2', 120, 5, 40, 1], ['B2', None, None, 0, 0, 40, 5]], ['S1', 'L4', 150, 30]], 'B1'], ['generated mix 18', [[['B0', None, None, 0, 0, 60, 7], ['B1', 'S1', 'L2', 145, 5, 60, 3], ['B2', 'S1', 'L2', 120, 40, 40, 7], ['B3', None, None, 0, 0, 20, 9], ['B4', None, None, 0, 0, 20, 9]], ['S1', 'L4', 130, 10]], 'B1']], [['generated mix 75', [[['B0', 'S1', 'L1', 120, 30, 60, 8], ['B1', None, None, 0, 0, 40, 8], ['B2', 'S1', 'L3', 130, 10, 60, 2]], ['S1', 'L4', 100, 30]], 'B0'], ['generated mix 1', [[['B0', 'S1', 'L2', 130, 5, 40, 9], ['B1', 'S1', 'L2', 160, 10, 60, 9], ['B2', 'S1', 'L2', 130, 10, 40, 2], ['B3', 'S2', 'L1', 120, 0, 40, 3], ['B4', 'S2', 'L2', 130, 30, 20, 6], ['B5', 'S2', 'L3', 130, 40, 20, 3], ['B6', 'S2', 'L2', 130, 30, 20, 8]], ['S1', 'L1', 130, 10]], 'B2'], ['nothing', [[['X', 'S2', 'L1', 100, 5, 10, 1]], ['S1', 'L1', 100, 20]], 'HOLD'], ['room exact', [[['A', 'S1', 'L1', 100, 20, 40, 9], ['E', None, None, 0, 0, 40, 1]], ['S1', 'L1', 100, 20]], 'A'], ['expiry 31 days', [[['A', 'S1', 'L2', 131, 10, 60, 5], ['E', None, None, 0, 0, 60, 1]], ['S1', 'L1', 100, 20]], 'E'], ['lot code on other sku', [[['X', 'S2', 'L1', 100, 5, 60, 1], ['E', None, None, 0, 0, 60, 4]], ['S1', 'L1', 100, 20]], 'E'], ['generated mix 21', [[['B0', 'S1', 'L3', 130, 40, 60, 3], ['B1', 'S1', 'L3', 145, 30, 40, 7], ['B2', 'S1', 'L2', 130, 40, 60, 4], ['B3', 'S2', 'L2', 120, 30, 40, 3], ['B4', 'S1', 'L3', 160, 30, 60, 2], ['B5', 'S1', 'L3', 160, 40, 40, 7]], ['S2', 'L4', 150, 10]], 'B3'], ['generated mix 29', [[['B0', None, None, 0, 0, 60, 5], ['B1', 'S1', 'L3', 100, 0, 60, 7], ['B2', 'S2', 'L2', 160, 40, 60, 7], ['B3', 'S1', 'L3', 131, 30, 60, 3], ['B4', 'S1', 'L1', 145, 10, 20, 4], ['B5', 'S2', 'L1', 130, 5, 40, 3], ['B6', 'S2', 'L2', 160, 40, 60, 5]], ['S1', 'L2', 100, 30]], 'B0']], [['generated mix 39', [[['B0', 'S1', 'L2', 120, 30, 20, 3], ['B1', 'S1', 'L3', 145, 0, 20, 4], ['B2', None, None, 0, 0, 40, 6], ['B3', 'S1', 'L3', 131, 30, 60, 9], ['B4', 'S1', 'L1', 100, 5, 60, 7], ['B5', None, None, 0, 0, 40, 4], ['B6', 'S2', 'L2', 100, 30, 60, 6]], ['S1', 'L4', 130, 10]], 'B3'], ['generated mix 1', [[['B0', 'S1', 'L2', 130, 5, 40, 9], ['B1', 'S1', 'L2', 160, 10, 60, 9], ['B2', 'S1', 'L2', 130, 10, 40, 2], ['B3', 'S2', 'L1', 120, 0, 40, 3], ['B4', 'S2', 'L2', 130, 30, 20, 6], ['B5', 'S2', 'L3', 130, 40, 20, 3], ['B6', 'S2', 'L2', 130, 30, 20, 8]], ['S1', 'L1', 130, 10]], 'B2'], ['expiry 30 days later', [[['A', 'S1', 'L2', 130, 10, 60, 5], ['E', None, None, 0, 0, 60, 1]], ['S1', 'L1', 100, 20]], 'A'], ['residual label empty', [[['R', 'S9', 'L7', 50, 0, 60, 2], ['E', None, None, 0, 0, 60, 4]], ['S1', 'L1', 100, 20]], 'R'], ['nothing', [[['X', 'S2', 'L1', 100, 5, 10, 1]], ['S1', 'L1', 100, 20]], 'HOLD'], ['room exact', [[['A', 'S1', 'L1', 100, 20, 40, 9], ['E', None, None, 0, 0, 40, 1]], ['S1', 'L1', 100, 20]], 'A'], ['generated mix 32', [[['B0', 'S1', 'L3', 145, 40, 40, 7], ['B1', None, None, 0, 0, 40, 3]], ['S2', 'L4', 150, 20]], 'B1'], ['generated mix 41', [[['B0', 'S1', 'L2', 160, 30, 60, 7], ['B1', 'S1', 'L2', 160, 40, 60, 3], ['B2', 'S1', 'L3', 100, 0, 60, 7], ['B3', 'S2', 'L2', 130, 10, 60, 9], ['B4', 'S1', 'L2', 160, 0, 20, 4], ['B5', 'S2', 'L2', 100, 30, 40, 4]], ['S2', 'L1', 130, 30]], 'B3']], [['generated mix 56', [[['B0', 'S2', 'L3', 120, 40, 20, 4], ['B1', 'S1', 'L3', 131, 0, 20, 8], ['B2', 'S1', 'L1', 130, 30, 40, 1], ['B3', 'S1', 'L1', 131, 5, 40, 7], ['B4', 'S2', 'L3', 160, 5, 20, 1], ['B5', 'S1', 'L3', 100, 10, 40, 7]], ['S1', 'L4', 100, 10]], 'B5'], ['generated mix 1', [[['B0', 'S1', 'L2', 130, 5, 40, 9], ['B1', 'S1', 'L2', 160, 10, 60, 9], ['B2', 'S1', 'L2', 130, 10, 40, 2], ['B3', 'S2', 'L1', 120, 0, 40, 3], ['B4', 'S2', 'L2', 130, 30, 20, 6], ['B5', 'S2', 'L3', 130, 40, 20, 3], ['B6', 'S2', 'L2', 130, 30, 20, 8]], ['S1', 'L1', 130, 10]], 'B2'], ['lot code on other sku', [[['X', 'S2', 'L1', 100, 5, 60, 1], ['E', None, None, 0, 0, 60, 4]], ['S1', 'L1', 100, 20]], 'E'], ['same lot preferred', [[['A', 'S1', 'L1', 100, 10, 40, 9], ['B', 'S1', 'L2', 100, 0, 40, 1]], ['S1', 'L1', 100, 20]], 'A'], ['expiry 30 days later', [[['A', 'S1', 'L2', 130, 10, 60, 5], ['E', None, None, 0, 0, 60, 1]], ['S1', 'L1', 100, 20]], 'A'], ['residual label empty', [[['R', 'S9', 'L7', 50, 0, 60, 2], ['E', None, None, 0, 0, 60, 4]], ['S1', 'L1', 100, 20]], 'R'], ['generated mix 43', [[['B0', 'S1', 'L1', 120, 30, 40, 4], ['B1', None, None, 0, 0, 20, 9]], ['S1', 'L4', 130, 10]], 'B0'], ['generated mix 51', [[['B0', 'S2', 'L3', 130, 40, 60, 6], ['B1', 'S1', 'L1', 130, 40, 40, 1], ['B2', 'S1', 'L1', 100, 30, 40, 8], ['B3', 'S1', 'L1', 145, 0, 20, 2]], ['S2', 'L1', 100, 30]], 'HOLD']]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"Stipulated day-number expiries and a single receipt; no quarantine or multi-bin splits. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-warehouse-slotting-fefo-putaway-mixed-lot-rank","generated_at":"2026-09-29T14:52:10.140607+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"FEFO storage keeps lots with similar expiry together so the earliest expiring stock ships first.","repair":"Rank mixed-lot bins by expiry gap, then distance, then bin id.","root_cause":"Mixed-lot candidates are ranked by travel distance, ignoring expiry gap.","sha256":"a42276768c331a2f6cd9856b40984d23b8ce4326399eae4c34c6fea1fc2104aa","title":"FEFO putaway: mixed lot bin chosen by distance only · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.761,"exit_code":1,"observations":[{"actual":"B5","check":"generated mix 17","expected":"B5","passed":true},{"actual":"B0","check":"generated mix 1","expected":"B2","passed":false},{"actual":"A","check":"same lot preferred","expected":"A","passed":true},{"actual":"A","check":"expiry 30 days later","expected":"A","passed":true},{"actual":"R","check":"residual label empty","expected":"R","passed":true},{"actual":"HOLD","check":"nothing","expected":"HOLD","passed":true},{"actual":"A","check":"room exact","expected":"A","passed":true},{"actual":"B2","check":"generated mix 7","expected":"B2","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"generated mix 17\", \"actual\": \"B5\", \"expected\": \"B5\", \"passed\": true}, {\"check\": \"generated mix 1\", \"actual\": \"B0\", \"expected\": \"B2\", \"passed\": false}, {\"check\": \"same lot preferred\", \"actual\": \"A\", \"expected\": \"A\", \"passed\": true}, {\"check\": \"expiry 30 days later\", \"actual\": \"A\", \"expected\": \"A\", \"passed\": true}, {\"check\": \"residual label empty\", \"actual\": \"R\", \"expected\": \"R\", \"passed\": true}, {\"check\": \"nothing\", \"actual\": \"HOLD\", \"expected\": \"HOLD\", \"passed\": true}, {\"check\": \"room exact\", \"actual\": \"A\", \"expected\": \"A\", \"passed\": true}, {\"check\": \"generated mix 7\", \"actual\": \"B2\", \"expected\": \"B2\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.193,"exit_code":1,"observations":[{"actual":"B1","check":"generated mix 17","expected":"B5","passed":false},{"actual":"B2","check":"generated mix 1","expected":"B2","passed":true},{"actual":"A","check":"same lot preferred","expected":"A","passed":true},{"actual":"A","check":"expiry 30 days later","expected":"A","passed":true},{"actual":"R","check":"residual label empty","expected":"R","passed":true},{"actual":"HOLD","check":"nothing","expected":"HOLD","passed":true},{"actual":"A","check":"room exact","expected":"A","passed":true},{"actual":"B2","check":"generated mix 7","expected":"B2","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"generated mix 17\", \"actual\": \"B1\", \"expected\": \"B5\", \"passed\": false}, {\"check\": \"generated mix 1\", \"actual\": \"B2\", \"expected\": \"B2\", \"passed\": true}, {\"check\": \"same lot preferred\", \"actual\": \"A\", \"expected\": \"A\", \"passed\": true}, {\"check\": \"expiry 30 days later\", \"actual\": \"A\", \"expected\": \"A\", \"passed\": true}, {\"check\": \"residual label empty\", \"actual\": \"R\", \"expected\": \"R\", \"passed\": true}, {\"check\": \"nothing\", \"actual\": \"HOLD\", \"expected\": \"HOLD\", \"passed\": true}, {\"check\": \"room exact\", \"actual\": \"A\", \"expected\": \"A\", \"passed\": true}, {\"check\": \"generated mix 7\", \"actual\": \"B2\", \"expected\": \"B2\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.649,"exit_code":0,"observations":[{"actual":"B5","check":"generated mix 17","expected":"B5","passed":true},{"actual":"B2","check":"generated mix 1","expected":"B2","passed":true},{"actual":"A","check":"same lot preferred","expected":"A","passed":true},{"actual":"A","check":"expiry 30 days later","expected":"A","passed":true},{"actual":"R","check":"residual label empty","expected":"R","passed":true},{"actual":"HOLD","check":"nothing","expected":"HOLD","passed":true},{"actual":"A","check":"room exact","expected":"A","passed":true},{"actual":"B2","check":"generated mix 7","expected":"B2","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"generated mix 17\", \"actual\": \"B5\", \"expected\": \"B5\", \"passed\": true}, {\"check\": \"generated mix 1\", \"actual\": \"B2\", \"expected\": \"B2\", \"passed\": true}, {\"check\": \"same lot preferred\", \"actual\": \"A\", \"expected\": \"A\", \"passed\": true}, {\"check\": \"expiry 30 days later\", \"actual\": \"A\", \"expected\": \"A\", \"passed\": true}, {\"check\": \"residual label empty\", \"actual\": \"R\", \"expected\": \"R\", \"passed\": true}, {\"check\": \"nothing\", \"actual\": \"HOLD\", \"expected\": \"HOLD\", \"passed\": true}, {\"check\": \"room exact\", \"actual\": \"A\", \"expected\": \"A\", \"passed\": true}, {\"check\": \"generated mix 7\", \"actual\": \"B2\", \"expected\": \"B2\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}