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

N = 1
observations = []
def solve(x):
    v0 = list(dict.fromkeys(t for t in x["tickets"] if t in x["roster"]))
    v1 = [t for t in x["tickets"] if t in x["roster"]]
    v2 = [t for t in dict.fromkeys(x["tickets"]) if t in x["roster"] and t not in x["disqualified"]]
    v3 = x["roster"][x["draw"]] if 0<=x["draw"]<len(x["roster"]) else None
    v4 = next((t for t in x["committed"] if t not in x["declined"]),None)
    v5 = max(0,x["supply"]-len(set(x["winners"])))
    v6 = set(x["tickets"])&set(x["roster"])==set(x["committed"])
    v7 = x["committed"][:x["supply"]] if x["published"] else []
    v8 = x["round"]==x["ballot_round"]
    v9 = [x["substitutes"].get(w,w) if x["substitutes"].get(w,w) in x["consented"] else w for w in x["winners"]]
    return {'one-ticket-per-bidder':v0,'roster-ticket-admission':v1,'disqualification-before-draw':v2,'draw-index-contract':v3,'declined-ticket-rotation':v4,'ballot-supply-remainder':v5,'ticket-order-commitment':v6,'publication-before-award':v7,'round-specific-ballot':v8,'winner-substitute-consent':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('different ticket commitment', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['a', 'b', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('future ballot / different ticket commitment', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['a', 'b', 'c'], 'published': True, 'round': 2, 'ballot_round': 3, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('normal contract', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [True, True, True, True, True]), ('future ballot', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 3, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [True, True, True, True, True]), ('no declines', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': [], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [True, True, True, True, True]), ('draw first', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 0, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [True, True, True, True, True]), ('draw beyond roster', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 7, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [True, True, True, True, True]), ('all disqualified', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['a', 'b', 'c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [True, True, True, True, True]), ('all tickets valid', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [True, True, True, True, True]), ('unpublished draw', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': False, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [True, True, True, True, True]), ('same round', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 2, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [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))['ticket-order-commitment'], 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 = list(dict.fromkeys(t for t in x["tickets"] if t in x["roster"]))
    v1 = [t for t in x["tickets"] if t in x["roster"]]
    v2 = [t for t in dict.fromkeys(x["tickets"]) if t in x["roster"] and t not in x["disqualified"]]
    v3 = x["roster"][x["draw"]] if 0<=x["draw"]<len(x["roster"]) else None
    v4 = next((t for t in x["committed"] if t not in x["declined"]),None)
    v5 = max(0,x["supply"]-len(set(x["winners"])))
    v6 = True
    v7 = x["committed"][:x["supply"]] if x["published"] else []
    v8 = x["round"]==x["ballot_round"]
    v9 = [x["substitutes"].get(w,w) if x["substitutes"].get(w,w) in x["consented"] else w for w in x["winners"]]
    return {'one-ticket-per-bidder':v0,'roster-ticket-admission':v1,'disqualification-before-draw':v2,'draw-index-contract':v3,'declined-ticket-rotation':v4,'ballot-supply-remainder':v5,'ticket-order-commitment':v6,'publication-before-award':v7,'round-specific-ballot':v8,'winner-substitute-consent':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('different ticket commitment', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['a', 'b', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('future ballot / different ticket commitment', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['a', 'b', 'c'], 'published': True, 'round': 2, 'ballot_round': 3, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('normal contract', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [True, True, True, True, True]), ('future ballot', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 3, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [True, True, True, True, True]), ('no declines', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': [], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [True, True, True, True, True]), ('draw first', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 0, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [True, True, True, True, True]), ('draw beyond roster', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 7, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [True, True, True, True, True]), ('all disqualified', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['a', 'b', 'c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [True, True, True, True, True]), ('all tickets valid', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [True, True, True, True, True]), ('unpublished draw', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': False, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [True, True, True, True, True]), ('same round', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 2, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [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))['ticket-order-commitment'], 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:
Ticket-order changes are hidden by set comparison of the published commitment.

A toy tied-award ballot has a frozen eligible bidder roster, published ticket order, one ticket per eligible bidder, and an explicitly supplied draw index. It is deterministic: no randomness claim. Declined winners rotate to the next eligible ticket without returning the declined bidder to the draw. Named decision ticket-order-commitment: For ticket order commitment, apply the stipulated decision list(dict.fromkeys(t for t in x["tickets"] if t in x["roster"]))==x["committed"].

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = list(dict.fromkeys(t for t in x["tickets"] if t in x["roster"]))
    v1 = [t for t in x["tickets"] if t in x["roster"]]
    v2 = [t for t in dict.fromkeys(x["tickets"]) if t in x["roster"] and t not in x["disqualified"]]
    v3 = x["roster"][x["draw"]] if 0<=x["draw"]<len(x["roster"]) else None
    v4 = next((t for t in x["committed"] if t not in x["declined"]),None)
    v5 = max(0,x["supply"]-len(set(x["winners"])))
    v6 = list(dict.fromkeys(t for t in x["tickets"] if t in x["roster"]))==x["committed"]
    v7 = x["committed"][:x["supply"]]
    v8 = x["round"]==x["ballot_round"]
    v9 = [x["substitutes"].get(w,w) if x["substitutes"].get(w,w) in x["consented"] else w for w in x["winners"]]
    return {'one-ticket-per-bidder':v0,'roster-ticket-admission':v1,'disqualification-before-draw':v2,'draw-index-contract':v3,'declined-ticket-rotation':v4,'ballot-supply-remainder':v5,'ticket-order-commitment':v6,'publication-before-award':v7,'round-specific-ballot':v8,'winner-substitute-consent':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('unpublished draw', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': False, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [[], [], [], [], []]), ('future ballot / unpublished draw', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': False, 'round': 2, 'ballot_round': 3, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [[], [], [], [], []]), ('normal contract', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['b', 'a'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c']]), ('future ballot', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 3, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['b', 'a'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c']]), ('no declines', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': [], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['b', 'a'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c']]), ('draw first', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 0, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['b', 'a'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c']]), ('draw beyond roster', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 7, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['b', 'a'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c']]), ('all disqualified', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['a', 'b', 'c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['b', 'a'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c']]), ('all tickets valid', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['b', 'a'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c']]), ('same round', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 2, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['b', 'a'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c']]), ('zero supply', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 0, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [[], [], [], [], []]), ('future ballot / zero supply', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 0, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 3, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [[], [], [], [], []])]
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))['publication-before-award'], 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 = list(dict.fromkeys(t for t in x["tickets"] if t in x["roster"]))
    v1 = [t for t in x["tickets"] if t in x["roster"]]
    v2 = [t for t in dict.fromkeys(x["tickets"]) if t in x["roster"] and t not in x["disqualified"]]
    v3 = x["roster"][x["draw"]] if 0<=x["draw"]<len(x["roster"]) else None
    v4 = next((t for t in x["committed"] if t not in x["declined"]),None)
    v5 = max(0,x["supply"]-len(set(x["winners"])))
    v6 = list(dict.fromkeys(t for t in x["tickets"] if t in x["roster"]))==x["committed"]
    v7 = x["committed"] if x["published"] else []
    v8 = x["round"]==x["ballot_round"]
    v9 = [x["substitutes"].get(w,w) if x["substitutes"].get(w,w) in x["consented"] else w for w in x["winners"]]
    return {'one-ticket-per-bidder':v0,'roster-ticket-admission':v1,'disqualification-before-draw':v2,'draw-index-contract':v3,'declined-ticket-rotation':v4,'ballot-supply-remainder':v5,'ticket-order-commitment':v6,'publication-before-award':v7,'round-specific-ballot':v8,'winner-substitute-consent':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('unpublished draw', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': False, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [[], [], [], [], []]), ('future ballot / unpublished draw', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': False, 'round': 2, 'ballot_round': 3, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [[], [], [], [], []]), ('normal contract', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['b', 'a'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c']]), ('future ballot', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 3, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['b', 'a'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c']]), ('no declines', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': [], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['b', 'a'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c']]), ('draw first', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 0, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['b', 'a'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c']]), ('draw beyond roster', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 7, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['b', 'a'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c']]), ('all disqualified', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['a', 'b', 'c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['b', 'a'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c']]), ('all tickets valid', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['b', 'a'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c']]), ('same round', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 2, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['b', 'a'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c'], ['b', 'a', 'c']]), ('zero supply', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 0, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [[], [], [], [], []]), ('future ballot / zero supply', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 0, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 3, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [[], [], [], [], []])]
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))['publication-before-award'], 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:
Unpublished ballot outcomes or too many winners become awards.

A toy tied-award ballot has a frozen eligible bidder roster, published ticket order, one ticket per eligible bidder, and an explicitly supplied draw index. It is deterministic: no randomness claim. Declined winners rotate to the next eligible ticket without returning the declined bidder to the draw. Named decision publication-before-award: For publication before award, apply the stipulated decision x["committed"][:x["supply"]] if x["published"] else [].

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = list(dict.fromkeys(t for t in x["tickets"] if t in x["roster"]))
    v1 = [t for t in x["tickets"] if t in x["roster"]]
    v2 = [t for t in dict.fromkeys(x["tickets"]) if t in x["roster"] and t not in x["disqualified"]]
    v3 = x["roster"][x["draw"]] if 0<=x["draw"]<len(x["roster"]) else None
    v4 = next((t for t in x["committed"] if t not in x["declined"]),None)
    v5 = max(0,x["supply"]-len(set(x["winners"])))
    v6 = list(dict.fromkeys(t for t in x["tickets"] if t in x["roster"]))==x["committed"]
    v7 = x["committed"][:x["supply"]] if x["published"] else []
    v8 = x["round"]>=x["ballot_round"]
    v9 = [x["substitutes"].get(w,w) if x["substitutes"].get(w,w) in x["consented"] else w for w in x["winners"]]
    return {'one-ticket-per-bidder':v0,'roster-ticket-admission':v1,'disqualification-before-draw':v2,'draw-index-contract':v3,'declined-ticket-rotation':v4,'ballot-supply-remainder':v5,'ticket-order-commitment':v6,'publication-before-award':v7,'round-specific-ballot':v8,'winner-substitute-consent':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('no declines', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': [], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('future ballot', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 3, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('future ballot / no declines', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': [], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 3, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('draw first', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 0, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('draw beyond roster', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 7, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('all disqualified', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['a', 'b', 'c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('all tickets valid', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('unpublished draw', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': False, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('same round', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 2, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [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))['round-specific-ballot'], 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 = list(dict.fromkeys(t for t in x["tickets"] if t in x["roster"]))
    v1 = [t for t in x["tickets"] if t in x["roster"]]
    v2 = [t for t in dict.fromkeys(x["tickets"]) if t in x["roster"] and t not in x["disqualified"]]
    v3 = x["roster"][x["draw"]] if 0<=x["draw"]<len(x["roster"]) else None
    v4 = next((t for t in x["committed"] if t not in x["declined"]),None)
    v5 = max(0,x["supply"]-len(set(x["winners"])))
    v6 = list(dict.fromkeys(t for t in x["tickets"] if t in x["roster"]))==x["committed"]
    v7 = x["committed"][:x["supply"]] if x["published"] else []
    v8 = x["round"]<=x["ballot_round"]
    v9 = [x["substitutes"].get(w,w) if x["substitutes"].get(w,w) in x["consented"] else w for w in x["winners"]]
    return {'one-ticket-per-bidder':v0,'roster-ticket-admission':v1,'disqualification-before-draw':v2,'draw-index-contract':v3,'declined-ticket-rotation':v4,'ballot-supply-remainder':v5,'ticket-order-commitment':v6,'publication-before-award':v7,'round-specific-ballot':v8,'winner-substitute-consent':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('no declines', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': [], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('future ballot', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 3, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('future ballot / no declines', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': [], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 3, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('draw first', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 0, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('draw beyond roster', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 7, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('all disqualified', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['a', 'b', 'c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('all tickets valid', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('unpublished draw', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': False, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [False, False, False, False, False]), ('same round', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 2, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [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))['round-specific-ballot'], 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 previous auction-round ballot is reused for a new tie.

A toy tied-award ballot has a frozen eligible bidder roster, published ticket order, one ticket per eligible bidder, and an explicitly supplied draw index. It is deterministic: no randomness claim. Declined winners rotate to the next eligible ticket without returning the declined bidder to the draw. Named decision round-specific-ballot: For round specific ballot, apply the stipulated decision x["round"]==x["ballot_round"].

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = list(dict.fromkeys(t for t in x["tickets"] if t in x["roster"]))
    v1 = [t for t in x["tickets"] if t in x["roster"]]
    v2 = [t for t in dict.fromkeys(x["tickets"]) if t in x["roster"] and t not in x["disqualified"]]
    v3 = x["roster"][x["draw"]] if 0<=x["draw"]<len(x["roster"]) else None
    v4 = next((t for t in x["committed"] if t not in x["declined"]),None)
    v5 = max(0,x["supply"]-len(set(x["winners"])))
    v6 = list(dict.fromkeys(t for t in x["tickets"] if t in x["roster"]))==x["committed"]
    v7 = x["committed"][:x["supply"]] if x["published"] else []
    v8 = x["round"]==x["ballot_round"]
    v9 = [x["substitutes"].get(w,w) for w in x["winners"]]
    return {'one-ticket-per-bidder':v0,'roster-ticket-admission':v1,'disqualification-before-draw':v2,'draw-index-contract':v3,'declined-ticket-rotation':v4,'ballot-supply-remainder':v5,'ticket-order-commitment':v6,'publication-before-award':v7,'round-specific-ballot':v8,'winner-substitute-consent':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('unapproved substitute', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': []}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('future ballot / unapproved substitute', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 3, 'substitutes': {'a': 'z'}, 'consented': []}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('normal contract', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['z'], ['z'], ['z'], ['z'], ['z']]), ('future ballot', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 3, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['z'], ['z'], ['z'], ['z'], ['z']]), ('no declines', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': [], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['z'], ['z'], ['z'], ['z'], ['z']]), ('draw first', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 0, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['z'], ['z'], ['z'], ['z'], ['z']]), ('draw beyond roster', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 7, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['z'], ['z'], ['z'], ['z'], ['z']]), ('all disqualified', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['a', 'b', 'c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['z'], ['z'], ['z'], ['z'], ['z']]), ('all tickets valid', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['z'], ['z'], ['z'], ['z'], ['z']]), ('unpublished draw', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': False, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['z'], ['z'], ['z'], ['z'], ['z']]), ('same round', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 2, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['z'], ['z'], ['z'], ['z'], ['z']])]
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))['winner-substitute-consent'], 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 = list(dict.fromkeys(t for t in x["tickets"] if t in x["roster"]))
    v1 = [t for t in x["tickets"] if t in x["roster"]]
    v2 = [t for t in dict.fromkeys(x["tickets"]) if t in x["roster"] and t not in x["disqualified"]]
    v3 = x["roster"][x["draw"]] if 0<=x["draw"]<len(x["roster"]) else None
    v4 = next((t for t in x["committed"] if t not in x["declined"]),None)
    v5 = max(0,x["supply"]-len(set(x["winners"])))
    v6 = list(dict.fromkeys(t for t in x["tickets"] if t in x["roster"]))==x["committed"]
    v7 = x["committed"][:x["supply"]] if x["published"] else []
    v8 = x["round"]==x["ballot_round"]
    v9 = x["winners"]
    return {'one-ticket-per-bidder':v0,'roster-ticket-admission':v1,'disqualification-before-draw':v2,'draw-index-contract':v3,'declined-ticket-rotation':v4,'ballot-supply-remainder':v5,'ticket-order-commitment':v6,'publication-before-award':v7,'round-specific-ballot':v8,'winner-substitute-consent':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('unapproved substitute', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': []}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('future ballot / unapproved substitute', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 3, 'substitutes': {'a': 'z'}, 'consented': []}, [['a'], ['a'], ['a'], ['a'], ['a']]), ('normal contract', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['z'], ['z'], ['z'], ['z'], ['z']]), ('future ballot', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 3, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['z'], ['z'], ['z'], ['z'], ['z']]), ('no declines', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': [], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['z'], ['z'], ['z'], ['z'], ['z']]), ('draw first', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 0, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['z'], ['z'], ['z'], ['z'], ['z']]), ('draw beyond roster', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 7, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['z'], ['z'], ['z'], ['z'], ['z']]), ('all disqualified', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['a', 'b', 'c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['z'], ['z'], ['z'], ['z'], ['z']]), ('all tickets valid', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['z'], ['z'], ['z'], ['z'], ['z']]), ('unpublished draw', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': False, 'round': 2, 'ballot_round': 1, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['z'], ['z'], ['z'], ['z'], ['z']]), ('same round', {'roster': ['a', 'b', 'c'], 'tickets': ['b', 'a', 'b', 'd', 'c'], 'disqualified': ['c'], 'draw': 1, 'declined': ['b'], 'winners': ['a'], 'supply': 2, 'committed': ['b', 'a', 'c'], 'published': True, 'round': 2, 'ballot_round': 2, 'substitutes': {'a': 'z'}, 'consented': ['z']}, [['z'], ['z'], ['z'], ['z'], ['z']])]
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))['winner-substitute-consent'], 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 tied award transfers to an unconsenting designated substitute.

A toy tied-award ballot has a frozen eligible bidder roster, published ticket order, one ticket per eligible bidder, and an explicitly supplied draw index. It is deterministic: no randomness claim. Declined winners rotate to the next eligible ticket without returning the declined bidder to the draw. Named decision winner-substitute-consent: For winner substitute consent, apply the stipulated decision [x["substitutes"].get(w,w) if x["substitutes"].get(w,w) in x["consented"] else w for w in x["winners"]].

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = x["records"]
    v1 = [r[2] for r in x["records"]] if x["closed"] else []
    v2 = len({r[0] for r in x["records"]})>=x["threshold"]
    v3 = [[x["aliases"].get(r[0],"anonymous"),r[1]] for r in x["records"]]
    v4 = x["aliases"] if x["auditor"] else {}
    v5 = [r[0] for r in x["records"] if r[0] in x["consenting"] and r[0] not in x["revoked"]]
    v6 = sum(r[1] for r in x["records"] if r[0] not in x["withdrawn"])
    v7 = [{k:r[i] for k,i in (("quantity",1),("value",2)) if k in x["published_fields"]} for r in x["records"]]
    v8 = x["winner"] if x["closed"] and not x["embargo"] else None
    v9 = x["records"] if x["appeal_open"] or x["auditor"] else []
    return {'self-view-scope':v0,'preclose-value-embargo':v1,'distinct-bidder-suppression':v2,'alias-result-view':v3,'auditor-linkage':v4,'consent-qualified-disclosure':v5,'withdrawn-demand-statistic':v6,'field-projection':v7,'embargo-final-result':v8,'appeal-audit-retention':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['a', 2, 7], ['a', 1, 6]], [['a', 4, 14], ['a', 2, 12]], [['a', 6, 21], ['a', 3, 18]], [['a', 8, 28], ['a', 4, 24]], [['a', 10, 35], ['a', 5, 30]]]), ('closed', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': True, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['a', 2, 7], ['a', 1, 6]], [['a', 4, 14], ['a', 2, 12]], [['a', 6, 21], ['a', 3, 18]], [['a', 8, 28], ['a', 4, 24]], [['a', 10, 35], ['a', 5, 30]]]), ('outsider view', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'z', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[], [], [], [], []]), ('all consent', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a', 'b'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['a', 2, 7], ['a', 1, 6]], [['a', 4, 14], ['a', 2, 12]], [['a', 6, 21], ['a', 3, 18]], [['a', 8, 28], ['a', 4, 24]], [['a', 10, 35], ['a', 5, 30]]]), ('auditor view', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': True, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['a', 2, 7], ['a', 1, 6]], [['a', 4, 14], ['a', 2, 12]], [['a', 6, 21], ['a', 3, 18]], [['a', 8, 28], ['a', 4, 24]], [['a', 10, 35], ['a', 5, 30]]]), ('threshold met', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 2, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['a', 2, 7], ['a', 1, 6]], [['a', 4, 14], ['a', 2, 12]], [['a', 6, 21], ['a', 3, 18]], [['a', 8, 28], ['a', 4, 24]], [['a', 10, 35], ['a', 5, 30]]]), ('embargo active', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': True, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['a', 2, 7], ['a', 1, 6]], [['a', 4, 14], ['a', 2, 12]], [['a', 6, 21], ['a', 3, 18]], [['a', 8, 28], ['a', 4, 24]], [['a', 10, 35], ['a', 5, 30]]]), ('no appeal', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': False, 'winner': 'b', 'revoked': ['a']}, [[['a', 2, 7], ['a', 1, 6]], [['a', 4, 14], ['a', 2, 12]], [['a', 6, 21], ['a', 3, 18]], [['a', 8, 28], ['a', 4, 24]], [['a', 10, 35], ['a', 5, 30]]]), ('all revoked', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a', 'b']}, [[['a', 2, 7], ['a', 1, 6]], [['a', 4, 14], ['a', 2, 12]], [['a', 6, 21], ['a', 3, 18]], [['a', 8, 28], ['a', 4, 24]], [['a', 10, 35], ['a', 5, 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))['self-view-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 = [r for r in x["records"] if r[0] in x["consenting"]]
    v1 = [r[2] for r in x["records"]] if x["closed"] else []
    v2 = len({r[0] for r in x["records"]})>=x["threshold"]
    v3 = [[x["aliases"].get(r[0],"anonymous"),r[1]] for r in x["records"]]
    v4 = x["aliases"] if x["auditor"] else {}
    v5 = [r[0] for r in x["records"] if r[0] in x["consenting"] and r[0] not in x["revoked"]]
    v6 = sum(r[1] for r in x["records"] if r[0] not in x["withdrawn"])
    v7 = [{k:r[i] for k,i in (("quantity",1),("value",2)) if k in x["published_fields"]} for r in x["records"]]
    v8 = x["winner"] if x["closed"] and not x["embargo"] else None
    v9 = x["records"] if x["appeal_open"] or x["auditor"] else []
    return {'self-view-scope':v0,'preclose-value-embargo':v1,'distinct-bidder-suppression':v2,'alias-result-view':v3,'auditor-linkage':v4,'consent-qualified-disclosure':v5,'withdrawn-demand-statistic':v6,'field-projection':v7,'embargo-final-result':v8,'appeal-audit-retention':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['a', 2, 7], ['a', 1, 6]], [['a', 4, 14], ['a', 2, 12]], [['a', 6, 21], ['a', 3, 18]], [['a', 8, 28], ['a', 4, 24]], [['a', 10, 35], ['a', 5, 30]]]), ('closed', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': True, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['a', 2, 7], ['a', 1, 6]], [['a', 4, 14], ['a', 2, 12]], [['a', 6, 21], ['a', 3, 18]], [['a', 8, 28], ['a', 4, 24]], [['a', 10, 35], ['a', 5, 30]]]), ('outsider view', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'z', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[], [], [], [], []]), ('all consent', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a', 'b'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['a', 2, 7], ['a', 1, 6]], [['a', 4, 14], ['a', 2, 12]], [['a', 6, 21], ['a', 3, 18]], [['a', 8, 28], ['a', 4, 24]], [['a', 10, 35], ['a', 5, 30]]]), ('auditor view', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': True, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['a', 2, 7], ['a', 1, 6]], [['a', 4, 14], ['a', 2, 12]], [['a', 6, 21], ['a', 3, 18]], [['a', 8, 28], ['a', 4, 24]], [['a', 10, 35], ['a', 5, 30]]]), ('threshold met', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 2, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['a', 2, 7], ['a', 1, 6]], [['a', 4, 14], ['a', 2, 12]], [['a', 6, 21], ['a', 3, 18]], [['a', 8, 28], ['a', 4, 24]], [['a', 10, 35], ['a', 5, 30]]]), ('embargo active', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': True, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['a', 2, 7], ['a', 1, 6]], [['a', 4, 14], ['a', 2, 12]], [['a', 6, 21], ['a', 3, 18]], [['a', 8, 28], ['a', 4, 24]], [['a', 10, 35], ['a', 5, 30]]]), ('no appeal', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': False, 'winner': 'b', 'revoked': ['a']}, [[['a', 2, 7], ['a', 1, 6]], [['a', 4, 14], ['a', 2, 12]], [['a', 6, 21], ['a', 3, 18]], [['a', 8, 28], ['a', 4, 24]], [['a', 10, 35], ['a', 5, 30]]]), ('all revoked', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a', 'b']}, [[['a', 2, 7], ['a', 1, 6]], [['a', 4, 14], ['a', 2, 12]], [['a', 6, 21], ['a', 3, 18]], [['a', 8, 28], ['a', 4, 24]], [['a', 10, 35], ['a', 5, 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))['self-view-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:
A bidder self-view includes other participants offers.

Toy auction disclosure views distinguish bidder self-view, public preclose statistics, anonymized postclose results, and auditor-only linkage. List records have fields [bidder, quantity, value]; suppression thresholds count distinct bidders, not submitted records. Named decision self-view-scope: For self view scope, apply the stipulated decision [r for r in x["records"] if r[0]==x["viewer"]].

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = [r for r in x["records"] if r[0]==x["viewer"]]
    v1 = [r[2] for r in x["records"]]
    v2 = len({r[0] for r in x["records"]})>=x["threshold"]
    v3 = [[x["aliases"].get(r[0],"anonymous"),r[1]] for r in x["records"]]
    v4 = x["aliases"] if x["auditor"] else {}
    v5 = [r[0] for r in x["records"] if r[0] in x["consenting"] and r[0] not in x["revoked"]]
    v6 = sum(r[1] for r in x["records"] if r[0] not in x["withdrawn"])
    v7 = [{k:r[i] for k,i in (("quantity",1),("value",2)) if k in x["published_fields"]} for r in x["records"]]
    v8 = x["winner"] if x["closed"] and not x["embargo"] else None
    v9 = x["records"] if x["appeal_open"] or x["auditor"] else []
    return {'self-view-scope':v0,'preclose-value-embargo':v1,'distinct-bidder-suppression':v2,'alias-result-view':v3,'auditor-linkage':v4,'consent-qualified-disclosure':v5,'withdrawn-demand-statistic':v6,'field-projection':v7,'embargo-final-result':v8,'appeal-audit-retention':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[], [], [], [], []]), ('auditor view', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': True, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[], [], [], [], []]), ('closed', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': True, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[7, 9, 6], [14, 18, 12], [21, 27, 18], [28, 36, 24], [35, 45, 30]]), ('no appeal', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': False, 'winner': 'b', 'revoked': ['a']}, [[], [], [], [], []]), ('outsider view', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'z', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[], [], [], [], []]), ('threshold met', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 2, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[], [], [], [], []]), ('all consent', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a', 'b'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[], [], [], [], []]), ('embargo active', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': True, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[], [], [], [], []]), ('all revoked', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a', 'b']}, [[], [], [], [], []])]
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))['preclose-value-embargo'], 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 = [r for r in x["records"] if r[0]==x["viewer"]]
    v1 = [r[2] for r in x["records"]] if not x["appeal_open"] else []
    v2 = len({r[0] for r in x["records"]})>=x["threshold"]
    v3 = [[x["aliases"].get(r[0],"anonymous"),r[1]] for r in x["records"]]
    v4 = x["aliases"] if x["auditor"] else {}
    v5 = [r[0] for r in x["records"] if r[0] in x["consenting"] and r[0] not in x["revoked"]]
    v6 = sum(r[1] for r in x["records"] if r[0] not in x["withdrawn"])
    v7 = [{k:r[i] for k,i in (("quantity",1),("value",2)) if k in x["published_fields"]} for r in x["records"]]
    v8 = x["winner"] if x["closed"] and not x["embargo"] else None
    v9 = x["records"] if x["appeal_open"] or x["auditor"] else []
    return {'self-view-scope':v0,'preclose-value-embargo':v1,'distinct-bidder-suppression':v2,'alias-result-view':v3,'auditor-linkage':v4,'consent-qualified-disclosure':v5,'withdrawn-demand-statistic':v6,'field-projection':v7,'embargo-final-result':v8,'appeal-audit-retention':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[], [], [], [], []]), ('auditor view', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': True, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[], [], [], [], []]), ('closed', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': True, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[7, 9, 6], [14, 18, 12], [21, 27, 18], [28, 36, 24], [35, 45, 30]]), ('no appeal', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': False, 'winner': 'b', 'revoked': ['a']}, [[], [], [], [], []]), ('outsider view', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'z', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[], [], [], [], []]), ('threshold met', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 2, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[], [], [], [], []]), ('all consent', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a', 'b'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[], [], [], [], []]), ('embargo active', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': True, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[], [], [], [], []]), ('all revoked', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a', 'b']}, [[], [], [], [], []])]
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))['preclose-value-embargo'], 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:
Sealed offer values leak before the auction closes.

Toy auction disclosure views distinguish bidder self-view, public preclose statistics, anonymized postclose results, and auditor-only linkage. List records have fields [bidder, quantity, value]; suppression thresholds count distinct bidders, not submitted records. Named decision preclose-value-embargo: For preclose value embargo, apply the stipulated decision [r[2] for r in x["records"]] if x["closed"] else [].

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = [r for r in x["records"] if r[0]==x["viewer"]]
    v1 = [r[2] for r in x["records"]] if x["closed"] else []
    v2 = len(x["records"])>=x["threshold"]
    v3 = [[x["aliases"].get(r[0],"anonymous"),r[1]] for r in x["records"]]
    v4 = x["aliases"] if x["auditor"] else {}
    v5 = [r[0] for r in x["records"] if r[0] in x["consenting"] and r[0] not in x["revoked"]]
    v6 = sum(r[1] for r in x["records"] if r[0] not in x["withdrawn"])
    v7 = [{k:r[i] for k,i in (("quantity",1),("value",2)) if k in x["published_fields"]} for r in x["records"]]
    v8 = x["winner"] if x["closed"] and not x["embargo"] else None
    v9 = x["records"] if x["appeal_open"] or x["auditor"] else []
    return {'self-view-scope':v0,'preclose-value-embargo':v1,'distinct-bidder-suppression':v2,'alias-result-view':v3,'auditor-linkage':v4,'consent-qualified-disclosure':v5,'withdrawn-demand-statistic':v6,'field-projection':v7,'embargo-final-result':v8,'appeal-audit-retention':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [False, False, False, False, False]), ('closed', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': True, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [False, False, False, False, False]), ('threshold met', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 2, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [True, True, True, True, True]), ('closed / threshold met', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': True, 'auditor': False, 'consenting': ['a'], 'threshold': 2, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [True, True, True, True, True]), ('auditor view', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': True, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [False, False, False, False, False]), ('outsider view', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'z', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [False, False, False, False, False]), ('all consent', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a', 'b'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [False, False, False, False, False]), ('embargo active', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': True, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [False, False, False, False, False]), ('no appeal', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': False, 'winner': 'b', 'revoked': ['a']}, [False, False, False, False, False]), ('all revoked', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a', 'b']}, [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))['distinct-bidder-suppression'], 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 = [r for r in x["records"] if r[0]==x["viewer"]]
    v1 = [r[2] for r in x["records"]] if x["closed"] else []
    v2 = len({r[0] for r in x["records"]})>x["threshold"]
    v3 = [[x["aliases"].get(r[0],"anonymous"),r[1]] for r in x["records"]]
    v4 = x["aliases"] if x["auditor"] else {}
    v5 = [r[0] for r in x["records"] if r[0] in x["consenting"] and r[0] not in x["revoked"]]
    v6 = sum(r[1] for r in x["records"] if r[0] not in x["withdrawn"])
    v7 = [{k:r[i] for k,i in (("quantity",1),("value",2)) if k in x["published_fields"]} for r in x["records"]]
    v8 = x["winner"] if x["closed"] and not x["embargo"] else None
    v9 = x["records"] if x["appeal_open"] or x["auditor"] else []
    return {'self-view-scope':v0,'preclose-value-embargo':v1,'distinct-bidder-suppression':v2,'alias-result-view':v3,'auditor-linkage':v4,'consent-qualified-disclosure':v5,'withdrawn-demand-statistic':v6,'field-projection':v7,'embargo-final-result':v8,'appeal-audit-retention':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [False, False, False, False, False]), ('closed', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': True, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [False, False, False, False, False]), ('threshold met', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 2, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [True, True, True, True, True]), ('closed / threshold met', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': True, 'auditor': False, 'consenting': ['a'], 'threshold': 2, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [True, True, True, True, True]), ('auditor view', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': True, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [False, False, False, False, False]), ('outsider view', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'z', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [False, False, False, False, False]), ('all consent', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a', 'b'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [False, False, False, False, False]), ('embargo active', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': True, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [False, False, False, False, False]), ('no appeal', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': False, 'winner': 'b', 'revoked': ['a']}, [False, False, False, False, False]), ('all revoked', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a', 'b']}, [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))['distinct-bidder-suppression'], 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:
Repeated bids satisfy a publication anonymity threshold.

Toy auction disclosure views distinguish bidder self-view, public preclose statistics, anonymized postclose results, and auditor-only linkage. List records have fields [bidder, quantity, value]; suppression thresholds count distinct bidders, not submitted records. Named decision distinct-bidder-suppression: For distinct bidder suppression, apply the stipulated decision len({r[0] for r in x["records"]})>=x["threshold"].

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = [r for r in x["records"] if r[0]==x["viewer"]]
    v1 = [r[2] for r in x["records"]] if x["closed"] else []
    v2 = len({r[0] for r in x["records"]})>=x["threshold"]
    v3 = [[r[0],r[1]] for r in x["records"]]
    v4 = x["aliases"] if x["auditor"] else {}
    v5 = [r[0] for r in x["records"] if r[0] in x["consenting"] and r[0] not in x["revoked"]]
    v6 = sum(r[1] for r in x["records"] if r[0] not in x["withdrawn"])
    v7 = [{k:r[i] for k,i in (("quantity",1),("value",2)) if k in x["published_fields"]} for r in x["records"]]
    v8 = x["winner"] if x["closed"] and not x["embargo"] else None
    v9 = x["records"] if x["appeal_open"] or x["auditor"] else []
    return {'self-view-scope':v0,'preclose-value-embargo':v1,'distinct-bidder-suppression':v2,'alias-result-view':v3,'auditor-linkage':v4,'consent-qualified-disclosure':v5,'withdrawn-demand-statistic':v6,'field-projection':v7,'embargo-final-result':v8,'appeal-audit-retention':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['X', 2], ['Y', 3], ['X', 1]], [['X', 4], ['Y', 6], ['X', 2]], [['X', 6], ['Y', 9], ['X', 3]], [['X', 8], ['Y', 12], ['X', 4]], [['X', 10], ['Y', 15], ['X', 5]]]), ('closed', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': True, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['X', 2], ['Y', 3], ['X', 1]], [['X', 4], ['Y', 6], ['X', 2]], [['X', 6], ['Y', 9], ['X', 3]], [['X', 8], ['Y', 12], ['X', 4]], [['X', 10], ['Y', 15], ['X', 5]]]), ('auditor view', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': True, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['X', 2], ['Y', 3], ['X', 1]], [['X', 4], ['Y', 6], ['X', 2]], [['X', 6], ['Y', 9], ['X', 3]], [['X', 8], ['Y', 12], ['X', 4]], [['X', 10], ['Y', 15], ['X', 5]]]), ('outsider view', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'z', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['X', 2], ['Y', 3], ['X', 1]], [['X', 4], ['Y', 6], ['X', 2]], [['X', 6], ['Y', 9], ['X', 3]], [['X', 8], ['Y', 12], ['X', 4]], [['X', 10], ['Y', 15], ['X', 5]]]), ('threshold met', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 2, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['X', 2], ['Y', 3], ['X', 1]], [['X', 4], ['Y', 6], ['X', 2]], [['X', 6], ['Y', 9], ['X', 3]], [['X', 8], ['Y', 12], ['X', 4]], [['X', 10], ['Y', 15], ['X', 5]]]), ('all consent', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a', 'b'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['X', 2], ['Y', 3], ['X', 1]], [['X', 4], ['Y', 6], ['X', 2]], [['X', 6], ['Y', 9], ['X', 3]], [['X', 8], ['Y', 12], ['X', 4]], [['X', 10], ['Y', 15], ['X', 5]]]), ('embargo active', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': True, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['X', 2], ['Y', 3], ['X', 1]], [['X', 4], ['Y', 6], ['X', 2]], [['X', 6], ['Y', 9], ['X', 3]], [['X', 8], ['Y', 12], ['X', 4]], [['X', 10], ['Y', 15], ['X', 5]]]), ('no appeal', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': False, 'winner': 'b', 'revoked': ['a']}, [[['X', 2], ['Y', 3], ['X', 1]], [['X', 4], ['Y', 6], ['X', 2]], [['X', 6], ['Y', 9], ['X', 3]], [['X', 8], ['Y', 12], ['X', 4]], [['X', 10], ['Y', 15], ['X', 5]]]), ('all revoked', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a', 'b']}, [[['X', 2], ['Y', 3], ['X', 1]], [['X', 4], ['Y', 6], ['X', 2]], [['X', 6], ['Y', 9], ['X', 3]], [['X', 8], ['Y', 12], ['X', 4]], [['X', 10], ['Y', 15], ['X', 5]]])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['alias-result-view'], 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 = [r for r in x["records"] if r[0]==x["viewer"]]
    v1 = [r[2] for r in x["records"]] if x["closed"] else []
    v2 = len({r[0] for r in x["records"]})>=x["threshold"]
    v3 = [["anonymous",r[1]] for r in x["records"]]
    v4 = x["aliases"] if x["auditor"] else {}
    v5 = [r[0] for r in x["records"] if r[0] in x["consenting"] and r[0] not in x["revoked"]]
    v6 = sum(r[1] for r in x["records"] if r[0] not in x["withdrawn"])
    v7 = [{k:r[i] for k,i in (("quantity",1),("value",2)) if k in x["published_fields"]} for r in x["records"]]
    v8 = x["winner"] if x["closed"] and not x["embargo"] else None
    v9 = x["records"] if x["appeal_open"] or x["auditor"] else []
    return {'self-view-scope':v0,'preclose-value-embargo':v1,'distinct-bidder-suppression':v2,'alias-result-view':v3,'auditor-linkage':v4,'consent-qualified-disclosure':v5,'withdrawn-demand-statistic':v6,'field-projection':v7,'embargo-final-result':v8,'appeal-audit-retention':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['X', 2], ['Y', 3], ['X', 1]], [['X', 4], ['Y', 6], ['X', 2]], [['X', 6], ['Y', 9], ['X', 3]], [['X', 8], ['Y', 12], ['X', 4]], [['X', 10], ['Y', 15], ['X', 5]]]), ('closed', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': True, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['X', 2], ['Y', 3], ['X', 1]], [['X', 4], ['Y', 6], ['X', 2]], [['X', 6], ['Y', 9], ['X', 3]], [['X', 8], ['Y', 12], ['X', 4]], [['X', 10], ['Y', 15], ['X', 5]]]), ('auditor view', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': True, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['X', 2], ['Y', 3], ['X', 1]], [['X', 4], ['Y', 6], ['X', 2]], [['X', 6], ['Y', 9], ['X', 3]], [['X', 8], ['Y', 12], ['X', 4]], [['X', 10], ['Y', 15], ['X', 5]]]), ('outsider view', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'z', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['X', 2], ['Y', 3], ['X', 1]], [['X', 4], ['Y', 6], ['X', 2]], [['X', 6], ['Y', 9], ['X', 3]], [['X', 8], ['Y', 12], ['X', 4]], [['X', 10], ['Y', 15], ['X', 5]]]), ('threshold met', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 2, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['X', 2], ['Y', 3], ['X', 1]], [['X', 4], ['Y', 6], ['X', 2]], [['X', 6], ['Y', 9], ['X', 3]], [['X', 8], ['Y', 12], ['X', 4]], [['X', 10], ['Y', 15], ['X', 5]]]), ('all consent', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a', 'b'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['X', 2], ['Y', 3], ['X', 1]], [['X', 4], ['Y', 6], ['X', 2]], [['X', 6], ['Y', 9], ['X', 3]], [['X', 8], ['Y', 12], ['X', 4]], [['X', 10], ['Y', 15], ['X', 5]]]), ('embargo active', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': True, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[['X', 2], ['Y', 3], ['X', 1]], [['X', 4], ['Y', 6], ['X', 2]], [['X', 6], ['Y', 9], ['X', 3]], [['X', 8], ['Y', 12], ['X', 4]], [['X', 10], ['Y', 15], ['X', 5]]]), ('no appeal', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': False, 'winner': 'b', 'revoked': ['a']}, [[['X', 2], ['Y', 3], ['X', 1]], [['X', 4], ['Y', 6], ['X', 2]], [['X', 6], ['Y', 9], ['X', 3]], [['X', 8], ['Y', 12], ['X', 4]], [['X', 10], ['Y', 15], ['X', 5]]]), ('all revoked', {'records': [['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], 'viewer': 'a', 'closed': False, 'auditor': False, 'consenting': ['a'], 'threshold': 3, 'aliases': {'a': 'X', 'b': 'Y'}, 'withdrawn': ['b'], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a', 'b']}, [[['X', 2], ['Y', 3], ['X', 1]], [['X', 4], ['Y', 6], ['X', 2]], [['X', 6], ['Y', 9], ['X', 3]], [['X', 8], ['Y', 12], ['X', 4]], [['X', 10], ['Y', 15], ['X', 5]]])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['alias-result-view'], 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:
Result views expose identity or lose the stable pseudonym needed to follow awards.

Toy auction disclosure views distinguish bidder self-view, public preclose statistics, anonymized postclose results, and auditor-only linkage. List records have fields [bidder, quantity, value]; suppression thresholds count distinct bidders, not submitted records. Named decision alias-result-view: For alias result view, apply the stipulated decision [[x["aliases"].get(r[0],"anonymous"),r[1]] for r in x["records"]].

split: open-access