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

N = 1
observations = []
def solve(d):
    return {'cycle':({'neutral':'include','include':'exclude','exclude':'neutral'}[d['state']]), 'negative-operand':(d['value'] if d['state']=='exclude' else None), 'positive-operand':(d['value'] if d['state']=='include' else None), 'exclusion-badge':('minus' if d['state']=='exclude' else ('check' if d['state']=='include' else 'none')), 'reverse-cycle':({'neutral':'include','include':'exclude','exclude':'neutral'}[d['state']]), 'negation-help':('Exclude '+d['value'] if d['state']=='include' else ('Clear '+d['value'] if d['state']=='exclude' else 'Include '+d['value']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'state': 'neutral', 'value': 'red'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include red'}), ({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'include', 'value': 'gold'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'gold', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude gold'}), ({'state': 'exclude', 'value': 'red'}, {'cycle': 'neutral', 'negative-operand': 'red', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear red'}), ({'state': 'exclude', 'value': 'blue'}, {'cycle': 'neutral', 'negative-operand': 'blue', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear blue'}), ({'state': 'exclude', 'value': 'green'}, {'cycle': 'neutral', 'negative-operand': 'green', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear green'}), ({'state': 'exclude', 'value': 'gold'}, {'cycle': 'neutral', 'negative-operand': 'gold', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear gold'}), ({'state': 'neutral', 'value': 'blue'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include blue'}), ({'state': 'neutral', 'value': 'green'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include green'}), ({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'})], 2: [({'state': 'neutral', 'value': 'blue'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include blue'}), ({'state': 'exclude', 'value': 'green'}, {'cycle': 'neutral', 'negative-operand': 'green', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear green'}), ({'state': 'neutral', 'value': 'green'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include green'}), ({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'}), ({'state': 'include', 'value': 'blue'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'blue', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude blue'}), ({'state': 'include', 'value': 'green'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'green', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude green'}), ({'state': 'include', 'value': 'gold'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'gold', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude gold'}), ({'state': 'exclude', 'value': 'red'}, {'cycle': 'neutral', 'negative-operand': 'red', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear red'}), ({'state': 'exclude', 'value': 'blue'}, {'cycle': 'neutral', 'negative-operand': 'blue', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear blue'})], 3: [({'state': 'neutral', 'value': 'green'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include green'}), ({'state': 'neutral', 'value': 'blue'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include blue'}), ({'state': 'exclude', 'value': 'blue'}, {'cycle': 'neutral', 'negative-operand': 'blue', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear blue'}), ({'state': 'exclude', 'value': 'green'}, {'cycle': 'neutral', 'negative-operand': 'green', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear green'}), ({'state': 'exclude', 'value': 'gold'}, {'cycle': 'neutral', 'negative-operand': 'gold', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear gold'}), ({'state': 'neutral', 'value': 'red'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include red'}), ({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'}), ({'state': 'include', 'value': 'blue'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'blue', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude blue'}), ({'state': 'include', 'value': 'green'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'green', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude green'})], 4: [({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'exclude', 'value': 'red'}, {'cycle': 'neutral', 'negative-operand': 'red', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear red'}), ({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'}), ({'state': 'include', 'value': 'blue'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'blue', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude blue'}), ({'state': 'include', 'value': 'green'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'green', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude green'}), ({'state': 'include', 'value': 'gold'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'gold', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude gold'}), ({'state': 'exclude', 'value': 'blue'}, {'cycle': 'neutral', 'negative-operand': 'blue', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear blue'}), ({'state': 'exclude', 'value': 'green'}, {'cycle': 'neutral', 'negative-operand': 'green', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear green'}), ({'state': 'exclude', 'value': 'gold'}, {'cycle': 'neutral', 'negative-operand': 'gold', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear gold'}), ({'state': 'neutral', 'value': 'red'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include red'})], 5: [({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'}), ({'state': 'exclude', 'value': 'gold'}, {'cycle': 'neutral', 'negative-operand': 'gold', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear gold'}), ({'state': 'neutral', 'value': 'red'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include red'}), ({'state': 'neutral', 'value': 'blue'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include blue'}), ({'state': 'neutral', 'value': 'green'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include green'}), ({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'include', 'value': 'blue'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'blue', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude blue'}), ({'state': 'include', 'value': 'green'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'green', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude green'}), ({'state': 'include', 'value': 'gold'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'gold', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude gold'}), ({'state': 'exclude', 'value': 'red'}, {'cycle': 'neutral', 'negative-operand': 'red', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear red'})]}
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 {'cycle':({'neutral':'include','include':'exclude','exclude':'neutral'}[d['state']]), 'negative-operand':(d['value'] if d['state']=='exclude' else None), 'positive-operand':(d['value'] if d['state']=='include' else None), 'exclusion-badge':('minus' if d['state']=='exclude' else ('check' if d['state']=='include' else 'none')), 'reverse-cycle':('neutral'), 'negation-help':('Exclude '+d['value'] if d['state']=='include' else ('Clear '+d['value'] if d['state']=='exclude' else 'Include '+d['value']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'state': 'neutral', 'value': 'red'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include red'}), ({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'include', 'value': 'gold'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'gold', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude gold'}), ({'state': 'exclude', 'value': 'red'}, {'cycle': 'neutral', 'negative-operand': 'red', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear red'}), ({'state': 'exclude', 'value': 'blue'}, {'cycle': 'neutral', 'negative-operand': 'blue', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear blue'}), ({'state': 'exclude', 'value': 'green'}, {'cycle': 'neutral', 'negative-operand': 'green', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear green'}), ({'state': 'exclude', 'value': 'gold'}, {'cycle': 'neutral', 'negative-operand': 'gold', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear gold'}), ({'state': 'neutral', 'value': 'blue'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include blue'}), ({'state': 'neutral', 'value': 'green'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include green'}), ({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'})], 2: [({'state': 'neutral', 'value': 'blue'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include blue'}), ({'state': 'exclude', 'value': 'green'}, {'cycle': 'neutral', 'negative-operand': 'green', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear green'}), ({'state': 'neutral', 'value': 'green'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include green'}), ({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'}), ({'state': 'include', 'value': 'blue'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'blue', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude blue'}), ({'state': 'include', 'value': 'green'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'green', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude green'}), ({'state': 'include', 'value': 'gold'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'gold', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude gold'}), ({'state': 'exclude', 'value': 'red'}, {'cycle': 'neutral', 'negative-operand': 'red', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear red'}), ({'state': 'exclude', 'value': 'blue'}, {'cycle': 'neutral', 'negative-operand': 'blue', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear blue'})], 3: [({'state': 'neutral', 'value': 'green'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include green'}), ({'state': 'neutral', 'value': 'blue'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include blue'}), ({'state': 'exclude', 'value': 'blue'}, {'cycle': 'neutral', 'negative-operand': 'blue', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear blue'}), ({'state': 'exclude', 'value': 'green'}, {'cycle': 'neutral', 'negative-operand': 'green', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear green'}), ({'state': 'exclude', 'value': 'gold'}, {'cycle': 'neutral', 'negative-operand': 'gold', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear gold'}), ({'state': 'neutral', 'value': 'red'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include red'}), ({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'}), ({'state': 'include', 'value': 'blue'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'blue', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude blue'}), ({'state': 'include', 'value': 'green'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'green', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude green'})], 4: [({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'exclude', 'value': 'red'}, {'cycle': 'neutral', 'negative-operand': 'red', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear red'}), ({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'}), ({'state': 'include', 'value': 'blue'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'blue', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude blue'}), ({'state': 'include', 'value': 'green'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'green', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude green'}), ({'state': 'include', 'value': 'gold'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'gold', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude gold'}), ({'state': 'exclude', 'value': 'blue'}, {'cycle': 'neutral', 'negative-operand': 'blue', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear blue'}), ({'state': 'exclude', 'value': 'green'}, {'cycle': 'neutral', 'negative-operand': 'green', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear green'}), ({'state': 'exclude', 'value': 'gold'}, {'cycle': 'neutral', 'negative-operand': 'gold', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear gold'}), ({'state': 'neutral', 'value': 'red'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include red'})], 5: [({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'}), ({'state': 'exclude', 'value': 'gold'}, {'cycle': 'neutral', 'negative-operand': 'gold', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear gold'}), ({'state': 'neutral', 'value': 'red'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include red'}), ({'state': 'neutral', 'value': 'blue'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include blue'}), ({'state': 'neutral', 'value': 'green'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include green'}), ({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'include', 'value': 'blue'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'blue', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude blue'}), ({'state': 'include', 'value': 'green'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'green', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude green'}), ({'state': 'include', 'value': 'gold'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'gold', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude gold'}), ({'state': 'exclude', 'value': 'red'}, {'cycle': 'neutral', 'negative-operand': 'red', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear red'})]}
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:
Reverse activation traverses the tri-state cycle backward is violated by the widget projection.

A facet has neutral/include/exclude states. The UI cycles neutral to include to exclude to neutral, exposes polarity, and serializes inclusion and exclusion separately. This example checks: Reverse activation traverses the tri-state cycle backward.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'cycle':({'neutral':'include','include':'exclude','exclude':'neutral'}[d['state']]), 'negative-operand':(d['value'] if d['state']=='exclude' else None), 'positive-operand':(d['value'] if d['state']=='include' else None), 'exclusion-badge':('minus' if d['state']=='exclude' else ('check' if d['state']=='include' else 'none')), 'reverse-cycle':({'neutral':'exclude','include':'neutral','exclude':'include'}[d['state']]), 'negation-help':('Clear '+d['value'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'state': 'neutral', 'value': 'red'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include red'}), ({'state': 'include', 'value': 'gold'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'gold', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude gold'}), ({'state': 'exclude', 'value': 'red'}, {'cycle': 'neutral', 'negative-operand': 'red', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear red'}), ({'state': 'exclude', 'value': 'blue'}, {'cycle': 'neutral', 'negative-operand': 'blue', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear blue'}), ({'state': 'exclude', 'value': 'green'}, {'cycle': 'neutral', 'negative-operand': 'green', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear green'}), ({'state': 'exclude', 'value': 'gold'}, {'cycle': 'neutral', 'negative-operand': 'gold', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear gold'}), ({'state': 'neutral', 'value': 'blue'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include blue'}), ({'state': 'neutral', 'value': 'green'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include green'}), ({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'})], 2: [({'state': 'neutral', 'value': 'blue'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include blue'}), ({'state': 'exclude', 'value': 'green'}, {'cycle': 'neutral', 'negative-operand': 'green', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear green'}), ({'state': 'neutral', 'value': 'green'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include green'}), ({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'}), ({'state': 'include', 'value': 'blue'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'blue', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude blue'}), ({'state': 'include', 'value': 'green'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'green', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude green'}), ({'state': 'include', 'value': 'gold'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'gold', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude gold'}), ({'state': 'exclude', 'value': 'red'}, {'cycle': 'neutral', 'negative-operand': 'red', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear red'}), ({'state': 'exclude', 'value': 'blue'}, {'cycle': 'neutral', 'negative-operand': 'blue', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear blue'})], 3: [({'state': 'neutral', 'value': 'green'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include green'}), ({'state': 'include', 'value': 'blue'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'blue', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude blue'}), ({'state': 'exclude', 'value': 'blue'}, {'cycle': 'neutral', 'negative-operand': 'blue', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear blue'}), ({'state': 'exclude', 'value': 'green'}, {'cycle': 'neutral', 'negative-operand': 'green', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear green'}), ({'state': 'exclude', 'value': 'gold'}, {'cycle': 'neutral', 'negative-operand': 'gold', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear gold'}), ({'state': 'neutral', 'value': 'red'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include red'}), ({'state': 'neutral', 'value': 'blue'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include blue'}), ({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'}), ({'state': 'include', 'value': 'green'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'green', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude green'})], 4: [({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'exclude', 'value': 'red'}, {'cycle': 'neutral', 'negative-operand': 'red', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear red'}), ({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'}), ({'state': 'include', 'value': 'blue'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'blue', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude blue'}), ({'state': 'include', 'value': 'green'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'green', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude green'}), ({'state': 'include', 'value': 'gold'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'gold', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude gold'}), ({'state': 'exclude', 'value': 'blue'}, {'cycle': 'neutral', 'negative-operand': 'blue', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear blue'}), ({'state': 'exclude', 'value': 'green'}, {'cycle': 'neutral', 'negative-operand': 'green', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear green'}), ({'state': 'exclude', 'value': 'gold'}, {'cycle': 'neutral', 'negative-operand': 'gold', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear gold'}), ({'state': 'neutral', 'value': 'red'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include red'})], 5: [({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'}), ({'state': 'exclude', 'value': 'gold'}, {'cycle': 'neutral', 'negative-operand': 'gold', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear gold'}), ({'state': 'neutral', 'value': 'red'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include red'}), ({'state': 'neutral', 'value': 'blue'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include blue'}), ({'state': 'neutral', 'value': 'green'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include green'}), ({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'include', 'value': 'blue'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'blue', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude blue'}), ({'state': 'include', 'value': 'green'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'green', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude green'}), ({'state': 'include', 'value': 'gold'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'gold', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude gold'}), ({'state': 'exclude', 'value': 'red'}, {'cycle': 'neutral', 'negative-operand': 'red', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear red'})]}
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 {'cycle':({'neutral':'include','include':'exclude','exclude':'neutral'}[d['state']]), 'negative-operand':(d['value'] if d['state']=='exclude' else None), 'positive-operand':(d['value'] if d['state']=='include' else None), 'exclusion-badge':('minus' if d['state']=='exclude' else ('check' if d['state']=='include' else 'none')), 'reverse-cycle':({'neutral':'exclude','include':'neutral','exclude':'include'}[d['state']]), 'negation-help':('Include '+d['value'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'state': 'neutral', 'value': 'red'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include red'}), ({'state': 'include', 'value': 'gold'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'gold', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude gold'}), ({'state': 'exclude', 'value': 'red'}, {'cycle': 'neutral', 'negative-operand': 'red', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear red'}), ({'state': 'exclude', 'value': 'blue'}, {'cycle': 'neutral', 'negative-operand': 'blue', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear blue'}), ({'state': 'exclude', 'value': 'green'}, {'cycle': 'neutral', 'negative-operand': 'green', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear green'}), ({'state': 'exclude', 'value': 'gold'}, {'cycle': 'neutral', 'negative-operand': 'gold', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear gold'}), ({'state': 'neutral', 'value': 'blue'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include blue'}), ({'state': 'neutral', 'value': 'green'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include green'}), ({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'})], 2: [({'state': 'neutral', 'value': 'blue'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include blue'}), ({'state': 'exclude', 'value': 'green'}, {'cycle': 'neutral', 'negative-operand': 'green', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear green'}), ({'state': 'neutral', 'value': 'green'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include green'}), ({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'}), ({'state': 'include', 'value': 'blue'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'blue', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude blue'}), ({'state': 'include', 'value': 'green'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'green', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude green'}), ({'state': 'include', 'value': 'gold'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'gold', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude gold'}), ({'state': 'exclude', 'value': 'red'}, {'cycle': 'neutral', 'negative-operand': 'red', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear red'}), ({'state': 'exclude', 'value': 'blue'}, {'cycle': 'neutral', 'negative-operand': 'blue', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear blue'})], 3: [({'state': 'neutral', 'value': 'green'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include green'}), ({'state': 'include', 'value': 'blue'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'blue', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude blue'}), ({'state': 'exclude', 'value': 'blue'}, {'cycle': 'neutral', 'negative-operand': 'blue', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear blue'}), ({'state': 'exclude', 'value': 'green'}, {'cycle': 'neutral', 'negative-operand': 'green', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear green'}), ({'state': 'exclude', 'value': 'gold'}, {'cycle': 'neutral', 'negative-operand': 'gold', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear gold'}), ({'state': 'neutral', 'value': 'red'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include red'}), ({'state': 'neutral', 'value': 'blue'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include blue'}), ({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'}), ({'state': 'include', 'value': 'green'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'green', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude green'})], 4: [({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'exclude', 'value': 'red'}, {'cycle': 'neutral', 'negative-operand': 'red', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear red'}), ({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'}), ({'state': 'include', 'value': 'blue'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'blue', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude blue'}), ({'state': 'include', 'value': 'green'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'green', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude green'}), ({'state': 'include', 'value': 'gold'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'gold', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude gold'}), ({'state': 'exclude', 'value': 'blue'}, {'cycle': 'neutral', 'negative-operand': 'blue', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear blue'}), ({'state': 'exclude', 'value': 'green'}, {'cycle': 'neutral', 'negative-operand': 'green', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear green'}), ({'state': 'exclude', 'value': 'gold'}, {'cycle': 'neutral', 'negative-operand': 'gold', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear gold'}), ({'state': 'neutral', 'value': 'red'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include red'})], 5: [({'state': 'include', 'value': 'red'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'red', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude red'}), ({'state': 'exclude', 'value': 'gold'}, {'cycle': 'neutral', 'negative-operand': 'gold', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear gold'}), ({'state': 'neutral', 'value': 'red'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include red'}), ({'state': 'neutral', 'value': 'blue'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include blue'}), ({'state': 'neutral', 'value': 'green'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include green'}), ({'state': 'neutral', 'value': 'gold'}, {'cycle': 'include', 'negative-operand': None, 'positive-operand': None, 'exclusion-badge': 'none', 'reverse-cycle': 'exclude', 'negation-help': 'Include gold'}), ({'state': 'include', 'value': 'blue'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'blue', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude blue'}), ({'state': 'include', 'value': 'green'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'green', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude green'}), ({'state': 'include', 'value': 'gold'}, {'cycle': 'exclude', 'negative-operand': None, 'positive-operand': 'gold', 'exclusion-badge': 'check', 'reverse-cycle': 'neutral', 'negation-help': 'Exclude gold'}), ({'state': 'exclude', 'value': 'red'}, {'cycle': 'neutral', 'negative-operand': 'red', 'positive-operand': None, 'exclusion-badge': 'minus', 'reverse-cycle': 'include', 'negation-help': 'Clear red'})]}
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:
Next-action help describes the upcoming tri-state action is violated by the widget projection.

A facet has neutral/include/exclude states. The UI cycles neutral to include to exclude to neutral, exposes polarity, and serializes inclusion and exclusion separately. This example checks: Next-action help describes the upcoming tri-state action.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'compatible-child':(list(d['selected'])), 'child-editor-enabled':(d['parent'] is not None and not d['loading']), 'request-parent':({'parent':d['parent']} if d['parent'] is not None else None), 'parent-reset-child':([] if d['parent'] is None else list(d['selected'])), 'pending-validation':(d['parent'] is not None and d['loading'] and bool(d['selected'])), 'invalid-child-notice':([x for x in d['selected'] if x not in d['allowed']] if not d['loading'] else [])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': '', 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']})], 2: [({'parent': None, 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': '', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': 'p', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []})], 3: [({'parent': None, 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []})], 4: [({'parent': None, 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': 'p', 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': None, 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []})], 5: [({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': None, 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': None, 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': '', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []})]}
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 {'compatible-child':([]), 'child-editor-enabled':(d['parent'] is not None and not d['loading']), 'request-parent':({'parent':d['parent']} if d['parent'] is not None else None), 'parent-reset-child':([] if d['parent'] is None else list(d['selected'])), 'pending-validation':(d['parent'] is not None and d['loading'] and bool(d['selected'])), 'invalid-child-notice':([x for x in d['selected'] if x not in d['allowed']] if not d['loading'] else [])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': '', 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']})], 2: [({'parent': None, 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': '', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': 'p', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []})], 3: [({'parent': None, 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []})], 4: [({'parent': None, 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': 'p', 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': None, 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []})], 5: [({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': None, 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': None, 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': '', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []})]}
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:
Parent changes retain only compatible child selections is violated by the widget projection.

A child facet is meaningful only inside its selected parent scope. Parent changes invalidate incompatible child selections but retain compatible identities. This example checks: Parent changes retain only compatible child selections.

split: open-access