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"]]
    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 = [('waived condition / conditional locked', {'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': ['B'], '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']]), ('conditional locked / unrelated exclusion waiver', {'proposed': ['A', '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': ['B'], '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']]), ('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}}, [[], [], [], [], []]), ('unrelated exclusion waiver', {'proposed': ['A', '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': ['B'], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [[], [], [], [], []]), ('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']]), ('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}}, [['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}}, [['B'], ['B'], ['B'], ['B'], ['B']]), ('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']]), ('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']]), ('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))['locked-condition-waiver'], 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 = 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 = x["conditional"]
    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 = [('waived condition / conditional locked', {'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': ['B'], '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']]), ('conditional locked / unrelated exclusion waiver', {'proposed': ['A', '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': ['B'], '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']]), ('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}}, [[], [], [], [], []]), ('unrelated exclusion waiver', {'proposed': ['A', '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': ['B'], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [[], [], [], [], []]), ('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']]), ('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}}, [['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}}, [['B'], ['B'], ['B'], ['B'], ['B']]), ('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']]), ('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']]), ('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))['locked-condition-waiver'], 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 waiver removes a condition already locked into the awarded contract.

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 locked-condition-waiver: For locked condition waiver, apply the stipulated decision [a for a in x["conditional"] if a not in x["waived"] or a in x["locked"]].

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 = 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 = [('empty proposed award', {'proposed': [], '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}}, [True, True, True, True, True]), ('complete prerequisite set / empty proposed award', {'proposed': [], '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}}, [True, True, True, True, True]), ('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}}, [False, False, False, False, False]), ('complete prerequisite set / no activator', {'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': [], 'waived': [], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [False, False, False, False, False]), ('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}}, [True, True, True, True, True]), ('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}}, [True, True, True, True, True]), ('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}}, [True, True, True, True, True]), ('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}}, [True, True, True, True, True]), ('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}}, [True, True, True, True, True]), ('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}}, [True, True, True, True, True]), ('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}}, [True, True, True, True, True]), ('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}}, [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))['activation-presence'], 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 = 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 = True
    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 = [('empty proposed award', {'proposed': [], '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}}, [True, True, True, True, True]), ('complete prerequisite set / empty proposed award', {'proposed': [], '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}}, [True, True, True, True, True]), ('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}}, [False, False, False, False, False]), ('complete prerequisite set / no activator', {'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': [], 'waived': [], 'expired': ['opt2'], 'activation_bundles': [['A', 'C'], ['B']], 'release_revisions': {'A': 1, 'B': 3}, 'award_revisions': {'A': 2, 'B': 2}}, [False, False, False, False, False]), ('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}}, [True, True, True, True, True]), ('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}}, [True, True, True, True, True]), ('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}}, [True, True, True, True, True]), ('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}}, [True, True, True, True, True]), ('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}}, [True, True, True, True, True]), ('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}}, [True, True, True, True, True]), ('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}}, [True, True, True, True, True]), ('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}}, [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))['activation-presence'], 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 inactive contingent offer is certified without its triggering award.

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 activation-presence: For activation presence, apply the stipulated decision not (set(x["conditional"])&set(x["proposed"])) or bool(set(x["activation"])&set(x["proposed"])).

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 = x["proposed"]
    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}}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('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']]), ('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}}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('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}}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('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}}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('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}}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('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}}, [['A', 'B'], ['A', 'B'], ['A', 'B'], ['A', 'B'], ['A', '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}}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('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}}, [['A'], ['A'], ['A'], ['A'], ['A']])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['expired-option-veto'], 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 = 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) in x["confirmed"]]
    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}}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('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']]), ('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}}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('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}}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('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}}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('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}}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('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}}, [['A', 'B'], ['A', 'B'], ['A', 'B'], ['A', 'B'], ['A', '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}}, [['A'], ['A'], ['A'], ['A'], ['A']]), ('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}}, [['A'], ['A'], ['A'], ['A'], ['A']])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['expired-option-veto'], 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:
Expired underlying options still support final contingent awards.

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 expired-option-veto: For expired option veto, apply the stipulated decision [a for a in x["proposed"] if x["options"].get(a) not in x["expired"]].

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = set(x["required"])<=set(x["submitted"])
    v1 = not set(x["required"])&set(x["rejected"])
    v2 = x["requested_category"] in x["certified"]
    v3 = min(x["volume"],x["qualified_volume"])
    v4 = x["now"]<x["expires"]
    v5 = not x["suspended"] and x["now"]<x["expires"]
    v6 = x["appeal"]
    v7 = all(s in x["completed"] for s in x["sequence"][:x["sequence"].index(x["stage"])])
    v8 = x["evidence_revision"]==x["reviewed_revision"]
    v9 = not x["conditional"] or x["conditions_met"]
    return {'submitted-is-not-approved':v0,'rejected-required-evidence':v1,'certified-award-category':v2,'qualified-volume':v3,'qualification-validity':v4,'suspension-bid-gate':v5,'appeal-during-suspension':v6,'preceding-stage-certification':v7,'reviewed-evidence-revision':v8,'conditional-admission':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('all evidence', {'required': ['identity', 'capacity'], 'submitted': ['identity', 'capacity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('all approved', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity', 'capacity'], 'rejected': [], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [True, True, True, True, True]), ('normal contract', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('unrelated rejection', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['optional'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('missing prior stage', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'admission', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('red category', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'red', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('small award', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 3, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('qualification expired', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 9, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('suspended bidder', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': True, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [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))['submitted-is-not-approved'], 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 = bool(x["approved"])
    v1 = not set(x["required"])&set(x["rejected"])
    v2 = x["requested_category"] in x["certified"]
    v3 = min(x["volume"],x["qualified_volume"])
    v4 = x["now"]<x["expires"]
    v5 = not x["suspended"] and x["now"]<x["expires"]
    v6 = x["appeal"]
    v7 = all(s in x["completed"] for s in x["sequence"][:x["sequence"].index(x["stage"])])
    v8 = x["evidence_revision"]==x["reviewed_revision"]
    v9 = not x["conditional"] or x["conditions_met"]
    return {'submitted-is-not-approved':v0,'rejected-required-evidence':v1,'certified-award-category':v2,'qualified-volume':v3,'qualification-validity':v4,'suspension-bid-gate':v5,'appeal-during-suspension':v6,'preceding-stage-certification':v7,'reviewed-evidence-revision':v8,'conditional-admission':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('all evidence', {'required': ['identity', 'capacity'], 'submitted': ['identity', 'capacity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('all approved', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity', 'capacity'], 'rejected': [], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [True, True, True, True, True]), ('normal contract', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('unrelated rejection', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['optional'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('missing prior stage', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'admission', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('red category', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'red', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('small award', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 3, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('qualification expired', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 9, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('suspended bidder', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': True, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [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))['submitted-is-not-approved'], 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:
Uploaded qualification evidence is treated as reviewed approval.

A staged toy auction prequalification uses submitted evidence, reviewer decisions, category-specific certification and bounded award volume. A qualification suspension freezes new offers but preserves previously earned appeal rights. Evidence identifiers distinguish revisions. Named decision submitted-is-not-approved: For submitted is not approved, apply the stipulated decision set(x["required"])<=set(x["approved"]).

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = set(x["required"])<=set(x["approved"])
    v1 = True
    v2 = x["requested_category"] in x["certified"]
    v3 = min(x["volume"],x["qualified_volume"])
    v4 = x["now"]<x["expires"]
    v5 = not x["suspended"] and x["now"]<x["expires"]
    v6 = x["appeal"]
    v7 = all(s in x["completed"] for s in x["sequence"][:x["sequence"].index(x["stage"])])
    v8 = x["evidence_revision"]==x["reviewed_revision"]
    v9 = not x["conditional"] or x["conditions_met"]
    return {'submitted-is-not-approved':v0,'rejected-required-evidence':v1,'certified-award-category':v2,'qualified-volume':v3,'qualification-validity':v4,'suspension-bid-gate':v5,'appeal-during-suspension':v6,'preceding-stage-certification':v7,'reviewed-evidence-revision':v8,'conditional-admission':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('missing prior stage', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'admission', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('unrelated rejection', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['optional'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [True, True, True, True, True]), ('unrelated rejection / missing prior stage', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['optional'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'admission', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [True, True, True, True, True]), ('all evidence', {'required': ['identity', 'capacity'], 'submitted': ['identity', 'capacity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('all approved', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity', 'capacity'], 'rejected': [], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [True, True, True, True, True]), ('red category', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'red', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('small award', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 3, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('qualification expired', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 9, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('suspended bidder', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': True, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [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))['rejected-required-evidence'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x):
    v0 = set(x["required"])<=set(x["approved"])
    v1 = not x["rejected"]
    v2 = x["requested_category"] in x["certified"]
    v3 = min(x["volume"],x["qualified_volume"])
    v4 = x["now"]<x["expires"]
    v5 = not x["suspended"] and x["now"]<x["expires"]
    v6 = x["appeal"]
    v7 = all(s in x["completed"] for s in x["sequence"][:x["sequence"].index(x["stage"])])
    v8 = x["evidence_revision"]==x["reviewed_revision"]
    v9 = not x["conditional"] or x["conditions_met"]
    return {'submitted-is-not-approved':v0,'rejected-required-evidence':v1,'certified-award-category':v2,'qualified-volume':v3,'qualification-validity':v4,'suspension-bid-gate':v5,'appeal-during-suspension':v6,'preceding-stage-certification':v7,'reviewed-evidence-revision':v8,'conditional-admission':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('missing prior stage', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'admission', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('unrelated rejection', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['optional'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [True, True, True, True, True]), ('unrelated rejection / missing prior stage', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['optional'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'admission', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [True, True, True, True, True]), ('all evidence', {'required': ['identity', 'capacity'], 'submitted': ['identity', 'capacity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('all approved', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity', 'capacity'], 'rejected': [], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [True, True, True, True, True]), ('red category', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'red', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('small award', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 3, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('qualification expired', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 9, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('suspended bidder', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': True, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [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))['rejected-required-evidence'], 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 required rejected qualification item does not veto admission.

A staged toy auction prequalification uses submitted evidence, reviewer decisions, category-specific certification and bounded award volume. A qualification suspension freezes new offers but preserves previously earned appeal rights. Evidence identifiers distinguish revisions. Named decision rejected-required-evidence: For rejected required evidence, apply the stipulated decision not set(x["required"])&set(x["rejected"]).

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = set(x["required"])<=set(x["approved"])
    v1 = not set(x["required"])&set(x["rejected"])
    v2 = x["requested_category"] in x["categories"]
    v3 = min(x["volume"],x["qualified_volume"])
    v4 = x["now"]<x["expires"]
    v5 = not x["suspended"] and x["now"]<x["expires"]
    v6 = x["appeal"]
    v7 = all(s in x["completed"] for s in x["sequence"][:x["sequence"].index(x["stage"])])
    v8 = x["evidence_revision"]==x["reviewed_revision"]
    v9 = not x["conditional"] or x["conditions_met"]
    return {'submitted-is-not-approved':v0,'rejected-required-evidence':v1,'certified-award-category':v2,'qualified-volume':v3,'qualification-validity':v4,'suspension-bid-gate':v5,'appeal-during-suspension':v6,'preceding-stage-certification':v7,'reviewed-evidence-revision':v8,'conditional-admission':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('unrelated rejection', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['optional'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('missing prior stage', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'admission', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('all evidence', {'required': ['identity', 'capacity'], 'submitted': ['identity', 'capacity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('all approved', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity', 'capacity'], 'rejected': [], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('red category', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'red', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [True, True, True, True, True]), ('small award', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 3, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('qualification expired', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 9, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('suspended bidder', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': True, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [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))['certified-award-category'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x):
    v0 = set(x["required"])<=set(x["approved"])
    v1 = not set(x["required"])&set(x["rejected"])
    v2 = bool(x["certified"])
    v3 = min(x["volume"],x["qualified_volume"])
    v4 = x["now"]<x["expires"]
    v5 = not x["suspended"] and x["now"]<x["expires"]
    v6 = x["appeal"]
    v7 = all(s in x["completed"] for s in x["sequence"][:x["sequence"].index(x["stage"])])
    v8 = x["evidence_revision"]==x["reviewed_revision"]
    v9 = not x["conditional"] or x["conditions_met"]
    return {'submitted-is-not-approved':v0,'rejected-required-evidence':v1,'certified-award-category':v2,'qualified-volume':v3,'qualification-validity':v4,'suspension-bid-gate':v5,'appeal-during-suspension':v6,'preceding-stage-certification':v7,'reviewed-evidence-revision':v8,'conditional-admission':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('unrelated rejection', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['optional'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('missing prior stage', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'admission', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('all evidence', {'required': ['identity', 'capacity'], 'submitted': ['identity', 'capacity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('all approved', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity', 'capacity'], 'rejected': [], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('red category', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'red', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [True, True, True, True, True]), ('small award', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 3, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('qualification expired', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 9, 'suspended': False, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('suspended bidder', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['capacity'], 'categories': ['red', 'blue'], 'certified': ['red'], 'requested_category': 'blue', 'volume': 8, 'qualified_volume': 5, 'expires': 9, 'now': 7, 'suspended': True, 'appeal': True, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [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))['certified-award-category'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Any certified category authorizes bids in an uncertified auction category.

A staged toy auction prequalification uses submitted evidence, reviewer decisions, category-specific certification and bounded award volume. A qualification suspension freezes new offers but preserves previously earned appeal rights. Evidence identifiers distinguish revisions. Named decision certified-award-category: For certified award category, apply the stipulated decision x["requested_category"] in x["certified"].

split: open-access