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

N = 1
observations = []
def solve(x):
    v0 = sum(x["points"][i] for i in set(x["active"])-set(x["withdrawn"]))
    v1 = sum(x["points"][i] for i in x["active"]+x["standing"])
    v2 = x["use_waiver"] and x["waivers"]>0
    v3 = x["waivers"]-int(x["use_waiver"] and x["waivers"]>0)
    v4 = min(x["previous"],sum(x["points"][i] for i in x["active"]))
    v5 = x["previous"] if x["use_waiver"] and x["waivers"]>0 else min(x["previous"],x["required"])
    v6 = x["history"] if x["round"]<=x["last_round"] else x["history"]+[x["previous"]]
    v7 = min(x["previous"],x["stage_limits"][min(x["stage"],len(x["stage_limits"])-1)])
    v8 = min(x["qualification"],x["previous"]+x["transferred"])
    v9 = 0 if x["revoked"] else min(x["previous"],x["qualification"])
    return {'withdrawn-activity':v0,'standing-credit-dedup':v1,'waiver-availability':v2,'waiver-consumption':v3,'eligibility-monotonicity':v4,'waiver-preservation':v5,'round-advance':v6,'stage-ceiling':v7,'transfer-cap':v8,'revocation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('standing overlaps activity', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['A'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('waiver round / standing overlaps activity', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['A'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('normal contract', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [6, 12, 18, 24, 30]), ('waiver round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [6, 12, 18, 24, 30]), ('no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [6, 12, 18, 24, 30]), ('all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [6, 12, 18, 24, 30]), ('replayed round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 1, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [6, 12, 18, 24, 30]), ('stage entry', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 0, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [6, 12, 18, 24, 30]), ('small qualification', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 2, 'transferred': 2, 'revoked': False}, [6, 12, 18, 24, 30]), ('qualification revoked', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': True}, [6, 12, 18, 24, 30])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['standing-credit-dedup'], 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 = sum(x["points"][i] for i in set(x["active"])-set(x["withdrawn"]))
    v1 = sum(x["points"][i] for i in set(x["active"])&set(x["standing"]))
    v2 = x["use_waiver"] and x["waivers"]>0
    v3 = x["waivers"]-int(x["use_waiver"] and x["waivers"]>0)
    v4 = min(x["previous"],sum(x["points"][i] for i in x["active"]))
    v5 = x["previous"] if x["use_waiver"] and x["waivers"]>0 else min(x["previous"],x["required"])
    v6 = x["history"] if x["round"]<=x["last_round"] else x["history"]+[x["previous"]]
    v7 = min(x["previous"],x["stage_limits"][min(x["stage"],len(x["stage_limits"])-1)])
    v8 = min(x["qualification"],x["previous"]+x["transferred"])
    v9 = 0 if x["revoked"] else min(x["previous"],x["qualification"])
    return {'withdrawn-activity':v0,'standing-credit-dedup':v1,'waiver-availability':v2,'waiver-consumption':v3,'eligibility-monotonicity':v4,'waiver-preservation':v5,'round-advance':v6,'stage-ceiling':v7,'transfer-cap':v8,'revocation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('standing overlaps activity', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['A'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('waiver round / standing overlaps activity', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['A'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('normal contract', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [6, 12, 18, 24, 30]), ('waiver round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [6, 12, 18, 24, 30]), ('no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [6, 12, 18, 24, 30]), ('all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [6, 12, 18, 24, 30]), ('replayed round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 1, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [6, 12, 18, 24, 30]), ('stage entry', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 0, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [6, 12, 18, 24, 30]), ('small qualification', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 2, 'transferred': 2, 'revoked': False}, [6, 12, 18, 24, 30]), ('qualification revoked', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': True}, [6, 12, 18, 24, 30])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['standing-credit-dedup'], 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:
Standing and new demand double-credit one lot.

A stipulated ascending multiround auction records eligibility in activity points. Submitted lots contribute fixed points, withdrawn lots contribute none, a waiver preserves previous eligibility once, and frozen eligibility cannot grow. These rules are pedagogical and independent of real spectrum-auction regulations. Named decision standing-credit-dedup: Credit the union of active and standing lot identities.

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = sum(x["points"][i] for i in set(x["active"])-set(x["withdrawn"]))
    v1 = sum(x["points"][i] for i in set(x["active"])|set(x["standing"]))
    v2 = x["use_waiver"]
    v3 = x["waivers"]-int(x["use_waiver"] and x["waivers"]>0)
    v4 = min(x["previous"],sum(x["points"][i] for i in x["active"]))
    v5 = x["previous"] if x["use_waiver"] and x["waivers"]>0 else min(x["previous"],x["required"])
    v6 = x["history"] if x["round"]<=x["last_round"] else x["history"]+[x["previous"]]
    v7 = min(x["previous"],x["stage_limits"][min(x["stage"],len(x["stage_limits"])-1)])
    v8 = min(x["qualification"],x["previous"]+x["transferred"])
    v9 = 0 if x["revoked"] else min(x["previous"],x["qualification"])
    return {'withdrawn-activity':v0,'standing-credit-dedup':v1,'waiver-availability':v2,'waiver-consumption':v3,'eligibility-monotonicity':v4,'waiver-preservation':v5,'round-advance':v6,'stage-ceiling':v7,'transfer-cap':v8,'revocation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [False, False, False, False, False]), ('waiver round / no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [False, False, False, False, False]), ('normal contract', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [False, False, False, False, False]), ('all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [False, False, False, False, False]), ('waiver round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [True, True, True, True, True]), ('standing overlaps activity', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['A'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [False, False, False, False, False]), ('replayed round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 1, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [False, False, False, False, False]), ('stage entry', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 0, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [False, False, False, False, False]), ('small qualification', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 2, 'transferred': 2, 'revoked': False}, [False, False, False, False, False]), ('qualification revoked', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': True}, [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))['waiver-availability'], 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 = sum(x["points"][i] for i in set(x["active"])-set(x["withdrawn"]))
    v1 = sum(x["points"][i] for i in set(x["active"])|set(x["standing"]))
    v2 = x["waivers"]>0
    v3 = x["waivers"]-int(x["use_waiver"] and x["waivers"]>0)
    v4 = min(x["previous"],sum(x["points"][i] for i in x["active"]))
    v5 = x["previous"] if x["use_waiver"] and x["waivers"]>0 else min(x["previous"],x["required"])
    v6 = x["history"] if x["round"]<=x["last_round"] else x["history"]+[x["previous"]]
    v7 = min(x["previous"],x["stage_limits"][min(x["stage"],len(x["stage_limits"])-1)])
    v8 = min(x["qualification"],x["previous"]+x["transferred"])
    v9 = 0 if x["revoked"] else min(x["previous"],x["qualification"])
    return {'withdrawn-activity':v0,'standing-credit-dedup':v1,'waiver-availability':v2,'waiver-consumption':v3,'eligibility-monotonicity':v4,'waiver-preservation':v5,'round-advance':v6,'stage-ceiling':v7,'transfer-cap':v8,'revocation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [False, False, False, False, False]), ('waiver round / no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [False, False, False, False, False]), ('normal contract', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [False, False, False, False, False]), ('all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [False, False, False, False, False]), ('waiver round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [True, True, True, True, True]), ('standing overlaps activity', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['A'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [False, False, False, False, False]), ('replayed round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 1, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [False, False, False, False, False]), ('stage entry', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 0, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [False, False, False, False, False]), ('small qualification', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 2, 'transferred': 2, 'revoked': False}, [False, False, False, False, False]), ('qualification revoked', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': True}, [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))['waiver-availability'], expected[N-1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
An exhausted or unrequested waiver becomes effective.

A stipulated ascending multiround auction records eligibility in activity points. Submitted lots contribute fixed points, withdrawn lots contribute none, a waiver preserves previous eligibility once, and frozen eligibility cannot grow. These rules are pedagogical and independent of real spectrum-auction regulations. Named decision waiver-availability: A waiver is effective only if requested with positive balance.

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = sum(x["points"][i] for i in set(x["active"])-set(x["withdrawn"]))
    v1 = sum(x["points"][i] for i in set(x["active"])|set(x["standing"]))
    v2 = x["use_waiver"] and x["waivers"]>0
    v3 = x["waivers"]-int(x["use_waiver"])
    v4 = min(x["previous"],sum(x["points"][i] for i in x["active"]))
    v5 = x["previous"] if x["use_waiver"] and x["waivers"]>0 else min(x["previous"],x["required"])
    v6 = x["history"] if x["round"]<=x["last_round"] else x["history"]+[x["previous"]]
    v7 = min(x["previous"],x["stage_limits"][min(x["stage"],len(x["stage_limits"])-1)])
    v8 = min(x["qualification"],x["previous"]+x["transferred"])
    v9 = 0 if x["revoked"] else min(x["previous"],x["qualification"])
    return {'withdrawn-activity':v0,'standing-credit-dedup':v1,'waiver-availability':v2,'waiver-consumption':v3,'eligibility-monotonicity':v4,'waiver-preservation':v5,'round-advance':v6,'stage-ceiling':v7,'transfer-cap':v8,'revocation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [0, 0, 0, 0, 0]), ('waiver round / no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [0, 0, 0, 0, 0]), ('waiver round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [1, 3, 5, 7, 9]), ('waiver round / all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [1, 3, 5, 7, 9]), ('normal contract', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [2, 4, 6, 8, 10]), ('all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [2, 4, 6, 8, 10]), ('standing overlaps activity', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['A'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [2, 4, 6, 8, 10]), ('replayed round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 1, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [2, 4, 6, 8, 10]), ('stage entry', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 0, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [2, 4, 6, 8, 10]), ('small qualification', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 2, 'transferred': 2, 'revoked': False}, [2, 4, 6, 8, 10]), ('qualification revoked', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': True}, [2, 4, 6, 8, 10])]
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))['waiver-consumption'], 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 = sum(x["points"][i] for i in set(x["active"])-set(x["withdrawn"]))
    v1 = sum(x["points"][i] for i in set(x["active"])|set(x["standing"]))
    v2 = x["use_waiver"] and x["waivers"]>0
    v3 = x["waivers"]
    v4 = min(x["previous"],sum(x["points"][i] for i in x["active"]))
    v5 = x["previous"] if x["use_waiver"] and x["waivers"]>0 else min(x["previous"],x["required"])
    v6 = x["history"] if x["round"]<=x["last_round"] else x["history"]+[x["previous"]]
    v7 = min(x["previous"],x["stage_limits"][min(x["stage"],len(x["stage_limits"])-1)])
    v8 = min(x["qualification"],x["previous"]+x["transferred"])
    v9 = 0 if x["revoked"] else min(x["previous"],x["qualification"])
    return {'withdrawn-activity':v0,'standing-credit-dedup':v1,'waiver-availability':v2,'waiver-consumption':v3,'eligibility-monotonicity':v4,'waiver-preservation':v5,'round-advance':v6,'stage-ceiling':v7,'transfer-cap':v8,'revocation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [0, 0, 0, 0, 0]), ('waiver round / no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [0, 0, 0, 0, 0]), ('waiver round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [1, 3, 5, 7, 9]), ('waiver round / all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [1, 3, 5, 7, 9]), ('normal contract', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [2, 4, 6, 8, 10]), ('all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [2, 4, 6, 8, 10]), ('standing overlaps activity', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['A'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [2, 4, 6, 8, 10]), ('replayed round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 1, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [2, 4, 6, 8, 10]), ('stage entry', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 0, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [2, 4, 6, 8, 10]), ('small qualification', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 2, 'transferred': 2, 'revoked': False}, [2, 4, 6, 8, 10]), ('qualification revoked', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': True}, [2, 4, 6, 8, 10])]
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))['waiver-consumption'], 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:
Waiver accounting can go negative or fail to consume a used waiver.

A stipulated ascending multiround auction records eligibility in activity points. Submitted lots contribute fixed points, withdrawn lots contribute none, a waiver preserves previous eligibility once, and frozen eligibility cannot grow. These rules are pedagogical and independent of real spectrum-auction regulations. Named decision waiver-consumption: Consume one available waiver exactly when used.

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = sum(x["points"][i] for i in set(x["active"])-set(x["withdrawn"]))
    v1 = sum(x["points"][i] for i in set(x["active"])|set(x["standing"]))
    v2 = x["use_waiver"] and x["waivers"]>0
    v3 = x["waivers"]-int(x["use_waiver"] and x["waivers"]>0)
    v4 = sum(x["points"][i] for i in x["active"])
    v5 = x["previous"] if x["use_waiver"] and x["waivers"]>0 else min(x["previous"],x["required"])
    v6 = x["history"] if x["round"]<=x["last_round"] else x["history"]+[x["previous"]]
    v7 = min(x["previous"],x["stage_limits"][min(x["stage"],len(x["stage_limits"])-1)])
    v8 = min(x["qualification"],x["previous"]+x["transferred"])
    v9 = 0 if x["revoked"] else min(x["previous"],x["qualification"])
    return {'withdrawn-activity':v0,'standing-credit-dedup':v1,'waiver-availability':v2,'waiver-consumption':v3,'eligibility-monotonicity':v4,'waiver-preservation':v5,'round-advance':v6,'stage-ceiling':v7,'transfer-cap':v8,'revocation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('late stage', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 3, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [3, 6, 9, 12, 15]), ('waiver round / late stage', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 3, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [3, 6, 9, 12, 15]), ('normal contract', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('waiver round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('standing overlaps activity', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['A'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('replayed round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 1, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('stage entry', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 0, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('small qualification', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 2, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('qualification revoked', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': True}, [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))['eligibility-monotonicity'], 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 = sum(x["points"][i] for i in set(x["active"])-set(x["withdrawn"]))
    v1 = sum(x["points"][i] for i in set(x["active"])|set(x["standing"]))
    v2 = x["use_waiver"] and x["waivers"]>0
    v3 = x["waivers"]-int(x["use_waiver"] and x["waivers"]>0)
    v4 = x["previous"]
    v5 = x["previous"] if x["use_waiver"] and x["waivers"]>0 else min(x["previous"],x["required"])
    v6 = x["history"] if x["round"]<=x["last_round"] else x["history"]+[x["previous"]]
    v7 = min(x["previous"],x["stage_limits"][min(x["stage"],len(x["stage_limits"])-1)])
    v8 = min(x["qualification"],x["previous"]+x["transferred"])
    v9 = 0 if x["revoked"] else min(x["previous"],x["qualification"])
    return {'withdrawn-activity':v0,'standing-credit-dedup':v1,'waiver-availability':v2,'waiver-consumption':v3,'eligibility-monotonicity':v4,'waiver-preservation':v5,'round-advance':v6,'stage-ceiling':v7,'transfer-cap':v8,'revocation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('late stage', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 3, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [3, 6, 9, 12, 15]), ('waiver round / late stage', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 3, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [3, 6, 9, 12, 15]), ('normal contract', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('waiver round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('standing overlaps activity', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['A'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('replayed round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 1, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('stage entry', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 0, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('small qualification', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 2, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('qualification revoked', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': True}, [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))['eligibility-monotonicity'], 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 new round restores eligibility that earlier inactivity removed.

A stipulated ascending multiround auction records eligibility in activity points. Submitted lots contribute fixed points, withdrawn lots contribute none, a waiver preserves previous eligibility once, and frozen eligibility cannot grow. These rules are pedagogical and independent of real spectrum-auction regulations. Named decision eligibility-monotonicity: Cap recalculated activity eligibility at its previous level.

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = sum(x["points"][i] for i in set(x["active"])-set(x["withdrawn"]))
    v1 = sum(x["points"][i] for i in set(x["active"])|set(x["standing"]))
    v2 = x["use_waiver"] and x["waivers"]>0
    v3 = x["waivers"]-int(x["use_waiver"] and x["waivers"]>0)
    v4 = min(x["previous"],sum(x["points"][i] for i in x["active"]))
    v5 = min(x["previous"],x["required"])
    v6 = x["history"] if x["round"]<=x["last_round"] else x["history"]+[x["previous"]]
    v7 = min(x["previous"],x["stage_limits"][min(x["stage"],len(x["stage_limits"])-1)])
    v8 = min(x["qualification"],x["previous"]+x["transferred"])
    v9 = 0 if x["revoked"] else min(x["previous"],x["qualification"])
    return {'withdrawn-activity':v0,'standing-credit-dedup':v1,'waiver-availability':v2,'waiver-consumption':v3,'eligibility-monotonicity':v4,'waiver-preservation':v5,'round-advance':v6,'stage-ceiling':v7,'transfer-cap':v8,'revocation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('waiver round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [8, 16, 24, 32, 40]), ('waiver round / all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [8, 16, 24, 32, 40]), ('no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('waiver round / no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('normal contract', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('standing overlaps activity', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['A'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('replayed round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 1, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('stage entry', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 0, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('small qualification', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 2, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('qualification revoked', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': True}, [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))['waiver-preservation'], 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 = sum(x["points"][i] for i in set(x["active"])-set(x["withdrawn"]))
    v1 = sum(x["points"][i] for i in set(x["active"])|set(x["standing"]))
    v2 = x["use_waiver"] and x["waivers"]>0
    v3 = x["waivers"]-int(x["use_waiver"] and x["waivers"]>0)
    v4 = min(x["previous"],sum(x["points"][i] for i in x["active"]))
    v5 = x["previous"] if x["use_waiver"] else min(x["previous"],x["required"])
    v6 = x["history"] if x["round"]<=x["last_round"] else x["history"]+[x["previous"]]
    v7 = min(x["previous"],x["stage_limits"][min(x["stage"],len(x["stage_limits"])-1)])
    v8 = min(x["qualification"],x["previous"]+x["transferred"])
    v9 = 0 if x["revoked"] else min(x["previous"],x["qualification"])
    return {'withdrawn-activity':v0,'standing-credit-dedup':v1,'waiver-availability':v2,'waiver-consumption':v3,'eligibility-monotonicity':v4,'waiver-preservation':v5,'round-advance':v6,'stage-ceiling':v7,'transfer-cap':v8,'revocation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('waiver round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [8, 16, 24, 32, 40]), ('waiver round / all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [8, 16, 24, 32, 40]), ('no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('waiver round / no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('normal contract', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('standing overlaps activity', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['A'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('replayed round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 1, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('stage entry', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 0, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('small qualification', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 2, 'transferred': 2, 'revoked': False}, [5, 10, 15, 20, 25]), ('qualification revoked', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': True}, [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))['waiver-preservation'], 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 valid waiver fails to preserve prior eligibility.

A stipulated ascending multiround auction records eligibility in activity points. Submitted lots contribute fixed points, withdrawn lots contribute none, a waiver preserves previous eligibility once, and frozen eligibility cannot grow. These rules are pedagogical and independent of real spectrum-auction regulations. Named decision waiver-preservation: Preserve eligibility for an available used waiver only.

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = sum(x["points"][i] for i in set(x["active"])-set(x["withdrawn"]))
    v1 = sum(x["points"][i] for i in set(x["active"])|set(x["standing"]))
    v2 = x["use_waiver"] and x["waivers"]>0
    v3 = x["waivers"]-int(x["use_waiver"] and x["waivers"]>0)
    v4 = min(x["previous"],sum(x["points"][i] for i in x["active"]))
    v5 = x["previous"] if x["use_waiver"] and x["waivers"]>0 else min(x["previous"],x["required"])
    v6 = x["history"]+[x["previous"]]
    v7 = min(x["previous"],x["stage_limits"][min(x["stage"],len(x["stage_limits"])-1)])
    v8 = min(x["qualification"],x["previous"]+x["transferred"])
    v9 = 0 if x["revoked"] else min(x["previous"],x["qualification"])
    return {'withdrawn-activity':v0,'standing-credit-dedup':v1,'waiver-availability':v2,'waiver-consumption':v3,'eligibility-monotonicity':v4,'waiver-preservation':v5,'round-advance':v6,'stage-ceiling':v7,'transfer-cap':v8,'revocation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('replayed round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 1, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [[8, 6, 5], [16, 12, 10], [24, 18, 15], [32, 24, 20], [40, 30, 25]]), ('waiver round / replayed round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 1, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [[8, 6, 5], [16, 12, 10], [24, 18, 15], [32, 24, 20], [40, 30, 25]]), ('normal contract', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [[8, 6, 5, 8], [16, 12, 10, 16], [24, 18, 15, 24], [32, 24, 20, 32], [40, 30, 25, 40]]), ('waiver round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [[8, 6, 5, 8], [16, 12, 10, 16], [24, 18, 15, 24], [32, 24, 20, 32], [40, 30, 25, 40]]), ('no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [[8, 6, 5, 8], [16, 12, 10, 16], [24, 18, 15, 24], [32, 24, 20, 32], [40, 30, 25, 40]]), ('all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [[8, 6, 5, 8], [16, 12, 10, 16], [24, 18, 15, 24], [32, 24, 20, 32], [40, 30, 25, 40]]), ('standing overlaps activity', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['A'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [[8, 6, 5, 8], [16, 12, 10, 16], [24, 18, 15, 24], [32, 24, 20, 32], [40, 30, 25, 40]]), ('stage entry', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 0, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [[8, 6, 5, 8], [16, 12, 10, 16], [24, 18, 15, 24], [32, 24, 20, 32], [40, 30, 25, 40]]), ('small qualification', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 2, 'transferred': 2, 'revoked': False}, [[8, 6, 5, 8], [16, 12, 10, 16], [24, 18, 15, 24], [32, 24, 20, 32], [40, 30, 25, 40]]), ('qualification revoked', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': True}, [[8, 6, 5, 8], [16, 12, 10, 16], [24, 18, 15, 24], [32, 24, 20, 32], [40, 30, 25, 40]])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['round-advance'], 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 = sum(x["points"][i] for i in set(x["active"])-set(x["withdrawn"]))
    v1 = sum(x["points"][i] for i in set(x["active"])|set(x["standing"]))
    v2 = x["use_waiver"] and x["waivers"]>0
    v3 = x["waivers"]-int(x["use_waiver"] and x["waivers"]>0)
    v4 = min(x["previous"],sum(x["points"][i] for i in x["active"]))
    v5 = x["previous"] if x["use_waiver"] and x["waivers"]>0 else min(x["previous"],x["required"])
    v6 = x["history"]
    v7 = min(x["previous"],x["stage_limits"][min(x["stage"],len(x["stage_limits"])-1)])
    v8 = min(x["qualification"],x["previous"]+x["transferred"])
    v9 = 0 if x["revoked"] else min(x["previous"],x["qualification"])
    return {'withdrawn-activity':v0,'standing-credit-dedup':v1,'waiver-availability':v2,'waiver-consumption':v3,'eligibility-monotonicity':v4,'waiver-preservation':v5,'round-advance':v6,'stage-ceiling':v7,'transfer-cap':v8,'revocation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('replayed round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 1, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [[8, 6, 5], [16, 12, 10], [24, 18, 15], [32, 24, 20], [40, 30, 25]]), ('waiver round / replayed round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 1, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [[8, 6, 5], [16, 12, 10], [24, 18, 15], [32, 24, 20], [40, 30, 25]]), ('normal contract', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [[8, 6, 5, 8], [16, 12, 10, 16], [24, 18, 15, 24], [32, 24, 20, 32], [40, 30, 25, 40]]), ('waiver round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [[8, 6, 5, 8], [16, 12, 10, 16], [24, 18, 15, 24], [32, 24, 20, 32], [40, 30, 25, 40]]), ('no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [[8, 6, 5, 8], [16, 12, 10, 16], [24, 18, 15, 24], [32, 24, 20, 32], [40, 30, 25, 40]]), ('all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [[8, 6, 5, 8], [16, 12, 10, 16], [24, 18, 15, 24], [32, 24, 20, 32], [40, 30, 25, 40]]), ('standing overlaps activity', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['A'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [[8, 6, 5, 8], [16, 12, 10, 16], [24, 18, 15, 24], [32, 24, 20, 32], [40, 30, 25, 40]]), ('stage entry', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 0, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [[8, 6, 5, 8], [16, 12, 10, 16], [24, 18, 15, 24], [32, 24, 20, 32], [40, 30, 25, 40]]), ('small qualification', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 2, 'transferred': 2, 'revoked': False}, [[8, 6, 5, 8], [16, 12, 10, 16], [24, 18, 15, 24], [32, 24, 20, 32], [40, 30, 25, 40]]), ('qualification revoked', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': True}, [[8, 6, 5, 8], [16, 12, 10, 16], [24, 18, 15, 24], [32, 24, 20, 32], [40, 30, 25, 40]])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['round-advance'], 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:
Replaying a round adds another eligibility-history decision.

A stipulated ascending multiround auction records eligibility in activity points. Submitted lots contribute fixed points, withdrawn lots contribute none, a waiver preserves previous eligibility once, and frozen eligibility cannot grow. These rules are pedagogical and independent of real spectrum-auction regulations. Named decision round-advance: Append eligibility history only on a newly processed round.

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = sum(x["points"][i] for i in set(x["active"])-set(x["withdrawn"]))
    v1 = sum(x["points"][i] for i in set(x["active"])|set(x["standing"]))
    v2 = x["use_waiver"] and x["waivers"]>0
    v3 = x["waivers"]-int(x["use_waiver"] and x["waivers"]>0)
    v4 = min(x["previous"],sum(x["points"][i] for i in x["active"]))
    v5 = x["previous"] if x["use_waiver"] and x["waivers"]>0 else min(x["previous"],x["required"])
    v6 = x["history"] if x["round"]<=x["last_round"] else x["history"]+[x["previous"]]
    v7 = x["stage_limits"][min(x["stage"],len(x["stage_limits"])-1)]
    v8 = min(x["qualification"],x["previous"]+x["transferred"])
    v9 = 0 if x["revoked"] else min(x["previous"],x["qualification"])
    return {'withdrawn-activity':v0,'standing-credit-dedup':v1,'waiver-availability':v2,'waiver-consumption':v3,'eligibility-monotonicity':v4,'waiver-preservation':v5,'round-advance':v6,'stage-ceiling':v7,'transfer-cap':v8,'revocation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('stage entry', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 0, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [8, 16, 24, 32, 40]), ('late stage', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 3, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [3, 6, 9, 12, 15]), ('normal contract', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [4, 8, 12, 16, 20]), ('waiver round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [4, 8, 12, 16, 20]), ('no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [4, 8, 12, 16, 20]), ('all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [4, 8, 12, 16, 20]), ('standing overlaps activity', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['A'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [4, 8, 12, 16, 20]), ('replayed round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 1, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [4, 8, 12, 16, 20]), ('small qualification', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 2, 'transferred': 2, 'revoked': False}, [4, 8, 12, 16, 20]), ('qualification revoked', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': True}, [4, 8, 12, 16, 20])]
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))['stage-ceiling'], 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 = sum(x["points"][i] for i in set(x["active"])-set(x["withdrawn"]))
    v1 = sum(x["points"][i] for i in set(x["active"])|set(x["standing"]))
    v2 = x["use_waiver"] and x["waivers"]>0
    v3 = x["waivers"]-int(x["use_waiver"] and x["waivers"]>0)
    v4 = min(x["previous"],sum(x["points"][i] for i in x["active"]))
    v5 = x["previous"] if x["use_waiver"] and x["waivers"]>0 else min(x["previous"],x["required"])
    v6 = x["history"] if x["round"]<=x["last_round"] else x["history"]+[x["previous"]]
    v7 = min(x["previous"],x["stage_limits"][0])
    v8 = min(x["qualification"],x["previous"]+x["transferred"])
    v9 = 0 if x["revoked"] else min(x["previous"],x["qualification"])
    return {'withdrawn-activity':v0,'standing-credit-dedup':v1,'waiver-availability':v2,'waiver-consumption':v3,'eligibility-monotonicity':v4,'waiver-preservation':v5,'round-advance':v6,'stage-ceiling':v7,'transfer-cap':v8,'revocation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('stage entry', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 0, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [8, 16, 24, 32, 40]), ('late stage', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 3, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [3, 6, 9, 12, 15]), ('normal contract', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [4, 8, 12, 16, 20]), ('waiver round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [4, 8, 12, 16, 20]), ('no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [4, 8, 12, 16, 20]), ('all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [4, 8, 12, 16, 20]), ('standing overlaps activity', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['A'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [4, 8, 12, 16, 20]), ('replayed round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 1, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [4, 8, 12, 16, 20]), ('small qualification', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 2, 'transferred': 2, 'revoked': False}, [4, 8, 12, 16, 20]), ('qualification revoked', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': True}, [4, 8, 12, 16, 20])]
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))['stage-ceiling'], 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:
Stage transition uses the initial ceiling or increases existing eligibility.

A stipulated ascending multiround auction records eligibility in activity points. Submitted lots contribute fixed points, withdrawn lots contribute none, a waiver preserves previous eligibility once, and frozen eligibility cannot grow. These rules are pedagogical and independent of real spectrum-auction regulations. Named decision stage-ceiling: Apply the current stage ceiling without restoring eligibility.

split: open-access


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

N = 1
observations = []
def solve(x):
    v0 = sum(x["points"][i] for i in set(x["active"])-set(x["withdrawn"]))
    v1 = sum(x["points"][i] for i in set(x["active"])|set(x["standing"]))
    v2 = x["use_waiver"] and x["waivers"]>0
    v3 = x["waivers"]-int(x["use_waiver"] and x["waivers"]>0)
    v4 = min(x["previous"],sum(x["points"][i] for i in x["active"]))
    v5 = x["previous"] if x["use_waiver"] and x["waivers"]>0 else min(x["previous"],x["required"])
    v6 = x["history"] if x["round"]<=x["last_round"] else x["history"]+[x["previous"]]
    v7 = min(x["previous"],x["stage_limits"][min(x["stage"],len(x["stage_limits"])-1)])
    v8 = x["previous"]+x["transferred"]
    v9 = 0 if x["revoked"] else min(x["previous"],x["qualification"])
    return {'withdrawn-activity':v0,'standing-credit-dedup':v1,'waiver-availability':v2,'waiver-consumption':v3,'eligibility-monotonicity':v4,'waiver-preservation':v5,'round-advance':v6,'stage-ceiling':v7,'transfer-cap':v8,'revocation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [9, 18, 27, 36, 45]), ('waiver round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [9, 18, 27, 36, 45]), ('no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [9, 18, 27, 36, 45]), ('all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [9, 18, 27, 36, 45]), ('standing overlaps activity', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['A'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [9, 18, 27, 36, 45]), ('replayed round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 1, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [9, 18, 27, 36, 45]), ('stage entry', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 0, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [9, 18, 27, 36, 45]), ('small qualification', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 2, 'transferred': 2, 'revoked': False}, [2, 4, 6, 8, 10]), ('qualification revoked', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': True}, [9, 18, 27, 36, 45])]
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))['transfer-cap'], 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 = sum(x["points"][i] for i in set(x["active"])-set(x["withdrawn"]))
    v1 = sum(x["points"][i] for i in set(x["active"])|set(x["standing"]))
    v2 = x["use_waiver"] and x["waivers"]>0
    v3 = x["waivers"]-int(x["use_waiver"] and x["waivers"]>0)
    v4 = min(x["previous"],sum(x["points"][i] for i in x["active"]))
    v5 = x["previous"] if x["use_waiver"] and x["waivers"]>0 else min(x["previous"],x["required"])
    v6 = x["history"] if x["round"]<=x["last_round"] else x["history"]+[x["previous"]]
    v7 = min(x["previous"],x["stage_limits"][min(x["stage"],len(x["stage_limits"])-1)])
    v8 = min(x["qualification"],x["previous"])+x["transferred"]
    v9 = 0 if x["revoked"] else min(x["previous"],x["qualification"])
    return {'withdrawn-activity':v0,'standing-credit-dedup':v1,'waiver-availability':v2,'waiver-consumption':v3,'eligibility-monotonicity':v4,'waiver-preservation':v5,'round-advance':v6,'stage-ceiling':v7,'transfer-cap':v8,'revocation':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [9, 18, 27, 36, 45]), ('waiver round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [9, 18, 27, 36, 45]), ('no waiver left', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 0, 'use_waiver': True, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [9, 18, 27, 36, 45]), ('all withdrawn', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['A', 'B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [9, 18, 27, 36, 45]), ('standing overlaps activity', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['A'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [9, 18, 27, 36, 45]), ('replayed round', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 1, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [9, 18, 27, 36, 45]), ('stage entry', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 0, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': False}, [9, 18, 27, 36, 45]), ('small qualification', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 2, 'transferred': 2, 'revoked': False}, [2, 4, 6, 8, 10]), ('qualification revoked', {'points': {'A': 3, 'B': 2, 'C': 1}, 'active': ['A', 'B'], 'withdrawn': ['B'], 'standing': ['C'], 'previous': 8, 'waivers': 2, 'use_waiver': False, 'required': 5, 'round': 2, 'last_round': 1, 'history': [8, 6, 5], 'stage': 2, 'stage_limits': [10, 7, 4], 'qualification': 9, 'transferred': 2, 'revoked': True}, [9, 18, 27, 36, 45])]
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))['transfer-cap'], 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:
Transferred eligibility bypasses the bidder qualification cap.

A stipulated ascending multiround auction records eligibility in activity points. Submitted lots contribute fixed points, withdrawn lots contribute none, a waiver preserves previous eligibility once, and frozen eligibility cannot grow. These rules are pedagogical and independent of real spectrum-auction regulations. Named decision transfer-cap: Cap the combined eligibility after transferring points.

split: open-access