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["certified"]
    v3 = x["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}, [5, 10, 15, 20, 25]), ('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}, [5, 10, 15, 20, 25]), ('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}, [3, 6, 9, 12, 15]), ('unrelated rejection / small award', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['optional'], '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}, [3, 6, 9, 12, 15]), ('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}, [5, 10, 15, 20, 25]), ('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}, [5, 10, 15, 20, 25]), ('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}, [5, 10, 15, 20, 25]), ('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}, [5, 10, 15, 20, 25]), ('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}, [5, 10, 15, 20, 25]), ('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}, [5, 10, 15, 20, 25])]
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))['qualified-volume'], 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 = x["requested_category"] in x["certified"]
    v3 = 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}, [5, 10, 15, 20, 25]), ('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}, [5, 10, 15, 20, 25]), ('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}, [3, 6, 9, 12, 15]), ('unrelated rejection / small award', {'required': ['identity', 'capacity'], 'submitted': ['identity'], 'approved': ['identity'], 'rejected': ['optional'], '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}, [3, 6, 9, 12, 15]), ('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}, [5, 10, 15, 20, 25]), ('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}, [5, 10, 15, 20, 25]), ('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}, [5, 10, 15, 20, 25]), ('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}, [5, 10, 15, 20, 25]), ('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}, [5, 10, 15, 20, 25]), ('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}, [5, 10, 15, 20, 25])]
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))['qualified-volume'], 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:
The bidder maximum qualification volume replaces actual requested award volume.

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 qualified-volume: For qualified volume, apply the stipulated decision min(x["volume"],x["qualified_volume"]).

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["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 = [('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]), ('unrelated rejection / qualification expired', {'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': 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]), ('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}, [True, True, True, True, True]), ('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]), ('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}, [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}, [True, True, True, True, True]), ('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}, [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}, [True, True, True, True, True]), ('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}, [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))['qualification-validity'], 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 = set(x["required"])<=set(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 = [('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]), ('unrelated rejection / qualification expired', {'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': 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]), ('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}, [True, True, True, True, True]), ('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]), ('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}, [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}, [True, True, True, True, True]), ('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}, [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}, [True, True, True, True, True]), ('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}, [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))['qualification-validity'], 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 qualification remains bid-eligible at its expiration tick.

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 qualification-validity: For qualification validity, apply the stipulated decision x["now"]<x["expires"].

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["certified"]
    v3 = min(x["volume"],x["qualified_volume"])
    v4 = x["now"]<x["expires"]
    v5 = 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 = [('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]), ('unrelated rejection / suspended bidder', {'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': 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]), ('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]), ('unrelated rejection / qualification expired', {'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': 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]), ('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}, [True, True, True, True, True]), ('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]), ('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}, [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}, [True, True, True, True, True]), ('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}, [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}, [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))['suspension-bid-gate'], 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 = x["requested_category"] in x["certified"]
    v3 = min(x["volume"],x["qualified_volume"])
    v4 = x["now"]<x["expires"]
    v5 = not x["suspended"]
    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 = [('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]), ('unrelated rejection / suspended bidder', {'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': 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]), ('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]), ('unrelated rejection / qualification expired', {'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': 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]), ('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}, [True, True, True, True, True]), ('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]), ('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}, [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}, [True, True, True, True, True]), ('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}, [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}, [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))['suspension-bid-gate'], 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:
Suspended or expired qualification still admits a new offer.

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 suspension-bid-gate: For suspension bid gate, apply the stipulated decision not x["suspended"] and x["now"]<x["expires"].

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["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"] and not x["suspended"]
    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 = [('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}, [True, True, True, True, True]), ('unrelated rejection / suspended bidder', {'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': True, '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]), ('appeal absent', {'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': False, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('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}, [True, True, True, True, True]), ('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]), ('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}, [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}, [True, True, True, True, True]), ('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}, [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}, [True, True, True, True, True]), ('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}, [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))['appeal-during-suspension'], 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 = 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 = not x["suspended"]
    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 = [('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}, [True, True, True, True, True]), ('unrelated rejection / suspended bidder', {'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': True, '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]), ('appeal absent', {'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': False, 'stage': 'review', 'completed': ['application'], 'sequence': ['application', 'review', 'admission'], 'evidence_revision': 2, 'reviewed_revision': 1, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('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}, [True, True, True, True, True]), ('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]), ('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}, [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}, [True, True, True, True, True]), ('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}, [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}, [True, True, True, True, True]), ('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}, [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))['appeal-during-suspension'], 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:
Suspension incorrectly extinguishes the bidder pending appeal right.

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 appeal-during-suspension: For appeal during suspension, apply the stipulated decision x["appeal"].

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["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 = x["stage"] in x["completed"]
    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}, [True, True, True, True, True]), ('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]), ('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 / 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}, [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}, [True, True, True, True, True]), ('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}, [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}, [True, True, True, True, True]), ('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}, [True, True, True, True, True]), ('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}, [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))['preceding-stage-certification'], 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 = 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 = bool(x["completed"])
    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}, [True, True, True, True, True]), ('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]), ('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 / 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}, [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}, [True, True, True, True, True]), ('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}, [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}, [True, True, True, True, True]), ('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}, [True, True, True, True, True]), ('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}, [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))['preceding-stage-certification'], 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 qualification stage skips unfinished earlier stages.

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 preceding-stage-certification: For preceding stage certification, apply the stipulated decision all(s in x["completed"] for s in x["sequence"][:x["sequence"].index(x["stage"])]).

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["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["reviewed_revision"]<=x["evidence_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]), ('future evidence', {'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': 3, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('unrelated rejection / future evidence', {'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': 3, '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}, [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))['reviewed-evidence-revision'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x):
    v0 = set(x["required"])<=set(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["reviewed_revision"]>=x["evidence_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]), ('future evidence', {'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': 3, 'conditional': True, 'conditions_met': False}, [False, False, False, False, False]), ('unrelated rejection / future evidence', {'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': 3, '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}, [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))['reviewed-evidence-revision'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A review of older evidence approves the amended qualification packet.

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 reviewed-evidence-revision: For reviewed evidence revision, apply the stipulated decision x["evidence_revision"]==x["reviewed_revision"].

split: open-access