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 = [[x["aliases"].get(r[0],"anonymous"),r[1]] for r in x["records"]]
    v4 = x["aliases"]
    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']}, [{}, {}, {}, {}, {}]), ('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']}, [{}, {}, {}, {}, {}]), ('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': 'X', 'b': 'Y'}, {'a': 'X', 'b': 'Y'}, {'a': 'X', 'b': 'Y'}, {'a': 'X', 'b': 'Y'}, {'a': 'X', 'b': 'Y'}]), ('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']}, [{}, {}, {}, {}, {}]), ('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']}, [{}, {}, {}, {}, {}]), ('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))['auditor-linkage'], 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["closed"] 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']}, [{}, {}, {}, {}, {}]), ('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']}, [{}, {}, {}, {}, {}]), ('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': 'X', 'b': 'Y'}, {'a': 'X', 'b': 'Y'}, {'a': 'X', 'b': 'Y'}, {'a': 'X', 'b': 'Y'}, {'a': 'X', 'b': 'Y'}]), ('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']}, [{}, {}, {}, {}, {}]), ('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']}, [{}, {}, {}, {}, {}]), ('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))['auditor-linkage'], 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:
Closing the auction releases private bidder-alias linkage.

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 auditor-linkage: For auditor linkage, apply the stipulated decision x["aliases"] if x["auditor"] 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({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"]]
    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']}, [[], [], [], [], []]), ('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']}, [[], [], [], [], []]), ('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']}, [[], [], [], [], []]), ('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']}, [['b'], ['b'], ['b'], ['b'], ['b']]), ('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']}, [[], [], [], [], []]), ('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']}, [[], [], [], [], []]), ('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))['consent-qualified-disclosure'], 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 = [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] 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']}, [[], [], [], [], []]), ('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']}, [[], [], [], [], []]), ('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']}, [[], [], [], [], []]), ('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']}, [['b'], ['b'], ['b'], ['b'], ['b']]), ('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']}, [[], [], [], [], []]), ('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']}, [[], [], [], [], []]), ('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))['consent-qualified-disclosure'], 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:
Revoked identity publication consent remains effective.

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 consent-qualified-disclosure: For consent qualified disclosure, apply the stipulated decision [r[0] for r in x["records"] if r[0] in x["consenting"] and r[0] not in x["revoked"]].

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 = [[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"])
    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']}, [3, 6, 9, 12, 15]), ('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']}, [3, 6, 9, 12, 15]), ('no withdrawn bids', {'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': [], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [6, 12, 18, 24, 30]), ('closed / no withdrawn bids', {'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': [], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [6, 12, 18, 24, 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']}, [3, 6, 9, 12, 15]), ('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']}, [3, 6, 9, 12, 15]), ('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']}, [3, 6, 9, 12, 15]), ('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']}, [3, 6, 9, 12, 15]), ('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']}, [3, 6, 9, 12, 15]), ('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']}, [3, 6, 9, 12, 15]), ('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']}, [3, 6, 9, 12, 15])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['withdrawn-demand-statistic'], 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] 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']}, [3, 6, 9, 12, 15]), ('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']}, [3, 6, 9, 12, 15]), ('no withdrawn bids', {'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': [], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [6, 12, 18, 24, 30]), ('closed / no withdrawn bids', {'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': [], 'embargo': False, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [6, 12, 18, 24, 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']}, [3, 6, 9, 12, 15]), ('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']}, [3, 6, 9, 12, 15]), ('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']}, [3, 6, 9, 12, 15]), ('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']}, [3, 6, 9, 12, 15]), ('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']}, [3, 6, 9, 12, 15]), ('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']}, [3, 6, 9, 12, 15]), ('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']}, [3, 6, 9, 12, 15])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['withdrawn-demand-statistic'], 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:
Public live demand includes withdrawn auction 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 withdrawn-demand-statistic: For withdrawn demand statistic, apply the stipulated decision sum(r[1] for r in x["records"] if r[0] not in x["withdrawn"]).

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = [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 = [{"quantity":r[1],"value":r[2]} 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']}, [[{'quantity': 2}, {'quantity': 3}, {'quantity': 1}], [{'quantity': 4}, {'quantity': 6}, {'quantity': 2}], [{'quantity': 6}, {'quantity': 9}, {'quantity': 3}], [{'quantity': 8}, {'quantity': 12}, {'quantity': 4}], [{'quantity': 10}, {'quantity': 15}, {'quantity': 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']}, [[{'quantity': 2}, {'quantity': 3}, {'quantity': 1}], [{'quantity': 4}, {'quantity': 6}, {'quantity': 2}], [{'quantity': 6}, {'quantity': 9}, {'quantity': 3}], [{'quantity': 8}, {'quantity': 12}, {'quantity': 4}], [{'quantity': 10}, {'quantity': 15}, {'quantity': 5}]]), ('values allowed', {'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', 'value'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[{'quantity': 2, 'value': 7}, {'quantity': 3, 'value': 9}, {'quantity': 1, 'value': 6}], [{'quantity': 4, 'value': 14}, {'quantity': 6, 'value': 18}, {'quantity': 2, 'value': 12}], [{'quantity': 6, 'value': 21}, {'quantity': 9, 'value': 27}, {'quantity': 3, 'value': 18}], [{'quantity': 8, 'value': 28}, {'quantity': 12, 'value': 36}, {'quantity': 4, 'value': 24}], [{'quantity': 10, 'value': 35}, {'quantity': 15, 'value': 45}, {'quantity': 5, 'value': 30}]]), ('closed / values allowed', {'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', 'value'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[{'quantity': 2, 'value': 7}, {'quantity': 3, 'value': 9}, {'quantity': 1, 'value': 6}], [{'quantity': 4, 'value': 14}, {'quantity': 6, 'value': 18}, {'quantity': 2, 'value': 12}], [{'quantity': 6, 'value': 21}, {'quantity': 9, 'value': 27}, {'quantity': 3, 'value': 18}], [{'quantity': 8, 'value': 28}, {'quantity': 12, 'value': 36}, {'quantity': 4, 'value': 24}], [{'quantity': 10, 'value': 35}, {'quantity': 15, 'value': 45}, {'quantity': 5, 'value': 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']}, [[{'quantity': 2}, {'quantity': 3}, {'quantity': 1}], [{'quantity': 4}, {'quantity': 6}, {'quantity': 2}], [{'quantity': 6}, {'quantity': 9}, {'quantity': 3}], [{'quantity': 8}, {'quantity': 12}, {'quantity': 4}], [{'quantity': 10}, {'quantity': 15}, {'quantity': 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']}, [[{'quantity': 2}, {'quantity': 3}, {'quantity': 1}], [{'quantity': 4}, {'quantity': 6}, {'quantity': 2}], [{'quantity': 6}, {'quantity': 9}, {'quantity': 3}], [{'quantity': 8}, {'quantity': 12}, {'quantity': 4}], [{'quantity': 10}, {'quantity': 15}, {'quantity': 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']}, [[{'quantity': 2}, {'quantity': 3}, {'quantity': 1}], [{'quantity': 4}, {'quantity': 6}, {'quantity': 2}], [{'quantity': 6}, {'quantity': 9}, {'quantity': 3}], [{'quantity': 8}, {'quantity': 12}, {'quantity': 4}], [{'quantity': 10}, {'quantity': 15}, {'quantity': 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']}, [[{'quantity': 2}, {'quantity': 3}, {'quantity': 1}], [{'quantity': 4}, {'quantity': 6}, {'quantity': 2}], [{'quantity': 6}, {'quantity': 9}, {'quantity': 3}], [{'quantity': 8}, {'quantity': 12}, {'quantity': 4}], [{'quantity': 10}, {'quantity': 15}, {'quantity': 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']}, [[{'quantity': 2}, {'quantity': 3}, {'quantity': 1}], [{'quantity': 4}, {'quantity': 6}, {'quantity': 2}], [{'quantity': 6}, {'quantity': 9}, {'quantity': 3}], [{'quantity': 8}, {'quantity': 12}, {'quantity': 4}], [{'quantity': 10}, {'quantity': 15}, {'quantity': 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']}, [[{'quantity': 2}, {'quantity': 3}, {'quantity': 1}], [{'quantity': 4}, {'quantity': 6}, {'quantity': 2}], [{'quantity': 6}, {'quantity': 9}, {'quantity': 3}], [{'quantity': 8}, {'quantity': 12}, {'quantity': 4}], [{'quantity': 10}, {'quantity': 15}, {'quantity': 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']}, [[{'quantity': 2}, {'quantity': 3}, {'quantity': 1}], [{'quantity': 4}, {'quantity': 6}, {'quantity': 2}], [{'quantity': 6}, {'quantity': 9}, {'quantity': 3}], [{'quantity': 8}, {'quantity': 12}, {'quantity': 4}], [{'quantity': 10}, {'quantity': 15}, {'quantity': 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))['field-projection'], 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 = [{"quantity":r[1]} 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']}, [[{'quantity': 2}, {'quantity': 3}, {'quantity': 1}], [{'quantity': 4}, {'quantity': 6}, {'quantity': 2}], [{'quantity': 6}, {'quantity': 9}, {'quantity': 3}], [{'quantity': 8}, {'quantity': 12}, {'quantity': 4}], [{'quantity': 10}, {'quantity': 15}, {'quantity': 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']}, [[{'quantity': 2}, {'quantity': 3}, {'quantity': 1}], [{'quantity': 4}, {'quantity': 6}, {'quantity': 2}], [{'quantity': 6}, {'quantity': 9}, {'quantity': 3}], [{'quantity': 8}, {'quantity': 12}, {'quantity': 4}], [{'quantity': 10}, {'quantity': 15}, {'quantity': 5}]]), ('values allowed', {'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', 'value'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[{'quantity': 2, 'value': 7}, {'quantity': 3, 'value': 9}, {'quantity': 1, 'value': 6}], [{'quantity': 4, 'value': 14}, {'quantity': 6, 'value': 18}, {'quantity': 2, 'value': 12}], [{'quantity': 6, 'value': 21}, {'quantity': 9, 'value': 27}, {'quantity': 3, 'value': 18}], [{'quantity': 8, 'value': 28}, {'quantity': 12, 'value': 36}, {'quantity': 4, 'value': 24}], [{'quantity': 10, 'value': 35}, {'quantity': 15, 'value': 45}, {'quantity': 5, 'value': 30}]]), ('closed / values allowed', {'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', 'value'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [[{'quantity': 2, 'value': 7}, {'quantity': 3, 'value': 9}, {'quantity': 1, 'value': 6}], [{'quantity': 4, 'value': 14}, {'quantity': 6, 'value': 18}, {'quantity': 2, 'value': 12}], [{'quantity': 6, 'value': 21}, {'quantity': 9, 'value': 27}, {'quantity': 3, 'value': 18}], [{'quantity': 8, 'value': 28}, {'quantity': 12, 'value': 36}, {'quantity': 4, 'value': 24}], [{'quantity': 10, 'value': 35}, {'quantity': 15, 'value': 45}, {'quantity': 5, 'value': 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']}, [[{'quantity': 2}, {'quantity': 3}, {'quantity': 1}], [{'quantity': 4}, {'quantity': 6}, {'quantity': 2}], [{'quantity': 6}, {'quantity': 9}, {'quantity': 3}], [{'quantity': 8}, {'quantity': 12}, {'quantity': 4}], [{'quantity': 10}, {'quantity': 15}, {'quantity': 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']}, [[{'quantity': 2}, {'quantity': 3}, {'quantity': 1}], [{'quantity': 4}, {'quantity': 6}, {'quantity': 2}], [{'quantity': 6}, {'quantity': 9}, {'quantity': 3}], [{'quantity': 8}, {'quantity': 12}, {'quantity': 4}], [{'quantity': 10}, {'quantity': 15}, {'quantity': 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']}, [[{'quantity': 2}, {'quantity': 3}, {'quantity': 1}], [{'quantity': 4}, {'quantity': 6}, {'quantity': 2}], [{'quantity': 6}, {'quantity': 9}, {'quantity': 3}], [{'quantity': 8}, {'quantity': 12}, {'quantity': 4}], [{'quantity': 10}, {'quantity': 15}, {'quantity': 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']}, [[{'quantity': 2}, {'quantity': 3}, {'quantity': 1}], [{'quantity': 4}, {'quantity': 6}, {'quantity': 2}], [{'quantity': 6}, {'quantity': 9}, {'quantity': 3}], [{'quantity': 8}, {'quantity': 12}, {'quantity': 4}], [{'quantity': 10}, {'quantity': 15}, {'quantity': 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']}, [[{'quantity': 2}, {'quantity': 3}, {'quantity': 1}], [{'quantity': 4}, {'quantity': 6}, {'quantity': 2}], [{'quantity': 6}, {'quantity': 9}, {'quantity': 3}], [{'quantity': 8}, {'quantity': 12}, {'quantity': 4}], [{'quantity': 10}, {'quantity': 15}, {'quantity': 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']}, [[{'quantity': 2}, {'quantity': 3}, {'quantity': 1}], [{'quantity': 4}, {'quantity': 6}, {'quantity': 2}], [{'quantity': 6}, {'quantity': 9}, {'quantity': 3}], [{'quantity': 8}, {'quantity': 12}, {'quantity': 4}], [{'quantity': 10}, {'quantity': 15}, {'quantity': 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']}, [[{'quantity': 2}, {'quantity': 3}, {'quantity': 1}], [{'quantity': 4}, {'quantity': 6}, {'quantity': 2}], [{'quantity': 6}, {'quantity': 9}, {'quantity': 3}], [{'quantity': 8}, {'quantity': 12}, {'quantity': 4}], [{'quantity': 10}, {'quantity': 15}, {'quantity': 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))['field-projection'], 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:
Disclosure projection ignores which offer fields are approved for publication.

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 field-projection: For field projection, apply the stipulated decision [{k:r[i] for k,i in (("quantity",1),("value",2)) if k in x["published_fields"]} for r in x["records"]].

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 = [[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"] 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 = [('closed / embargo active', {'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': True, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [None, None, None, None, None]), ('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']}, [None, None, None, None, None]), ('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']}, [None, None, None, None, None]), ('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']}, ['b', 'b', 'b', 'b', 'b']), ('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']}, [None, None, None, None, None]), ('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']}, [None, None, None, None, None]), ('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']}, [None, None, None, None, None]), ('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']}, [None, None, None, None, None]), ('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']}, [None, None, None, None, None]), ('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']}, [None, None, None, None, None])]
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))['embargo-final-result'], 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 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 = [('closed / embargo active', {'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': True, 'published_fields': ['quantity'], 'appeal_open': True, 'winner': 'b', 'revoked': ['a']}, [None, None, None, None, None]), ('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']}, [None, None, None, None, None]), ('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']}, [None, None, None, None, None]), ('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']}, ['b', 'b', 'b', 'b', 'b']), ('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']}, [None, None, None, None, None]), ('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']}, [None, None, None, None, None]), ('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']}, [None, None, None, None, None]), ('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']}, [None, None, None, None, None]), ('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']}, [None, None, None, None, None]), ('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']}, [None, None, None, None, None])]
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))['embargo-final-result'], 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:
Closed-auction results leak during an explicit publication embargo.

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 embargo-final-result: For embargo final result, apply the stipulated decision x["winner"] if x["closed"] and not x["embargo"] else None.

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 = [[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["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], ['b', 3, 9], ['a', 1, 6]], [['a', 4, 14], ['b', 6, 18], ['a', 2, 12]], [['a', 6, 21], ['b', 9, 27], ['a', 3, 18]], [['a', 8, 28], ['b', 12, 36], ['a', 4, 24]], [['a', 10, 35], ['b', 15, 45], ['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], ['b', 3, 9], ['a', 1, 6]], [['a', 4, 14], ['b', 6, 18], ['a', 2, 12]], [['a', 6, 21], ['b', 9, 27], ['a', 3, 18]], [['a', 8, 28], ['b', 12, 36], ['a', 4, 24]], [['a', 10, 35], ['b', 15, 45], ['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']}, [[], [], [], [], []]), ('closed / no appeal', {'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': False, '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']}, [[['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], [['a', 4, 14], ['b', 6, 18], ['a', 2, 12]], [['a', 6, 21], ['b', 9, 27], ['a', 3, 18]], [['a', 8, 28], ['b', 12, 36], ['a', 4, 24]], [['a', 10, 35], ['b', 15, 45], ['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']}, [[['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], [['a', 4, 14], ['b', 6, 18], ['a', 2, 12]], [['a', 6, 21], ['b', 9, 27], ['a', 3, 18]], [['a', 8, 28], ['b', 12, 36], ['a', 4, 24]], [['a', 10, 35], ['b', 15, 45], ['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], ['b', 3, 9], ['a', 1, 6]], [['a', 4, 14], ['b', 6, 18], ['a', 2, 12]], [['a', 6, 21], ['b', 9, 27], ['a', 3, 18]], [['a', 8, 28], ['b', 12, 36], ['a', 4, 24]], [['a', 10, 35], ['b', 15, 45], ['a', 5, 30]]]), ('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], ['b', 3, 9], ['a', 1, 6]], [['a', 4, 14], ['b', 6, 18], ['a', 2, 12]], [['a', 6, 21], ['b', 9, 27], ['a', 3, 18]], [['a', 8, 28], ['b', 12, 36], ['a', 4, 24]], [['a', 10, 35], ['b', 15, 45], ['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], ['b', 3, 9], ['a', 1, 6]], [['a', 4, 14], ['b', 6, 18], ['a', 2, 12]], [['a', 6, 21], ['b', 9, 27], ['a', 3, 18]], [['a', 8, 28], ['b', 12, 36], ['a', 4, 24]], [['a', 10, 35], ['b', 15, 45], ['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], ['b', 3, 9], ['a', 1, 6]], [['a', 4, 14], ['b', 6, 18], ['a', 2, 12]], [['a', 6, 21], ['b', 9, 27], ['a', 3, 18]], [['a', 8, 28], ['b', 12, 36], ['a', 4, 24]], [['a', 10, 35], ['b', 15, 45], ['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))['appeal-audit-retention'], 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"]
    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], ['b', 3, 9], ['a', 1, 6]], [['a', 4, 14], ['b', 6, 18], ['a', 2, 12]], [['a', 6, 21], ['b', 9, 27], ['a', 3, 18]], [['a', 8, 28], ['b', 12, 36], ['a', 4, 24]], [['a', 10, 35], ['b', 15, 45], ['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], ['b', 3, 9], ['a', 1, 6]], [['a', 4, 14], ['b', 6, 18], ['a', 2, 12]], [['a', 6, 21], ['b', 9, 27], ['a', 3, 18]], [['a', 8, 28], ['b', 12, 36], ['a', 4, 24]], [['a', 10, 35], ['b', 15, 45], ['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']}, [[], [], [], [], []]), ('closed / no appeal', {'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': False, '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']}, [[['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], [['a', 4, 14], ['b', 6, 18], ['a', 2, 12]], [['a', 6, 21], ['b', 9, 27], ['a', 3, 18]], [['a', 8, 28], ['b', 12, 36], ['a', 4, 24]], [['a', 10, 35], ['b', 15, 45], ['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']}, [[['a', 2, 7], ['b', 3, 9], ['a', 1, 6]], [['a', 4, 14], ['b', 6, 18], ['a', 2, 12]], [['a', 6, 21], ['b', 9, 27], ['a', 3, 18]], [['a', 8, 28], ['b', 12, 36], ['a', 4, 24]], [['a', 10, 35], ['b', 15, 45], ['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], ['b', 3, 9], ['a', 1, 6]], [['a', 4, 14], ['b', 6, 18], ['a', 2, 12]], [['a', 6, 21], ['b', 9, 27], ['a', 3, 18]], [['a', 8, 28], ['b', 12, 36], ['a', 4, 24]], [['a', 10, 35], ['b', 15, 45], ['a', 5, 30]]]), ('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], ['b', 3, 9], ['a', 1, 6]], [['a', 4, 14], ['b', 6, 18], ['a', 2, 12]], [['a', 6, 21], ['b', 9, 27], ['a', 3, 18]], [['a', 8, 28], ['b', 12, 36], ['a', 4, 24]], [['a', 10, 35], ['b', 15, 45], ['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], ['b', 3, 9], ['a', 1, 6]], [['a', 4, 14], ['b', 6, 18], ['a', 2, 12]], [['a', 6, 21], ['b', 9, 27], ['a', 3, 18]], [['a', 8, 28], ['b', 12, 36], ['a', 4, 24]], [['a', 10, 35], ['b', 15, 45], ['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], ['b', 3, 9], ['a', 1, 6]], [['a', 4, 14], ['b', 6, 18], ['a', 2, 12]], [['a', 6, 21], ['b', 9, 27], ['a', 3, 18]], [['a', 8, 28], ['b', 12, 36], ['a', 4, 24]], [['a', 10, 35], ['b', 15, 45], ['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))['appeal-audit-retention'], 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:
Bid evidence is purged while an auction appeal is open.

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 appeal-audit-retention: For appeal audit retention, apply the stipulated decision x["records"] if x["appeal_open"] or x["auditor"] else [].

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = next((b for b in x["activation_bundles"] if set(b)&set(x["proposed"])),None)
    v1 = all(a in x["waived"] or not set(x["excludes"].get(a,[]))&set(x["proposed"]) for a in x["proposed"])
    v2 = all(x["owners"].get(a)==x["owners"].get(b) for a,b in x["same_owner"] if a in x["proposed"] and b in x["proposed"])
    v3 = [a for a in x["proposed"] if x["release_revisions"].get(a)==x["award_revisions"].get(a) and a in x["release_revisions"]]
    v4 = all(x["options"][a] in x["confirmed"] for a in x["proposed"] if a in x["options"])
    v5 = len(set(x["proposed"]))>=x["minimum_set"]
    v6 = len(set(x["proposed"]))<=x["maximum_set"]
    v7 = [a for a in x["conditional"] if a not in x["waived"] or a in x["locked"]]
    v8 = not (set(x["conditional"])&set(x["proposed"])) or bool(set(x["activation"])&set(x["proposed"]))
    v9 = [a for a in x["proposed"] if x["options"].get(a) not in x["expired"]]
    return {'alternative-trigger-bundles':v0,'conditional-exclusion-exception':v1,'same-owner-companion':v2,'release-certificate-revision':v3,'option-confirmation':v4,'minimum-award-set':v5,'maximum-award-set':v6,'locked-condition-waiver':v7,'activation-presence':v8,'expired-option-veto':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'proposed': ['A', 'B'], 'requires': {'B': ['A', 'C']}, 'excludes': {'A': ['C']}, 'owners': {'A': 'x', 'B': 'y', 'C': 'x'}, 'same_owner': [['A', 'B']], 'released': ['A'], 'seller_required': ['A', 'B'], 'confirmed': ['opt1'], 'options': {'A': 'opt1', 'B': 'opt2'}, 'minimum_set': 2, 'maximum_set': 3, 'locked': ['C'], 'conditional': ['B'], 'activation': ['A'], 'waived': [], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [['B'], ['B'], ['B'], ['B'], ['B']]), ('no conditional award', {'proposed': ['A'], 'requires': {'B': ['A', 'C']}, 'excludes': {'A': ['C']}, 'owners': {'A': 'x', 'B': 'y', 'C': 'x'}, 'same_owner': [['A', 'B']], 'released': ['A'], 'seller_required': ['A', 'B'], 'confirmed': ['opt1'], 'options': {'A': 'opt1', 'B': 'opt2'}, 'minimum_set': 2, 'maximum_set': 3, 'locked': ['C'], 'conditional': ['B'], 'activation': ['A'], 'waived': [], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [None, None, None, None, None]), ('same owner pair', {'proposed': ['A', 'B'], 'requires': {'B': ['A', 'C']}, 'excludes': {'A': ['C']}, 'owners': {'A': 'x', 'B': 'x', 'C': 'x'}, 'same_owner': [['A', 'B']], 'released': ['A'], 'seller_required': ['A', 'B'], 'confirmed': ['opt1'], 'options': {'A': 'opt1', 'B': 'opt2'}, 'minimum_set': 2, 'maximum_set': 3, 'locked': ['C'], 'conditional': ['B'], 'activation': ['A'], 'waived': [], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [['B'], ['B'], ['B'], ['B'], ['B']]), ('complete prerequisite set', {'proposed': ['A', 'B', 'C'], 'requires': {'B': ['A', 'C']}, 'excludes': {'A': ['C']}, 'owners': {'A': 'x', 'B': 'y', 'C': 'x'}, 'same_owner': [['A', 'B']], 'released': ['A'], 'seller_required': ['A', 'B'], 'confirmed': ['opt1'], 'options': {'A': 'opt1', 'B': 'opt2'}, 'minimum_set': 2, 'maximum_set': 3, 'locked': ['C'], 'conditional': ['B'], 'activation': ['A'], 'waived': [], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [['A', 'C'], ['A', 'C'], ['A', 'C'], ['A', 'C'], ['A', 'C']]), ('seller releases all', {'proposed': ['A', 'B'], 'requires': {'B': ['A', 'C']}, 'excludes': {'A': ['C']}, 'owners': {'A': 'x', 'B': 'y', 'C': 'x'}, 'same_owner': [['A', 'B']], 'released': ['A', 'B'], 'seller_required': ['A', 'B'], 'confirmed': ['opt1'], 'options': {'A': 'opt1', 'B': 'opt2'}, 'minimum_set': 2, 'maximum_set': 3, 'locked': ['C'], 'conditional': ['B'], 'activation': ['A'], 'waived': [], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [['B'], ['B'], ['B'], ['B'], ['B']]), ('all options confirmed', {'proposed': ['A', 'B'], 'requires': {'B': ['A', 'C']}, 'excludes': {'A': ['C']}, 'owners': {'A': 'x', 'B': 'y', 'C': 'x'}, 'same_owner': [['A', 'B']], 'released': ['A'], 'seller_required': ['A', 'B'], 'confirmed': ['opt1', 'opt2'], 'options': {'A': 'opt1', 'B': 'opt2'}, 'minimum_set': 2, 'maximum_set': 3, 'locked': ['C'], 'conditional': ['B'], 'activation': ['A'], 'waived': [], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [['B'], ['B'], ['B'], ['B'], ['B']]), ('no expired options', {'proposed': ['A', 'B'], 'requires': {'B': ['A', 'C']}, 'excludes': {'A': ['C']}, 'owners': {'A': 'x', 'B': 'y', 'C': 'x'}, 'same_owner': [['A', 'B']], 'released': ['A'], 'seller_required': ['A', 'B'], 'confirmed': ['opt1'], 'options': {'A': 'opt1', 'B': 'opt2'}, 'minimum_set': 2, 'maximum_set': 3, 'locked': ['C'], 'conditional': ['B'], 'activation': ['A'], 'waived': [], 'expired': [], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [['B'], ['B'], ['B'], ['B'], ['B']]), ('waived condition', {'proposed': ['A', 'B'], 'requires': {'B': ['A', 'C']}, 'excludes': {'A': ['C']}, 'owners': {'A': 'x', 'B': 'y', 'C': 'x'}, 'same_owner': [['A', 'B']], 'released': ['A'], 'seller_required': ['A', 'B'], 'confirmed': ['opt1'], 'options': {'A': 'opt1', 'B': 'opt2'}, 'minimum_set': 2, 'maximum_set': 3, 'locked': ['C'], 'conditional': ['B'], 'activation': ['A'], 'waived': ['B'], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [['B'], ['B'], ['B'], ['B'], ['B']]), ('no activator', {'proposed': ['A', 'B'], 'requires': {'B': ['A', 'C']}, 'excludes': {'A': ['C']}, 'owners': {'A': 'x', 'B': 'y', 'C': 'x'}, 'same_owner': [['A', 'B']], 'released': ['A'], 'seller_required': ['A', 'B'], 'confirmed': ['opt1'], 'options': {'A': 'opt1', 'B': 'opt2'}, 'minimum_set': 2, 'maximum_set': 3, 'locked': ['C'], 'conditional': ['B'], 'activation': [], 'waived': [], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [['B'], ['B'], ['B'], ['B'], ['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))['alternative-trigger-bundles'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x):
    v0 = x["activation_bundles"][0] if x["activation_bundles"] and set(x["activation_bundles"][0])<=set(x["proposed"]) else None
    v1 = all(a in x["waived"] or not set(x["excludes"].get(a,[]))&set(x["proposed"]) for a in x["proposed"])
    v2 = all(x["owners"].get(a)==x["owners"].get(b) for a,b in x["same_owner"] if a in x["proposed"] and b in x["proposed"])
    v3 = [a for a in x["proposed"] if x["release_revisions"].get(a)==x["award_revisions"].get(a) and a in x["release_revisions"]]
    v4 = all(x["options"][a] in x["confirmed"] for a in x["proposed"] if a in x["options"])
    v5 = len(set(x["proposed"]))>=x["minimum_set"]
    v6 = len(set(x["proposed"]))<=x["maximum_set"]
    v7 = [a for a in x["conditional"] if a not in x["waived"] or a in x["locked"]]
    v8 = not (set(x["conditional"])&set(x["proposed"])) or bool(set(x["activation"])&set(x["proposed"]))
    v9 = [a for a in x["proposed"] if x["options"].get(a) not in x["expired"]]
    return {'alternative-trigger-bundles':v0,'conditional-exclusion-exception':v1,'same-owner-companion':v2,'release-certificate-revision':v3,'option-confirmation':v4,'minimum-award-set':v5,'maximum-award-set':v6,'locked-condition-waiver':v7,'activation-presence':v8,'expired-option-veto':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'proposed': ['A', 'B'], 'requires': {'B': ['A', 'C']}, 'excludes': {'A': ['C']}, 'owners': {'A': 'x', 'B': 'y', 'C': 'x'}, 'same_owner': [['A', 'B']], 'released': ['A'], 'seller_required': ['A', 'B'], 'confirmed': ['opt1'], 'options': {'A': 'opt1', 'B': 'opt2'}, 'minimum_set': 2, 'maximum_set': 3, 'locked': ['C'], 'conditional': ['B'], 'activation': ['A'], 'waived': [], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [['B'], ['B'], ['B'], ['B'], ['B']]), ('no conditional award', {'proposed': ['A'], 'requires': {'B': ['A', 'C']}, 'excludes': {'A': ['C']}, 'owners': {'A': 'x', 'B': 'y', 'C': 'x'}, 'same_owner': [['A', 'B']], 'released': ['A'], 'seller_required': ['A', 'B'], 'confirmed': ['opt1'], 'options': {'A': 'opt1', 'B': 'opt2'}, 'minimum_set': 2, 'maximum_set': 3, 'locked': ['C'], 'conditional': ['B'], 'activation': ['A'], 'waived': [], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [None, None, None, None, None]), ('same owner pair', {'proposed': ['A', 'B'], 'requires': {'B': ['A', 'C']}, 'excludes': {'A': ['C']}, 'owners': {'A': 'x', 'B': 'x', 'C': 'x'}, 'same_owner': [['A', 'B']], 'released': ['A'], 'seller_required': ['A', 'B'], 'confirmed': ['opt1'], 'options': {'A': 'opt1', 'B': 'opt2'}, 'minimum_set': 2, 'maximum_set': 3, 'locked': ['C'], 'conditional': ['B'], 'activation': ['A'], 'waived': [], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [['B'], ['B'], ['B'], ['B'], ['B']]), ('complete prerequisite set', {'proposed': ['A', 'B', 'C'], 'requires': {'B': ['A', 'C']}, 'excludes': {'A': ['C']}, 'owners': {'A': 'x', 'B': 'y', 'C': 'x'}, 'same_owner': [['A', 'B']], 'released': ['A'], 'seller_required': ['A', 'B'], 'confirmed': ['opt1'], 'options': {'A': 'opt1', 'B': 'opt2'}, 'minimum_set': 2, 'maximum_set': 3, 'locked': ['C'], 'conditional': ['B'], 'activation': ['A'], 'waived': [], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [['A', 'C'], ['A', 'C'], ['A', 'C'], ['A', 'C'], ['A', 'C']]), ('seller releases all', {'proposed': ['A', 'B'], 'requires': {'B': ['A', 'C']}, 'excludes': {'A': ['C']}, 'owners': {'A': 'x', 'B': 'y', 'C': 'x'}, 'same_owner': [['A', 'B']], 'released': ['A', 'B'], 'seller_required': ['A', 'B'], 'confirmed': ['opt1'], 'options': {'A': 'opt1', 'B': 'opt2'}, 'minimum_set': 2, 'maximum_set': 3, 'locked': ['C'], 'conditional': ['B'], 'activation': ['A'], 'waived': [], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [['B'], ['B'], ['B'], ['B'], ['B']]), ('all options confirmed', {'proposed': ['A', 'B'], 'requires': {'B': ['A', 'C']}, 'excludes': {'A': ['C']}, 'owners': {'A': 'x', 'B': 'y', 'C': 'x'}, 'same_owner': [['A', 'B']], 'released': ['A'], 'seller_required': ['A', 'B'], 'confirmed': ['opt1', 'opt2'], 'options': {'A': 'opt1', 'B': 'opt2'}, 'minimum_set': 2, 'maximum_set': 3, 'locked': ['C'], 'conditional': ['B'], 'activation': ['A'], 'waived': [], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [['B'], ['B'], ['B'], ['B'], ['B']]), ('no expired options', {'proposed': ['A', 'B'], 'requires': {'B': ['A', 'C']}, 'excludes': {'A': ['C']}, 'owners': {'A': 'x', 'B': 'y', 'C': 'x'}, 'same_owner': [['A', 'B']], 'released': ['A'], 'seller_required': ['A', 'B'], 'confirmed': ['opt1'], 'options': {'A': 'opt1', 'B': 'opt2'}, 'minimum_set': 2, 'maximum_set': 3, 'locked': ['C'], 'conditional': ['B'], 'activation': ['A'], 'waived': [], 'expired': [], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [['B'], ['B'], ['B'], ['B'], ['B']]), ('waived condition', {'proposed': ['A', 'B'], 'requires': {'B': ['A', 'C']}, 'excludes': {'A': ['C']}, 'owners': {'A': 'x', 'B': 'y', 'C': 'x'}, 'same_owner': [['A', 'B']], 'released': ['A'], 'seller_required': ['A', 'B'], 'confirmed': ['opt1'], 'options': {'A': 'opt1', 'B': 'opt2'}, 'minimum_set': 2, 'maximum_set': 3, 'locked': ['C'], 'conditional': ['B'], 'activation': ['A'], 'waived': ['B'], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [['B'], ['B'], ['B'], ['B'], ['B']]), ('no activator', {'proposed': ['A', 'B'], 'requires': {'B': ['A', 'C']}, 'excludes': {'A': ['C']}, 'owners': {'A': 'x', 'B': 'y', 'C': 'x'}, 'same_owner': [['A', 'B']], 'released': ['A'], 'seller_required': ['A', 'B'], 'confirmed': ['opt1'], 'options': {'A': 'opt1', 'B': 'opt2'}, 'minimum_set': 2, 'maximum_set': 3, 'locked': ['C'], 'conditional': ['B'], 'activation': [], 'waived': [], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [['B'], ['B'], ['B'], ['B'], ['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))['alternative-trigger-bundles'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
An alternative activation bundle fires on a partial bundle or fails to consider a later complete alternative.

A proposed auction award set is certified against named conditional offers. Conditions distinguish requiring another award, requiring its absence, requiring same-owner award, seller release, and externally confirmed options. These are certificates on a proposed set, not an optimizer. Named decision alternative-trigger-bundles: For alternative trigger bundles, apply the stipulated decision next((b for b in x["activation_bundles"] if set(b)<=set(x["proposed"])),None).

split: open-access