FA-60316 / Inventory cost layering / Open access
Period-end ownership cutoff adjustments: shipment date cutoff · case 01
Goods shipped on the last day of the period are left out of the cutoff adjustment.
ROOT CAUSE
The inbound shipment test requires the ship day to be strictly before period end.
THE FAILURE
The inbound shipment test requires the ship day to be strictly before period end.
Unsuccessful approach: Allowing one day past period end admits next-period shipments.
Case 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}.
Why this case matters
Inventory valuation and cost-of-goods decisions depend on this rule.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
end = x['period_end']
add = 0
sub = 0
for it in x['items']:
k = it['type']
v = it['value']
arrived = it['arrived_day'] is not None and it['arrived_day'] <= end
if k == 'in_transit_in':
if it['terms'] == 'FOB_shipping' and it['shipped_day'] < end and not arrived:
add += v
elif k == 'in_transit_out':
if it['terms'] == 'FOB_destination' and it['shipped_day'] <= end and not arrived:
add += v
elif k == 'consigned_out':
add += v
elif k in ('consigned_in', 'bill_and_hold'):
sub += v
return {'adjusted': x['count_value'] + add - sub, 'adds': add, 'subtracts': sub}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['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}]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| inbound shipping terms | {'adds': 501, 'adjusted': 10501, 'subtracts': 0} | {'adds': 501, 'adjusted': 10501, 'subtracts': 0} | Passed |
| shipped on period end | {'adds': 201, 'adjusted': 5201, 'subtracts': 0} | {'adds': 501, 'adjusted': 5501, 'subtracts': 0} | Failed |
| shipped after period | {'adds': 0, 'adjusted': 5000, 'subtracts': 0} | {'adds': 0, 'adjusted': 5000, 'subtracts': 0} | Passed |
| arrived before end | {'adds': 0, 'adjusted': 8000, 'subtracts': 0} | {'adds': 0, 'adjusted': 8000, 'subtracts': 0} | Passed |
| outbound terms | {'adds': 600, 'adjusted': 7600, 'subtracts': 0} | {'adds': 600, 'adjusted': 7600, 'subtracts': 0} | Passed |
| consignment | {'adds': 1200, 'adjusted': 9749, 'subtracts': 451} | {'adds': 1200, 'adjusted': 9749, 'subtracts': 451} | Passed |
| bill and hold | {'adds': 0, 'adjusted': 5549, 'subtracts': 451} | {'adds': 0, 'adjusted': 5549, 'subtracts': 451} | Passed |
| undelivered none | {'adds': 55, 'adjusted': 155, 'subtracts': 0} | {'adds': 55, 'adjusted': 155, 'subtracts': 0} | Passed |
SHA-256 / 52d6d762b55216b65842c5868735bd6daa58e21bd1b9c809ad3166dea03a1a17
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
end = x['period_end']
add = 0
sub = 0
for it in x['items']:
k = it['type']
v = it['value']
arrived = it['arrived_day'] is not None and it['arrived_day'] <= end
if k == 'in_transit_in':
if it['terms'] == 'FOB_shipping' and it['shipped_day'] <= end + 1 and not arrived:
add += v
elif k == 'in_transit_out':
if it['terms'] == 'FOB_destination' and it['shipped_day'] <= end and not arrived:
add += v
elif k == 'consigned_out':
add += v
elif k in ('consigned_in', 'bill_and_hold'):
sub += v
return {'adjusted': x['count_value'] + add - sub, 'adds': add, 'subtracts': sub}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['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}]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| inbound shipping terms | {'adds': 501, 'adjusted': 10501, 'subtracts': 0} | {'adds': 501, 'adjusted': 10501, 'subtracts': 0} | Passed |
| shipped on period end | {'adds': 501, 'adjusted': 5501, 'subtracts': 0} | {'adds': 501, 'adjusted': 5501, 'subtracts': 0} | Passed |
| shipped after period | {'adds': 300, 'adjusted': 5300, 'subtracts': 0} | {'adds': 0, 'adjusted': 5000, 'subtracts': 0} | Failed |
| arrived before end | {'adds': 0, 'adjusted': 8000, 'subtracts': 0} | {'adds': 0, 'adjusted': 8000, 'subtracts': 0} | Passed |
| outbound terms | {'adds': 600, 'adjusted': 7600, 'subtracts': 0} | {'adds': 600, 'adjusted': 7600, 'subtracts': 0} | Passed |
| consignment | {'adds': 1200, 'adjusted': 9749, 'subtracts': 451} | {'adds': 1200, 'adjusted': 9749, 'subtracts': 451} | Passed |
| bill and hold | {'adds': 0, 'adjusted': 5549, 'subtracts': 451} | {'adds': 0, 'adjusted': 5549, 'subtracts': 451} | Passed |
| undelivered none | {'adds': 55, 'adjusted': 155, 'subtracts': 0} | {'adds': 55, 'adjusted': 155, 'subtracts': 0} | Passed |
SHA-256 / 10e65ddd8fb1f09b559be2d73130094118babbbb63de2a4480d1e44af65bb19e
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:46:44.710333+00:00.
Case digest / 56b68d65280a21af3dadcc7e62666adee23da642196648dc8fde7943487d35a5