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

N = 1
observations = []
def solve(x):
    v0 = max(0,x["awarded"]-x["shipped"]-x["inventory_released"])
    v1 = min(x["returned"],x["shipped"])
    v2 = max(0,x["paid"]-x["refunded"])
    v3 = max(0,x["seller_paid"]-x["seller_recovered"])
    v4 = max(0,x["paid"]-x["refunded"]) if x["annulled"] else 0
    v5 = x["fee"] if x["fee_refundable"] and x["annulled"] else 0
    v6 = x["award_id"]==x["reversal_award"]
    v7 = x["annulled"] and x["title_passed"]
    v8 = max(0,x["bond"]-x["bond_called"])
    v9 = [i for i in x["related"] if i not in x["annulled_ids"]]
    return {'unshipped-inventory-release':v0,'returned-inventory-restoration':v1,'buyer-refund-residue':v2,'seller-proceeds-recovery':v3,'annulment-execution-gate':v4,'fee-refund-policy':v5,'reversal-award-binding':v6,'title-return-gate':v7,'uncalled-bond-release':v8,'related-award-isolation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [False, False, False, False, False]), ('fully refunded', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 30, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [False, False, False, False, False]), ('return above shipped quantity / not annulled', {'annulled': False, 'awarded': 8, 'shipped': 5, 'returned': 7, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [False, False, False, False, False]), ('return above shipped quantity / no title transfer', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 7, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': False, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [False, False, False, False, False]), ('return above shipped quantity', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 7, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [True, True, True, True, True]), ('not annulled', {'annulled': False, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [False, False, False, False, False]), ('all shipped returned', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 5, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [True, True, True, True, True]), ('no shipments', {'annulled': True, 'awarded': 8, 'shipped': 0, 'returned': 0, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [True, True, True, True, True]), ('seller fully recovered', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 20, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [False, False, False, False, False]), ('fee refundable', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': True, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [False, False, False, False, False]), ('wrong award reversal', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w2', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [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))['title-return-gate'], 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 = max(0,x["awarded"]-x["shipped"]-x["inventory_released"])
    v1 = min(x["returned"],x["shipped"])
    v2 = max(0,x["paid"]-x["refunded"])
    v3 = max(0,x["seller_paid"]-x["seller_recovered"])
    v4 = max(0,x["paid"]-x["refunded"]) if x["annulled"] else 0
    v5 = x["fee"] if x["fee_refundable"] and x["annulled"] else 0
    v6 = x["award_id"]==x["reversal_award"]
    v7 = x["returned"]>=x["shipped"]
    v8 = max(0,x["bond"]-x["bond_called"])
    v9 = [i for i in x["related"] if i not in x["annulled_ids"]]
    return {'unshipped-inventory-release':v0,'returned-inventory-restoration':v1,'buyer-refund-residue':v2,'seller-proceeds-recovery':v3,'annulment-execution-gate':v4,'fee-refund-policy':v5,'reversal-award-binding':v6,'title-return-gate':v7,'uncalled-bond-release':v8,'related-award-isolation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [False, False, False, False, False]), ('fully refunded', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 30, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [False, False, False, False, False]), ('return above shipped quantity / not annulled', {'annulled': False, 'awarded': 8, 'shipped': 5, 'returned': 7, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [False, False, False, False, False]), ('return above shipped quantity / no title transfer', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 7, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': False, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [False, False, False, False, False]), ('return above shipped quantity', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 7, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [True, True, True, True, True]), ('not annulled', {'annulled': False, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [False, False, False, False, False]), ('all shipped returned', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 5, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [True, True, True, True, True]), ('no shipments', {'annulled': True, 'awarded': 8, 'shipped': 0, 'returned': 0, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [True, True, True, True, True]), ('seller fully recovered', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 20, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [False, False, False, False, False]), ('fee refundable', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': True, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [False, False, False, False, False]), ('wrong award reversal', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w2', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [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))['title-return-gate'], 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:
Title reversal happens while delivered award units remain with the buyer.

An annulled auction award is unwound by separately reversing unshipped inventory reservations, refundable buyer payments, seller proceeds and title. Delivered units require return first. Reversal records refer to the original award identifier and prior reversal amount. Named decision title-return-gate: For title return gate, apply the stipulated decision x["annulled"] and x["title_passed"] and x["returned"]>=x["shipped"].

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = max(0,x["awarded"]-x["shipped"]-x["inventory_released"])
    v1 = min(x["returned"],x["shipped"])
    v2 = max(0,x["paid"]-x["refunded"])
    v3 = max(0,x["seller_paid"]-x["seller_recovered"])
    v4 = max(0,x["paid"]-x["refunded"]) if x["annulled"] else 0
    v5 = x["fee"] if x["fee_refundable"] and x["annulled"] else 0
    v6 = x["award_id"]==x["reversal_award"]
    v7 = x["annulled"] and x["title_passed"] and x["returned"]>=x["shipped"]
    v8 = x["bond"]
    v9 = [i for i in x["related"] if i not in x["annulled_ids"]]
    return {'unshipped-inventory-release':v0,'returned-inventory-restoration':v1,'buyer-refund-residue':v2,'seller-proceeds-recovery':v3,'annulment-execution-gate':v4,'fee-refund-policy':v5,'reversal-award-binding':v6,'title-return-gate':v7,'uncalled-bond-release':v8,'related-award-isolation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [4, 8, 12, 16, 20]), ('return above shipped quantity', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 7, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [4, 8, 12, 16, 20]), ('not annulled', {'annulled': False, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [4, 8, 12, 16, 20]), ('fully refunded', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 30, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [4, 8, 12, 16, 20]), ('all shipped returned', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 5, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [4, 8, 12, 16, 20]), ('no shipments', {'annulled': True, 'awarded': 8, 'shipped': 0, 'returned': 0, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [4, 8, 12, 16, 20]), ('seller fully recovered', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 20, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [4, 8, 12, 16, 20]), ('fee refundable', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': True, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [4, 8, 12, 16, 20]), ('wrong award reversal', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w2', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [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))['uncalled-bond-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 = max(0,x["awarded"]-x["shipped"]-x["inventory_released"])
    v1 = min(x["returned"],x["shipped"])
    v2 = max(0,x["paid"]-x["refunded"])
    v3 = max(0,x["seller_paid"]-x["seller_recovered"])
    v4 = max(0,x["paid"]-x["refunded"]) if x["annulled"] else 0
    v5 = x["fee"] if x["fee_refundable"] and x["annulled"] else 0
    v6 = x["award_id"]==x["reversal_award"]
    v7 = x["annulled"] and x["title_passed"] and x["returned"]>=x["shipped"]
    v8 = x["bond_called"]
    v9 = [i for i in x["related"] if i not in x["annulled_ids"]]
    return {'unshipped-inventory-release':v0,'returned-inventory-restoration':v1,'buyer-refund-residue':v2,'seller-proceeds-recovery':v3,'annulment-execution-gate':v4,'fee-refund-policy':v5,'reversal-award-binding':v6,'title-return-gate':v7,'uncalled-bond-release':v8,'related-award-isolation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [4, 8, 12, 16, 20]), ('return above shipped quantity', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 7, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [4, 8, 12, 16, 20]), ('not annulled', {'annulled': False, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [4, 8, 12, 16, 20]), ('fully refunded', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 30, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [4, 8, 12, 16, 20]), ('all shipped returned', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 5, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [4, 8, 12, 16, 20]), ('no shipments', {'annulled': True, 'awarded': 8, 'shipped': 0, 'returned': 0, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [4, 8, 12, 16, 20]), ('seller fully recovered', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 20, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [4, 8, 12, 16, 20]), ('fee refundable', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': True, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [4, 8, 12, 16, 20]), ('wrong award reversal', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w2', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [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))['uncalled-bond-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:
Unwind releases already called bond value as unused security.

An annulled auction award is unwound by separately reversing unshipped inventory reservations, refundable buyer payments, seller proceeds and title. Delivered units require return first. Reversal records refer to the original award identifier and prior reversal amount. Named decision uncalled-bond-release: For uncalled bond release, apply the stipulated decision max(0,x["bond"]-x["bond_called"]).

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = max(0,x["awarded"]-x["shipped"]-x["inventory_released"])
    v1 = min(x["returned"],x["shipped"])
    v2 = max(0,x["paid"]-x["refunded"])
    v3 = max(0,x["seller_paid"]-x["seller_recovered"])
    v4 = max(0,x["paid"]-x["refunded"]) if x["annulled"] else 0
    v5 = x["fee"] if x["fee_refundable"] and x["annulled"] else 0
    v6 = x["award_id"]==x["reversal_award"]
    v7 = x["annulled"] and x["title_passed"] and x["returned"]>=x["shipped"]
    v8 = max(0,x["bond"]-x["bond_called"])
    v9 = [] if x["annulled_ids"] else x["related"]
    return {'unshipped-inventory-release':v0,'returned-inventory-restoration':v1,'buyer-refund-residue':v2,'seller-proceeds-recovery':v3,'annulment-execution-gate':v4,'fee-refund-policy':v5,'reversal-award-binding':v6,'title-return-gate':v7,'uncalled-bond-release':v8,'related-award-isolation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [['w2'], ['w2'], ['w2'], ['w2'], ['w2']]), ('return above shipped quantity', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 7, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [['w2'], ['w2'], ['w2'], ['w2'], ['w2']]), ('not annulled', {'annulled': False, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [['w2'], ['w2'], ['w2'], ['w2'], ['w2']]), ('fully refunded', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 30, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [['w2'], ['w2'], ['w2'], ['w2'], ['w2']]), ('all shipped returned', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 5, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [['w2'], ['w2'], ['w2'], ['w2'], ['w2']]), ('no shipments', {'annulled': True, 'awarded': 8, 'shipped': 0, 'returned': 0, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [['w2'], ['w2'], ['w2'], ['w2'], ['w2']]), ('seller fully recovered', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 20, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [['w2'], ['w2'], ['w2'], ['w2'], ['w2']]), ('fee refundable', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': True, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [['w2'], ['w2'], ['w2'], ['w2'], ['w2']]), ('wrong award reversal', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w2', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [['w2'], ['w2'], ['w2'], ['w2'], ['w2']])]
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))['related-award-isolation'], 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 = max(0,x["awarded"]-x["shipped"]-x["inventory_released"])
    v1 = min(x["returned"],x["shipped"])
    v2 = max(0,x["paid"]-x["refunded"])
    v3 = max(0,x["seller_paid"]-x["seller_recovered"])
    v4 = max(0,x["paid"]-x["refunded"]) if x["annulled"] else 0
    v5 = x["fee"] if x["fee_refundable"] and x["annulled"] else 0
    v6 = x["award_id"]==x["reversal_award"]
    v7 = x["annulled"] and x["title_passed"] and x["returned"]>=x["shipped"]
    v8 = max(0,x["bond"]-x["bond_called"])
    v9 = x["related"]
    return {'unshipped-inventory-release':v0,'returned-inventory-restoration':v1,'buyer-refund-residue':v2,'seller-proceeds-recovery':v3,'annulment-execution-gate':v4,'fee-refund-policy':v5,'reversal-award-binding':v6,'title-return-gate':v7,'uncalled-bond-release':v8,'related-award-isolation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [['w2'], ['w2'], ['w2'], ['w2'], ['w2']]), ('return above shipped quantity', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 7, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [['w2'], ['w2'], ['w2'], ['w2'], ['w2']]), ('not annulled', {'annulled': False, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [['w2'], ['w2'], ['w2'], ['w2'], ['w2']]), ('fully refunded', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 30, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [['w2'], ['w2'], ['w2'], ['w2'], ['w2']]), ('all shipped returned', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 5, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [['w2'], ['w2'], ['w2'], ['w2'], ['w2']]), ('no shipments', {'annulled': True, 'awarded': 8, 'shipped': 0, 'returned': 0, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [['w2'], ['w2'], ['w2'], ['w2'], ['w2']]), ('seller fully recovered', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 20, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [['w2'], ['w2'], ['w2'], ['w2'], ['w2']]), ('fee refundable', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': True, 'award_id': 'w1', 'reversal_award': 'w1', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [['w2'], ['w2'], ['w2'], ['w2'], ['w2']]), ('wrong award reversal', {'annulled': True, 'awarded': 8, 'shipped': 5, 'returned': 2, 'paid': 30, 'refunded': 8, 'seller_paid': 20, 'seller_recovered': 4, 'fee': 3, 'fee_refundable': False, 'award_id': 'w1', 'reversal_award': 'w2', 'title_passed': True, 'inventory_released': 1, 'bond': 6, 'bond_called': 2, 'related': ['w1', 'w2'], 'annulled_ids': ['w1']}, [['w2'], ['w2'], ['w2'], ['w2'], ['w2']])]
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))['related-award-isolation'], 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:
Annulment cascades to unrelated surviving awards.

An annulled auction award is unwound by separately reversing unshipped inventory reservations, refundable buyer payments, seller proceeds and title. Delivered units require return first. Reversal records refer to the original award identifier and prior reversal amount. Named decision related-award-isolation: For related award isolation, apply the stipulated decision [i for i in x["related"] if i not in x["annulled_ids"]].

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = dict(zip(x["ids"],x["versions"]))
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if not d]
    v2 = [a for a in x["ids"] if a not in x["withdrawn"]]
    v3 = {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}
    v4 = x["edition"] in x["published_editions"]
    v5 = {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)]
    v7 = x["owners"] if x["disclose_owner"] else [None]*len(x["owners"])
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('out of order versions', {'ids': ['a', 'b', 'a'], 'versions': [2, 1, 1], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('all final / out of order versions', {'ids': ['a', 'b', 'a'], 'versions': [2, 1, 1], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}])]
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))['latest-award-revision'], 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 = {a:min(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if not d]
    v2 = [a for a in x["ids"] if a not in x["withdrawn"]]
    v3 = {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}
    v4 = x["edition"] in x["published_editions"]
    v5 = {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)]
    v7 = x["owners"] if x["disclose_owner"] else [None]*len(x["owners"])
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('out of order versions', {'ids': ['a', 'b', 'a'], 'versions': [2, 1, 1], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('all final / out of order versions', {'ids': ['a', 'b', 'a'], 'versions': [2, 1, 1], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 2, 'b': 1}, {'a': 4, 'b': 2}, {'a': 6, 'b': 3}, {'a': 8, 'b': 4}, {'a': 10, 'b': 5}])]
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))['latest-award-revision'], 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:
Publication arrival order replaces the latest award correction with an older revision.

Auction result publication assembles accepted award records, provisional appeal markers and correction versions. An original award record and its correction share one award identifier. Readers request a publication edition; drafts and withdrawn results must not appear. Named decision latest-award-revision: For latest award revision, apply the stipulated decision {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}.

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = x["ids"]
    v2 = [a for a in x["ids"] if a not in x["withdrawn"]]
    v3 = {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}
    v4 = x["edition"] in x["published_editions"]
    v5 = {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)]
    v7 = x["owners"] if x["disclose_owner"] else [None]*len(x["owners"])
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', '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))['draft-result-filter'], 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 = {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if d]
    v2 = [a for a in x["ids"] if a not in x["withdrawn"]]
    v3 = {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}
    v4 = x["edition"] in x["published_editions"]
    v5 = {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)]
    v7 = x["owners"] if x["disclose_owner"] else [None]*len(x["owners"])
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', '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))['draft-result-filter'], 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:
Draft award rows enter the published result edition.

Auction result publication assembles accepted award records, provisional appeal markers and correction versions. An original award record and its correction share one award identifier. Readers request a publication edition; drafts and withdrawn results must not appear. Named decision draft-result-filter: For draft result filter, apply the stipulated decision [a for a,d in zip(x["ids"],x["draft"]) if not d].

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if not d]
    v2 = x["ids"]
    v3 = {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}
    v4 = x["edition"] in x["published_editions"]
    v5 = {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)]
    v7 = x["owners"] if x["disclose_owner"] else [None]*len(x["owners"])
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', '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))['withdrawn-result-tombstone'], 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 = {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if not d]
    v2 = [a for a in x["ids"] if a not in x["appealed"]]
    v3 = {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}
    v4 = x["edition"] in x["published_editions"]
    v5 = {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)]
    v7 = x["owners"] if x["disclose_owner"] else [None]*len(x["owners"])
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a'], ['a', 'b', 'a']]), ('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a'], ['a', 'a']]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [['a', 'a'], ['a', 'a'], ['a', '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))['withdrawn-result-tombstone'], 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:
Withdrawn results remain public or appealed results are mistakenly removed.

Auction result publication assembles accepted award records, provisional appeal markers and correction versions. An original award record and its correction share one award identifier. Readers request a publication edition; drafts and withdrawn results must not appear. Named decision withdrawn-result-tombstone: For withdrawn result tombstone, apply the stipulated decision [a for a in x["ids"] if a not in x["withdrawn"]].

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if not d]
    v2 = [a for a in x["ids"] if a not in x["withdrawn"]]
    v3 = {a:"final" for a in x["ids"]}
    v4 = x["edition"] in x["published_editions"]
    v5 = {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)]
    v7 = x["owners"] if x["disclose_owner"] else [None]*len(x["owners"])
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'final', 'b': 'final'}, {'a': 'final', 'b': 'final'}, {'a': 'final', 'b': 'final'}, {'a': 'final', 'b': 'final'}, {'a': 'final', 'b': 'final'}]), ('all final / all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'final', 'b': 'final'}, {'a': 'final', 'b': 'final'}, {'a': 'final', 'b': 'final'}, {'a': 'final', 'b': 'final'}, {'a': 'final', 'b': 'final'}]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}]), ('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}])]
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))['appeal-finality-label'], 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 = {a:max(v for b,v in zip(x["ids"],x["versions"]) if b==a) for a in x["ids"]}
    v1 = [a for a,d in zip(x["ids"],x["draft"]) if not d]
    v2 = [a for a in x["ids"] if a not in x["withdrawn"]]
    v3 = {a:("provisional" if a in x["appealed"] else "final") for a in x["ids"]}
    v4 = x["edition"] in x["published_editions"]
    v5 = {a:x["quantities"][max((i for i,b in enumerate(x["ids"]) if b==a),key=lambda i:x["versions"][i])] for a in x["ids"]}
    v6 = [a for a in dict.fromkeys(x["ids"]) if max(v for b,v in zip(x["ids"],x["versions"]) if b==a)>x["notice_ack_version"].get(a,0)]
    v7 = x["owners"] if x["disclose_owner"] else [None]*len(x["owners"])
    v8 = [a for a,v in zip(x["ids"],x["versions"]) if v<=x["edition"]]
    v9 = [a for a,l in zip(x["ids"],x["lot_ids"]) if l in x["eligible_lots"]]
    return {'latest-award-revision':v0,'draft-result-filter':v1,'withdrawn-result-tombstone':v2,'appeal-finality-label':v3,'edition-existence':v4,'correction-quantity-replacement':v5,'correction-notice-edition':v6,'owner-redaction':v7,'edition-revision-cutoff':v8,'lot-publication-scope':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}]), ('all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}]), ('all final', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'final', 'b': 'final'}, {'a': 'final', 'b': 'final'}, {'a': 'final', 'b': 'final'}, {'a': 'final', 'b': 'final'}, {'a': 'final', 'b': 'final'}]), ('all final / all published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, False, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['a', 'b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'final', 'b': 'final'}, {'a': 'final', 'b': 'final'}, {'a': 'final', 'b': 'final'}, {'a': 'final', 'b': 'final'}, {'a': 'final', 'b': 'final'}]), ('no withdrawal', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': [], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}]), ('first edition', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 1, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}]), ('edition published', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1, 2], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}]), ('owner disclosure', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': True, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}]), ('no acknowledgments', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': [], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}]), ('all lots eligible', {'ids': ['a', 'b', 'a'], 'versions': [1, 1, 2], 'quantities': [3, 4, 2], 'draft': [False, True, False], 'withdrawn': ['b'], 'appealed': ['a'], 'finalized': ['b'], 'edition': 2, 'published_editions': [1], 'correction_of': {'a': 'a'}, 'announcements': ['a', 'b'], 'acknowledged': ['a'], 'disclose_owner': False, 'owners': ['x', 'y', 'x'], 'lot_ids': ['L1', 'L2', 'L1'], 'eligible_lots': ['L1', 'L2'], 'notice_ack_version': {'a': 1, 'b': 1}}, [{'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}, {'a': 'provisional', 'b': 'final'}])]
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))['appeal-finality-label'], 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:
Appeal result labels never reflect final resolution.

Auction result publication assembles accepted award records, provisional appeal markers and correction versions. An original award record and its correction share one award identifier. Readers request a publication edition; drafts and withdrawn results must not appear. Named decision appeal-finality-label: For appeal finality label, apply the stipulated decision {a:("provisional" if a in x["appealed"] and a not in x["finalized"] else "final") for a in x["ids"]}.

split: open-access