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

N = 1
observations = []
def solve(x):
    v0 = x["balance"]-x["other_hold"] >= x["new_hold"]
    v1 = x["new_hold"] if x["replace_ok"] else x["old_hold"]
    v2 = max(0,x["old_hold"]-x["fill_cost"])
    v3 = x["balance"]-x["old_hold"]-x["other_hold"]+(x["pending"] if x["confirmed"] else 0)
    v4 = min(x["refund"],x["captured"])
    v5 = x["old_hold"]+x["bond"]
    v6 = x["old_hold"] if x["closed"] else 0
    v7 = min(x["release"],max(0,x["old_hold"]-x["fill_cost"]))
    v8 = max(0,x["fill_cost"]-x["fee"])
    v9 = x["balance"]-x["other_hold"]-x["new_hold"] >= x["fee"]
    return {'replace-credit':v0,'atomic-replacement':v1,'capture-release':v2,'pending-release-availability':v3,'refund-ceiling':v4,'bond-separation':v5,'close-release':v6,'release-clamp':v7,'seller-net-remittance':v8,'unreserved-fee-check':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('closed auction', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': True}, [18, 36, 54, 72, 90]), ('reuse existing collateral / closed auction', {'balance': 100, 'old_hold': 30, 'new_hold': 70, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': True}, [18, 36, 54, 72, 90]), ('normal contract', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0]), ('reuse existing collateral', {'balance': 100, 'old_hold': 30, 'new_hold': 70, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0]), ('other auction limits credit', {'balance': 100, 'old_hold': 30, 'new_hold': 90, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0]), ('insufficient replacement', {'balance': 100, 'old_hold': 30, 'new_hold': 200, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': False, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0]), ('old hold larger', {'balance': 100, 'old_hold': 30, 'new_hold': 15, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0]), ('confirmed release', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': True, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0]), ('fully captured', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 30, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0]), ('zero reservation', {'balance': 100, 'old_hold': 0, 'new_hold': 0, 'other_hold': 0, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['close-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)

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

N = 1
observations = []
def solve(x):
    v0 = x["balance"]-x["other_hold"] >= x["new_hold"]
    v1 = x["new_hold"] if x["replace_ok"] else x["old_hold"]
    v2 = max(0,x["old_hold"]-x["fill_cost"])
    v3 = x["balance"]-x["old_hold"]-x["other_hold"]+(x["pending"] if x["confirmed"] else 0)
    v4 = min(x["refund"],x["captured"])
    v5 = x["old_hold"]+x["bond"]
    v6 = max(0,x["old_hold"]-x["captured"]) if x["closed"] else 0
    v7 = min(x["release"],max(0,x["old_hold"]-x["fill_cost"]))
    v8 = max(0,x["fill_cost"]-x["fee"])
    v9 = x["balance"]-x["other_hold"]-x["new_hold"] >= x["fee"]
    return {'replace-credit':v0,'atomic-replacement':v1,'capture-release':v2,'pending-release-availability':v3,'refund-ceiling':v4,'bond-separation':v5,'close-release':v6,'release-clamp':v7,'seller-net-remittance':v8,'unreserved-fee-check':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('closed auction', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': True}, [18, 36, 54, 72, 90]), ('reuse existing collateral / closed auction', {'balance': 100, 'old_hold': 30, 'new_hold': 70, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': True}, [18, 36, 54, 72, 90]), ('normal contract', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0]), ('reuse existing collateral', {'balance': 100, 'old_hold': 30, 'new_hold': 70, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0]), ('other auction limits credit', {'balance': 100, 'old_hold': 30, 'new_hold': 90, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0]), ('insufficient replacement', {'balance': 100, 'old_hold': 30, 'new_hold': 200, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': False, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0]), ('old hold larger', {'balance': 100, 'old_hold': 30, 'new_hold': 15, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0]), ('confirmed release', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': True, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0]), ('fully captured', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 30, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0]), ('zero reservation', {'balance': 100, 'old_hold': 0, 'new_hold': 0, 'other_hold': 0, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['close-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:
Auction closure returns collateral already consumed by the final fill.

A toy per-auction escrow account distinguishes available funds, reserved collateral, captured fill payments and pending releases. Reservation replaces an old hold atomically; a failed replacement retains the old hold. Separate auction holds must remain unavailable. Named decision close-release: Release only the unconsumed current reservation at closure.

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = x["balance"]-x["other_hold"] >= x["new_hold"]
    v1 = x["new_hold"] if x["replace_ok"] else x["old_hold"]
    v2 = max(0,x["old_hold"]-x["fill_cost"])
    v3 = x["balance"]-x["old_hold"]-x["other_hold"]+(x["pending"] if x["confirmed"] else 0)
    v4 = min(x["refund"],x["captured"])
    v5 = x["old_hold"]+x["bond"]
    v6 = max(0,x["old_hold"]-x["fill_cost"]) if x["closed"] else 0
    v7 = x["release"]
    v8 = max(0,x["fill_cost"]-x["fee"])
    v9 = x["balance"]-x["other_hold"]-x["new_hold"] >= x["fee"]
    return {'replace-credit':v0,'atomic-replacement':v1,'capture-release':v2,'pending-release-availability':v3,'refund-ceiling':v4,'bond-separation':v5,'close-release':v6,'release-clamp':v7,'seller-net-remittance':v8,'unreserved-fee-check':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('fully captured', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 30, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0]), ('zero reservation', {'balance': 100, 'old_hold': 0, 'new_hold': 0, 'other_hold': 0, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0]), ('release above residual', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 40, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [18, 36, 54, 72, 90]), ('normal contract', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [5, 10, 15, 20, 25]), ('reuse existing collateral', {'balance': 100, 'old_hold': 30, 'new_hold': 70, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [5, 10, 15, 20, 25]), ('other auction limits credit', {'balance': 100, 'old_hold': 30, 'new_hold': 90, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [5, 10, 15, 20, 25]), ('insufficient replacement', {'balance': 100, 'old_hold': 30, 'new_hold': 200, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': False, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [5, 10, 15, 20, 25]), ('old hold larger', {'balance': 100, 'old_hold': 30, 'new_hold': 15, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [5, 10, 15, 20, 25]), ('confirmed release', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': True, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [5, 10, 15, 20, 25]), ('closed auction', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': True}, [5, 10, 15, 20, 25])]
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))['release-clamp'], 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 = x["balance"]-x["other_hold"] >= x["new_hold"]
    v1 = x["new_hold"] if x["replace_ok"] else x["old_hold"]
    v2 = max(0,x["old_hold"]-x["fill_cost"])
    v3 = x["balance"]-x["old_hold"]-x["other_hold"]+(x["pending"] if x["confirmed"] else 0)
    v4 = min(x["refund"],x["captured"])
    v5 = x["old_hold"]+x["bond"]
    v6 = max(0,x["old_hold"]-x["fill_cost"]) if x["closed"] else 0
    v7 = min(x["release"],x["old_hold"])
    v8 = max(0,x["fill_cost"]-x["fee"])
    v9 = x["balance"]-x["other_hold"]-x["new_hold"] >= x["fee"]
    return {'replace-credit':v0,'atomic-replacement':v1,'capture-release':v2,'pending-release-availability':v3,'refund-ceiling':v4,'bond-separation':v5,'close-release':v6,'release-clamp':v7,'seller-net-remittance':v8,'unreserved-fee-check':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('fully captured', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 30, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0]), ('zero reservation', {'balance': 100, 'old_hold': 0, 'new_hold': 0, 'other_hold': 0, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [0, 0, 0, 0, 0]), ('release above residual', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 40, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [18, 36, 54, 72, 90]), ('normal contract', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [5, 10, 15, 20, 25]), ('reuse existing collateral', {'balance': 100, 'old_hold': 30, 'new_hold': 70, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [5, 10, 15, 20, 25]), ('other auction limits credit', {'balance': 100, 'old_hold': 30, 'new_hold': 90, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [5, 10, 15, 20, 25]), ('insufficient replacement', {'balance': 100, 'old_hold': 30, 'new_hold': 200, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': False, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [5, 10, 15, 20, 25]), ('old hold larger', {'balance': 100, 'old_hold': 30, 'new_hold': 15, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [5, 10, 15, 20, 25]), ('confirmed release', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': True, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [5, 10, 15, 20, 25]), ('closed auction', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': True}, [5, 10, 15, 20, 25])]
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))['release-clamp'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A release command exceeds the reservation left after capture.

A toy per-auction escrow account distinguishes available funds, reserved collateral, captured fill payments and pending releases. Reservation replaces an old hold atomically; a failed replacement retains the old hold. Separate auction holds must remain unavailable. Named decision release-clamp: Clamp release to the residual uncaptured hold.

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = x["balance"]-x["other_hold"] >= x["new_hold"]
    v1 = x["new_hold"] if x["replace_ok"] else x["old_hold"]
    v2 = max(0,x["old_hold"]-x["fill_cost"])
    v3 = x["balance"]-x["old_hold"]-x["other_hold"]+(x["pending"] if x["confirmed"] else 0)
    v4 = min(x["refund"],x["captured"])
    v5 = x["old_hold"]+x["bond"]
    v6 = max(0,x["old_hold"]-x["fill_cost"]) if x["closed"] else 0
    v7 = min(x["release"],max(0,x["old_hold"]-x["fill_cost"]))
    v8 = x["fill_cost"]
    v9 = x["balance"]-x["other_hold"]-x["new_hold"] >= x["fee"]
    return {'replace-credit':v0,'atomic-replacement':v1,'capture-release':v2,'pending-release-availability':v3,'refund-ceiling':v4,'bond-separation':v5,'close-release':v6,'release-clamp':v7,'seller-net-remittance':v8,'unreserved-fee-check':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [9, 18, 27, 36, 45]), ('reuse existing collateral', {'balance': 100, 'old_hold': 30, 'new_hold': 70, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [9, 18, 27, 36, 45]), ('other auction limits credit', {'balance': 100, 'old_hold': 30, 'new_hold': 90, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [9, 18, 27, 36, 45]), ('insufficient replacement', {'balance': 100, 'old_hold': 30, 'new_hold': 200, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': False, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [9, 18, 27, 36, 45]), ('old hold larger', {'balance': 100, 'old_hold': 30, 'new_hold': 15, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [9, 18, 27, 36, 45]), ('confirmed release', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': True, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [9, 18, 27, 36, 45]), ('fully captured', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 30, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [27, 54, 81, 108, 135]), ('zero reservation', {'balance': 100, 'old_hold': 0, 'new_hold': 0, 'other_hold': 0, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [9, 18, 27, 36, 45]), ('closed auction', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': True}, [9, 18, 27, 36, 45])]
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))['seller-net-remittance'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x):
    v0 = x["balance"]-x["other_hold"] >= x["new_hold"]
    v1 = x["new_hold"] if x["replace_ok"] else x["old_hold"]
    v2 = max(0,x["old_hold"]-x["fill_cost"])
    v3 = x["balance"]-x["old_hold"]-x["other_hold"]+(x["pending"] if x["confirmed"] else 0)
    v4 = min(x["refund"],x["captured"])
    v5 = x["old_hold"]+x["bond"]
    v6 = max(0,x["old_hold"]-x["fill_cost"]) if x["closed"] else 0
    v7 = min(x["release"],max(0,x["old_hold"]-x["fill_cost"]))
    v8 = max(0,x["fill_cost"]-x["fee"]-x["bond"])
    v9 = x["balance"]-x["other_hold"]-x["new_hold"] >= x["fee"]
    return {'replace-credit':v0,'atomic-replacement':v1,'capture-release':v2,'pending-release-availability':v3,'refund-ceiling':v4,'bond-separation':v5,'close-release':v6,'release-clamp':v7,'seller-net-remittance':v8,'unreserved-fee-check':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [9, 18, 27, 36, 45]), ('reuse existing collateral', {'balance': 100, 'old_hold': 30, 'new_hold': 70, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [9, 18, 27, 36, 45]), ('other auction limits credit', {'balance': 100, 'old_hold': 30, 'new_hold': 90, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [9, 18, 27, 36, 45]), ('insufficient replacement', {'balance': 100, 'old_hold': 30, 'new_hold': 200, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': False, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [9, 18, 27, 36, 45]), ('old hold larger', {'balance': 100, 'old_hold': 30, 'new_hold': 15, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [9, 18, 27, 36, 45]), ('confirmed release', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': True, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [9, 18, 27, 36, 45]), ('fully captured', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 30, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [27, 54, 81, 108, 135]), ('zero reservation', {'balance': 100, 'old_hold': 0, 'new_hold': 0, 'other_hold': 0, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [9, 18, 27, 36, 45]), ('closed auction', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': True}, [9, 18, 27, 36, 45])]
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))['seller-net-remittance'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Seller remittance omits the fee or charges refundable bidder collateral.

A toy per-auction escrow account distinguishes available funds, reserved collateral, captured fill payments and pending releases. Reservation replaces an old hold atomically; a failed replacement retains the old hold. Separate auction holds must remain unavailable. Named decision seller-net-remittance: Deduct the settlement fee and leave the bidder bond separate.

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = x["balance"]-x["other_hold"] >= x["new_hold"]
    v1 = x["new_hold"] if x["replace_ok"] else x["old_hold"]
    v2 = max(0,x["old_hold"]-x["fill_cost"])
    v3 = x["balance"]-x["old_hold"]-x["other_hold"]+(x["pending"] if x["confirmed"] else 0)
    v4 = min(x["refund"],x["captured"])
    v5 = x["old_hold"]+x["bond"]
    v6 = max(0,x["old_hold"]-x["fill_cost"]) if x["closed"] else 0
    v7 = min(x["release"],max(0,x["old_hold"]-x["fill_cost"]))
    v8 = max(0,x["fill_cost"]-x["fee"])
    v9 = x["balance"]>=x["fee"]
    return {'replace-credit':v0,'atomic-replacement':v1,'capture-release':v2,'pending-release-availability':v3,'refund-ceiling':v4,'bond-separation':v5,'close-release':v6,'release-clamp':v7,'seller-net-remittance':v8,'unreserved-fee-check':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('other auction limits credit', {'balance': 100, 'old_hold': 30, 'new_hold': 90, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [False, False, False, False, False]), ('insufficient replacement', {'balance': 100, 'old_hold': 30, 'new_hold': 200, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': False, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [False, False, False, False, False]), ('normal contract', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('reuse existing collateral', {'balance': 100, 'old_hold': 30, 'new_hold': 70, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('old hold larger', {'balance': 100, 'old_hold': 30, 'new_hold': 15, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('confirmed release', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': True, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('fully captured', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 30, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('zero reservation', {'balance': 100, 'old_hold': 0, 'new_hold': 0, 'other_hold': 0, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('closed auction', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': True}, [True, True, True, True, True])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['unreserved-fee-check'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x):
    v0 = x["balance"]-x["other_hold"] >= x["new_hold"]
    v1 = x["new_hold"] if x["replace_ok"] else x["old_hold"]
    v2 = max(0,x["old_hold"]-x["fill_cost"])
    v3 = x["balance"]-x["old_hold"]-x["other_hold"]+(x["pending"] if x["confirmed"] else 0)
    v4 = min(x["refund"],x["captured"])
    v5 = x["old_hold"]+x["bond"]
    v6 = max(0,x["old_hold"]-x["fill_cost"]) if x["closed"] else 0
    v7 = min(x["release"],max(0,x["old_hold"]-x["fill_cost"]))
    v8 = max(0,x["fill_cost"]-x["fee"])
    v9 = x["balance"]-x["other_hold"]>=x["fee"]
    return {'replace-credit':v0,'atomic-replacement':v1,'capture-release':v2,'pending-release-availability':v3,'refund-ceiling':v4,'bond-separation':v5,'close-release':v6,'release-clamp':v7,'seller-net-remittance':v8,'unreserved-fee-check':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('other auction limits credit', {'balance': 100, 'old_hold': 30, 'new_hold': 90, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [False, False, False, False, False]), ('insufficient replacement', {'balance': 100, 'old_hold': 30, 'new_hold': 200, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': False, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [False, False, False, False, False]), ('normal contract', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('reuse existing collateral', {'balance': 100, 'old_hold': 30, 'new_hold': 70, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('old hold larger', {'balance': 100, 'old_hold': 30, 'new_hold': 15, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('confirmed release', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': True, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('fully captured', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 30, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('zero reservation', {'balance': 100, 'old_hold': 0, 'new_hold': 0, 'other_hold': 0, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('closed auction', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': True}, [True, True, True, True, True])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['unreserved-fee-check'], 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:
Admission approves a fee using funds already committed to the replacement bid.

A toy per-auction escrow account distinguishes available funds, reserved collateral, captured fill payments and pending releases. Reservation replaces an old hold atomically; a failed replacement retains the old hold. Separate auction holds must remain unavailable. Named decision unreserved-fee-check: Check fee funds after both replacement and unrelated reservations.

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = bool(set(x["won"])&set(x["required"]))
    v1 = not set(x["won"])&set(x["forbidden"])
    v2 = set(x["won"])<=set(x["available"])
    v3 = all(set(x["prerequisites"].get(i,[]))<=set(x["won"]) for i in x["won"])
    v4 = all(x["counts"].get(i,0)==q for i,q in x["wanted"].items())
    v5 = sum(set(a)<=set(x["won"]) for a in x["alternatives"])<=1
    v6 = set(x["won"])&set(x["seller_items"])<=set(x["consents"])
    v7 = all(len(set(a)&set(x["won"]))<=1 for a in x["substitutes"])
    v8 = set(x["split"])<=set(x["divisible"])
    v9 = not set(x["won"])&set(x["previous"])
    return {'must-link-completeness':v0,'negative-package-clause':v1,'offered-inventory':v2,'dependency-closure':v3,'exact-quantity-contract':v4,'alternative-activation':v5,'seller-consent-scope':v6,'substitute-collision':v7,'divisibility-certificate':v8,'prior-package-encumbrance':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('nothing awarded', {'won': [], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('partial bundle', {'won': ['A'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('unoffered item', {'won': ['D'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('normal contract', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('partial exclusion set', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['B', 'C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('multi prerequisite', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A', 'C']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('mixed split certificate', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['A', 'B'], 'previous': ['C']}, [True, True, True, True, True]), ('blocked bundle', {'won': ['A', 'C'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('full consent', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A', 'B'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['must-link-completeness'], 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 = set(x["required"])<=set(x["won"])
    v1 = not set(x["won"])&set(x["forbidden"])
    v2 = set(x["won"])<=set(x["available"])
    v3 = all(set(x["prerequisites"].get(i,[]))<=set(x["won"]) for i in x["won"])
    v4 = all(x["counts"].get(i,0)==q for i,q in x["wanted"].items())
    v5 = sum(set(a)<=set(x["won"]) for a in x["alternatives"])<=1
    v6 = set(x["won"])&set(x["seller_items"])<=set(x["consents"])
    v7 = all(len(set(a)&set(x["won"]))<=1 for a in x["substitutes"])
    v8 = set(x["split"])<=set(x["divisible"])
    v9 = not set(x["won"])&set(x["previous"])
    return {'must-link-completeness':v0,'negative-package-clause':v1,'offered-inventory':v2,'dependency-closure':v3,'exact-quantity-contract':v4,'alternative-activation':v5,'seller-consent-scope':v6,'substitute-collision':v7,'divisibility-certificate':v8,'prior-package-encumbrance':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('nothing awarded', {'won': [], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('partial bundle', {'won': ['A'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('unoffered item', {'won': ['D'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('normal contract', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('partial exclusion set', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['B', 'C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('multi prerequisite', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A', 'C']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('mixed split certificate', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['A', 'B'], 'previous': ['C']}, [True, True, True, True, True]), ('blocked bundle', {'won': ['A', 'C'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('full consent', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A', 'B'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['must-link-completeness'], 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:
Package admission accepts a fragment of an all-linked offer.

Auction package certification operates on item sets, declared item quantities and a dependency graph already known acyclic. It reports whether a proposed award respects must-link, excludes, prerequisites, lots offered, exact package quantities, and a seller consent rule. All package item identifiers are strings. Named decision must-link-completeness: Allow zero linked items or every linked item.

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = not set(x["won"])&set(x["required"]) or set(x["required"])<=set(x["won"])
    v1 = not set(x["forbidden"])<=set(x["won"])
    v2 = set(x["won"])<=set(x["available"])
    v3 = all(set(x["prerequisites"].get(i,[]))<=set(x["won"]) for i in x["won"])
    v4 = all(x["counts"].get(i,0)==q for i,q in x["wanted"].items())
    v5 = sum(set(a)<=set(x["won"]) for a in x["alternatives"])<=1
    v6 = set(x["won"])&set(x["seller_items"])<=set(x["consents"])
    v7 = all(len(set(a)&set(x["won"]))<=1 for a in x["substitutes"])
    v8 = set(x["split"])<=set(x["divisible"])
    v9 = not set(x["won"])&set(x["previous"])
    return {'must-link-completeness':v0,'negative-package-clause':v1,'offered-inventory':v2,'dependency-closure':v3,'exact-quantity-contract':v4,'alternative-activation':v5,'seller-consent-scope':v6,'substitute-collision':v7,'divisibility-certificate':v8,'prior-package-encumbrance':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('partial exclusion set', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['B', 'C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('partial exclusion set / multi prerequisite', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['B', 'C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A', 'C']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('normal contract', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('multi prerequisite', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A', 'C']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('mixed split certificate', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['A', 'B'], 'previous': ['C']}, [True, True, True, True, True]), ('nothing awarded', {'won': [], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('partial bundle', {'won': ['A'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('blocked bundle', {'won': ['A', 'C'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('unoffered item', {'won': ['D'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('full consent', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A', 'B'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['negative-package-clause'], 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 = not set(x["won"])&set(x["required"]) or set(x["required"])<=set(x["won"])
    v1 = not x["won"]
    v2 = set(x["won"])<=set(x["available"])
    v3 = all(set(x["prerequisites"].get(i,[]))<=set(x["won"]) for i in x["won"])
    v4 = all(x["counts"].get(i,0)==q for i,q in x["wanted"].items())
    v5 = sum(set(a)<=set(x["won"]) for a in x["alternatives"])<=1
    v6 = set(x["won"])&set(x["seller_items"])<=set(x["consents"])
    v7 = all(len(set(a)&set(x["won"]))<=1 for a in x["substitutes"])
    v8 = set(x["split"])<=set(x["divisible"])
    v9 = not set(x["won"])&set(x["previous"])
    return {'must-link-completeness':v0,'negative-package-clause':v1,'offered-inventory':v2,'dependency-closure':v3,'exact-quantity-contract':v4,'alternative-activation':v5,'seller-consent-scope':v6,'substitute-collision':v7,'divisibility-certificate':v8,'prior-package-encumbrance':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('partial exclusion set', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['B', 'C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('partial exclusion set / multi prerequisite', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['B', 'C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A', 'C']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('normal contract', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('multi prerequisite', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A', 'C']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('mixed split certificate', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['A', 'B'], 'previous': ['C']}, [True, True, True, True, True]), ('nothing awarded', {'won': [], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('partial bundle', {'won': ['A'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('blocked bundle', {'won': ['A', 'C'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('unoffered item', {'won': ['D'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('full consent', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A', 'B'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['negative-package-clause'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
An exclusion clause checks complete forbidden bundles instead of any forbidden item.

Auction package certification operates on item sets, declared item quantities and a dependency graph already known acyclic. It reports whether a proposed award respects must-link, excludes, prerequisites, lots offered, exact package quantities, and a seller consent rule. All package item identifiers are strings. Named decision negative-package-clause: Reject every award containing a forbidden item.

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = not set(x["won"])&set(x["required"]) or set(x["required"])<=set(x["won"])
    v1 = not set(x["won"])&set(x["forbidden"])
    v2 = bool(set(x["won"])&set(x["available"]))
    v3 = all(set(x["prerequisites"].get(i,[]))<=set(x["won"]) for i in x["won"])
    v4 = all(x["counts"].get(i,0)==q for i,q in x["wanted"].items())
    v5 = sum(set(a)<=set(x["won"]) for a in x["alternatives"])<=1
    v6 = set(x["won"])&set(x["seller_items"])<=set(x["consents"])
    v7 = all(len(set(a)&set(x["won"]))<=1 for a in x["substitutes"])
    v8 = set(x["split"])<=set(x["divisible"])
    v9 = not set(x["won"])&set(x["previous"])
    return {'must-link-completeness':v0,'negative-package-clause':v1,'offered-inventory':v2,'dependency-closure':v3,'exact-quantity-contract':v4,'alternative-activation':v5,'seller-consent-scope':v6,'substitute-collision':v7,'divisibility-certificate':v8,'prior-package-encumbrance':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('nothing awarded', {'won': [], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('partial exclusion set / nothing awarded', {'won': [], 'required': ['A', 'B'], 'forbidden': ['B', 'C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('unoffered item', {'won': ['D'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('partial exclusion set / unoffered item', {'won': ['D'], 'required': ['A', 'B'], 'forbidden': ['B', 'C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('normal contract', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('partial exclusion set', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['B', 'C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('multi prerequisite', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A', 'C']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('mixed split certificate', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['A', 'B'], 'previous': ['C']}, [True, True, True, True, True]), ('partial bundle', {'won': ['A'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('blocked bundle', {'won': ['A', 'C'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('full consent', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A', 'B'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['offered-inventory'], 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 = not set(x["won"])&set(x["required"]) or set(x["required"])<=set(x["won"])
    v1 = not set(x["won"])&set(x["forbidden"])
    v2 = True
    v3 = all(set(x["prerequisites"].get(i,[]))<=set(x["won"]) for i in x["won"])
    v4 = all(x["counts"].get(i,0)==q for i,q in x["wanted"].items())
    v5 = sum(set(a)<=set(x["won"]) for a in x["alternatives"])<=1
    v6 = set(x["won"])&set(x["seller_items"])<=set(x["consents"])
    v7 = all(len(set(a)&set(x["won"]))<=1 for a in x["substitutes"])
    v8 = set(x["split"])<=set(x["divisible"])
    v9 = not set(x["won"])&set(x["previous"])
    return {'must-link-completeness':v0,'negative-package-clause':v1,'offered-inventory':v2,'dependency-closure':v3,'exact-quantity-contract':v4,'alternative-activation':v5,'seller-consent-scope':v6,'substitute-collision':v7,'divisibility-certificate':v8,'prior-package-encumbrance':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('nothing awarded', {'won': [], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('partial exclusion set / nothing awarded', {'won': [], 'required': ['A', 'B'], 'forbidden': ['B', 'C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('unoffered item', {'won': ['D'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('partial exclusion set / unoffered item', {'won': ['D'], 'required': ['A', 'B'], 'forbidden': ['B', 'C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('normal contract', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('partial exclusion set', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['B', 'C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('multi prerequisite', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A', 'C']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('mixed split certificate', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['A', 'B'], 'previous': ['C']}, [True, True, True, True, True]), ('partial bundle', {'won': ['A'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('blocked bundle', {'won': ['A', 'C'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('full consent', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A', 'B'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['offered-inventory'], 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:
Unlisted auction lots enter a certified package.

Auction package certification operates on item sets, declared item quantities and a dependency graph already known acyclic. It reports whether a proposed award respects must-link, excludes, prerequisites, lots offered, exact package quantities, and a seller consent rule. All package item identifiers are strings. Named decision offered-inventory: Require every awarded item to have been offered.

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = not set(x["won"])&set(x["required"]) or set(x["required"])<=set(x["won"])
    v1 = not set(x["won"])&set(x["forbidden"])
    v2 = set(x["won"])<=set(x["available"])
    v3 = all(bool(set(x["prerequisites"].get(i,[]))&set(x["won"])) for i in x["won"] if i in x["prerequisites"])
    v4 = all(x["counts"].get(i,0)==q for i,q in x["wanted"].items())
    v5 = sum(set(a)<=set(x["won"]) for a in x["alternatives"])<=1
    v6 = set(x["won"])&set(x["seller_items"])<=set(x["consents"])
    v7 = all(len(set(a)&set(x["won"]))<=1 for a in x["substitutes"])
    v8 = set(x["split"])<=set(x["divisible"])
    v9 = not set(x["won"])&set(x["previous"])
    return {'must-link-completeness':v0,'negative-package-clause':v1,'offered-inventory':v2,'dependency-closure':v3,'exact-quantity-contract':v4,'alternative-activation':v5,'seller-consent-scope':v6,'substitute-collision':v7,'divisibility-certificate':v8,'prior-package-encumbrance':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('multi prerequisite', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A', 'C']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('partial exclusion set / multi prerequisite', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['B', 'C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A', 'C']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('normal contract', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('partial exclusion set', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['B', 'C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('mixed split certificate', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['A', 'B'], 'previous': ['C']}, [True, True, True, True, True]), ('nothing awarded', {'won': [], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('partial bundle', {'won': ['A'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('blocked bundle', {'won': ['A', 'C'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('unoffered item', {'won': ['D'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('full consent', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A', 'B'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['dependency-closure'], 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 = not set(x["won"])&set(x["required"]) or set(x["required"])<=set(x["won"])
    v1 = not set(x["won"])&set(x["forbidden"])
    v2 = set(x["won"])<=set(x["available"])
    v3 = all(i in x["won"] for i in x["prerequisites"])
    v4 = all(x["counts"].get(i,0)==q for i,q in x["wanted"].items())
    v5 = sum(set(a)<=set(x["won"]) for a in x["alternatives"])<=1
    v6 = set(x["won"])&set(x["seller_items"])<=set(x["consents"])
    v7 = all(len(set(a)&set(x["won"]))<=1 for a in x["substitutes"])
    v8 = set(x["split"])<=set(x["divisible"])
    v9 = not set(x["won"])&set(x["previous"])
    return {'must-link-completeness':v0,'negative-package-clause':v1,'offered-inventory':v2,'dependency-closure':v3,'exact-quantity-contract':v4,'alternative-activation':v5,'seller-consent-scope':v6,'substitute-collision':v7,'divisibility-certificate':v8,'prior-package-encumbrance':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('multi prerequisite', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A', 'C']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('partial exclusion set / multi prerequisite', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['B', 'C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A', 'C']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('normal contract', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('partial exclusion set', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['B', 'C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('mixed split certificate', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['A', 'B'], 'previous': ['C']}, [True, True, True, True, True]), ('nothing awarded', {'won': [], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('partial bundle', {'won': ['A'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('blocked bundle', {'won': ['A', 'C'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [False, False, False, False, False]), ('unoffered item', {'won': ['D'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True]), ('full consent', {'won': ['A', 'B'], 'required': ['A', 'B'], 'forbidden': ['C'], 'available': ['A', 'B', 'C'], 'prerequisites': {'B': ['A'], 'C': ['B']}, 'counts': {'A': 2, 'B': 1}, 'wanted': {'A': 2, 'B': 1}, 'alternatives': [['A', 'B'], ['C']], 'consents': ['A', 'B'], 'seller_items': ['A', 'B'], 'substitutes': [['A', 'C']], 'divisible': ['A'], 'split': ['B'], 'previous': ['C']}, [True, True, True, True, True])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['dependency-closure'], 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:
Package prerequisites use overlap instead of complete closure.

Auction package certification operates on item sets, declared item quantities and a dependency graph already known acyclic. It reports whether a proposed award respects must-link, excludes, prerequisites, lots offered, exact package quantities, and a seller consent rule. All package item identifiers are strings. Named decision dependency-closure: Require all prerequisites of each awarded item.

split: open-access