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

N = 1
observations = []
def solve(x):
    v0 = x["representative"] in x["members"]
    v1 = set(x["members"])<=set(x["signers"])
    v2 = any(set(x["lots"])<=set(x["approved_lots"].get(m,[])) for m in x["members"])
    v3 = sum(x["shares"].get(m,0) for m in x["members"])==x["award"]
    v4 = all(x["shares"].get(m,0)==0 for m in x["exits"])
    v5 = x["replacement"] in x["approved_members"] and x["replacement"] not in x["members"]
    v6 = not any(set(x["affiliates"].get(m,[]))&set(x["rivals"]) for m in x["members"])
    v7 = {m:x["award"] if x["joint"] else x["shares"].get(m,0) for m in x["members"]}
    v8 = all(x["shares"].get(m,0)<=x["member_caps"].get(m,0) for m in x["members"])
    v9 = not x["dissolved"] and all(x["payments"].get(m,0)>=x["required"].get(m,0) for m in x["members"])
    return {'representative-membership':v0,'unanimous-bid-signature':v1,'joint-lot-mandate':v2,'share-conservation':v3,'exit-assignment-guard':v4,'replacement-member-approval':v5,'affiliate-rival-exclusion':v6,'joint-exposure':v7,'member-cap-certification':v8,'dissolution-settlement':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('member not signer', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('outsider signs', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'c'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('overassigned award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 4, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('existing replacement', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'a', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('all signed', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'b'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('outsider representative', {'members': ['a', 'b'], 'representative': 'c', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('single lot mandate', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [True, True, True, True, True]), ('unallocated award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 6, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': 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))['joint-lot-mandate'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x):
    v0 = x["representative"] in x["members"]
    v1 = set(x["members"])<=set(x["signers"])
    v2 = all(bool(set(x["lots"])&set(x["approved_lots"].get(m,[]))) for m in x["members"])
    v3 = sum(x["shares"].get(m,0) for m in x["members"])==x["award"]
    v4 = all(x["shares"].get(m,0)==0 for m in x["exits"])
    v5 = x["replacement"] in x["approved_members"] and x["replacement"] not in x["members"]
    v6 = not any(set(x["affiliates"].get(m,[]))&set(x["rivals"]) for m in x["members"])
    v7 = {m:x["award"] if x["joint"] else x["shares"].get(m,0) for m in x["members"]}
    v8 = all(x["shares"].get(m,0)<=x["member_caps"].get(m,0) for m in x["members"])
    v9 = not x["dissolved"] and all(x["payments"].get(m,0)>=x["required"].get(m,0) for m in x["members"])
    return {'representative-membership':v0,'unanimous-bid-signature':v1,'joint-lot-mandate':v2,'share-conservation':v3,'exit-assignment-guard':v4,'replacement-member-approval':v5,'affiliate-rival-exclusion':v6,'joint-exposure':v7,'member-cap-certification':v8,'dissolution-settlement':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('member not signer', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('outsider signs', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'c'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('overassigned award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 4, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('existing replacement', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'a', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('all signed', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'b'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('outsider representative', {'members': ['a', 'b'], 'representative': 'c', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('single lot mandate', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [True, True, True, True, True]), ('unallocated award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 6, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': 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))['joint-lot-mandate'], 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:
One member mandate authorizes lots not approved by the others.

A consortium submits one joint bid with named members and a designated representative. Member approvals are scope-specific. Award shares are literal integer units, member exits cannot strand assigned units, and affiliate conflicts are checked against both consortiums. Named decision joint-lot-mandate: For joint lot mandate, apply the stipulated decision all(set(x["lots"])<=set(x["approved_lots"].get(m,[])) for m in x["members"]).

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = x["representative"] in x["members"]
    v1 = set(x["members"])<=set(x["signers"])
    v2 = all(set(x["lots"])<=set(x["approved_lots"].get(m,[])) for m in x["members"])
    v3 = sum(x["shares"].values())<=x["award"]
    v4 = all(x["shares"].get(m,0)==0 for m in x["exits"])
    v5 = x["replacement"] in x["approved_members"] and x["replacement"] not in x["members"]
    v6 = not any(set(x["affiliates"].get(m,[]))&set(x["rivals"]) for m in x["members"])
    v7 = {m:x["award"] if x["joint"] else x["shares"].get(m,0) for m in x["members"]}
    v8 = all(x["shares"].get(m,0)<=x["member_caps"].get(m,0) for m in x["members"])
    v9 = not x["dissolved"] and all(x["payments"].get(m,0)>=x["required"].get(m,0) for m in x["members"])
    return {'representative-membership':v0,'unanimous-bid-signature':v1,'joint-lot-mandate':v2,'share-conservation':v3,'exit-assignment-guard':v4,'replacement-member-approval':v5,'affiliate-rival-exclusion':v6,'joint-exposure':v7,'member-cap-certification':v8,'dissolution-settlement':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('unallocated award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 6, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('member not signer / unallocated award', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 6, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('overassigned award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 4, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('member not signer / overassigned award', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 4, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('normal contract', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [True, True, True, True, True]), ('member not signer', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [True, True, True, True, True]), ('outsider signs', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'c'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [True, True, True, True, True]), ('existing replacement', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'a', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [True, True, True, True, True]), ('all signed', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'b'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [True, True, True, True, True]), ('outsider representative', {'members': ['a', 'b'], 'representative': 'c', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [True, True, True, True, True]), ('single lot mandate', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [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))['share-conservation'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(x):
    v0 = x["representative"] in x["members"]
    v1 = set(x["members"])<=set(x["signers"])
    v2 = all(set(x["lots"])<=set(x["approved_lots"].get(m,[])) for m in x["members"])
    v3 = sum(x["shares"].values())>=x["award"]
    v4 = all(x["shares"].get(m,0)==0 for m in x["exits"])
    v5 = x["replacement"] in x["approved_members"] and x["replacement"] not in x["members"]
    v6 = not any(set(x["affiliates"].get(m,[]))&set(x["rivals"]) for m in x["members"])
    v7 = {m:x["award"] if x["joint"] else x["shares"].get(m,0) for m in x["members"]}
    v8 = all(x["shares"].get(m,0)<=x["member_caps"].get(m,0) for m in x["members"])
    v9 = not x["dissolved"] and all(x["payments"].get(m,0)>=x["required"].get(m,0) for m in x["members"])
    return {'representative-membership':v0,'unanimous-bid-signature':v1,'joint-lot-mandate':v2,'share-conservation':v3,'exit-assignment-guard':v4,'replacement-member-approval':v5,'affiliate-rival-exclusion':v6,'joint-exposure':v7,'member-cap-certification':v8,'dissolution-settlement':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('unallocated award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 6, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('member not signer / unallocated award', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 6, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('overassigned award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 4, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('member not signer / overassigned award', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 4, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('normal contract', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [True, True, True, True, True]), ('member not signer', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [True, True, True, True, True]), ('outsider signs', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'c'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [True, True, True, True, True]), ('existing replacement', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'a', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [True, True, True, True, True]), ('all signed', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'b'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [True, True, True, True, True]), ('outsider representative', {'members': ['a', 'b'], 'representative': 'c', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [True, True, True, True, True]), ('single lot mandate', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [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))['share-conservation'], 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:
Consortium award shares leave units unassigned or overassigned.

A consortium submits one joint bid with named members and a designated representative. Member approvals are scope-specific. Award shares are literal integer units, member exits cannot strand assigned units, and affiliate conflicts are checked against both consortiums. Named decision share-conservation: For share conservation, apply the stipulated decision sum(x["shares"].get(m,0) for m in x["members"])==x["award"].

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = x["representative"] in x["members"]
    v1 = set(x["members"])<=set(x["signers"])
    v2 = all(set(x["lots"])<=set(x["approved_lots"].get(m,[])) for m in x["members"])
    v3 = sum(x["shares"].get(m,0) for m in x["members"])==x["award"]
    v4 = True
    v5 = x["replacement"] in x["approved_members"] and x["replacement"] not in x["members"]
    v6 = not any(set(x["affiliates"].get(m,[]))&set(x["rivals"]) for m in x["members"])
    v7 = {m:x["award"] if x["joint"] else x["shares"].get(m,0) for m in x["members"]}
    v8 = all(x["shares"].get(m,0)<=x["member_caps"].get(m,0) for m in x["members"])
    v9 = not x["dissolved"] and all(x["payments"].get(m,0)>=x["required"].get(m,0) for m in x["members"])
    return {'representative-membership':v0,'unanimous-bid-signature':v1,'joint-lot-mandate':v2,'share-conservation':v3,'exit-assignment-guard':v4,'replacement-member-approval':v5,'affiliate-rival-exclusion':v6,'joint-exposure':v7,'member-cap-certification':v8,'dissolution-settlement':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('member not signer', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('exit no shares', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 5, 'b': 0}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [True, True, True, True, True]), ('member not signer / exit no shares', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 5, 'b': 0}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [True, True, True, True, True]), ('outsider signs', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'c'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('overassigned award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 4, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('existing replacement', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'a', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('all signed', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'b'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('outsider representative', {'members': ['a', 'b'], 'representative': 'c', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('single lot mandate', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('unallocated award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 6, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': 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))['exit-assignment-guard'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x):
    v0 = x["representative"] in x["members"]
    v1 = set(x["members"])<=set(x["signers"])
    v2 = all(set(x["lots"])<=set(x["approved_lots"].get(m,[])) for m in x["members"])
    v3 = sum(x["shares"].get(m,0) for m in x["members"])==x["award"]
    v4 = not x["exits"]
    v5 = x["replacement"] in x["approved_members"] and x["replacement"] not in x["members"]
    v6 = not any(set(x["affiliates"].get(m,[]))&set(x["rivals"]) for m in x["members"])
    v7 = {m:x["award"] if x["joint"] else x["shares"].get(m,0) for m in x["members"]}
    v8 = all(x["shares"].get(m,0)<=x["member_caps"].get(m,0) for m in x["members"])
    v9 = not x["dissolved"] and all(x["payments"].get(m,0)>=x["required"].get(m,0) for m in x["members"])
    return {'representative-membership':v0,'unanimous-bid-signature':v1,'joint-lot-mandate':v2,'share-conservation':v3,'exit-assignment-guard':v4,'replacement-member-approval':v5,'affiliate-rival-exclusion':v6,'joint-exposure':v7,'member-cap-certification':v8,'dissolution-settlement':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('member not signer', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('exit no shares', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 5, 'b': 0}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [True, True, True, True, True]), ('member not signer / exit no shares', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 5, 'b': 0}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [True, True, True, True, True]), ('outsider signs', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'c'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('overassigned award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 4, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('existing replacement', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'a', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('all signed', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'b'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('outsider representative', {'members': ['a', 'b'], 'representative': 'c', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('single lot mandate', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('unallocated award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 6, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': 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))['exit-assignment-guard'], 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 consortium member exits while still holding an award allocation.

A consortium submits one joint bid with named members and a designated representative. Member approvals are scope-specific. Award shares are literal integer units, member exits cannot strand assigned units, and affiliate conflicts are checked against both consortiums. Named decision exit-assignment-guard: For exit assignment guard, apply the stipulated decision all(x["shares"].get(m,0)==0 for m in x["exits"]).

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = x["representative"] in x["members"]
    v1 = set(x["members"])<=set(x["signers"])
    v2 = all(set(x["lots"])<=set(x["approved_lots"].get(m,[])) for m in x["members"])
    v3 = sum(x["shares"].get(m,0) for m in x["members"])==x["award"]
    v4 = all(x["shares"].get(m,0)==0 for m in x["exits"])
    v5 = x["replacement"] not in x["members"]
    v6 = not any(set(x["affiliates"].get(m,[]))&set(x["rivals"]) for m in x["members"])
    v7 = {m:x["award"] if x["joint"] else x["shares"].get(m,0) for m in x["members"]}
    v8 = all(x["shares"].get(m,0)<=x["member_caps"].get(m,0) for m in x["members"])
    v9 = not x["dissolved"] and all(x["payments"].get(m,0)>=x["required"].get(m,0) for m in x["members"])
    return {'representative-membership':v0,'unanimous-bid-signature':v1,'joint-lot-mandate':v2,'share-conservation':v3,'exit-assignment-guard':v4,'replacement-member-approval':v5,'affiliate-rival-exclusion':v6,'joint-exposure':v7,'member-cap-certification':v8,'dissolution-settlement':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('member not signer', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('existing replacement', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'a', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('member not signer / existing replacement', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'a', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('outsider signs', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'c'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('overassigned award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 4, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('all signed', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'b'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('outsider representative', {'members': ['a', 'b'], 'representative': 'c', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('single lot mandate', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('unallocated award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 6, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': 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))['replacement-member-approval'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x):
    v0 = x["representative"] in x["members"]
    v1 = set(x["members"])<=set(x["signers"])
    v2 = all(set(x["lots"])<=set(x["approved_lots"].get(m,[])) for m in x["members"])
    v3 = sum(x["shares"].get(m,0) for m in x["members"])==x["award"]
    v4 = all(x["shares"].get(m,0)==0 for m in x["exits"])
    v5 = x["replacement"] in x["approved_members"]
    v6 = not any(set(x["affiliates"].get(m,[]))&set(x["rivals"]) for m in x["members"])
    v7 = {m:x["award"] if x["joint"] else x["shares"].get(m,0) for m in x["members"]}
    v8 = all(x["shares"].get(m,0)<=x["member_caps"].get(m,0) for m in x["members"])
    v9 = not x["dissolved"] and all(x["payments"].get(m,0)>=x["required"].get(m,0) for m in x["members"])
    return {'representative-membership':v0,'unanimous-bid-signature':v1,'joint-lot-mandate':v2,'share-conservation':v3,'exit-assignment-guard':v4,'replacement-member-approval':v5,'affiliate-rival-exclusion':v6,'joint-exposure':v7,'member-cap-certification':v8,'dissolution-settlement':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('member not signer', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('existing replacement', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'a', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('member not signer / existing replacement', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'a', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('outsider signs', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'c'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('overassigned award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 4, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('all signed', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'b'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('outsider representative', {'members': ['a', 'b'], 'representative': 'c', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('single lot mandate', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('unallocated award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 6, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': 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))['replacement-member-approval'], 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 existing or unapproved member is used as the replacement entrant.

A consortium submits one joint bid with named members and a designated representative. Member approvals are scope-specific. Award shares are literal integer units, member exits cannot strand assigned units, and affiliate conflicts are checked against both consortiums. Named decision replacement-member-approval: For replacement member approval, apply the stipulated decision x["replacement"] in x["approved_members"] and x["replacement"] not in x["members"].

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = x["representative"] in x["members"]
    v1 = set(x["members"])<=set(x["signers"])
    v2 = all(set(x["lots"])<=set(x["approved_lots"].get(m,[])) for m in x["members"])
    v3 = sum(x["shares"].get(m,0) for m in x["members"])==x["award"]
    v4 = all(x["shares"].get(m,0)==0 for m in x["exits"])
    v5 = x["replacement"] in x["approved_members"] and x["replacement"] not in x["members"]
    v6 = not set(x["members"])&set(x["rivals"])
    v7 = {m:x["award"] if x["joint"] else x["shares"].get(m,0) for m in x["members"]}
    v8 = all(x["shares"].get(m,0)<=x["member_caps"].get(m,0) for m in x["members"])
    v9 = not x["dissolved"] and all(x["payments"].get(m,0)>=x["required"].get(m,0) for m in x["members"])
    return {'representative-membership':v0,'unanimous-bid-signature':v1,'joint-lot-mandate':v2,'share-conservation':v3,'exit-assignment-guard':v4,'replacement-member-approval':v5,'affiliate-rival-exclusion':v6,'joint-exposure':v7,'member-cap-certification':v8,'dissolution-settlement':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('member not signer', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('outsider signs', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'c'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('overassigned award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 4, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('existing replacement', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'a', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('all signed', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'b'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('outsider representative', {'members': ['a', 'b'], 'representative': 'c', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('single lot mandate', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('unallocated award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 6, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': 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))['affiliate-rival-exclusion'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x):
    v0 = x["representative"] in x["members"]
    v1 = set(x["members"])<=set(x["signers"])
    v2 = all(set(x["lots"])<=set(x["approved_lots"].get(m,[])) for m in x["members"])
    v3 = sum(x["shares"].get(m,0) for m in x["members"])==x["award"]
    v4 = all(x["shares"].get(m,0)==0 for m in x["exits"])
    v5 = x["replacement"] in x["approved_members"] and x["replacement"] not in x["members"]
    v6 = not set(x["affiliates"].get(x["representative"],[]))&set(x["rivals"])
    v7 = {m:x["award"] if x["joint"] else x["shares"].get(m,0) for m in x["members"]}
    v8 = all(x["shares"].get(m,0)<=x["member_caps"].get(m,0) for m in x["members"])
    v9 = not x["dissolved"] and all(x["payments"].get(m,0)>=x["required"].get(m,0) for m in x["members"])
    return {'representative-membership':v0,'unanimous-bid-signature':v1,'joint-lot-mandate':v2,'share-conservation':v3,'exit-assignment-guard':v4,'replacement-member-approval':v5,'affiliate-rival-exclusion':v6,'joint-exposure':v7,'member-cap-certification':v8,'dissolution-settlement':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('member not signer', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('outsider signs', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'c'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('overassigned award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 4, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('existing replacement', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'a', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('all signed', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'b'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('outsider representative', {'members': ['a', 'b'], 'representative': 'c', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('single lot mandate', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [False, False, False, False, False]), ('unallocated award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 6, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': 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))['affiliate-rival-exclusion'], 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:
Affiliate conflicts of a nonrepresentative member escape review.

A consortium submits one joint bid with named members and a designated representative. Member approvals are scope-specific. Award shares are literal integer units, member exits cannot strand assigned units, and affiliate conflicts are checked against both consortiums. Named decision affiliate-rival-exclusion: For affiliate rival exclusion, apply the stipulated decision not any(set(x["affiliates"].get(m,[]))&set(x["rivals"]) for m in x["members"]).

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = x["representative"] in x["members"]
    v1 = set(x["members"])<=set(x["signers"])
    v2 = all(set(x["lots"])<=set(x["approved_lots"].get(m,[])) for m in x["members"])
    v3 = sum(x["shares"].get(m,0) for m in x["members"])==x["award"]
    v4 = all(x["shares"].get(m,0)==0 for m in x["exits"])
    v5 = x["replacement"] in x["approved_members"] and x["replacement"] not in x["members"]
    v6 = not any(set(x["affiliates"].get(m,[]))&set(x["rivals"]) for m in x["members"])
    v7 = x["shares"]
    v8 = all(x["shares"].get(m,0)<=x["member_caps"].get(m,0) for m in x["members"])
    v9 = not x["dissolved"] and all(x["payments"].get(m,0)>=x["required"].get(m,0) for m in x["members"])
    return {'representative-membership':v0,'unanimous-bid-signature':v1,'joint-lot-mandate':v2,'share-conservation':v3,'exit-assignment-guard':v4,'replacement-member-approval':v5,'affiliate-rival-exclusion':v6,'joint-exposure':v7,'member-cap-certification':v8,'dissolution-settlement':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 5, 'b': 5}, {'a': 10, 'b': 10}, {'a': 15, 'b': 15}, {'a': 20, 'b': 20}, {'a': 25, 'b': 25}]), ('member not signer', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 5, 'b': 5}, {'a': 10, 'b': 10}, {'a': 15, 'b': 15}, {'a': 20, 'b': 20}, {'a': 25, 'b': 25}]), ('several liabilities', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': False, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 3, 'b': 2}, {'a': 6, 'b': 4}, {'a': 9, 'b': 6}, {'a': 12, 'b': 8}, {'a': 15, 'b': 10}]), ('member not signer / several liabilities', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': False, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 3, 'b': 2}, {'a': 6, 'b': 4}, {'a': 9, 'b': 6}, {'a': 12, 'b': 8}, {'a': 15, 'b': 10}]), ('outsider signs', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'c'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 5, 'b': 5}, {'a': 10, 'b': 10}, {'a': 15, 'b': 15}, {'a': 20, 'b': 20}, {'a': 25, 'b': 25}]), ('overassigned award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 4, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 4, 'b': 4}, {'a': 8, 'b': 8}, {'a': 12, 'b': 12}, {'a': 16, 'b': 16}, {'a': 20, 'b': 20}]), ('existing replacement', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'a', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 5, 'b': 5}, {'a': 10, 'b': 10}, {'a': 15, 'b': 15}, {'a': 20, 'b': 20}, {'a': 25, 'b': 25}]), ('all signed', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'b'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 5, 'b': 5}, {'a': 10, 'b': 10}, {'a': 15, 'b': 15}, {'a': 20, 'b': 20}, {'a': 25, 'b': 25}]), ('outsider representative', {'members': ['a', 'b'], 'representative': 'c', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 5, 'b': 5}, {'a': 10, 'b': 10}, {'a': 15, 'b': 15}, {'a': 20, 'b': 20}, {'a': 25, 'b': 25}]), ('single lot mandate', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 5, 'b': 5}, {'a': 10, 'b': 10}, {'a': 15, 'b': 15}, {'a': 20, 'b': 20}, {'a': 25, 'b': 25}]), ('unallocated award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 6, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 6, 'b': 6}, {'a': 12, 'b': 12}, {'a': 18, 'b': 18}, {'a': 24, 'b': 24}, {'a': 30, 'b': 30}])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['joint-exposure'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x):
    v0 = x["representative"] in x["members"]
    v1 = set(x["members"])<=set(x["signers"])
    v2 = all(set(x["lots"])<=set(x["approved_lots"].get(m,[])) for m in x["members"])
    v3 = sum(x["shares"].get(m,0) for m in x["members"])==x["award"]
    v4 = all(x["shares"].get(m,0)==0 for m in x["exits"])
    v5 = x["replacement"] in x["approved_members"] and x["replacement"] not in x["members"]
    v6 = not any(set(x["affiliates"].get(m,[]))&set(x["rivals"]) for m in x["members"])
    v7 = {m:x["award"] for m in x["members"]}
    v8 = all(x["shares"].get(m,0)<=x["member_caps"].get(m,0) for m in x["members"])
    v9 = not x["dissolved"] and all(x["payments"].get(m,0)>=x["required"].get(m,0) for m in x["members"])
    return {'representative-membership':v0,'unanimous-bid-signature':v1,'joint-lot-mandate':v2,'share-conservation':v3,'exit-assignment-guard':v4,'replacement-member-approval':v5,'affiliate-rival-exclusion':v6,'joint-exposure':v7,'member-cap-certification':v8,'dissolution-settlement':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 5, 'b': 5}, {'a': 10, 'b': 10}, {'a': 15, 'b': 15}, {'a': 20, 'b': 20}, {'a': 25, 'b': 25}]), ('member not signer', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 5, 'b': 5}, {'a': 10, 'b': 10}, {'a': 15, 'b': 15}, {'a': 20, 'b': 20}, {'a': 25, 'b': 25}]), ('several liabilities', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': False, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 3, 'b': 2}, {'a': 6, 'b': 4}, {'a': 9, 'b': 6}, {'a': 12, 'b': 8}, {'a': 15, 'b': 10}]), ('member not signer / several liabilities', {'members': ['a', 'b'], 'representative': 'b', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': False, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 3, 'b': 2}, {'a': 6, 'b': 4}, {'a': 9, 'b': 6}, {'a': 12, 'b': 8}, {'a': 15, 'b': 10}]), ('outsider signs', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'c'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 5, 'b': 5}, {'a': 10, 'b': 10}, {'a': 15, 'b': 15}, {'a': 20, 'b': 20}, {'a': 25, 'b': 25}]), ('overassigned award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 4, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 4, 'b': 4}, {'a': 8, 'b': 8}, {'a': 12, 'b': 12}, {'a': 16, 'b': 16}, {'a': 20, 'b': 20}]), ('existing replacement', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'a', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 5, 'b': 5}, {'a': 10, 'b': 10}, {'a': 15, 'b': 15}, {'a': 20, 'b': 20}, {'a': 25, 'b': 25}]), ('all signed', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a', 'b'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 5, 'b': 5}, {'a': 10, 'b': 10}, {'a': 15, 'b': 15}, {'a': 20, 'b': 20}, {'a': 25, 'b': 25}]), ('outsider representative', {'members': ['a', 'b'], 'representative': 'c', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 5, 'b': 5}, {'a': 10, 'b': 10}, {'a': 15, 'b': 15}, {'a': 20, 'b': 20}, {'a': 25, 'b': 25}]), ('single lot mandate', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1'], 'shares': {'a': 3, 'b': 2}, 'award': 5, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 5, 'b': 5}, {'a': 10, 'b': 10}, {'a': 15, 'b': 15}, {'a': 20, 'b': 20}, {'a': 25, 'b': 25}]), ('unallocated award', {'members': ['a', 'b'], 'representative': 'a', 'signers': ['a'], 'approved_lots': {'a': ['L1', 'L2'], 'b': ['L1']}, 'lots': ['L1', 'L2'], 'shares': {'a': 3, 'b': 2}, 'award': 6, 'exits': ['b'], 'replacement': 'c', 'approved_members': ['a', 'b'], 'affiliates': {'a': ['x'], 'b': ['y']}, 'rivals': ['y'], 'joint': True, 'member_caps': {'a': 4, 'b': 3}, 'payments': {'a': 3, 'b': 1}, 'required': {'a': 3, 'b': 2}, 'dissolved': False}, [{'a': 6, 'b': 6}, {'a': 12, 'b': 12}, {'a': 18, 'b': 18}, {'a': 24, 'b': 24}, {'a': 30, 'b': 30}])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['joint-exposure'], 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:
Joint and several award obligations are interchanged.

A consortium submits one joint bid with named members and a designated representative. Member approvals are scope-specific. Award shares are literal integer units, member exits cannot strand assigned units, and affiliate conflicts are checked against both consortiums. Named decision joint-exposure: For joint exposure, apply the stipulated decision {m:x["award"] if x["joint"] else x["shares"].get(m,0) for m in x["members"]}.

split: open-access