{"abstract":"Goods held by consignees are deducted from inventory instead of added.","category":"Inventory cost layering","checks":8,"contract":"Input {count_value, period_end, items:[{type, terms, value, shipped_day, arrived_day|None}]}. Goods \"arrived\" when arrived_day is set and <= period_end. Inbound in transit is added when FOB_shipping, shipped by period end and not arrived. Outbound in transit is added back when FOB_destination, shipped by period end and not arrived. Goods consigned out are added; consigned-in and bill-and-hold goods (counted but not owned) are subtracted regardless of terms. Return {adjusted, adds, subtracts}.","evaluation_group":"w2-inventory-cost-layering-period-end-cutoff","failed_approach":"Ignoring consigned-out goods still omits inventory the company owns.","family":"w2-inventory-cost-layering-period-end-cutoff-consigned-out-direction","id":"FA-60331","implementations":{"attempt":{"sha256":"e93046e9a0d03055d3f9dc5ed5358b460fc86ce1749485be7bd30dfc4ab4084f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    end = x['period_end']\n    add = 0\n    sub = 0\n    for it in x['items']:\n        k = it['type']\n        v = it['value']\n        arrived = it['arrived_day'] is not None and it['arrived_day'] <= end\n        if k == 'in_transit_in':\n            if it['terms'] == 'FOB_shipping' and it['shipped_day'] <= end and not arrived:\n                add += v\n        elif k == 'in_transit_out':\n            if it['terms'] == 'FOB_destination' and it['shipped_day'] <= end and not arrived:\n                add += v\n        elif k in ('consigned_in', 'bill_and_hold'):\n            sub += v\n    return {'adjusted': x['count_value'] + add - sub, 'adds': add, 'subtracts': sub}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['inbound shipping terms', {'count_value': 10000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 501, 'shipped_day': 30, 'arrived_day': None}, {'type': 'in_transit_in', 'terms': 'FOB_destination', 'value': 700, 'shipped_day': 29, 'arrived_day': 33}]}, {'adjusted': 10501, 'adds': 501, 'subtracts': 0}], ['shipped on period end', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 31, 'arrived_day': 34}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 201, 'shipped_day': 31, 'arrived_day': None}]}, {'adjusted': 5501, 'adds': 501, 'subtracts': 0}], ['shipped after period', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 32, 'arrived_day': 35}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 250, 'shipped_day': 32, 'arrived_day': None}]}, {'adjusted': 5000, 'adds': 0, 'subtracts': 0}], ['arrived before end', {'count_value': 8000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 400, 'shipped_day': 20, 'arrived_day': 26}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 90, 'shipped_day': 28, 'arrived_day': 31}]}, {'adjusted': 8000, 'adds': 0, 'subtracts': 0}], ['outbound terms', {'count_value': 7000, 'period_end': 31, 'items': [{'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 600, 'shipped_day': 30, 'arrived_day': 32}, {'type': 'in_transit_out', 'terms': 'FOB_shipping', 'value': 801, 'shipped_day': 30, 'arrived_day': 33}]}, {'adjusted': 7600, 'adds': 600, 'subtracts': 0}], ['consignment', {'count_value': 9000, 'period_end': 31, 'items': [{'type': 'consigned_out', 'terms': 'none', 'value': 1200, 'shipped_day': 10, 'arrived_day': None}, {'type': 'consigned_in', 'terms': 'none', 'value': 451, 'shipped_day': 5, 'arrived_day': 6}]}, {'adjusted': 9749, 'adds': 1200, 'subtracts': 451}], ['bill and hold', {'count_value': 6000, 'period_end': 31, 'items': [{'type': 'bill_and_hold', 'terms': 'FOB_destination', 'value': 351, 'shipped_day': 0, 'arrived_day': None}, {'type': 'bill_and_hold', 'terms': 'FOB_shipping', 'value': 100, 'shipped_day': 0, 'arrived_day': None}]}, {'adjusted': 5549, 'adds': 0, 'subtracts': 451}], ['undelivered none', {'count_value': 100, 'period_end': 32, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 55, 'shipped_day': 12, 'arrived_day': None}]}, {'adjusted': 155, 'adds': 55, 'subtracts': 0}]], [['inbound shipping terms', {'count_value': 10000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 502, 'shipped_day': 30, 'arrived_day': None}, {'type': 'in_transit_in', 'terms': 'FOB_destination', 'value': 700, 'shipped_day': 29, 'arrived_day': 33}]}, {'adjusted': 10502, 'adds': 502, 'subtracts': 0}], ['shipped on period end', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 31, 'arrived_day': 34}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 202, 'shipped_day': 31, 'arrived_day': None}]}, {'adjusted': 5502, 'adds': 502, 'subtracts': 0}], ['shipped after period', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 32, 'arrived_day': 35}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 250, 'shipped_day': 32, 'arrived_day': None}]}, {'adjusted': 5000, 'adds': 0, 'subtracts': 0}], ['arrived before end', {'count_value': 8000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 400, 'shipped_day': 20, 'arrived_day': 27}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 90, 'shipped_day': 28, 'arrived_day': 31}]}, {'adjusted': 8000, 'adds': 0, 'subtracts': 0}], ['outbound terms', {'count_value': 7000, 'period_end': 31, 'items': [{'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 600, 'shipped_day': 30, 'arrived_day': 32}, {'type': 'in_transit_out', 'terms': 'FOB_shipping', 'value': 802, 'shipped_day': 30, 'arrived_day': 33}]}, {'adjusted': 7600, 'adds': 600, 'subtracts': 0}], ['consignment', {'count_value': 9000, 'period_end': 31, 'items': [{'type': 'consigned_out', 'terms': 'none', 'value': 1200, 'shipped_day': 10, 'arrived_day': None}, {'type': 'consigned_in', 'terms': 'none', 'value': 452, 'shipped_day': 5, 'arrived_day': 6}]}, {'adjusted': 9748, 'adds': 1200, 'subtracts': 452}], ['bill and hold', {'count_value': 6000, 'period_end': 31, 'items': [{'type': 'bill_and_hold', 'terms': 'FOB_destination', 'value': 352, 'shipped_day': 0, 'arrived_day': None}, {'type': 'bill_and_hold', 'terms': 'FOB_shipping', 'value': 100, 'shipped_day': 0, 'arrived_day': None}]}, {'adjusted': 5548, 'adds': 0, 'subtracts': 452}], ['undelivered none', {'count_value': 100, 'period_end': 33, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 55, 'shipped_day': 12, 'arrived_day': None}]}, {'adjusted': 155, 'adds': 55, 'subtracts': 0}]], [['inbound shipping terms', {'count_value': 10000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 503, 'shipped_day': 30, 'arrived_day': None}, {'type': 'in_transit_in', 'terms': 'FOB_destination', 'value': 700, 'shipped_day': 29, 'arrived_day': 33}]}, {'adjusted': 10503, 'adds': 503, 'subtracts': 0}], ['shipped on period end', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 31, 'arrived_day': 34}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 203, 'shipped_day': 31, 'arrived_day': None}]}, {'adjusted': 5503, 'adds': 503, 'subtracts': 0}], ['shipped after period', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 32, 'arrived_day': 35}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 250, 'shipped_day': 32, 'arrived_day': None}]}, {'adjusted': 5000, 'adds': 0, 'subtracts': 0}], ['arrived before end', {'count_value': 8000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 400, 'shipped_day': 20, 'arrived_day': 28}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 90, 'shipped_day': 28, 'arrived_day': 31}]}, {'adjusted': 8000, 'adds': 0, 'subtracts': 0}], ['outbound terms', {'count_value': 7000, 'period_end': 31, 'items': [{'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 600, 'shipped_day': 30, 'arrived_day': 32}, {'type': 'in_transit_out', 'terms': 'FOB_shipping', 'value': 803, 'shipped_day': 30, 'arrived_day': 33}]}, {'adjusted': 7600, 'adds': 600, 'subtracts': 0}], ['consignment', {'count_value': 9000, 'period_end': 31, 'items': [{'type': 'consigned_out', 'terms': 'none', 'value': 1200, 'shipped_day': 10, 'arrived_day': None}, {'type': 'consigned_in', 'terms': 'none', 'value': 453, 'shipped_day': 5, 'arrived_day': 6}]}, {'adjusted': 9747, 'adds': 1200, 'subtracts': 453}], ['bill and hold', {'count_value': 6000, 'period_end': 31, 'items': [{'type': 'bill_and_hold', 'terms': 'FOB_destination', 'value': 353, 'shipped_day': 0, 'arrived_day': None}, {'type': 'bill_and_hold', 'terms': 'FOB_shipping', 'value': 100, 'shipped_day': 0, 'arrived_day': None}]}, {'adjusted': 5547, 'adds': 0, 'subtracts': 453}], ['undelivered none', {'count_value': 100, 'period_end': 34, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 55, 'shipped_day': 12, 'arrived_day': None}]}, {'adjusted': 155, 'adds': 55, 'subtracts': 0}]], [['inbound shipping terms', {'count_value': 10000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 504, 'shipped_day': 30, 'arrived_day': None}, {'type': 'in_transit_in', 'terms': 'FOB_destination', 'value': 700, 'shipped_day': 29, 'arrived_day': 33}]}, {'adjusted': 10504, 'adds': 504, 'subtracts': 0}], ['shipped on period end', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 31, 'arrived_day': 34}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 204, 'shipped_day': 31, 'arrived_day': None}]}, {'adjusted': 5504, 'adds': 504, 'subtracts': 0}], ['shipped after period', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 32, 'arrived_day': 35}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 250, 'shipped_day': 32, 'arrived_day': None}]}, {'adjusted': 5000, 'adds': 0, 'subtracts': 0}], ['arrived before end', {'count_value': 8000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 400, 'shipped_day': 20, 'arrived_day': 29}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 90, 'shipped_day': 28, 'arrived_day': 31}]}, {'adjusted': 8000, 'adds': 0, 'subtracts': 0}], ['outbound terms', {'count_value': 7000, 'period_end': 31, 'items': [{'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 600, 'shipped_day': 30, 'arrived_day': 32}, {'type': 'in_transit_out', 'terms': 'FOB_shipping', 'value': 804, 'shipped_day': 30, 'arrived_day': 33}]}, {'adjusted': 7600, 'adds': 600, 'subtracts': 0}], ['consignment', {'count_value': 9000, 'period_end': 31, 'items': [{'type': 'consigned_out', 'terms': 'none', 'value': 1200, 'shipped_day': 10, 'arrived_day': None}, {'type': 'consigned_in', 'terms': 'none', 'value': 454, 'shipped_day': 5, 'arrived_day': 6}]}, {'adjusted': 9746, 'adds': 1200, 'subtracts': 454}], ['bill and hold', {'count_value': 6000, 'period_end': 31, 'items': [{'type': 'bill_and_hold', 'terms': 'FOB_destination', 'value': 354, 'shipped_day': 0, 'arrived_day': None}, {'type': 'bill_and_hold', 'terms': 'FOB_shipping', 'value': 100, 'shipped_day': 0, 'arrived_day': None}]}, {'adjusted': 5546, 'adds': 0, 'subtracts': 454}], ['undelivered none', {'count_value': 100, 'period_end': 35, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 55, 'shipped_day': 12, 'arrived_day': None}]}, {'adjusted': 155, 'adds': 55, 'subtracts': 0}]], [['inbound shipping terms', {'count_value': 10000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 505, 'shipped_day': 30, 'arrived_day': None}, {'type': 'in_transit_in', 'terms': 'FOB_destination', 'value': 700, 'shipped_day': 29, 'arrived_day': 33}]}, {'adjusted': 10505, 'adds': 505, 'subtracts': 0}], ['shipped on period end', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 31, 'arrived_day': 34}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 205, 'shipped_day': 31, 'arrived_day': None}]}, {'adjusted': 5505, 'adds': 505, 'subtracts': 0}], ['shipped after period', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 32, 'arrived_day': 35}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 250, 'shipped_day': 32, 'arrived_day': None}]}, {'adjusted': 5000, 'adds': 0, 'subtracts': 0}], ['arrived before end', {'count_value': 8000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 400, 'shipped_day': 20, 'arrived_day': 30}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 90, 'shipped_day': 28, 'arrived_day': 31}]}, {'adjusted': 8000, 'adds': 0, 'subtracts': 0}], ['outbound terms', {'count_value': 7000, 'period_end': 31, 'items': [{'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 600, 'shipped_day': 30, 'arrived_day': 32}, {'type': 'in_transit_out', 'terms': 'FOB_shipping', 'value': 805, 'shipped_day': 30, 'arrived_day': 33}]}, {'adjusted': 7600, 'adds': 600, 'subtracts': 0}], ['consignment', {'count_value': 9000, 'period_end': 31, 'items': [{'type': 'consigned_out', 'terms': 'none', 'value': 1200, 'shipped_day': 10, 'arrived_day': None}, {'type': 'consigned_in', 'terms': 'none', 'value': 455, 'shipped_day': 5, 'arrived_day': 6}]}, {'adjusted': 9745, 'adds': 1200, 'subtracts': 455}], ['bill and hold', {'count_value': 6000, 'period_end': 31, 'items': [{'type': 'bill_and_hold', 'terms': 'FOB_destination', 'value': 355, 'shipped_day': 0, 'arrived_day': None}, {'type': 'bill_and_hold', 'terms': 'FOB_shipping', 'value': 100, 'shipped_day': 0, 'arrived_day': None}]}, {'adjusted': 5545, 'adds': 0, 'subtracts': 455}], ['undelivered none', {'count_value': 100, 'period_end': 36, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 55, 'shipped_day': 12, 'arrived_day': None}]}, {'adjusted': 155, 'adds': 55, 'subtracts': 0}]]]\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":"4c4a6c822582efc36e942a1dc56bfad3d4322a9ec2867bab7a33b02da48d9930","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    end = x['period_end']\n    add = 0\n    sub = 0\n    for it in x['items']:\n        k = it['type']\n        v = it['value']\n        arrived = it['arrived_day'] is not None and it['arrived_day'] <= end\n        if k == 'in_transit_in':\n            if it['terms'] == 'FOB_shipping' and it['shipped_day'] <= end and not arrived:\n                add += v\n        elif k == 'in_transit_out':\n            if it['terms'] == 'FOB_destination' and it['shipped_day'] <= end and not arrived:\n                add += v\n        elif k in ('consigned_in', 'bill_and_hold', 'consigned_out'):\n            sub += v\n    return {'adjusted': x['count_value'] + add - sub, 'adds': add, 'subtracts': sub}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['inbound shipping terms', {'count_value': 10000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 501, 'shipped_day': 30, 'arrived_day': None}, {'type': 'in_transit_in', 'terms': 'FOB_destination', 'value': 700, 'shipped_day': 29, 'arrived_day': 33}]}, {'adjusted': 10501, 'adds': 501, 'subtracts': 0}], ['shipped on period end', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 31, 'arrived_day': 34}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 201, 'shipped_day': 31, 'arrived_day': None}]}, {'adjusted': 5501, 'adds': 501, 'subtracts': 0}], ['shipped after period', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 32, 'arrived_day': 35}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 250, 'shipped_day': 32, 'arrived_day': None}]}, {'adjusted': 5000, 'adds': 0, 'subtracts': 0}], ['arrived before end', {'count_value': 8000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 400, 'shipped_day': 20, 'arrived_day': 26}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 90, 'shipped_day': 28, 'arrived_day': 31}]}, {'adjusted': 8000, 'adds': 0, 'subtracts': 0}], ['outbound terms', {'count_value': 7000, 'period_end': 31, 'items': [{'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 600, 'shipped_day': 30, 'arrived_day': 32}, {'type': 'in_transit_out', 'terms': 'FOB_shipping', 'value': 801, 'shipped_day': 30, 'arrived_day': 33}]}, {'adjusted': 7600, 'adds': 600, 'subtracts': 0}], ['consignment', {'count_value': 9000, 'period_end': 31, 'items': [{'type': 'consigned_out', 'terms': 'none', 'value': 1200, 'shipped_day': 10, 'arrived_day': None}, {'type': 'consigned_in', 'terms': 'none', 'value': 451, 'shipped_day': 5, 'arrived_day': 6}]}, {'adjusted': 9749, 'adds': 1200, 'subtracts': 451}], ['bill and hold', {'count_value': 6000, 'period_end': 31, 'items': [{'type': 'bill_and_hold', 'terms': 'FOB_destination', 'value': 351, 'shipped_day': 0, 'arrived_day': None}, {'type': 'bill_and_hold', 'terms': 'FOB_shipping', 'value': 100, 'shipped_day': 0, 'arrived_day': None}]}, {'adjusted': 5549, 'adds': 0, 'subtracts': 451}], ['undelivered none', {'count_value': 100, 'period_end': 32, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 55, 'shipped_day': 12, 'arrived_day': None}]}, {'adjusted': 155, 'adds': 55, 'subtracts': 0}]], [['inbound shipping terms', {'count_value': 10000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 502, 'shipped_day': 30, 'arrived_day': None}, {'type': 'in_transit_in', 'terms': 'FOB_destination', 'value': 700, 'shipped_day': 29, 'arrived_day': 33}]}, {'adjusted': 10502, 'adds': 502, 'subtracts': 0}], ['shipped on period end', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 31, 'arrived_day': 34}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 202, 'shipped_day': 31, 'arrived_day': None}]}, {'adjusted': 5502, 'adds': 502, 'subtracts': 0}], ['shipped after period', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 32, 'arrived_day': 35}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 250, 'shipped_day': 32, 'arrived_day': None}]}, {'adjusted': 5000, 'adds': 0, 'subtracts': 0}], ['arrived before end', {'count_value': 8000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 400, 'shipped_day': 20, 'arrived_day': 27}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 90, 'shipped_day': 28, 'arrived_day': 31}]}, {'adjusted': 8000, 'adds': 0, 'subtracts': 0}], ['outbound terms', {'count_value': 7000, 'period_end': 31, 'items': [{'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 600, 'shipped_day': 30, 'arrived_day': 32}, {'type': 'in_transit_out', 'terms': 'FOB_shipping', 'value': 802, 'shipped_day': 30, 'arrived_day': 33}]}, {'adjusted': 7600, 'adds': 600, 'subtracts': 0}], ['consignment', {'count_value': 9000, 'period_end': 31, 'items': [{'type': 'consigned_out', 'terms': 'none', 'value': 1200, 'shipped_day': 10, 'arrived_day': None}, {'type': 'consigned_in', 'terms': 'none', 'value': 452, 'shipped_day': 5, 'arrived_day': 6}]}, {'adjusted': 9748, 'adds': 1200, 'subtracts': 452}], ['bill and hold', {'count_value': 6000, 'period_end': 31, 'items': [{'type': 'bill_and_hold', 'terms': 'FOB_destination', 'value': 352, 'shipped_day': 0, 'arrived_day': None}, {'type': 'bill_and_hold', 'terms': 'FOB_shipping', 'value': 100, 'shipped_day': 0, 'arrived_day': None}]}, {'adjusted': 5548, 'adds': 0, 'subtracts': 452}], ['undelivered none', {'count_value': 100, 'period_end': 33, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 55, 'shipped_day': 12, 'arrived_day': None}]}, {'adjusted': 155, 'adds': 55, 'subtracts': 0}]], [['inbound shipping terms', {'count_value': 10000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 503, 'shipped_day': 30, 'arrived_day': None}, {'type': 'in_transit_in', 'terms': 'FOB_destination', 'value': 700, 'shipped_day': 29, 'arrived_day': 33}]}, {'adjusted': 10503, 'adds': 503, 'subtracts': 0}], ['shipped on period end', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 31, 'arrived_day': 34}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 203, 'shipped_day': 31, 'arrived_day': None}]}, {'adjusted': 5503, 'adds': 503, 'subtracts': 0}], ['shipped after period', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 32, 'arrived_day': 35}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 250, 'shipped_day': 32, 'arrived_day': None}]}, {'adjusted': 5000, 'adds': 0, 'subtracts': 0}], ['arrived before end', {'count_value': 8000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 400, 'shipped_day': 20, 'arrived_day': 28}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 90, 'shipped_day': 28, 'arrived_day': 31}]}, {'adjusted': 8000, 'adds': 0, 'subtracts': 0}], ['outbound terms', {'count_value': 7000, 'period_end': 31, 'items': [{'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 600, 'shipped_day': 30, 'arrived_day': 32}, {'type': 'in_transit_out', 'terms': 'FOB_shipping', 'value': 803, 'shipped_day': 30, 'arrived_day': 33}]}, {'adjusted': 7600, 'adds': 600, 'subtracts': 0}], ['consignment', {'count_value': 9000, 'period_end': 31, 'items': [{'type': 'consigned_out', 'terms': 'none', 'value': 1200, 'shipped_day': 10, 'arrived_day': None}, {'type': 'consigned_in', 'terms': 'none', 'value': 453, 'shipped_day': 5, 'arrived_day': 6}]}, {'adjusted': 9747, 'adds': 1200, 'subtracts': 453}], ['bill and hold', {'count_value': 6000, 'period_end': 31, 'items': [{'type': 'bill_and_hold', 'terms': 'FOB_destination', 'value': 353, 'shipped_day': 0, 'arrived_day': None}, {'type': 'bill_and_hold', 'terms': 'FOB_shipping', 'value': 100, 'shipped_day': 0, 'arrived_day': None}]}, {'adjusted': 5547, 'adds': 0, 'subtracts': 453}], ['undelivered none', {'count_value': 100, 'period_end': 34, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 55, 'shipped_day': 12, 'arrived_day': None}]}, {'adjusted': 155, 'adds': 55, 'subtracts': 0}]], [['inbound shipping terms', {'count_value': 10000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 504, 'shipped_day': 30, 'arrived_day': None}, {'type': 'in_transit_in', 'terms': 'FOB_destination', 'value': 700, 'shipped_day': 29, 'arrived_day': 33}]}, {'adjusted': 10504, 'adds': 504, 'subtracts': 0}], ['shipped on period end', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 31, 'arrived_day': 34}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 204, 'shipped_day': 31, 'arrived_day': None}]}, {'adjusted': 5504, 'adds': 504, 'subtracts': 0}], ['shipped after period', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 32, 'arrived_day': 35}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 250, 'shipped_day': 32, 'arrived_day': None}]}, {'adjusted': 5000, 'adds': 0, 'subtracts': 0}], ['arrived before end', {'count_value': 8000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 400, 'shipped_day': 20, 'arrived_day': 29}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 90, 'shipped_day': 28, 'arrived_day': 31}]}, {'adjusted': 8000, 'adds': 0, 'subtracts': 0}], ['outbound terms', {'count_value': 7000, 'period_end': 31, 'items': [{'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 600, 'shipped_day': 30, 'arrived_day': 32}, {'type': 'in_transit_out', 'terms': 'FOB_shipping', 'value': 804, 'shipped_day': 30, 'arrived_day': 33}]}, {'adjusted': 7600, 'adds': 600, 'subtracts': 0}], ['consignment', {'count_value': 9000, 'period_end': 31, 'items': [{'type': 'consigned_out', 'terms': 'none', 'value': 1200, 'shipped_day': 10, 'arrived_day': None}, {'type': 'consigned_in', 'terms': 'none', 'value': 454, 'shipped_day': 5, 'arrived_day': 6}]}, {'adjusted': 9746, 'adds': 1200, 'subtracts': 454}], ['bill and hold', {'count_value': 6000, 'period_end': 31, 'items': [{'type': 'bill_and_hold', 'terms': 'FOB_destination', 'value': 354, 'shipped_day': 0, 'arrived_day': None}, {'type': 'bill_and_hold', 'terms': 'FOB_shipping', 'value': 100, 'shipped_day': 0, 'arrived_day': None}]}, {'adjusted': 5546, 'adds': 0, 'subtracts': 454}], ['undelivered none', {'count_value': 100, 'period_end': 35, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 55, 'shipped_day': 12, 'arrived_day': None}]}, {'adjusted': 155, 'adds': 55, 'subtracts': 0}]], [['inbound shipping terms', {'count_value': 10000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 505, 'shipped_day': 30, 'arrived_day': None}, {'type': 'in_transit_in', 'terms': 'FOB_destination', 'value': 700, 'shipped_day': 29, 'arrived_day': 33}]}, {'adjusted': 10505, 'adds': 505, 'subtracts': 0}], ['shipped on period end', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 31, 'arrived_day': 34}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 205, 'shipped_day': 31, 'arrived_day': None}]}, {'adjusted': 5505, 'adds': 505, 'subtracts': 0}], ['shipped after period', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 32, 'arrived_day': 35}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 250, 'shipped_day': 32, 'arrived_day': None}]}, {'adjusted': 5000, 'adds': 0, 'subtracts': 0}], ['arrived before end', {'count_value': 8000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 400, 'shipped_day': 20, 'arrived_day': 30}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 90, 'shipped_day': 28, 'arrived_day': 31}]}, {'adjusted': 8000, 'adds': 0, 'subtracts': 0}], ['outbound terms', {'count_value': 7000, 'period_end': 31, 'items': [{'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 600, 'shipped_day': 30, 'arrived_day': 32}, {'type': 'in_transit_out', 'terms': 'FOB_shipping', 'value': 805, 'shipped_day': 30, 'arrived_day': 33}]}, {'adjusted': 7600, 'adds': 600, 'subtracts': 0}], ['consignment', {'count_value': 9000, 'period_end': 31, 'items': [{'type': 'consigned_out', 'terms': 'none', 'value': 1200, 'shipped_day': 10, 'arrived_day': None}, {'type': 'consigned_in', 'terms': 'none', 'value': 455, 'shipped_day': 5, 'arrived_day': 6}]}, {'adjusted': 9745, 'adds': 1200, 'subtracts': 455}], ['bill and hold', {'count_value': 6000, 'period_end': 31, 'items': [{'type': 'bill_and_hold', 'terms': 'FOB_destination', 'value': 355, 'shipped_day': 0, 'arrived_day': None}, {'type': 'bill_and_hold', 'terms': 'FOB_shipping', 'value': 100, 'shipped_day': 0, 'arrived_day': None}]}, {'adjusted': 5545, 'adds': 0, 'subtracts': 455}], ['undelivered none', {'count_value': 100, 'period_end': 36, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 55, 'shipped_day': 12, 'arrived_day': None}]}, {'adjusted': 155, 'adds': 55, 'subtracts': 0}]]]\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":"5d6f1561633d2b6c2c46cc6bbe4f768d45ebf8472717fc759746140e1c8aeb06","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    end = x['period_end']\n    add = 0\n    sub = 0\n    for it in x['items']:\n        k = it['type']\n        v = it['value']\n        arrived = it['arrived_day'] is not None and it['arrived_day'] <= end\n        if k == 'in_transit_in':\n            if it['terms'] == 'FOB_shipping' and it['shipped_day'] <= end and not arrived:\n                add += v\n        elif k == 'in_transit_out':\n            if it['terms'] == 'FOB_destination' and it['shipped_day'] <= end and not arrived:\n                add += v\n        elif k == 'consigned_out':\n            add += v\n        elif k in ('consigned_in', 'bill_and_hold'):\n            sub += v\n    return {'adjusted': x['count_value'] + add - sub, 'adds': add, 'subtracts': sub}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['inbound shipping terms', {'count_value': 10000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 501, 'shipped_day': 30, 'arrived_day': None}, {'type': 'in_transit_in', 'terms': 'FOB_destination', 'value': 700, 'shipped_day': 29, 'arrived_day': 33}]}, {'adjusted': 10501, 'adds': 501, 'subtracts': 0}], ['shipped on period end', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 31, 'arrived_day': 34}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 201, 'shipped_day': 31, 'arrived_day': None}]}, {'adjusted': 5501, 'adds': 501, 'subtracts': 0}], ['shipped after period', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 32, 'arrived_day': 35}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 250, 'shipped_day': 32, 'arrived_day': None}]}, {'adjusted': 5000, 'adds': 0, 'subtracts': 0}], ['arrived before end', {'count_value': 8000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 400, 'shipped_day': 20, 'arrived_day': 26}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 90, 'shipped_day': 28, 'arrived_day': 31}]}, {'adjusted': 8000, 'adds': 0, 'subtracts': 0}], ['outbound terms', {'count_value': 7000, 'period_end': 31, 'items': [{'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 600, 'shipped_day': 30, 'arrived_day': 32}, {'type': 'in_transit_out', 'terms': 'FOB_shipping', 'value': 801, 'shipped_day': 30, 'arrived_day': 33}]}, {'adjusted': 7600, 'adds': 600, 'subtracts': 0}], ['consignment', {'count_value': 9000, 'period_end': 31, 'items': [{'type': 'consigned_out', 'terms': 'none', 'value': 1200, 'shipped_day': 10, 'arrived_day': None}, {'type': 'consigned_in', 'terms': 'none', 'value': 451, 'shipped_day': 5, 'arrived_day': 6}]}, {'adjusted': 9749, 'adds': 1200, 'subtracts': 451}], ['bill and hold', {'count_value': 6000, 'period_end': 31, 'items': [{'type': 'bill_and_hold', 'terms': 'FOB_destination', 'value': 351, 'shipped_day': 0, 'arrived_day': None}, {'type': 'bill_and_hold', 'terms': 'FOB_shipping', 'value': 100, 'shipped_day': 0, 'arrived_day': None}]}, {'adjusted': 5549, 'adds': 0, 'subtracts': 451}], ['undelivered none', {'count_value': 100, 'period_end': 32, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 55, 'shipped_day': 12, 'arrived_day': None}]}, {'adjusted': 155, 'adds': 55, 'subtracts': 0}]], [['inbound shipping terms', {'count_value': 10000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 502, 'shipped_day': 30, 'arrived_day': None}, {'type': 'in_transit_in', 'terms': 'FOB_destination', 'value': 700, 'shipped_day': 29, 'arrived_day': 33}]}, {'adjusted': 10502, 'adds': 502, 'subtracts': 0}], ['shipped on period end', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 31, 'arrived_day': 34}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 202, 'shipped_day': 31, 'arrived_day': None}]}, {'adjusted': 5502, 'adds': 502, 'subtracts': 0}], ['shipped after period', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 32, 'arrived_day': 35}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 250, 'shipped_day': 32, 'arrived_day': None}]}, {'adjusted': 5000, 'adds': 0, 'subtracts': 0}], ['arrived before end', {'count_value': 8000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 400, 'shipped_day': 20, 'arrived_day': 27}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 90, 'shipped_day': 28, 'arrived_day': 31}]}, {'adjusted': 8000, 'adds': 0, 'subtracts': 0}], ['outbound terms', {'count_value': 7000, 'period_end': 31, 'items': [{'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 600, 'shipped_day': 30, 'arrived_day': 32}, {'type': 'in_transit_out', 'terms': 'FOB_shipping', 'value': 802, 'shipped_day': 30, 'arrived_day': 33}]}, {'adjusted': 7600, 'adds': 600, 'subtracts': 0}], ['consignment', {'count_value': 9000, 'period_end': 31, 'items': [{'type': 'consigned_out', 'terms': 'none', 'value': 1200, 'shipped_day': 10, 'arrived_day': None}, {'type': 'consigned_in', 'terms': 'none', 'value': 452, 'shipped_day': 5, 'arrived_day': 6}]}, {'adjusted': 9748, 'adds': 1200, 'subtracts': 452}], ['bill and hold', {'count_value': 6000, 'period_end': 31, 'items': [{'type': 'bill_and_hold', 'terms': 'FOB_destination', 'value': 352, 'shipped_day': 0, 'arrived_day': None}, {'type': 'bill_and_hold', 'terms': 'FOB_shipping', 'value': 100, 'shipped_day': 0, 'arrived_day': None}]}, {'adjusted': 5548, 'adds': 0, 'subtracts': 452}], ['undelivered none', {'count_value': 100, 'period_end': 33, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 55, 'shipped_day': 12, 'arrived_day': None}]}, {'adjusted': 155, 'adds': 55, 'subtracts': 0}]], [['inbound shipping terms', {'count_value': 10000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 503, 'shipped_day': 30, 'arrived_day': None}, {'type': 'in_transit_in', 'terms': 'FOB_destination', 'value': 700, 'shipped_day': 29, 'arrived_day': 33}]}, {'adjusted': 10503, 'adds': 503, 'subtracts': 0}], ['shipped on period end', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 31, 'arrived_day': 34}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 203, 'shipped_day': 31, 'arrived_day': None}]}, {'adjusted': 5503, 'adds': 503, 'subtracts': 0}], ['shipped after period', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 32, 'arrived_day': 35}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 250, 'shipped_day': 32, 'arrived_day': None}]}, {'adjusted': 5000, 'adds': 0, 'subtracts': 0}], ['arrived before end', {'count_value': 8000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 400, 'shipped_day': 20, 'arrived_day': 28}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 90, 'shipped_day': 28, 'arrived_day': 31}]}, {'adjusted': 8000, 'adds': 0, 'subtracts': 0}], ['outbound terms', {'count_value': 7000, 'period_end': 31, 'items': [{'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 600, 'shipped_day': 30, 'arrived_day': 32}, {'type': 'in_transit_out', 'terms': 'FOB_shipping', 'value': 803, 'shipped_day': 30, 'arrived_day': 33}]}, {'adjusted': 7600, 'adds': 600, 'subtracts': 0}], ['consignment', {'count_value': 9000, 'period_end': 31, 'items': [{'type': 'consigned_out', 'terms': 'none', 'value': 1200, 'shipped_day': 10, 'arrived_day': None}, {'type': 'consigned_in', 'terms': 'none', 'value': 453, 'shipped_day': 5, 'arrived_day': 6}]}, {'adjusted': 9747, 'adds': 1200, 'subtracts': 453}], ['bill and hold', {'count_value': 6000, 'period_end': 31, 'items': [{'type': 'bill_and_hold', 'terms': 'FOB_destination', 'value': 353, 'shipped_day': 0, 'arrived_day': None}, {'type': 'bill_and_hold', 'terms': 'FOB_shipping', 'value': 100, 'shipped_day': 0, 'arrived_day': None}]}, {'adjusted': 5547, 'adds': 0, 'subtracts': 453}], ['undelivered none', {'count_value': 100, 'period_end': 34, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 55, 'shipped_day': 12, 'arrived_day': None}]}, {'adjusted': 155, 'adds': 55, 'subtracts': 0}]], [['inbound shipping terms', {'count_value': 10000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 504, 'shipped_day': 30, 'arrived_day': None}, {'type': 'in_transit_in', 'terms': 'FOB_destination', 'value': 700, 'shipped_day': 29, 'arrived_day': 33}]}, {'adjusted': 10504, 'adds': 504, 'subtracts': 0}], ['shipped on period end', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 31, 'arrived_day': 34}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 204, 'shipped_day': 31, 'arrived_day': None}]}, {'adjusted': 5504, 'adds': 504, 'subtracts': 0}], ['shipped after period', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 32, 'arrived_day': 35}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 250, 'shipped_day': 32, 'arrived_day': None}]}, {'adjusted': 5000, 'adds': 0, 'subtracts': 0}], ['arrived before end', {'count_value': 8000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 400, 'shipped_day': 20, 'arrived_day': 29}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 90, 'shipped_day': 28, 'arrived_day': 31}]}, {'adjusted': 8000, 'adds': 0, 'subtracts': 0}], ['outbound terms', {'count_value': 7000, 'period_end': 31, 'items': [{'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 600, 'shipped_day': 30, 'arrived_day': 32}, {'type': 'in_transit_out', 'terms': 'FOB_shipping', 'value': 804, 'shipped_day': 30, 'arrived_day': 33}]}, {'adjusted': 7600, 'adds': 600, 'subtracts': 0}], ['consignment', {'count_value': 9000, 'period_end': 31, 'items': [{'type': 'consigned_out', 'terms': 'none', 'value': 1200, 'shipped_day': 10, 'arrived_day': None}, {'type': 'consigned_in', 'terms': 'none', 'value': 454, 'shipped_day': 5, 'arrived_day': 6}]}, {'adjusted': 9746, 'adds': 1200, 'subtracts': 454}], ['bill and hold', {'count_value': 6000, 'period_end': 31, 'items': [{'type': 'bill_and_hold', 'terms': 'FOB_destination', 'value': 354, 'shipped_day': 0, 'arrived_day': None}, {'type': 'bill_and_hold', 'terms': 'FOB_shipping', 'value': 100, 'shipped_day': 0, 'arrived_day': None}]}, {'adjusted': 5546, 'adds': 0, 'subtracts': 454}], ['undelivered none', {'count_value': 100, 'period_end': 35, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 55, 'shipped_day': 12, 'arrived_day': None}]}, {'adjusted': 155, 'adds': 55, 'subtracts': 0}]], [['inbound shipping terms', {'count_value': 10000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 505, 'shipped_day': 30, 'arrived_day': None}, {'type': 'in_transit_in', 'terms': 'FOB_destination', 'value': 700, 'shipped_day': 29, 'arrived_day': 33}]}, {'adjusted': 10505, 'adds': 505, 'subtracts': 0}], ['shipped on period end', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 31, 'arrived_day': 34}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 205, 'shipped_day': 31, 'arrived_day': None}]}, {'adjusted': 5505, 'adds': 505, 'subtracts': 0}], ['shipped after period', {'count_value': 5000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 300, 'shipped_day': 32, 'arrived_day': 35}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 250, 'shipped_day': 32, 'arrived_day': None}]}, {'adjusted': 5000, 'adds': 0, 'subtracts': 0}], ['arrived before end', {'count_value': 8000, 'period_end': 31, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 400, 'shipped_day': 20, 'arrived_day': 30}, {'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 90, 'shipped_day': 28, 'arrived_day': 31}]}, {'adjusted': 8000, 'adds': 0, 'subtracts': 0}], ['outbound terms', {'count_value': 7000, 'period_end': 31, 'items': [{'type': 'in_transit_out', 'terms': 'FOB_destination', 'value': 600, 'shipped_day': 30, 'arrived_day': 32}, {'type': 'in_transit_out', 'terms': 'FOB_shipping', 'value': 805, 'shipped_day': 30, 'arrived_day': 33}]}, {'adjusted': 7600, 'adds': 600, 'subtracts': 0}], ['consignment', {'count_value': 9000, 'period_end': 31, 'items': [{'type': 'consigned_out', 'terms': 'none', 'value': 1200, 'shipped_day': 10, 'arrived_day': None}, {'type': 'consigned_in', 'terms': 'none', 'value': 455, 'shipped_day': 5, 'arrived_day': 6}]}, {'adjusted': 9745, 'adds': 1200, 'subtracts': 455}], ['bill and hold', {'count_value': 6000, 'period_end': 31, 'items': [{'type': 'bill_and_hold', 'terms': 'FOB_destination', 'value': 355, 'shipped_day': 0, 'arrived_day': None}, {'type': 'bill_and_hold', 'terms': 'FOB_shipping', 'value': 100, 'shipped_day': 0, 'arrived_day': None}]}, {'adjusted': 5545, 'adds': 0, 'subtracts': 455}], ['undelivered none', {'count_value': 100, 'period_end': 36, 'items': [{'type': 'in_transit_in', 'terms': 'FOB_shipping', 'value': 55, 'shipped_day': 12, 'arrived_day': None}]}, {'adjusted': 155, 'adds': 55, 'subtracts': 0}]]]\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 bounded teaching model with explicit toy rules; not an accounting-standard implementation. 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-inventory-cost-layering-period-end-cutoff-consigned-out-direction","generated_at":"2026-09-29T14:46:44.703690+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Inventory valuation and cost-of-goods decisions depend on this rule.","repair":"Add consigned-out goods; only consigned-in and bill-and-hold goods are subtracted.","root_cause":"Consigned-out goods fall into the subtraction branch with consigned-in goods.","sha256":"e287f06d266d5e14087580315d06eb51840a6e7d4794daed5a355fb8977e0f4d","title":"Period-end ownership cutoff adjustments: consigned-out direction · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.759,"exit_code":1,"observations":[{"actual":{"adds":501,"adjusted":10501,"subtracts":0},"check":"inbound shipping terms","expected":{"adds":501,"adjusted":10501,"subtracts":0},"passed":true},{"actual":{"adds":501,"adjusted":5501,"subtracts":0},"check":"shipped on period end","expected":{"adds":501,"adjusted":5501,"subtracts":0},"passed":true},{"actual":{"adds":0,"adjusted":5000,"subtracts":0},"check":"shipped after period","expected":{"adds":0,"adjusted":5000,"subtracts":0},"passed":true},{"actual":{"adds":0,"adjusted":8000,"subtracts":0},"check":"arrived before end","expected":{"adds":0,"adjusted":8000,"subtracts":0},"passed":true},{"actual":{"adds":600,"adjusted":7600,"subtracts":0},"check":"outbound terms","expected":{"adds":600,"adjusted":7600,"subtracts":0},"passed":true},{"actual":{"adds":0,"adjusted":8549,"subtracts":451},"check":"consignment","expected":{"adds":1200,"adjusted":9749,"subtracts":451},"passed":false},{"actual":{"adds":0,"adjusted":5549,"subtracts":451},"check":"bill and hold","expected":{"adds":0,"adjusted":5549,"subtracts":451},"passed":true},{"actual":{"adds":55,"adjusted":155,"subtracts":0},"check":"undelivered none","expected":{"adds":55,"adjusted":155,"subtracts":0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"inbound shipping terms\", \"actual\": {\"adjusted\": 10501, \"adds\": 501, \"subtracts\": 0}, \"expected\": {\"adjusted\": 10501, \"adds\": 501, \"subtracts\": 0}, \"passed\": true}, {\"check\": \"shipped on period end\", \"actual\": {\"adjusted\": 5501, \"adds\": 501, \"subtracts\": 0}, \"expected\": {\"adjusted\": 5501, \"adds\": 501, \"subtracts\": 0}, \"passed\": true}, {\"check\": \"shipped after period\", \"actual\": {\"adjusted\": 5000, \"adds\": 0, \"subtracts\": 0}, \"expected\": {\"adjusted\": 5000, \"adds\": 0, \"subtracts\": 0}, \"passed\": true}, {\"check\": \"arrived before end\", \"actual\": {\"adjusted\": 8000, \"adds\": 0, \"subtracts\": 0}, \"expected\": {\"adjusted\": 8000, \"adds\": 0, \"subtracts\": 0}, \"passed\": true}, {\"check\": \"outbound terms\", \"actual\": {\"adjusted\": 7600, \"adds\": 600, \"subtracts\": 0}, \"expected\": {\"adjusted\": 7600, \"adds\": 600, \"subtracts\": 0}, \"passed\": true}, {\"check\": \"consignment\", \"actual\": {\"adjusted\": 8549, \"adds\": 0, \"subtracts\": 451}, \"expected\": {\"adjusted\": 9749, \"adds\": 1200, \"subtracts\": 451}, \"passed\": false}, {\"check\": \"bill and hold\", \"actual\": {\"adjusted\": 5549, \"adds\": 0, \"subtracts\": 451}, \"expected\": {\"adjusted\": 5549, \"adds\": 0, \"subtracts\": 451}, \"passed\": true}, {\"check\": \"undelivered none\", \"actual\": {\"adjusted\": 155, \"adds\": 55, \"subtracts\": 0}, \"expected\": {\"adjusted\": 155, \"adds\": 55, \"subtracts\": 0}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.01,"exit_code":1,"observations":[{"actual":{"adds":501,"adjusted":10501,"subtracts":0},"check":"inbound shipping terms","expected":{"adds":501,"adjusted":10501,"subtracts":0},"passed":true},{"actual":{"adds":501,"adjusted":5501,"subtracts":0},"check":"shipped on period end","expected":{"adds":501,"adjusted":5501,"subtracts":0},"passed":true},{"actual":{"adds":0,"adjusted":5000,"subtracts":0},"check":"shipped after period","expected":{"adds":0,"adjusted":5000,"subtracts":0},"passed":true},{"actual":{"adds":0,"adjusted":8000,"subtracts":0},"check":"arrived before end","expected":{"adds":0,"adjusted":8000,"subtracts":0},"passed":true},{"actual":{"adds":600,"adjusted":7600,"subtracts":0},"check":"outbound terms","expected":{"adds":600,"adjusted":7600,"subtracts":0},"passed":true},{"actual":{"adds":0,"adjusted":7349,"subtracts":1651},"check":"consignment","expected":{"adds":1200,"adjusted":9749,"subtracts":451},"passed":false},{"actual":{"adds":0,"adjusted":5549,"subtracts":451},"check":"bill and hold","expected":{"adds":0,"adjusted":5549,"subtracts":451},"passed":true},{"actual":{"adds":55,"adjusted":155,"subtracts":0},"check":"undelivered none","expected":{"adds":55,"adjusted":155,"subtracts":0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"inbound shipping terms\", \"actual\": {\"adjusted\": 10501, \"adds\": 501, \"subtracts\": 0}, \"expected\": {\"adjusted\": 10501, \"adds\": 501, \"subtracts\": 0}, \"passed\": true}, {\"check\": \"shipped on period end\", \"actual\": {\"adjusted\": 5501, \"adds\": 501, \"subtracts\": 0}, \"expected\": {\"adjusted\": 5501, \"adds\": 501, \"subtracts\": 0}, \"passed\": true}, {\"check\": \"shipped after period\", \"actual\": {\"adjusted\": 5000, \"adds\": 0, \"subtracts\": 0}, \"expected\": {\"adjusted\": 5000, \"adds\": 0, \"subtracts\": 0}, \"passed\": true}, {\"check\": \"arrived before end\", \"actual\": {\"adjusted\": 8000, \"adds\": 0, \"subtracts\": 0}, \"expected\": {\"adjusted\": 8000, \"adds\": 0, \"subtracts\": 0}, \"passed\": true}, {\"check\": \"outbound terms\", \"actual\": {\"adjusted\": 7600, \"adds\": 600, \"subtracts\": 0}, \"expected\": {\"adjusted\": 7600, \"adds\": 600, \"subtracts\": 0}, \"passed\": true}, {\"check\": \"consignment\", \"actual\": {\"adjusted\": 7349, \"adds\": 0, \"subtracts\": 1651}, \"expected\": {\"adjusted\": 9749, \"adds\": 1200, \"subtracts\": 451}, \"passed\": false}, {\"check\": \"bill and hold\", \"actual\": {\"adjusted\": 5549, \"adds\": 0, \"subtracts\": 451}, \"expected\": {\"adjusted\": 5549, \"adds\": 0, \"subtracts\": 451}, \"passed\": true}, {\"check\": \"undelivered none\", \"actual\": {\"adjusted\": 155, \"adds\": 55, \"subtracts\": 0}, \"expected\": {\"adjusted\": 155, \"adds\": 55, \"subtracts\": 0}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.157,"exit_code":0,"observations":[{"actual":{"adds":501,"adjusted":10501,"subtracts":0},"check":"inbound shipping terms","expected":{"adds":501,"adjusted":10501,"subtracts":0},"passed":true},{"actual":{"adds":501,"adjusted":5501,"subtracts":0},"check":"shipped on period end","expected":{"adds":501,"adjusted":5501,"subtracts":0},"passed":true},{"actual":{"adds":0,"adjusted":5000,"subtracts":0},"check":"shipped after period","expected":{"adds":0,"adjusted":5000,"subtracts":0},"passed":true},{"actual":{"adds":0,"adjusted":8000,"subtracts":0},"check":"arrived before end","expected":{"adds":0,"adjusted":8000,"subtracts":0},"passed":true},{"actual":{"adds":600,"adjusted":7600,"subtracts":0},"check":"outbound terms","expected":{"adds":600,"adjusted":7600,"subtracts":0},"passed":true},{"actual":{"adds":1200,"adjusted":9749,"subtracts":451},"check":"consignment","expected":{"adds":1200,"adjusted":9749,"subtracts":451},"passed":true},{"actual":{"adds":0,"adjusted":5549,"subtracts":451},"check":"bill and hold","expected":{"adds":0,"adjusted":5549,"subtracts":451},"passed":true},{"actual":{"adds":55,"adjusted":155,"subtracts":0},"check":"undelivered none","expected":{"adds":55,"adjusted":155,"subtracts":0},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"inbound shipping terms\", \"actual\": {\"adjusted\": 10501, \"adds\": 501, \"subtracts\": 0}, \"expected\": {\"adjusted\": 10501, \"adds\": 501, \"subtracts\": 0}, \"passed\": true}, {\"check\": \"shipped on period end\", \"actual\": {\"adjusted\": 5501, \"adds\": 501, \"subtracts\": 0}, \"expected\": {\"adjusted\": 5501, \"adds\": 501, \"subtracts\": 0}, \"passed\": true}, {\"check\": \"shipped after period\", \"actual\": {\"adjusted\": 5000, \"adds\": 0, \"subtracts\": 0}, \"expected\": {\"adjusted\": 5000, \"adds\": 0, \"subtracts\": 0}, \"passed\": true}, {\"check\": \"arrived before end\", \"actual\": {\"adjusted\": 8000, \"adds\": 0, \"subtracts\": 0}, \"expected\": {\"adjusted\": 8000, \"adds\": 0, \"subtracts\": 0}, \"passed\": true}, {\"check\": \"outbound terms\", \"actual\": {\"adjusted\": 7600, \"adds\": 600, \"subtracts\": 0}, \"expected\": {\"adjusted\": 7600, \"adds\": 600, \"subtracts\": 0}, \"passed\": true}, {\"check\": \"consignment\", \"actual\": {\"adjusted\": 9749, \"adds\": 1200, \"subtracts\": 451}, \"expected\": {\"adjusted\": 9749, \"adds\": 1200, \"subtracts\": 451}, \"passed\": true}, {\"check\": \"bill and hold\", \"actual\": {\"adjusted\": 5549, \"adds\": 0, \"subtracts\": 451}, \"expected\": {\"adjusted\": 5549, \"adds\": 0, \"subtracts\": 451}, \"passed\": true}, {\"check\": \"undelivered none\", \"actual\": {\"adjusted\": 155, \"adds\": 55, \"subtracts\": 0}, \"expected\": {\"adjusted\": 155, \"adds\": 55, \"subtracts\": 0}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}