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

N = 1
observations = []
def solve(x):
    v0 = [l for l in x["offered"] if l not in x["sold"] and l in x["seller_carry"]]
    v1 = [l for l in x["standing"] if l in x["bidder_carry"]]
    v2 = [l for l in x["standing"] if l not in x["withdrawn"]]
    v3 = {l:x["old_priority"][l] if x["old_specs"][l]==x["new_specs"][l] else x["new_round"] for l in x["standing"]}
    v4 = [l for l in x["standing"] if l not in x["already_carried"]]
    v5 = {l:x["holds"].get(l,0) for l in x["standing"] if l in x["encumbered"]}
    v6 = {l:x["source_round"][l] for l in x["standing"]}
    v7 = x["standing"]
    v8 = [l for l in x["standing"] if l in x["bidder_carry"] and l not in x["expired"]]
    v9 = {l:x["approved_reserves"].get(l,x["reserves"][l]) for l in x["standing"]}
    return {'unsold-reoffer':v0,'standing-bid-reconsent':v1,'withdrawal-carry-veto':v2,'specification-priority-reset':v3,'carry-once-per-round':v4,'inherited-reservation':v5,'source-round-provenance':v6,'future-round-reoffer':v7,'authorization-expiry-carry':v8,'approved-reserve-revision':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('source from current round', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 3, 'B': 3, 'C': 3}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [[], [], [], [], []]), ('all seller carry / source from current round', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B', 'C'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 3, 'B': 3, 'C': 3}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [[], [], [], [], []]), ('normal contract', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C']]), ('all seller carry', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B', 'C'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C']]), ('all bidder carry', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['B', 'C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C']]), ('no withdrawals', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': [], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C']]), ('unchanged lot specs', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v1', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C']]), ('nothing already carried', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': [], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C']]), ('no expired authorization', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': [], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C']]), ('all sold', {'offered': ['A', 'B', 'C'], 'sold': ['A', 'B', 'C'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C']]), ('no encumbrance', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': [], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C']])]
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))['future-round-reoffer'], 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 = [l for l in x["offered"] if l not in x["sold"] and l in x["seller_carry"]]
    v1 = [l for l in x["standing"] if l in x["bidder_carry"]]
    v2 = [l for l in x["standing"] if l not in x["withdrawn"]]
    v3 = {l:x["old_priority"][l] if x["old_specs"][l]==x["new_specs"][l] else x["new_round"] for l in x["standing"]}
    v4 = [l for l in x["standing"] if l not in x["already_carried"]]
    v5 = {l:x["holds"].get(l,0) for l in x["standing"] if l in x["encumbered"]}
    v6 = {l:x["source_round"][l] for l in x["standing"]}
    v7 = [l for l in x["standing"] if x["source_round"][l]<=x["new_round"]]
    v8 = [l for l in x["standing"] if l in x["bidder_carry"] and l not in x["expired"]]
    v9 = {l:x["approved_reserves"].get(l,x["reserves"][l]) for l in x["standing"]}
    return {'unsold-reoffer':v0,'standing-bid-reconsent':v1,'withdrawal-carry-veto':v2,'specification-priority-reset':v3,'carry-once-per-round':v4,'inherited-reservation':v5,'source-round-provenance':v6,'future-round-reoffer':v7,'authorization-expiry-carry':v8,'approved-reserve-revision':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('source from current round', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 3, 'B': 3, 'C': 3}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [[], [], [], [], []]), ('all seller carry / source from current round', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B', 'C'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 3, 'B': 3, 'C': 3}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [[], [], [], [], []]), ('normal contract', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C']]), ('all seller carry', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B', 'C'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C']]), ('all bidder carry', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['B', 'C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C']]), ('no withdrawals', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': [], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C']]), ('unchanged lot specs', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v1', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C']]), ('nothing already carried', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': [], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C']]), ('no expired authorization', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': [], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C']]), ('all sold', {'offered': ['A', 'B', 'C'], 'sold': ['A', 'B', 'C'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C']]), ('no encumbrance', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': [], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C'], ['B', 'C']])]
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))['future-round-reoffer'], 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 offer is carried back into the same source round.

Unsold auction lots may carry into a later round with explicit seller consent and inherited encumbrances. Standing offers carry only while their bidder authorization survives and may retain or lose priority according to whether lot specification changed. Sale identifiers retain provenance. Named decision future-round-reoffer: For future round reoffer, apply the stipulated decision [l for l in x["standing"] if x["source_round"][l]<x["new_round"]].

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = [l for l in x["offered"] if l not in x["sold"] and l in x["seller_carry"]]
    v1 = [l for l in x["standing"] if l in x["bidder_carry"]]
    v2 = [l for l in x["standing"] if l not in x["withdrawn"]]
    v3 = {l:x["old_priority"][l] if x["old_specs"][l]==x["new_specs"][l] else x["new_round"] for l in x["standing"]}
    v4 = [l for l in x["standing"] if l not in x["already_carried"]]
    v5 = {l:x["holds"].get(l,0) for l in x["standing"] if l in x["encumbered"]}
    v6 = {l:x["source_round"][l] for l in x["standing"]}
    v7 = [l for l in x["standing"] if x["source_round"][l]<x["new_round"]]
    v8 = [l for l in x["standing"] if l in x["bidder_carry"]]
    v9 = {l:x["approved_reserves"].get(l,x["reserves"][l]) for l in x["standing"]}
    return {'unsold-reoffer':v0,'standing-bid-reconsent':v1,'withdrawal-carry-veto':v2,'specification-priority-reset':v3,'carry-once-per-round':v4,'inherited-reservation':v5,'source-round-provenance':v6,'future-round-reoffer':v7,'authorization-expiry-carry':v8,'approved-reserve-revision':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [[], [], [], [], []]), ('all seller carry', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B', 'C'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [[], [], [], [], []]), ('all bidder carry', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['B', 'C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B'], ['B'], ['B'], ['B'], ['B']]), ('no withdrawals', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': [], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [[], [], [], [], []]), ('unchanged lot specs', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v1', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [[], [], [], [], []]), ('nothing already carried', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': [], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [[], [], [], [], []]), ('no expired authorization', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': [], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['C'], ['C'], ['C'], ['C'], ['C']]), ('all sold', {'offered': ['A', 'B', 'C'], 'sold': ['A', 'B', 'C'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [[], [], [], [], []]), ('no encumbrance', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': [], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [[], [], [], [], []])]
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))['authorization-expiry-carry'], 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 = [l for l in x["offered"] if l not in x["sold"] and l in x["seller_carry"]]
    v1 = [l for l in x["standing"] if l in x["bidder_carry"]]
    v2 = [l for l in x["standing"] if l not in x["withdrawn"]]
    v3 = {l:x["old_priority"][l] if x["old_specs"][l]==x["new_specs"][l] else x["new_round"] for l in x["standing"]}
    v4 = [l for l in x["standing"] if l not in x["already_carried"]]
    v5 = {l:x["holds"].get(l,0) for l in x["standing"] if l in x["encumbered"]}
    v6 = {l:x["source_round"][l] for l in x["standing"]}
    v7 = [l for l in x["standing"] if x["source_round"][l]<x["new_round"]]
    v8 = [l for l in x["standing"] if l not in x["expired"]]
    v9 = {l:x["approved_reserves"].get(l,x["reserves"][l]) for l in x["standing"]}
    return {'unsold-reoffer':v0,'standing-bid-reconsent':v1,'withdrawal-carry-veto':v2,'specification-priority-reset':v3,'carry-once-per-round':v4,'inherited-reservation':v5,'source-round-provenance':v6,'future-round-reoffer':v7,'authorization-expiry-carry':v8,'approved-reserve-revision':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [[], [], [], [], []]), ('all seller carry', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B', 'C'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [[], [], [], [], []]), ('all bidder carry', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['B', 'C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['B'], ['B'], ['B'], ['B'], ['B']]), ('no withdrawals', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': [], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [[], [], [], [], []]), ('unchanged lot specs', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v1', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [[], [], [], [], []]), ('nothing already carried', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': [], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [[], [], [], [], []]), ('no expired authorization', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': [], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [['C'], ['C'], ['C'], ['C'], ['C']]), ('all sold', {'offered': ['A', 'B', 'C'], 'sold': ['A', 'B', 'C'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [[], [], [], [], []]), ('no encumbrance', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': [], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [[], [], [], [], []])]
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))['authorization-expiry-carry'], 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:
Standing offers carry after bidder authorization expires.

Unsold auction lots may carry into a later round with explicit seller consent and inherited encumbrances. Standing offers carry only while their bidder authorization survives and may retain or lose priority according to whether lot specification changed. Sale identifiers retain provenance. Named decision authorization-expiry-carry: For authorization expiry carry, apply the stipulated decision [l for l in x["standing"] if l in x["bidder_carry"] and l not in x["expired"]].

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = [l for l in x["offered"] if l not in x["sold"] and l in x["seller_carry"]]
    v1 = [l for l in x["standing"] if l in x["bidder_carry"]]
    v2 = [l for l in x["standing"] if l not in x["withdrawn"]]
    v3 = {l:x["old_priority"][l] if x["old_specs"][l]==x["new_specs"][l] else x["new_round"] for l in x["standing"]}
    v4 = [l for l in x["standing"] if l not in x["already_carried"]]
    v5 = {l:x["holds"].get(l,0) for l in x["standing"] if l in x["encumbered"]}
    v6 = {l:x["source_round"][l] for l in x["standing"]}
    v7 = [l for l in x["standing"] if x["source_round"][l]<x["new_round"]]
    v8 = [l for l in x["standing"] if l in x["bidder_carry"] and l not in x["expired"]]
    v9 = x["reserves"]
    return {'unsold-reoffer':v0,'standing-bid-reconsent':v1,'withdrawal-carry-veto':v2,'specification-priority-reset':v3,'carry-once-per-round':v4,'inherited-reservation':v5,'source-round-provenance':v6,'future-round-reoffer':v7,'authorization-expiry-carry':v8,'approved-reserve-revision':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [{'B': 9, 'C': 6}, {'B': 18, 'C': 12}, {'B': 27, 'C': 18}, {'B': 36, 'C': 24}, {'B': 45, 'C': 30}]), ('all seller carry', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B', 'C'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [{'B': 9, 'C': 6}, {'B': 18, 'C': 12}, {'B': 27, 'C': 18}, {'B': 36, 'C': 24}, {'B': 45, 'C': 30}]), ('all bidder carry', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['B', 'C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [{'B': 9, 'C': 6}, {'B': 18, 'C': 12}, {'B': 27, 'C': 18}, {'B': 36, 'C': 24}, {'B': 45, 'C': 30}]), ('no withdrawals', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': [], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [{'B': 9, 'C': 6}, {'B': 18, 'C': 12}, {'B': 27, 'C': 18}, {'B': 36, 'C': 24}, {'B': 45, 'C': 30}]), ('unchanged lot specs', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v1', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [{'B': 9, 'C': 6}, {'B': 18, 'C': 12}, {'B': 27, 'C': 18}, {'B': 36, 'C': 24}, {'B': 45, 'C': 30}]), ('nothing already carried', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': [], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [{'B': 9, 'C': 6}, {'B': 18, 'C': 12}, {'B': 27, 'C': 18}, {'B': 36, 'C': 24}, {'B': 45, 'C': 30}]), ('no expired authorization', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': [], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [{'B': 9, 'C': 6}, {'B': 18, 'C': 12}, {'B': 27, 'C': 18}, {'B': 36, 'C': 24}, {'B': 45, 'C': 30}]), ('all sold', {'offered': ['A', 'B', 'C'], 'sold': ['A', 'B', 'C'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [{'B': 9, 'C': 6}, {'B': 18, 'C': 12}, {'B': 27, 'C': 18}, {'B': 36, 'C': 24}, {'B': 45, 'C': 30}]), ('no encumbrance', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': [], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [{'B': 9, 'C': 6}, {'B': 18, 'C': 12}, {'B': 27, 'C': 18}, {'B': 36, 'C': 24}, {'B': 45, 'C': 30}])]
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))['approved-reserve-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 = [l for l in x["offered"] if l not in x["sold"] and l in x["seller_carry"]]
    v1 = [l for l in x["standing"] if l in x["bidder_carry"]]
    v2 = [l for l in x["standing"] if l not in x["withdrawn"]]
    v3 = {l:x["old_priority"][l] if x["old_specs"][l]==x["new_specs"][l] else x["new_round"] for l in x["standing"]}
    v4 = [l for l in x["standing"] if l not in x["already_carried"]]
    v5 = {l:x["holds"].get(l,0) for l in x["standing"] if l in x["encumbered"]}
    v6 = {l:x["source_round"][l] for l in x["standing"]}
    v7 = [l for l in x["standing"] if x["source_round"][l]<x["new_round"]]
    v8 = [l for l in x["standing"] if l in x["bidder_carry"] and l not in x["expired"]]
    v9 = {l:x["approved_reserves"].get(l,0) for l in x["standing"]}
    return {'unsold-reoffer':v0,'standing-bid-reconsent':v1,'withdrawal-carry-veto':v2,'specification-priority-reset':v3,'carry-once-per-round':v4,'inherited-reservation':v5,'source-round-provenance':v6,'future-round-reoffer':v7,'authorization-expiry-carry':v8,'approved-reserve-revision':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [{'B': 9, 'C': 6}, {'B': 18, 'C': 12}, {'B': 27, 'C': 18}, {'B': 36, 'C': 24}, {'B': 45, 'C': 30}]), ('all seller carry', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B', 'C'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [{'B': 9, 'C': 6}, {'B': 18, 'C': 12}, {'B': 27, 'C': 18}, {'B': 36, 'C': 24}, {'B': 45, 'C': 30}]), ('all bidder carry', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['B', 'C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [{'B': 9, 'C': 6}, {'B': 18, 'C': 12}, {'B': 27, 'C': 18}, {'B': 36, 'C': 24}, {'B': 45, 'C': 30}]), ('no withdrawals', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': [], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [{'B': 9, 'C': 6}, {'B': 18, 'C': 12}, {'B': 27, 'C': 18}, {'B': 36, 'C': 24}, {'B': 45, 'C': 30}]), ('unchanged lot specs', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v1', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [{'B': 9, 'C': 6}, {'B': 18, 'C': 12}, {'B': 27, 'C': 18}, {'B': 36, 'C': 24}, {'B': 45, 'C': 30}]), ('nothing already carried', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': [], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [{'B': 9, 'C': 6}, {'B': 18, 'C': 12}, {'B': 27, 'C': 18}, {'B': 36, 'C': 24}, {'B': 45, 'C': 30}]), ('no expired authorization', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': [], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [{'B': 9, 'C': 6}, {'B': 18, 'C': 12}, {'B': 27, 'C': 18}, {'B': 36, 'C': 24}, {'B': 45, 'C': 30}]), ('all sold', {'offered': ['A', 'B', 'C'], 'sold': ['A', 'B', 'C'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': ['C'], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [{'B': 9, 'C': 6}, {'B': 18, 'C': 12}, {'B': 27, 'C': 18}, {'B': 36, 'C': 24}, {'B': 45, 'C': 30}]), ('no encumbrance', {'offered': ['A', 'B', 'C'], 'sold': ['A'], 'seller_carry': ['B'], 'standing': ['B', 'C'], 'bidder_carry': ['C'], 'withdrawn': ['B'], 'old_specs': {'B': 'v1', 'C': 'v1'}, 'new_specs': {'B': 'v2', 'C': 'v1'}, 'old_priority': {'B': 1, 'C': 2}, 'new_round': 3, 'source_round': {'A': 1, 'B': 1, 'C': 2}, 'already_carried': ['B'], 'holds': {'B': 5, 'C': 3}, 'encumbered': [], 'expired': ['C'], 'reserves': {'B': 8, 'C': 6}, 'approved_reserves': {'B': 9}}, [{'B': 9, 'C': 6}, {'B': 18, 'C': 12}, {'B': 27, 'C': 18}, {'B': 36, 'C': 24}, {'B': 45, 'C': 30}])]
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))['approved-reserve-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:
Reserve revision drops unchanged carryover reserves or ignores seller-approved updates.

Unsold auction lots may carry into a later round with explicit seller consent and inherited encumbrances. Standing offers carry only while their bidder authorization survives and may retain or lose priority according to whether lot specification changed. Sale identifiers retain provenance. Named decision approved-reserve-revision: For approved reserve revision, apply the stipulated decision {l:x["approved_reserves"].get(l,x["reserves"][l]) for l in x["standing"]}.

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = bool(x["permit_categories"])
    v1 = all(d in x["destinations"] for d in x["route"])
    v2 = min(x["requested"],max(0,x["quota"]-x["reserved"]))
    v3 = max(0,x["quota"]-x["requested"]) if x["accepted"] else x["quota"]
    v4 = x["quota"]+(x["returned"] if x["return_ack"] else 0)
    v5 = x["award_time"]<x["expires"]
    v6 = x["delivery_time"]<x["expires"]
    v7 = [p for p in x["assigned"] if p in x["permits"] and p not in x["revoked"]]
    v8 = x["seller_license"] and x["buyer_license"]
    v9 = x["permit_owner"]==x["buyer"] or x["transferred"]
    return {'permit-category-scope':v0,'transit-route-permit':v1,'unreserved-permit-quota':v2,'accepted-quota-consumption':v3,'acknowledged-quota-restoration':v4,'award-time-permit-validity':v5,'delivery-permit-recheck':v6,'revoked-permit-selection':v7,'two-party-license':v8,'permit-owner-transfer':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('different category', {'category': 'green', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('award at permit expiry / different category', {'category': 'green', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 8, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('normal contract', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [True, True, True, True, True]), ('award at permit expiry', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 8, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [True, True, True, True, True]), ('different destination', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D2', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [True, True, True, True, True]), ('small request', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 2, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [True, True, True, True, True]), ('accepted award', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': True, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [True, True, True, True, True]), ('return acknowledged', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': True, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [True, True, True, True, True]), ('award after permit expiry', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 9, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [True, True, True, True, True]), ('delivery before expiry', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 7, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [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))['permit-category-scope'], 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["category"]==x["permit_categories"][0] if x["permit_categories"] else False
    v1 = all(d in x["destinations"] for d in x["route"])
    v2 = min(x["requested"],max(0,x["quota"]-x["reserved"]))
    v3 = max(0,x["quota"]-x["requested"]) if x["accepted"] else x["quota"]
    v4 = x["quota"]+(x["returned"] if x["return_ack"] else 0)
    v5 = x["award_time"]<x["expires"]
    v6 = x["delivery_time"]<x["expires"]
    v7 = [p for p in x["assigned"] if p in x["permits"] and p not in x["revoked"]]
    v8 = x["seller_license"] and x["buyer_license"]
    v9 = x["permit_owner"]==x["buyer"] or x["transferred"]
    return {'permit-category-scope':v0,'transit-route-permit':v1,'unreserved-permit-quota':v2,'accepted-quota-consumption':v3,'acknowledged-quota-restoration':v4,'award-time-permit-validity':v5,'delivery-permit-recheck':v6,'revoked-permit-selection':v7,'two-party-license':v8,'permit-owner-transfer':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('different category', {'category': 'green', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('award at permit expiry / different category', {'category': 'green', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 8, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('normal contract', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [True, True, True, True, True]), ('award at permit expiry', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 8, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [True, True, True, True, True]), ('different destination', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D2', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [True, True, True, True, True]), ('small request', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 2, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [True, True, True, True, True]), ('accepted award', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': True, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [True, True, True, True, True]), ('return acknowledged', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': True, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [True, True, True, True, True]), ('award after permit expiry', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 9, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [True, True, True, True, True]), ('delivery before expiry', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 7, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [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))['permit-category-scope'], 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:
Any permit or only its first category authorizes auction award category.

A toy regulated-item auction uses explicit fictional permit rules: permits are lot-category, destination and unit-count scoped; transfers consume quota only after award acceptance, and returns restore quota only after regulator acknowledgment. No real regulatory compliance is represented. Named decision permit-category-scope: For permit category scope, apply the stipulated decision x["category"] in x["permit_categories"].

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = x["category"] in x["permit_categories"]
    v1 = x["route"][-1] in x["destinations"] if x["route"] else True
    v2 = min(x["requested"],max(0,x["quota"]-x["reserved"]))
    v3 = max(0,x["quota"]-x["requested"]) if x["accepted"] else x["quota"]
    v4 = x["quota"]+(x["returned"] if x["return_ack"] else 0)
    v5 = x["award_time"]<x["expires"]
    v6 = x["delivery_time"]<x["expires"]
    v7 = [p for p in x["assigned"] if p in x["permits"] and p not in x["revoked"]]
    v8 = x["seller_license"] and x["buyer_license"]
    v9 = x["permit_owner"]==x["buyer"] or x["transferred"]
    return {'permit-category-scope':v0,'transit-route-permit':v1,'unreserved-permit-quota':v2,'accepted-quota-consumption':v3,'acknowledged-quota-restoration':v4,'award-time-permit-validity':v5,'delivery-permit-recheck':v6,'revoked-permit-selection':v7,'two-party-license':v8,'permit-owner-transfer':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('award at permit expiry', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 8, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('permitted transit not destination', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D1', 'D2']}, [False, False, False, False, False]), ('award at permit expiry / permitted transit not destination', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 8, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D1', 'D2']}, [False, False, False, False, False]), ('different category', {'category': 'green', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('different destination', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D2', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('small request', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 2, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('accepted award', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': True, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('return acknowledged', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': True, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('award after permit expiry', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 9, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('delivery before expiry', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 7, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [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))['transit-route-permit'], 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["category"] in x["permit_categories"]
    v1 = all(d in x["destinations"] for d in x["route"][:-1])
    v2 = min(x["requested"],max(0,x["quota"]-x["reserved"]))
    v3 = max(0,x["quota"]-x["requested"]) if x["accepted"] else x["quota"]
    v4 = x["quota"]+(x["returned"] if x["return_ack"] else 0)
    v5 = x["award_time"]<x["expires"]
    v6 = x["delivery_time"]<x["expires"]
    v7 = [p for p in x["assigned"] if p in x["permits"] and p not in x["revoked"]]
    v8 = x["seller_license"] and x["buyer_license"]
    v9 = x["permit_owner"]==x["buyer"] or x["transferred"]
    return {'permit-category-scope':v0,'transit-route-permit':v1,'unreserved-permit-quota':v2,'accepted-quota-consumption':v3,'acknowledged-quota-restoration':v4,'award-time-permit-validity':v5,'delivery-permit-recheck':v6,'revoked-permit-selection':v7,'two-party-license':v8,'permit-owner-transfer':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('award at permit expiry', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 8, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('permitted transit not destination', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D1', 'D2']}, [False, False, False, False, False]), ('award at permit expiry / permitted transit not destination', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 8, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D1', 'D2']}, [False, False, False, False, False]), ('different category', {'category': 'green', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('different destination', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D2', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('small request', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 2, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('accepted award', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': True, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('return acknowledged', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': True, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('award after permit expiry', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 9, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [False, False, False, False, False]), ('delivery before expiry', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 7, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [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))['transit-route-permit'], 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 shipment permit covers the destination but not the intermediate transit route.

A toy regulated-item auction uses explicit fictional permit rules: permits are lot-category, destination and unit-count scoped; transfers consume quota only after award acceptance, and returns restore quota only after regulator acknowledgment. No real regulatory compliance is represented. Named decision transit-route-permit: For transit route permit, apply the stipulated decision all(d in x["destinations"] for d in x["route"]).

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = x["category"] in x["permit_categories"]
    v1 = all(d in x["destinations"] for d in x["route"])
    v2 = min(x["requested"],x["quota"])
    v3 = max(0,x["quota"]-x["requested"]) if x["accepted"] else x["quota"]
    v4 = x["quota"]+(x["returned"] if x["return_ack"] else 0)
    v5 = x["award_time"]<x["expires"]
    v6 = x["delivery_time"]<x["expires"]
    v7 = [p for p in x["assigned"] if p in x["permits"] and p not in x["revoked"]]
    v8 = x["seller_license"] and x["buyer_license"]
    v9 = x["permit_owner"]==x["buyer"] or x["transferred"]
    return {'permit-category-scope':v0,'transit-route-permit':v1,'unreserved-permit-quota':v2,'accepted-quota-consumption':v3,'acknowledged-quota-restoration':v4,'award-time-permit-validity':v5,'delivery-permit-recheck':v6,'revoked-permit-selection':v7,'two-party-license':v8,'permit-owner-transfer':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [3, 6, 9, 12, 15]), ('award at permit expiry', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 8, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [3, 6, 9, 12, 15]), ('small request', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 2, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [2, 4, 6, 8, 10]), ('award at permit expiry / small request', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 2, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 8, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [2, 4, 6, 8, 10]), ('different category', {'category': 'green', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [3, 6, 9, 12, 15]), ('different destination', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D2', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [3, 6, 9, 12, 15]), ('accepted award', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': True, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [3, 6, 9, 12, 15]), ('return acknowledged', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': True, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [3, 6, 9, 12, 15]), ('award after permit expiry', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 9, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [3, 6, 9, 12, 15]), ('delivery before expiry', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 7, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [3, 6, 9, 12, 15])]
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-permit-quota'], 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["category"] in x["permit_categories"]
    v1 = all(d in x["destinations"] for d in x["route"])
    v2 = max(0,x["quota"]-x["reserved"])
    v3 = max(0,x["quota"]-x["requested"]) if x["accepted"] else x["quota"]
    v4 = x["quota"]+(x["returned"] if x["return_ack"] else 0)
    v5 = x["award_time"]<x["expires"]
    v6 = x["delivery_time"]<x["expires"]
    v7 = [p for p in x["assigned"] if p in x["permits"] and p not in x["revoked"]]
    v8 = x["seller_license"] and x["buyer_license"]
    v9 = x["permit_owner"]==x["buyer"] or x["transferred"]
    return {'permit-category-scope':v0,'transit-route-permit':v1,'unreserved-permit-quota':v2,'accepted-quota-consumption':v3,'acknowledged-quota-restoration':v4,'award-time-permit-validity':v5,'delivery-permit-recheck':v6,'revoked-permit-selection':v7,'two-party-license':v8,'permit-owner-transfer':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [3, 6, 9, 12, 15]), ('award at permit expiry', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 8, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [3, 6, 9, 12, 15]), ('small request', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 2, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [2, 4, 6, 8, 10]), ('award at permit expiry / small request', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 2, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 8, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [2, 4, 6, 8, 10]), ('different category', {'category': 'green', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [3, 6, 9, 12, 15]), ('different destination', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D2', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [3, 6, 9, 12, 15]), ('accepted award', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': True, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [3, 6, 9, 12, 15]), ('return acknowledged', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': True, 'expires': 8, 'award_time': 7, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [3, 6, 9, 12, 15]), ('award after permit expiry', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 9, 'delivery_time': 9, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [3, 6, 9, 12, 15]), ('delivery before expiry', {'category': 'blue', 'permit_categories': ['red', 'blue'], 'destination': 'D1', 'destinations': ['D1'], 'requested': 6, 'quota': 5, 'reserved': 2, 'accepted': False, 'returned': 3, 'return_ack': False, 'expires': 8, 'award_time': 7, 'delivery_time': 7, 'permits': ['p1', 'p2'], 'revoked': ['p2'], 'assigned': ['p2'], 'seller_license': True, 'buyer_license': False, 'permit_owner': 'b', 'buyer': 'b', 'transferred': False, 'route': ['D2', 'D1']}, [3, 6, 9, 12, 15])]
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-permit-quota'], 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:
Concurrent award reservations double-use permit quota.

A toy regulated-item auction uses explicit fictional permit rules: permits are lot-category, destination and unit-count scoped; transfers consume quota only after award acceptance, and returns restore quota only after regulator acknowledgment. No real regulatory compliance is represented. Named decision unreserved-permit-quota: For unreserved permit quota, apply the stipulated decision min(x["requested"],max(0,x["quota"]-x["reserved"])).

split: open-access