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

N = 1
observations = []
def solve(d):
    return {'lower-index':(d['options'].index(d['lo']) if d['lo'] in d['options'] else None), 'upper-index':(d['options'].index(d['hi']) if d['hi'] in d['options'] else None), 'range-order':(d['lo'] in d['options'] and d['hi'] in d['options'] and d['options'].index(d['lo'])<=d['options'].index(d['hi'])), 'endpoint-payload':([d['options'].index(d['lo']) if d['lo'] in d['options'] else -1,d['options'].index(d['hi']) if d['hi'] in d['options'] else -1]), 'unresolved-endpoints':([x for x in (d['lo'],d['hi']) if x not in d['options']]), 'full-domain':(bool(d['options']) and d['lo']==d['options'][0] and d['hi']==d['options'][-1])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'small'}, {'lower-index': 0, 'upper-index': 0, 'range-order': True, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': 1, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'large'}, {'lower-index': 2, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'small'}, {'lower-index': None, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'a'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': ['z', 'a'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': ['small', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': ['medium', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['medium'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': ['large', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'small'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['small'], 'full-domain': False})], 2: [({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'large'}, {'lower-index': 0, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'large'}, {'lower-index': None, 'upper-index': 2, 'range-order': False, 'endpoint-payload': ['z', 'large'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': ['medium', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': ['large', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'large'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'large'], 'unresolved-endpoints': ['large'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'small'}, {'lower-index': 0, 'upper-index': 0, 'range-order': True, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'a'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': 1, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': [], 'full-domain': False})], 3: [({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'a'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'small'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'a'}, {'lower-index': 0, 'upper-index': 1, 'range-order': True, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'large'}, {'lower-index': 0, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': 1, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': 1, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'large'}, {'lower-index': 2, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'small'}, {'lower-index': None, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'a'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': ['z', 'a'], 'full-domain': False})], 4: [({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': 1, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['large'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': 1, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'small'}, {'lower-index': 2, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'a'}, {'lower-index': 2, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'large'}, {'lower-index': None, 'upper-index': 2, 'range-order': False, 'endpoint-payload': ['z', 'large'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': ['small', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': ['medium', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': ['large', 'small'], 'full-domain': False})], 5: [({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': 1, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'a'}, {'lower-index': 0, 'upper-index': 1, 'range-order': True, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'a'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': ['z', 'a'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': ['small', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': ['medium', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['medium'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': ['large', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'small'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'large'}, {'lower-index': 0, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': 1, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': [], 'full-domain': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
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(d):
    return {'lower-index':(d['options'].index(d['lo']) if d['lo'] in d['options'] else None), 'upper-index':(d['options'].index(d['hi']) if d['hi'] in d['options'] else None), 'range-order':(d['lo'] in d['options'] and d['hi'] in d['options'] and d['options'].index(d['lo'])<=d['options'].index(d['hi'])), 'endpoint-payload':(sorted([d['lo'],d['hi']])), 'unresolved-endpoints':([x for x in (d['lo'],d['hi']) if x not in d['options']]), 'full-domain':(bool(d['options']) and d['lo']==d['options'][0] and d['hi']==d['options'][-1])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'small'}, {'lower-index': 0, 'upper-index': 0, 'range-order': True, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': 1, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'large'}, {'lower-index': 2, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'small'}, {'lower-index': None, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'a'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': ['z', 'a'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': ['small', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': ['medium', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['medium'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': ['large', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'small'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['small'], 'full-domain': False})], 2: [({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'large'}, {'lower-index': 0, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'large'}, {'lower-index': None, 'upper-index': 2, 'range-order': False, 'endpoint-payload': ['z', 'large'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': ['medium', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': ['large', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'large'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'large'], 'unresolved-endpoints': ['large'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'small'}, {'lower-index': 0, 'upper-index': 0, 'range-order': True, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'a'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': 1, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': [], 'full-domain': False})], 3: [({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'a'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'small'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'a'}, {'lower-index': 0, 'upper-index': 1, 'range-order': True, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'large'}, {'lower-index': 0, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': 1, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': 1, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'large'}, {'lower-index': 2, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'small'}, {'lower-index': None, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'a'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': ['z', 'a'], 'full-domain': False})], 4: [({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': 1, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['large'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': 1, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'small'}, {'lower-index': 2, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'a'}, {'lower-index': 2, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'large'}, {'lower-index': None, 'upper-index': 2, 'range-order': False, 'endpoint-payload': ['z', 'large'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': ['small', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': ['medium', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': ['large', 'small'], 'full-domain': False})], 5: [({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': 1, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'a'}, {'lower-index': 0, 'upper-index': 1, 'range-order': True, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'a'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': ['z', 'a'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': ['small', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': ['medium', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['medium'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': ['large', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'small'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'large'}, {'lower-index': 0, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': 1, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': [], 'full-domain': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
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:
Filter payloads retain discrete endpoint identities instead of display indices is violated by the widget projection.

A discrete range selector uses ordered option indices, preserves endpoint option identities across rerender, and renders unavailable selected options as unresolved. This example checks: Filter payloads retain discrete endpoint identities instead of display indices.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'lower-index':(d['options'].index(d['lo']) if d['lo'] in d['options'] else None), 'upper-index':(d['options'].index(d['hi']) if d['hi'] in d['options'] else None), 'range-order':(d['lo'] in d['options'] and d['hi'] in d['options'] and d['options'].index(d['lo'])<=d['options'].index(d['hi'])), 'endpoint-payload':([d['lo'],d['hi']]), 'unresolved-endpoints':([]), 'full-domain':(bool(d['options']) and d['lo']==d['options'][0] and d['hi']==d['options'][-1])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'a'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'small'}, {'lower-index': None, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'large'}, {'lower-index': 2, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'a'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': ['z', 'a'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': ['small', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': ['medium', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['medium'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': ['large', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'small'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'a'}, {'lower-index': 0, 'upper-index': 1, 'range-order': True, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': [], 'full-domain': True})], 2: [({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': 1, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': ['small', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': ['medium', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': ['large', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'large'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'large'], 'unresolved-endpoints': ['large'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'small'}, {'lower-index': 0, 'upper-index': 0, 'range-order': True, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'a'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': 1, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': [], 'full-domain': False})], 3: [({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'a'}, {'lower-index': 2, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': ['medium', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'small'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'a'}, {'lower-index': 0, 'upper-index': 1, 'range-order': True, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'large'}, {'lower-index': 0, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': 1, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': 1, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'large'}, {'lower-index': 2, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'small'}, {'lower-index': None, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'a'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': ['z', 'a'], 'full-domain': False})], 4: [({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'small'}, {'lower-index': None, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': ['large', 'small'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': 1, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'small'}, {'lower-index': 2, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'a'}, {'lower-index': 2, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'large'}, {'lower-index': None, 'upper-index': 2, 'range-order': False, 'endpoint-payload': ['z', 'large'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': ['small', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': ['medium', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['large'], 'full-domain': False})], 5: [({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'large'}, {'lower-index': None, 'upper-index': 2, 'range-order': False, 'endpoint-payload': ['z', 'large'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'small'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'a'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': ['z', 'a'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': ['small', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': ['medium', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['medium'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': ['large', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'a'}, {'lower-index': 0, 'upper-index': 1, 'range-order': True, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'large'}, {'lower-index': 0, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': 1, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': [], 'full-domain': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
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(d):
    return {'lower-index':(d['options'].index(d['lo']) if d['lo'] in d['options'] else None), 'upper-index':(d['options'].index(d['hi']) if d['hi'] in d['options'] else None), 'range-order':(d['lo'] in d['options'] and d['hi'] in d['options'] and d['options'].index(d['lo'])<=d['options'].index(d['hi'])), 'endpoint-payload':([d['lo'],d['hi']]), 'unresolved-endpoints':([x for x in (d['lo'],d['hi']) if not x]), 'full-domain':(bool(d['options']) and d['lo']==d['options'][0] and d['hi']==d['options'][-1])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'a'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'small'}, {'lower-index': None, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'large'}, {'lower-index': 2, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'a'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': ['z', 'a'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': ['small', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': ['medium', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['medium'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': ['large', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'small'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'a'}, {'lower-index': 0, 'upper-index': 1, 'range-order': True, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': [], 'full-domain': True})], 2: [({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': 1, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': ['small', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': ['medium', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': ['large', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'large'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'large'], 'unresolved-endpoints': ['large'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'small'}, {'lower-index': 0, 'upper-index': 0, 'range-order': True, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'a'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': 1, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': [], 'full-domain': False})], 3: [({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'a'}, {'lower-index': 2, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': ['medium', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'small'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'a'}, {'lower-index': 0, 'upper-index': 1, 'range-order': True, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'large'}, {'lower-index': 0, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': 1, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': 1, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'large'}, {'lower-index': 2, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'small'}, {'lower-index': None, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'a'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': ['z', 'a'], 'full-domain': False})], 4: [({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'small'}, {'lower-index': None, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': ['large', 'small'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': 1, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'small'}, {'lower-index': 2, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'a'}, {'lower-index': 2, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'large'}, {'lower-index': None, 'upper-index': 2, 'range-order': False, 'endpoint-payload': ['z', 'large'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': ['small', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': ['medium', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['large'], 'full-domain': False})], 5: [({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'large'}, {'lower-index': None, 'upper-index': 2, 'range-order': False, 'endpoint-payload': ['z', 'large'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'small'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'a'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': ['z', 'a'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': ['small', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': ['medium', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['medium'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': ['large', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'a'}, {'lower-index': 0, 'upper-index': 1, 'range-order': True, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'large'}, {'lower-index': 0, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': 1, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': [], 'full-domain': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
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:
Removed endpoint options are explicitly marked unresolved is violated by the widget projection.

A discrete range selector uses ordered option indices, preserves endpoint option identities across rerender, and renders unavailable selected options as unresolved. This example checks: Removed endpoint options are explicitly marked unresolved.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'lower-index':(d['options'].index(d['lo']) if d['lo'] in d['options'] else None), 'upper-index':(d['options'].index(d['hi']) if d['hi'] in d['options'] else None), 'range-order':(d['lo'] in d['options'] and d['hi'] in d['options'] and d['options'].index(d['lo'])<=d['options'].index(d['hi'])), 'endpoint-payload':([d['lo'],d['hi']]), 'unresolved-endpoints':([x for x in (d['lo'],d['hi']) if x not in d['options']]), 'full-domain':(bool(d['options']) and (d['lo']==d['options'][0] or d['hi']==d['options'][-1]))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'small'}, {'lower-index': 0, 'upper-index': 0, 'range-order': True, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': ['small', 'small'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'large'}, {'lower-index': 2, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'small'}, {'lower-index': None, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'a'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': ['z', 'a'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': ['small', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': ['medium', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['medium'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': ['large', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'small'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['small'], 'full-domain': False})], 2: [({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'a'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'small'}, {'lower-index': 0, 'upper-index': 0, 'range-order': True, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': ['medium', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': ['large', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'large'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'large'], 'unresolved-endpoints': ['large'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': 1, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'small'}, {'lower-index': 2, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'a'}, {'lower-index': 2, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False})], 3: [({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': 1, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': ['small', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'small'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'a'}, {'lower-index': 0, 'upper-index': 1, 'range-order': True, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'large'}, {'lower-index': 0, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': 1, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': 1, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'large'}, {'lower-index': 2, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'small'}, {'lower-index': None, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'a'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': ['z', 'a'], 'full-domain': False})], 4: [({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'large'}, {'lower-index': 2, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'small'}, {'lower-index': 0, 'upper-index': 0, 'range-order': True, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': 1, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'small'}, {'lower-index': 2, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'a'}, {'lower-index': 2, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'large'}, {'lower-index': None, 'upper-index': 2, 'range-order': False, 'endpoint-payload': ['z', 'large'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': ['small', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': ['medium', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': ['large', 'small'], 'full-domain': False})], 5: [({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'large'}, {'lower-index': None, 'upper-index': 2, 'range-order': False, 'endpoint-payload': ['z', 'large'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': ['small', 'small'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'a'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': ['z', 'a'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': ['small', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': ['medium', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['medium'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': ['large', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'small'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'a'}, {'lower-index': 0, 'upper-index': 1, 'range-order': True, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'large'}, {'lower-index': 0, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': [], 'full-domain': True})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
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(d):
    return {'lower-index':(d['options'].index(d['lo']) if d['lo'] in d['options'] else None), 'upper-index':(d['options'].index(d['hi']) if d['hi'] in d['options'] else None), 'range-order':(d['lo'] in d['options'] and d['hi'] in d['options'] and d['options'].index(d['lo'])<=d['options'].index(d['hi'])), 'endpoint-payload':([d['lo'],d['hi']]), 'unresolved-endpoints':([x for x in (d['lo'],d['hi']) if x not in d['options']]), 'full-domain':(d['lo']==d['hi'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'small'}, {'lower-index': 0, 'upper-index': 0, 'range-order': True, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': ['small', 'small'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'large'}, {'lower-index': 2, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'small'}, {'lower-index': None, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'a'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': ['z', 'a'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': ['small', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': ['medium', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['medium'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': ['large', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'small'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['small'], 'full-domain': False})], 2: [({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'a'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'small'}, {'lower-index': 0, 'upper-index': 0, 'range-order': True, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': ['medium', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': ['large', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'large'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'large'], 'unresolved-endpoints': ['large'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': 1, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'small'}, {'lower-index': 2, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'a'}, {'lower-index': 2, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False})], 3: [({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': 1, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': ['small', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'small'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'a'}, {'lower-index': 0, 'upper-index': 1, 'range-order': True, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'large'}, {'lower-index': 0, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': 1, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': 1, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'large'}, {'lower-index': 2, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'small'}, {'lower-index': None, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'a'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': ['z', 'a'], 'full-domain': False})], 4: [({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'large'}, {'lower-index': 2, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'small'}, {'lower-index': 0, 'upper-index': 0, 'range-order': True, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': 1, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'small'}, {'lower-index': 2, 'upper-index': 0, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': [], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'large', 'hi': 'a'}, {'lower-index': 2, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'a'], 'unresolved-endpoints': ['a'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'large'}, {'lower-index': None, 'upper-index': 2, 'range-order': False, 'endpoint-payload': ['z', 'large'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': ['small', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['small', 'a'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'large'], 'unresolved-endpoints': ['medium', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'small'], 'unresolved-endpoints': ['large', 'small'], 'full-domain': False})], 5: [({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'large'}, {'lower-index': None, 'upper-index': 2, 'range-order': False, 'endpoint-payload': ['z', 'large'], 'unresolved-endpoints': ['z'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'small'], 'unresolved-endpoints': ['small', 'small'], 'full-domain': False}), ({'options': ['small', 'medium', 'large'], 'lo': 'z', 'hi': 'a'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': ['z', 'a'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'small', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': ['small', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'small'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['medium', 'small'], 'unresolved-endpoints': ['medium', 'small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'medium', 'hi': 'a'}, {'lower-index': None, 'upper-index': 1, 'range-order': False, 'endpoint-payload': ['medium', 'a'], 'unresolved-endpoints': ['medium'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'large', 'hi': 'large'}, {'lower-index': None, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['large', 'large'], 'unresolved-endpoints': ['large', 'large'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'small'}, {'lower-index': 0, 'upper-index': None, 'range-order': False, 'endpoint-payload': ['z', 'small'], 'unresolved-endpoints': ['small'], 'full-domain': False}), ({'options': ['z', 'a'], 'lo': 'z', 'hi': 'a'}, {'lower-index': 0, 'upper-index': 1, 'range-order': True, 'endpoint-payload': ['z', 'a'], 'unresolved-endpoints': [], 'full-domain': True}), ({'options': ['small', 'medium', 'large'], 'lo': 'small', 'hi': 'large'}, {'lower-index': 0, 'upper-index': 2, 'range-order': True, 'endpoint-payload': ['small', 'large'], 'unresolved-endpoints': [], 'full-domain': True})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
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:
Only both extreme endpoints represent the full discrete domain is violated by the widget projection.

A discrete range selector uses ordered option indices, preserves endpoint option identities across rerender, and renders unavailable selected options as unresolved. This example checks: Only both extreme endpoints represent the full discrete domain.

split: open-access