broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = min(x["delivered"],x["inspected"])
    v1 = max(0,min(x["delivered"],x["inspected"])-x["rejected"])
    v2 = max(0,x["awarded"]-x["delivered"])
    v3 = x["buyer_signed"] and x["seller_signed"]
    v4 = bool(set(x["lots"])&set(x["certificate"]))
    v5 = [i for i in x["lots"] if i in x["certificate"] and i not in x["damaged"]]
    v6 = min(x["paid"],max(0,min(x["delivered"],x["inspected"])-x["rejected"])*x["unit_price"])
    v7 = max(0,x["delivered"]-x["returned"])
    v8 = x["storage"] if x["now"]>x["deadline"] else 0
    v9 = 0 if x["disputed"] else max(0,x["paid"]-x["freight"])
    return {'inspectable-units':v0,'accepted-unit-count':v1,'award-remainder':v2,'title-acceptance':v3,'certificate-coverage':v4,'undamaged-certificate-release':v5,'payout-payment-cap':v6,'returned-fulfillment':v7,'late-storage-charge':v8,'dispute-payout-hold':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [False, False, False, False, False]), ('wrong certificate same count', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [False, False, False, False, False]), ('wrong certificate same count / delivery at deadline', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 9, 'disputed': False}, [False, False, False, False, False]), ('delivery at deadline', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 9, 'disputed': False}, [False, False, False, False, False]), ('buyer accepts', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': True, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [False, False, False, False, False]), ('nothing delivered', {'awarded': 8, 'shipped': 6, 'delivered': 0, 'inspected': 0, 'rejected': 0, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [False, False, False, False, False]), ('inspection exceeds delivery', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 8, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [False, False, False, False, False]), ('all inspected rejected', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 4, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [False, False, False, False, False]), ('all certified', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'B'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [True, True, True, True, True]), ('no damage', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': [], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [False, False, False, False, False])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['certificate-coverage'], expected[N-1])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = min(x["delivered"],x["inspected"])
    v1 = max(0,min(x["delivered"],x["inspected"])-x["rejected"])
    v2 = max(0,x["awarded"]-x["delivered"])
    v3 = x["buyer_signed"] and x["seller_signed"]
    v4 = len(x["lots"])==len(x["certificate"])
    v5 = [i for i in x["lots"] if i in x["certificate"] and i not in x["damaged"]]
    v6 = min(x["paid"],max(0,min(x["delivered"],x["inspected"])-x["rejected"])*x["unit_price"])
    v7 = max(0,x["delivered"]-x["returned"])
    v8 = x["storage"] if x["now"]>x["deadline"] else 0
    v9 = 0 if x["disputed"] else max(0,x["paid"]-x["freight"])
    return {'inspectable-units':v0,'accepted-unit-count':v1,'award-remainder':v2,'title-acceptance':v3,'certificate-coverage':v4,'undamaged-certificate-release':v5,'payout-payment-cap':v6,'returned-fulfillment':v7,'late-storage-charge':v8,'dispute-payout-hold':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [False, False, False, False, False]), ('wrong certificate same count', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [False, False, False, False, False]), ('wrong certificate same count / delivery at deadline', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 9, 'disputed': False}, [False, False, False, False, False]), ('delivery at deadline', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 9, 'disputed': False}, [False, False, False, False, False]), ('buyer accepts', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': True, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [False, False, False, False, False]), ('nothing delivered', {'awarded': 8, 'shipped': 6, 'delivered': 0, 'inspected': 0, 'rejected': 0, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [False, False, False, False, False]), ('inspection exceeds delivery', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 8, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [False, False, False, False, False]), ('all inspected rejected', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 4, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [False, False, False, False, False]), ('all certified', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'B'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [True, True, True, True, True]), ('no damage', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': [], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [False, False, False, False, False])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['certificate-coverage'], expected[N-1])
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)

prompt:
One certificate stands in for all awarded lot certificates.

Award fulfillment tracks delivered, inspected, rejected and accepted units. Title and seller payout require acceptance, not shipping. Partial shipments and certificates refer to individual auction lot identifiers; freight and storage are fixed integer credits. Named decision certificate-coverage: For certificate coverage, apply the stipulated decision set(x["lots"])<=set(x["certificate"]).

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = min(x["delivered"],x["inspected"])
    v1 = max(0,min(x["delivered"],x["inspected"])-x["rejected"])
    v2 = max(0,x["awarded"]-x["delivered"])
    v3 = x["buyer_signed"] and x["seller_signed"]
    v4 = set(x["lots"])<=set(x["certificate"])
    v5 = [i for i in x["lots"] if i in x["certificate"]]
    v6 = min(x["paid"],max(0,min(x["delivered"],x["inspected"])-x["rejected"])*x["unit_price"])
    v7 = max(0,x["delivered"]-x["returned"])
    v8 = x["storage"] if x["now"]>x["deadline"] else 0
    v9 = 0 if x["disputed"] else max(0,x["paid"]-x["freight"])
    return {'inspectable-units':v0,'accepted-unit-count':v1,'award-remainder':v2,'title-acceptance':v3,'certificate-coverage':v4,'undamaged-certificate-release':v5,'payout-payment-cap':v6,'returned-fulfillment':v7,'late-storage-charge':v8,'dispute-payout-hold':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('all certified', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'B'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('wrong certificate same count / all certified', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'B'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('no damage', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': [], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('wrong certificate same count / no damage', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': [], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('normal contract', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('wrong certificate same count', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('delivery at deadline', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 9, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('buyer accepts', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': True, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('nothing delivered', {'awarded': 8, 'shipped': 6, 'delivered': 0, 'inspected': 0, 'rejected': 0, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('inspection exceeds delivery', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 8, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('all inspected rejected', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 4, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['undamaged-certificate-release'], expected[N-1])
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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = min(x["delivered"],x["inspected"])
    v1 = max(0,min(x["delivered"],x["inspected"])-x["rejected"])
    v2 = max(0,x["awarded"]-x["delivered"])
    v3 = x["buyer_signed"] and x["seller_signed"]
    v4 = set(x["lots"])<=set(x["certificate"])
    v5 = [i for i in x["lots"] if i not in x["damaged"]]
    v6 = min(x["paid"],max(0,min(x["delivered"],x["inspected"])-x["rejected"])*x["unit_price"])
    v7 = max(0,x["delivered"]-x["returned"])
    v8 = x["storage"] if x["now"]>x["deadline"] else 0
    v9 = 0 if x["disputed"] else max(0,x["paid"]-x["freight"])
    return {'inspectable-units':v0,'accepted-unit-count':v1,'award-remainder':v2,'title-acceptance':v3,'certificate-coverage':v4,'undamaged-certificate-release':v5,'payout-payment-cap':v6,'returned-fulfillment':v7,'late-storage-charge':v8,'dispute-payout-hold':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('all certified', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'B'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('wrong certificate same count / all certified', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'B'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('no damage', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': [], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('wrong certificate same count / no damage', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': [], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('normal contract', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('wrong certificate same count', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('delivery at deadline', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 9, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('buyer accepts', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': True, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('nothing delivered', {'awarded': 8, 'shipped': 6, 'delivered': 0, 'inspected': 0, 'rejected': 0, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('inspection exceeds delivery', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 8, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('all inspected rejected', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 4, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [['A'], ['A'], ['A'], ['A'], ['A']])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['undamaged-certificate-release'], expected[N-1])
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)

prompt:
Damaged or uncertified lots are released from award custody.

Award fulfillment tracks delivered, inspected, rejected and accepted units. Title and seller payout require acceptance, not shipping. Partial shipments and certificates refer to individual auction lot identifiers; freight and storage are fixed integer credits. Named decision undamaged-certificate-release: For undamaged certificate release, apply the stipulated decision [i for i in x["lots"] if i in x["certificate"] and i not in x["damaged"]].

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = min(x["delivered"],x["inspected"])
    v1 = max(0,min(x["delivered"],x["inspected"])-x["rejected"])
    v2 = max(0,x["awarded"]-x["delivered"])
    v3 = x["buyer_signed"] and x["seller_signed"]
    v4 = set(x["lots"])<=set(x["certificate"])
    v5 = [i for i in x["lots"] if i in x["certificate"] and i not in x["damaged"]]
    v6 = x["paid"]
    v7 = max(0,x["delivered"]-x["returned"])
    v8 = x["storage"] if x["now"]>x["deadline"] else 0
    v9 = 0 if x["disputed"] else max(0,x["paid"]-x["freight"])
    return {'inspectable-units':v0,'accepted-unit-count':v1,'award-remainder':v2,'title-acceptance':v3,'certificate-coverage':v4,'undamaged-certificate-release':v5,'payout-payment-cap':v6,'returned-fulfillment':v7,'late-storage-charge':v8,'dispute-payout-hold':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [9, 36, 60, 80, 100]), ('wrong certificate same count', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [9, 36, 60, 80, 100]), ('delivery at deadline', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 9, 'disputed': False}, [9, 36, 60, 80, 100]), ('buyer accepts', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': True, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [9, 36, 60, 80, 100]), ('nothing delivered', {'awarded': 8, 'shipped': 6, 'delivered': 0, 'inspected': 0, 'rejected': 0, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('inspection exceeds delivery', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 8, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [12, 40, 60, 80, 100]), ('all inspected rejected', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 4, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('all certified', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'B'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [9, 36, 60, 80, 100]), ('no damage', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': [], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [9, 36, 60, 80, 100]), ('overpayment', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 100, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [9, 36, 81, 144, 225])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['payout-payment-cap'], expected[N-1])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = min(x["delivered"],x["inspected"])
    v1 = max(0,min(x["delivered"],x["inspected"])-x["rejected"])
    v2 = max(0,x["awarded"]-x["delivered"])
    v3 = x["buyer_signed"] and x["seller_signed"]
    v4 = set(x["lots"])<=set(x["certificate"])
    v5 = [i for i in x["lots"] if i in x["certificate"] and i not in x["damaged"]]
    v6 = min(x["paid"],x["delivered"]*x["unit_price"])
    v7 = max(0,x["delivered"]-x["returned"])
    v8 = x["storage"] if x["now"]>x["deadline"] else 0
    v9 = 0 if x["disputed"] else max(0,x["paid"]-x["freight"])
    return {'inspectable-units':v0,'accepted-unit-count':v1,'award-remainder':v2,'title-acceptance':v3,'certificate-coverage':v4,'undamaged-certificate-release':v5,'payout-payment-cap':v6,'returned-fulfillment':v7,'late-storage-charge':v8,'dispute-payout-hold':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [9, 36, 60, 80, 100]), ('wrong certificate same count', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [9, 36, 60, 80, 100]), ('delivery at deadline', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 9, 'disputed': False}, [9, 36, 60, 80, 100]), ('buyer accepts', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': True, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [9, 36, 60, 80, 100]), ('nothing delivered', {'awarded': 8, 'shipped': 6, 'delivered': 0, 'inspected': 0, 'rejected': 0, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('inspection exceeds delivery', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 8, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [12, 40, 60, 80, 100]), ('all inspected rejected', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 4, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('all certified', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'B'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [9, 36, 60, 80, 100]), ('no damage', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': [], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [9, 36, 60, 80, 100]), ('overpayment', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 100, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [9, 36, 81, 144, 225])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['payout-payment-cap'], expected[N-1])
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)

prompt:
Seller receives proceeds for unaccepted delivery units.

Award fulfillment tracks delivered, inspected, rejected and accepted units. Title and seller payout require acceptance, not shipping. Partial shipments and certificates refer to individual auction lot identifiers; freight and storage are fixed integer credits. Named decision payout-payment-cap: For payout payment cap, apply the stipulated decision min(x["paid"],max(0,min(x["delivered"],x["inspected"])-x["rejected"])*x["unit_price"]).

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = min(x["delivered"],x["inspected"])
    v1 = max(0,min(x["delivered"],x["inspected"])-x["rejected"])
    v2 = max(0,x["awarded"]-x["delivered"])
    v3 = x["buyer_signed"] and x["seller_signed"]
    v4 = set(x["lots"])<=set(x["certificate"])
    v5 = [i for i in x["lots"] if i in x["certificate"] and i not in x["damaged"]]
    v6 = min(x["paid"],max(0,min(x["delivered"],x["inspected"])-x["rejected"])*x["unit_price"])
    v7 = x["delivered"]
    v8 = x["storage"] if x["now"]>x["deadline"] else 0
    v9 = 0 if x["disputed"] else max(0,x["paid"]-x["freight"])
    return {'inspectable-units':v0,'accepted-unit-count':v1,'award-remainder':v2,'title-acceptance':v3,'certificate-coverage':v4,'undamaged-certificate-release':v5,'payout-payment-cap':v6,'returned-fulfillment':v7,'late-storage-charge':v8,'dispute-payout-hold':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [4, 8, 12, 16, 20]), ('wrong certificate same count', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [4, 8, 12, 16, 20]), ('nothing delivered', {'awarded': 8, 'shipped': 6, 'delivered': 0, 'inspected': 0, 'rejected': 0, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('all returned', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 8, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('delivery at deadline', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 9, 'disputed': False}, [4, 8, 12, 16, 20]), ('buyer accepts', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': True, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [4, 8, 12, 16, 20]), ('inspection exceeds delivery', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 8, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [4, 8, 12, 16, 20]), ('all inspected rejected', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 4, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [4, 8, 12, 16, 20]), ('all certified', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'B'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [4, 8, 12, 16, 20]), ('no damage', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': [], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [4, 8, 12, 16, 20])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['returned-fulfillment'], expected[N-1])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = min(x["delivered"],x["inspected"])
    v1 = max(0,min(x["delivered"],x["inspected"])-x["rejected"])
    v2 = max(0,x["awarded"]-x["delivered"])
    v3 = x["buyer_signed"] and x["seller_signed"]
    v4 = set(x["lots"])<=set(x["certificate"])
    v5 = [i for i in x["lots"] if i in x["certificate"] and i not in x["damaged"]]
    v6 = min(x["paid"],max(0,min(x["delivered"],x["inspected"])-x["rejected"])*x["unit_price"])
    v7 = x["delivered"]-x["returned"]
    v8 = x["storage"] if x["now"]>x["deadline"] else 0
    v9 = 0 if x["disputed"] else max(0,x["paid"]-x["freight"])
    return {'inspectable-units':v0,'accepted-unit-count':v1,'award-remainder':v2,'title-acceptance':v3,'certificate-coverage':v4,'undamaged-certificate-release':v5,'payout-payment-cap':v6,'returned-fulfillment':v7,'late-storage-charge':v8,'dispute-payout-hold':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [4, 8, 12, 16, 20]), ('wrong certificate same count', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [4, 8, 12, 16, 20]), ('nothing delivered', {'awarded': 8, 'shipped': 6, 'delivered': 0, 'inspected': 0, 'rejected': 0, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('all returned', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 8, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('delivery at deadline', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 9, 'disputed': False}, [4, 8, 12, 16, 20]), ('buyer accepts', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': True, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [4, 8, 12, 16, 20]), ('inspection exceeds delivery', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 8, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [4, 8, 12, 16, 20]), ('all inspected rejected', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 4, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [4, 8, 12, 16, 20]), ('all certified', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'B'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [4, 8, 12, 16, 20]), ('no damage', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': [], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [4, 8, 12, 16, 20])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['returned-fulfillment'], expected[N-1])
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)

prompt:
Returned auction goods still count as fulfilled delivery.

Award fulfillment tracks delivered, inspected, rejected and accepted units. Title and seller payout require acceptance, not shipping. Partial shipments and certificates refer to individual auction lot identifiers; freight and storage are fixed integer credits. Named decision returned-fulfillment: For returned fulfillment, apply the stipulated decision max(0,x["delivered"]-x["returned"]).

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = min(x["delivered"],x["inspected"])
    v1 = max(0,min(x["delivered"],x["inspected"])-x["rejected"])
    v2 = max(0,x["awarded"]-x["delivered"])
    v3 = x["buyer_signed"] and x["seller_signed"]
    v4 = set(x["lots"])<=set(x["certificate"])
    v5 = [i for i in x["lots"] if i in x["certificate"] and i not in x["damaged"]]
    v6 = min(x["paid"],max(0,min(x["delivered"],x["inspected"])-x["rejected"])*x["unit_price"])
    v7 = max(0,x["delivered"]-x["returned"])
    v8 = x["storage"]
    v9 = 0 if x["disputed"] else max(0,x["paid"]-x["freight"])
    return {'inspectable-units':v0,'accepted-unit-count':v1,'award-remainder':v2,'title-acceptance':v3,'certificate-coverage':v4,'undamaged-certificate-release':v5,'payout-payment-cap':v6,'returned-fulfillment':v7,'late-storage-charge':v8,'dispute-payout-hold':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('wrong certificate same count', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('delivery at deadline', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 9, 'disputed': False}, [0, 0, 0, 0, 0]), ('wrong certificate same count / delivery at deadline', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 9, 'disputed': False}, [0, 0, 0, 0, 0]), ('buyer accepts', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': True, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('nothing delivered', {'awarded': 8, 'shipped': 6, 'delivered': 0, 'inspected': 0, 'rejected': 0, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('inspection exceeds delivery', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 8, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('all inspected rejected', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 4, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('all certified', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'B'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('no damage', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': [], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['late-storage-charge'], expected[N-1])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = min(x["delivered"],x["inspected"])
    v1 = max(0,min(x["delivered"],x["inspected"])-x["rejected"])
    v2 = max(0,x["awarded"]-x["delivered"])
    v3 = x["buyer_signed"] and x["seller_signed"]
    v4 = set(x["lots"])<=set(x["certificate"])
    v5 = [i for i in x["lots"] if i in x["certificate"] and i not in x["damaged"]]
    v6 = min(x["paid"],max(0,min(x["delivered"],x["inspected"])-x["rejected"])*x["unit_price"])
    v7 = max(0,x["delivered"]-x["returned"])
    v8 = x["storage"] if x["now"]>=x["deadline"] else 0
    v9 = 0 if x["disputed"] else max(0,x["paid"]-x["freight"])
    return {'inspectable-units':v0,'accepted-unit-count':v1,'award-remainder':v2,'title-acceptance':v3,'certificate-coverage':v4,'undamaged-certificate-release':v5,'payout-payment-cap':v6,'returned-fulfillment':v7,'late-storage-charge':v8,'dispute-payout-hold':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('wrong certificate same count', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('delivery at deadline', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 9, 'disputed': False}, [0, 0, 0, 0, 0]), ('wrong certificate same count / delivery at deadline', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 9, 'disputed': False}, [0, 0, 0, 0, 0]), ('buyer accepts', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': True, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('nothing delivered', {'awarded': 8, 'shipped': 6, 'delivered': 0, 'inspected': 0, 'rejected': 0, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('inspection exceeds delivery', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 8, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('all inspected rejected', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 4, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('all certified', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'B'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0]), ('no damage', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': [], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [0, 0, 0, 0, 0])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['late-storage-charge'], expected[N-1])
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)

prompt:
Storage charges begin before the stipulated post-deadline period.

Award fulfillment tracks delivered, inspected, rejected and accepted units. Title and seller payout require acceptance, not shipping. Partial shipments and certificates refer to individual auction lot identifiers; freight and storage are fixed integer credits. Named decision late-storage-charge: For late storage charge, apply the stipulated decision x["storage"] if x["now"]>x["deadline"] else 0.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = min(x["delivered"],x["inspected"])
    v1 = max(0,min(x["delivered"],x["inspected"])-x["rejected"])
    v2 = max(0,x["awarded"]-x["delivered"])
    v3 = x["buyer_signed"] and x["seller_signed"]
    v4 = set(x["lots"])<=set(x["certificate"])
    v5 = [i for i in x["lots"] if i in x["certificate"] and i not in x["damaged"]]
    v6 = min(x["paid"],max(0,min(x["delivered"],x["inspected"])-x["rejected"])*x["unit_price"])
    v7 = max(0,x["delivered"]-x["returned"])
    v8 = x["storage"] if x["now"]>x["deadline"] else 0
    v9 = max(0,x["paid"]-x["freight"])
    return {'inspectable-units':v0,'accepted-unit-count':v1,'award-remainder':v2,'title-acceptance':v3,'certificate-coverage':v4,'undamaged-certificate-release':v5,'payout-payment-cap':v6,'returned-fulfillment':v7,'late-storage-charge':v8,'dispute-payout-hold':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('active dispute', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': True}, [0, 0, 0, 0, 0]), ('wrong certificate same count / active dispute', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': True}, [0, 0, 0, 0, 0]), ('normal contract', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [16, 32, 48, 64, 80]), ('wrong certificate same count', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [16, 32, 48, 64, 80]), ('delivery at deadline', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 9, 'disputed': False}, [16, 32, 48, 64, 80]), ('buyer accepts', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': True, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [16, 32, 48, 64, 80]), ('nothing delivered', {'awarded': 8, 'shipped': 6, 'delivered': 0, 'inspected': 0, 'rejected': 0, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [16, 32, 48, 64, 80]), ('inspection exceeds delivery', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 8, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [16, 32, 48, 64, 80]), ('all inspected rejected', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 4, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [16, 32, 48, 64, 80]), ('all certified', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'B'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [16, 32, 48, 64, 80]), ('no damage', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': [], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [16, 32, 48, 64, 80])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['dispute-payout-hold'], expected[N-1])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = min(x["delivered"],x["inspected"])
    v1 = max(0,min(x["delivered"],x["inspected"])-x["rejected"])
    v2 = max(0,x["awarded"]-x["delivered"])
    v3 = x["buyer_signed"] and x["seller_signed"]
    v4 = set(x["lots"])<=set(x["certificate"])
    v5 = [i for i in x["lots"] if i in x["certificate"] and i not in x["damaged"]]
    v6 = min(x["paid"],max(0,min(x["delivered"],x["inspected"])-x["rejected"])*x["unit_price"])
    v7 = max(0,x["delivered"]-x["returned"])
    v8 = x["storage"] if x["now"]>x["deadline"] else 0
    v9 = 0 if x["disputed"] else x["paid"]
    return {'inspectable-units':v0,'accepted-unit-count':v1,'award-remainder':v2,'title-acceptance':v3,'certificate-coverage':v4,'undamaged-certificate-release':v5,'payout-payment-cap':v6,'returned-fulfillment':v7,'late-storage-charge':v8,'dispute-payout-hold':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('active dispute', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': True}, [0, 0, 0, 0, 0]), ('wrong certificate same count / active dispute', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': True}, [0, 0, 0, 0, 0]), ('normal contract', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [16, 32, 48, 64, 80]), ('wrong certificate same count', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'C'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [16, 32, 48, 64, 80]), ('delivery at deadline', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 9, 'disputed': False}, [16, 32, 48, 64, 80]), ('buyer accepts', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': True, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [16, 32, 48, 64, 80]), ('nothing delivered', {'awarded': 8, 'shipped': 6, 'delivered': 0, 'inspected': 0, 'rejected': 0, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [16, 32, 48, 64, 80]), ('inspection exceeds delivery', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 8, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [16, 32, 48, 64, 80]), ('all inspected rejected', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 4, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [16, 32, 48, 64, 80]), ('all certified', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A', 'B'], 'lots': ['A', 'B'], 'damaged': ['B'], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [16, 32, 48, 64, 80]), ('no damage', {'awarded': 8, 'shipped': 6, 'delivered': 5, 'inspected': 4, 'rejected': 1, 'paid': 20, 'unit_price': 3, 'certificate': ['A'], 'lots': ['A', 'B'], 'damaged': [], 'buyer_signed': False, 'seller_signed': True, 'freight': 4, 'storage': 2, 'returned': 1, 'deadline': 9, 'now': 7, 'disputed': False}, [16, 32, 48, 64, 80])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['dispute-payout-hold'], expected[N-1])
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)

prompt:
A delivery dispute fails to hold seller proceeds.

Award fulfillment tracks delivered, inspected, rejected and accepted units. Title and seller payout require acceptance, not shipping. Partial shipments and certificates refer to individual auction lot identifiers; freight and storage are fixed integer credits. Named decision dispute-payout-hold: For dispute payout hold, apply the stipulated decision 0 if x["disputed"] else max(0,x["paid"]-x["freight"]).

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = x["challenger"] in x["participants"]
    v1 = [g for g in x["grounds"] if g in x["permitted"]]
    v2 = x["filed"]<=x["deadline"]
    v3 = set(x["evidence"])<=set(x["received"])
    v4 = not (set(x["objections"])-set(x["resolved"])-set(x["withdrawn"]))
    v5 = [i for i in x["awarded"] if i not in x["affected"]] if x["upheld"] else x["awarded"]
    v6 = [o for o in x["objections"] if o not in x["withdrawn"]]
    v7 = 0 if x["frivolous"] else x["deposit"]
    v8 = sorted(set(x["participants"])-set(x["notified"]))
    v9 = [o for o in x["upheld"] if o in x["objections"] and o not in x["withdrawn"]]
    return {'challenger-standing':v0,'admissible-grounds':v1,'filing-deadline':v2,'evidence-completeness':v3,'open-objection-finality':v4,'remedy-lot-scope':v5,'withdrawn-hearing-removal':v6,'objection-deposit-disposition':v7,'hearing-notice-parties':v8,'upheld-live-objections':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('winner challenges own award', {'challenger': 'a', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [False, False, False, False, False]), ('ground order / winner challenges own award', {'challenger': 'a', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['procedure', 'eligibility'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [False, False, False, False, False]), ('nonparticipant', {'challenger': 'c', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [False, False, False, False, False]), ('ground order / nonparticipant', {'challenger': 'c', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['procedure', 'eligibility'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [False, False, False, False, False]), ('normal contract', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [True, True, True, True, True]), ('ground order', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['procedure', 'eligibility'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [True, True, True, True, True]), ('deadline filing', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 6, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [True, True, True, True, True]), ('late filing', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 7, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [True, True, True, True, True]), ('all evidence received', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1', 'e2'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [True, True, True, True, True]), ('all objections resolved', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1', 'o2'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [True, True, True, True, True]), ('none upheld', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': [], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [True, True, True, True, True])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['challenger-standing'], expected[N-1])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = x["challenger"]!=x["winner"]
    v1 = [g for g in x["grounds"] if g in x["permitted"]]
    v2 = x["filed"]<=x["deadline"]
    v3 = set(x["evidence"])<=set(x["received"])
    v4 = not (set(x["objections"])-set(x["resolved"])-set(x["withdrawn"]))
    v5 = [i for i in x["awarded"] if i not in x["affected"]] if x["upheld"] else x["awarded"]
    v6 = [o for o in x["objections"] if o not in x["withdrawn"]]
    v7 = 0 if x["frivolous"] else x["deposit"]
    v8 = sorted(set(x["participants"])-set(x["notified"]))
    v9 = [o for o in x["upheld"] if o in x["objections"] and o not in x["withdrawn"]]
    return {'challenger-standing':v0,'admissible-grounds':v1,'filing-deadline':v2,'evidence-completeness':v3,'open-objection-finality':v4,'remedy-lot-scope':v5,'withdrawn-hearing-removal':v6,'objection-deposit-disposition':v7,'hearing-notice-parties':v8,'upheld-live-objections':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('winner challenges own award', {'challenger': 'a', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [False, False, False, False, False]), ('ground order / winner challenges own award', {'challenger': 'a', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['procedure', 'eligibility'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [False, False, False, False, False]), ('nonparticipant', {'challenger': 'c', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [False, False, False, False, False]), ('ground order / nonparticipant', {'challenger': 'c', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['procedure', 'eligibility'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [False, False, False, False, False]), ('normal contract', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [True, True, True, True, True]), ('ground order', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['procedure', 'eligibility'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [True, True, True, True, True]), ('deadline filing', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 6, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [True, True, True, True, True]), ('late filing', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 7, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [True, True, True, True, True]), ('all evidence received', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1', 'e2'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [True, True, True, True, True]), ('all objections resolved', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1', 'o2'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [True, True, True, True, True]), ('none upheld', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': [], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [True, True, True, True, True])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['challenger-standing'], expected[N-1])
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)

prompt:
An award challenge admits a winner self-challenge or an outside bidder.

A provisional award challenge has bidder standing, grounds, evidence receipt, hearing outcomes and a limited remedy. Filing preserves the award but blocks finality until all admissible objections are resolved. Dates are ticks and list entries retain filing order. Named decision challenger-standing: For challenger standing, apply the stipulated decision x["challenger"] in x["participants"] and x["challenger"]!=x["winner"].

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = x["challenger"] in x["participants"] and x["challenger"]!=x["winner"]
    v1 = x["grounds"]
    v2 = x["filed"]<=x["deadline"]
    v3 = set(x["evidence"])<=set(x["received"])
    v4 = not (set(x["objections"])-set(x["resolved"])-set(x["withdrawn"]))
    v5 = [i for i in x["awarded"] if i not in x["affected"]] if x["upheld"] else x["awarded"]
    v6 = [o for o in x["objections"] if o not in x["withdrawn"]]
    v7 = 0 if x["frivolous"] else x["deposit"]
    v8 = sorted(set(x["participants"])-set(x["notified"]))
    v9 = [o for o in x["upheld"] if o in x["objections"] and o not in x["withdrawn"]]
    return {'challenger-standing':v0,'admissible-grounds':v1,'filing-deadline':v2,'evidence-completeness':v3,'open-objection-finality':v4,'remedy-lot-scope':v5,'withdrawn-hearing-removal':v6,'objection-deposit-disposition':v7,'hearing-notice-parties':v8,'upheld-live-objections':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['eligibility'], ['eligibility'], ['eligibility'], ['eligibility'], ['eligibility']]), ('nonparticipant', {'challenger': 'c', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['eligibility'], ['eligibility'], ['eligibility'], ['eligibility'], ['eligibility']]), ('ground order', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['procedure', 'eligibility'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['procedure', 'eligibility'], ['procedure', 'eligibility'], ['procedure', 'eligibility'], ['procedure', 'eligibility'], ['procedure', 'eligibility']]), ('ground order / nonparticipant', {'challenger': 'c', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['procedure', 'eligibility'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['procedure', 'eligibility'], ['procedure', 'eligibility'], ['procedure', 'eligibility'], ['procedure', 'eligibility'], ['procedure', 'eligibility']]), ('winner challenges own award', {'challenger': 'a', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['eligibility'], ['eligibility'], ['eligibility'], ['eligibility'], ['eligibility']]), ('deadline filing', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 6, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['eligibility'], ['eligibility'], ['eligibility'], ['eligibility'], ['eligibility']]), ('late filing', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 7, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['eligibility'], ['eligibility'], ['eligibility'], ['eligibility'], ['eligibility']]), ('all evidence received', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1', 'e2'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['eligibility'], ['eligibility'], ['eligibility'], ['eligibility'], ['eligibility']]), ('all objections resolved', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1', 'o2'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['eligibility'], ['eligibility'], ['eligibility'], ['eligibility'], ['eligibility']]), ('none upheld', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': [], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['eligibility'], ['eligibility'], ['eligibility'], ['eligibility'], ['eligibility']])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['admissible-grounds'], expected[N-1])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    v0 = x["challenger"] in x["participants"] and x["challenger"]!=x["winner"]
    v1 = [g for g in x["permitted"] if g in x["grounds"]]
    v2 = x["filed"]<=x["deadline"]
    v3 = set(x["evidence"])<=set(x["received"])
    v4 = not (set(x["objections"])-set(x["resolved"])-set(x["withdrawn"]))
    v5 = [i for i in x["awarded"] if i not in x["affected"]] if x["upheld"] else x["awarded"]
    v6 = [o for o in x["objections"] if o not in x["withdrawn"]]
    v7 = 0 if x["frivolous"] else x["deposit"]
    v8 = sorted(set(x["participants"])-set(x["notified"]))
    v9 = [o for o in x["upheld"] if o in x["objections"] and o not in x["withdrawn"]]
    return {'challenger-standing':v0,'admissible-grounds':v1,'filing-deadline':v2,'evidence-completeness':v3,'open-objection-finality':v4,'remedy-lot-scope':v5,'withdrawn-hearing-removal':v6,'objection-deposit-disposition':v7,'hearing-notice-parties':v8,'upheld-live-objections':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['eligibility'], ['eligibility'], ['eligibility'], ['eligibility'], ['eligibility']]), ('nonparticipant', {'challenger': 'c', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['eligibility'], ['eligibility'], ['eligibility'], ['eligibility'], ['eligibility']]), ('ground order', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['procedure', 'eligibility'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['procedure', 'eligibility'], ['procedure', 'eligibility'], ['procedure', 'eligibility'], ['procedure', 'eligibility'], ['procedure', 'eligibility']]), ('ground order / nonparticipant', {'challenger': 'c', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['procedure', 'eligibility'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['procedure', 'eligibility'], ['procedure', 'eligibility'], ['procedure', 'eligibility'], ['procedure', 'eligibility'], ['procedure', 'eligibility']]), ('winner challenges own award', {'challenger': 'a', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['eligibility'], ['eligibility'], ['eligibility'], ['eligibility'], ['eligibility']]), ('deadline filing', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 6, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['eligibility'], ['eligibility'], ['eligibility'], ['eligibility'], ['eligibility']]), ('late filing', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 7, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['eligibility'], ['eligibility'], ['eligibility'], ['eligibility'], ['eligibility']]), ('all evidence received', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1', 'e2'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['eligibility'], ['eligibility'], ['eligibility'], ['eligibility'], ['eligibility']]), ('all objections resolved', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1', 'o2'], 'objections': ['o1', 'o2'], 'upheld': ['o2'], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['eligibility'], ['eligibility'], ['eligibility'], ['eligibility'], ['eligibility']]), ('none upheld', {'challenger': 'b', 'participants': ['a', 'b'], 'winner': 'a', 'grounds': ['eligibility', 'price'], 'permitted': ['eligibility', 'procedure'], 'filed': 5, 'deadline': 6, 'evidence': ['e1', 'e2'], 'received': ['e1'], 'resolved': ['o1'], 'objections': ['o1', 'o2'], 'upheld': [], 'affected': ['L2'], 'awarded': ['L1', 'L2'], 'withdrawn': ['o1'], 'deposit': 4, 'frivolous': False, 'notified': ['a']}, [['eligibility'], ['eligibility'], ['eligibility'], ['eligibility'], ['eligibility']])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['admissible-grounds'], expected[N-1])
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)

prompt:
Challenge grounds are admitted without the stipulated ground filter or filing order.

A provisional award challenge has bidder standing, grounds, evidence receipt, hearing outcomes and a limited remedy. Filing preserves the award but blocks finality until all admissible objections are resolved. Dates are ticks and list entries retain filing order. Named decision admissible-grounds: For admissible grounds, apply the stipulated decision [g for g in x["grounds"] if g in x["permitted"]].

split: open-access