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

N = 1
observations = []
def solve(d):
    return {'zero-selected':(d['selected'] or d['count'] is None or d['count']>0), 'unknown-badge':('?' if d['count'] is None else str(d['count'])), 'hide-empty':(not d['hide'] or d['selected'] or d['count']!=0), 'busy-marker':(d['loading'] and d['count'] is None), 'empty-message':(d['count']==0 and not d['loading']), 'stale-count':(d['loading'] and bool(d['count']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True})], 2: [({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 3: [({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True})], 4: [({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 5: [({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': 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 {'zero-selected':(d['selected'] or d['count'] is None or d['count']>0), 'unknown-badge':('?' if d['count'] is None else str(d['count'])), 'hide-empty':(not d['hide'] or d['selected'] or d['count']!=0), 'busy-marker':(d['loading'] and d['count'] is None), 'empty-message':(d['count']==0 and not d['loading']), 'stale-count':(d['count'] is not None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True})], 2: [({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 3: [({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True})], 4: [({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 5: [({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': 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:
Cached zero counts receive a stale marker while refreshing is violated by the widget projection.

Facet choices remain removable when selected even at zero matches; counts distinguish unknown loading state from a known empty result. This example checks: Cached zero counts receive a stale marker while refreshing.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'lower-open':(int(d['lo'] or 0)), 'upper-open':(None if d['hi']=='' else int(d['hi'])), 'endpoint-order':(d['lo']=='' or d['hi']=='' or int(d['lo'])<=int(d['hi'])), 'empty-constraint':(d['lo']=='' and d['hi']==''), 'lower-handle':(int(d['lo']) if d['lo']!='' else d['minimum']), 'upper-handle':(int(d['hi']) if d['hi']!='' else d['maximum'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10}), ({'lo': '2', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 20}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '2', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 2}), ({'lo': '2', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 10}), ({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0}), ({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2}), ({'lo': '10', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 10})], 2: [({'lo': '', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 0}), ({'lo': '0', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 2}), ({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2}), ({'lo': '10', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 10}), ({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 2}), ({'lo': '', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 10}), ({'lo': '0', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 20}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10})], 3: [({'lo': '', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 2}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '0', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 2}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10}), ({'lo': '2', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 20}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '2', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 2}), ({'lo': '2', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 10}), ({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0})], 4: [({'lo': '', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 10}), ({'lo': '0', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 20}), ({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0}), ({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2}), ({'lo': '10', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 10}), ({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 0}), ({'lo': '', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 2}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0})], 5: [({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10}), ({'lo': '', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 10}), ({'lo': '0', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 20}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '0', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 2}), ({'lo': '2', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 20}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '2', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 2}), ({'lo': '2', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 10})]}
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-open':(None if d['lo'] in ('','0') else int(d['lo'])), 'upper-open':(None if d['hi']=='' else int(d['hi'])), 'endpoint-order':(d['lo']=='' or d['hi']=='' or int(d['lo'])<=int(d['hi'])), 'empty-constraint':(d['lo']=='' and d['hi']==''), 'lower-handle':(int(d['lo']) if d['lo']!='' else d['minimum']), 'upper-handle':(int(d['hi']) if d['hi']!='' else d['maximum'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10}), ({'lo': '2', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 20}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '2', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 2}), ({'lo': '2', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 10}), ({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0}), ({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2}), ({'lo': '10', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 10})], 2: [({'lo': '', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 0}), ({'lo': '0', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 2}), ({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2}), ({'lo': '10', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 10}), ({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 2}), ({'lo': '', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 10}), ({'lo': '0', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 20}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10})], 3: [({'lo': '', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 2}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '0', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 2}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10}), ({'lo': '2', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 20}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '2', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 2}), ({'lo': '2', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 10}), ({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0})], 4: [({'lo': '', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 10}), ({'lo': '0', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 20}), ({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0}), ({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2}), ({'lo': '10', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 10}), ({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 0}), ({'lo': '', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 2}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0})], 5: [({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10}), ({'lo': '', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 10}), ({'lo': '0', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 20}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '0', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 2}), ({'lo': '2', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 20}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '2', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 2}), ({'lo': '2', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 10})]}
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:
A blank lower bound is open while zero remains closed is violated by the widget projection.

A numeric range editor preserves open ends, treats zero as a bound, and rejects reversed finite endpoints before applying. This example checks: A blank lower bound is open while zero remains closed.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'lower-open':(None if d['lo']=='' else int(d['lo'])), 'upper-open':(int(d['hi'] or 0)), 'endpoint-order':(d['lo']=='' or d['hi']=='' or int(d['lo'])<=int(d['hi'])), 'empty-constraint':(d['lo']=='' and d['hi']==''), 'lower-handle':(int(d['lo']) if d['lo']!='' else d['minimum']), 'upper-handle':(int(d['hi']) if d['hi']!='' else d['maximum'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10}), ({'lo': '2', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 20}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '2', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 2}), ({'lo': '2', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 10}), ({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20}), ({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2}), ({'lo': '10', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 10})], 2: [({'lo': '0', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 20}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2}), ({'lo': '10', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 10}), ({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 0}), ({'lo': '', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 2}), ({'lo': '', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 10}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '0', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 2})], 3: [({'lo': '2', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 20}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '0', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 2}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '2', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 2}), ({'lo': '2', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 10}), ({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0}), ({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2})], 4: [({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20}), ({'lo': '', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 0}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0}), ({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2}), ({'lo': '10', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 10}), ({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 2}), ({'lo': '', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 10}), ({'lo': '0', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 20}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0})], 5: [({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0}), ({'lo': '', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 10}), ({'lo': '0', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 20}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '0', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 2}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10}), ({'lo': '2', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 20}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '2', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 2})]}
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-open':(None if d['lo']=='' else int(d['lo'])), 'upper-open':(None if d['hi'] in ('','0') else int(d['hi'])), 'endpoint-order':(d['lo']=='' or d['hi']=='' or int(d['lo'])<=int(d['hi'])), 'empty-constraint':(d['lo']=='' and d['hi']==''), 'lower-handle':(int(d['lo']) if d['lo']!='' else d['minimum']), 'upper-handle':(int(d['hi']) if d['hi']!='' else d['maximum'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10}), ({'lo': '2', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 20}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '2', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 2}), ({'lo': '2', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 10}), ({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20}), ({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2}), ({'lo': '10', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 10})], 2: [({'lo': '0', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 20}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2}), ({'lo': '10', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 10}), ({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 0}), ({'lo': '', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 2}), ({'lo': '', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 10}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '0', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 2})], 3: [({'lo': '2', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 20}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '0', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 2}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '2', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 2}), ({'lo': '2', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 10}), ({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0}), ({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2})], 4: [({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20}), ({'lo': '', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 0}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0}), ({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2}), ({'lo': '10', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 10}), ({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 2}), ({'lo': '', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 10}), ({'lo': '0', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 20}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0})], 5: [({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0}), ({'lo': '', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 10}), ({'lo': '0', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 20}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '0', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 2}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10}), ({'lo': '2', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 20}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '2', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 2})]}
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:
A blank upper bound is open while zero remains closed is violated by the widget projection.

A numeric range editor preserves open ends, treats zero as a bound, and rejects reversed finite endpoints before applying. This example checks: A blank upper bound is open while zero remains closed.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'lower-open':(None if d['lo']=='' else int(d['lo'])), 'upper-open':(None if d['hi']=='' else int(d['hi'])), 'endpoint-order':(d['lo']=='' or d['hi']=='' or d['lo']<=d['hi']), 'empty-constraint':(d['lo']=='' and d['hi']==''), 'lower-handle':(int(d['lo']) if d['lo']!='' else d['minimum']), 'upper-handle':(int(d['hi']) if d['hi']!='' else d['maximum'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'lo': '2', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 10}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10}), ({'lo': '2', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 20}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '2', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 2}), ({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0}), ({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2}), ({'lo': '10', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 10})], 2: [({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '10', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 10}), ({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 0}), ({'lo': '', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 2}), ({'lo': '', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 10}), ({'lo': '0', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 20}), ({'lo': '0', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 2}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10})], 3: [({'lo': '2', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 10}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '0', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 2}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10}), ({'lo': '2', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 20}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '2', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 2}), ({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0}), ({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2})], 4: [({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0}), ({'lo': '10', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 10}), ({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 0}), ({'lo': '', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 2}), ({'lo': '', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 10}), ({'lo': '0', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 20})], 5: [({'lo': '2', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 10}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 10}), ({'lo': '0', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 20}), ({'lo': '0', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 2}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10}), ({'lo': '2', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 20}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '2', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 2}), ({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20})]}
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-open':(None if d['lo']=='' else int(d['lo'])), 'upper-open':(None if d['hi']=='' else int(d['hi'])), 'endpoint-order':(d['lo']=='' or d['hi']=='' or int(d['lo'])<int(d['hi'])), 'empty-constraint':(d['lo']=='' and d['hi']==''), 'lower-handle':(int(d['lo']) if d['lo']!='' else d['minimum']), 'upper-handle':(int(d['hi']) if d['hi']!='' else d['maximum'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'lo': '2', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 10}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10}), ({'lo': '2', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 20}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '2', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 2}), ({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0}), ({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2}), ({'lo': '10', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 10})], 2: [({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '10', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 10}), ({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 0}), ({'lo': '', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 2}), ({'lo': '', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 10}), ({'lo': '0', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 20}), ({'lo': '0', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 2}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10})], 3: [({'lo': '2', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 10}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '0', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 2}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10}), ({'lo': '2', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 20}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '2', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 2}), ({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0}), ({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2})], 4: [({'lo': '10', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 2, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 2}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20}), ({'lo': '10', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 0}), ({'lo': '10', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 10}), ({'lo': '', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': True, 'lower-handle': -5, 'upper-handle': 20}), ({'lo': '', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 0}), ({'lo': '', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 2}), ({'lo': '', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 10}), ({'lo': '0', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 20})], 5: [({'lo': '2', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 10}), ({'lo': '0', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 0, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 0}), ({'lo': '', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': None, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': -5, 'upper-handle': 10}), ({'lo': '0', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 20}), ({'lo': '0', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 2}), ({'lo': '0', 'hi': '10', 'minimum': -5, 'maximum': 20}, {'lower-open': 0, 'upper-open': 10, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 0, 'upper-handle': 10}), ({'lo': '2', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 20}), ({'lo': '2', 'hi': '0', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 0, 'endpoint-order': False, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 0}), ({'lo': '2', 'hi': '2', 'minimum': -5, 'maximum': 20}, {'lower-open': 2, 'upper-open': 2, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 2, 'upper-handle': 2}), ({'lo': '10', 'hi': '', 'minimum': -5, 'maximum': 20}, {'lower-open': 10, 'upper-open': None, 'endpoint-order': True, 'empty-constraint': False, 'lower-handle': 10, 'upper-handle': 20})]}
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:
Range validation compares numeric endpoints and accepts point ranges is violated by the widget projection.

A numeric range editor preserves open ends, treats zero as a bound, and rejects reversed finite endpoints before applying. This example checks: Range validation compares numeric endpoints and accepts point ranges.

split: open-access