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

N = 1
observations = []
def solve(d):
    return {'symbolic-payload':({'duration':d['duration'],'direction':d['direction']} if d['mode']=='live' else {'anchor':d['anchor'],'duration':d['duration'],'direction':d['direction']}), 'direction-caption':('past' if d['direction']==-1 else 'next'), 'anchor-control':(d['mode']=='frozen'), 'preview-validity':(d['preview_anchor']==d['anchor'] and d['preview_direction']==d['direction']), 'duration-required':(d['duration']>=0), 'freeze-action':(d['now'] if d['mode']=='live' else d['anchor'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 1, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 0, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10}), ({'duration': 0, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': True, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': False, 'freeze-action': 10}), ({'duration': 1, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 1, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': True, 'duration-required': True, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10})], 2: [({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 1, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 0, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10}), ({'duration': 1, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': True, 'duration-required': True, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': True, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10})], 3: [({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': True, 'duration-required': False, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 1, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10})], 4: [({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10}), ({'duration': 0, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10})], 5: [({'duration': 0, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': True, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10}), ({'duration': 0, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': True, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': False, 'freeze-action': 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)

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

N = 1
observations = []
def solve(d):
    return {'symbolic-payload':({'duration':d['duration'],'direction':d['direction']} if d['mode']=='live' else {'anchor':d['anchor'],'duration':d['duration'],'direction':d['direction']}), 'direction-caption':('past' if d['direction']==-1 else 'next'), 'anchor-control':(d['mode']=='frozen'), 'preview-validity':(d['preview_anchor']==d['anchor'] and d['preview_direction']==d['direction']), 'duration-required':(d['duration']>1), 'freeze-action':(d['now'] if d['mode']=='live' else d['anchor'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 1, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 0, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10}), ({'duration': 0, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': True, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': False, 'freeze-action': 10}), ({'duration': 1, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 1, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': True, 'duration-required': True, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10})], 2: [({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 1, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 0, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10}), ({'duration': 1, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': True, 'duration-required': True, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': True, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10})], 3: [({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': True, 'duration-required': False, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 1, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10})], 4: [({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10}), ({'duration': 0, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10})], 5: [({'duration': 0, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': True, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10}), ({'duration': 0, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': True, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': False, 'freeze-action': 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 relative date preset requires a positive duration including one unit is violated by the widget projection.

Relative filter presets retain symbolic duration until apply when frozen mode is selected; changing anchor or direction invalidates an absolute draft preview. This example checks: A relative date preset requires a positive duration including one unit.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'symbolic-payload':({'duration':d['duration'],'direction':d['direction']} if d['mode']=='live' else {'anchor':d['anchor'],'duration':d['duration'],'direction':d['direction']}), 'direction-caption':('past' if d['direction']==-1 else 'next'), 'anchor-control':(d['mode']=='frozen'), 'preview-validity':(d['preview_anchor']==d['anchor'] and d['preview_direction']==d['direction']), 'duration-required':(d['duration']>0), 'freeze-action':(d['anchor'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10}), ({'duration': 0, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': True, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': False, 'freeze-action': 10}), ({'duration': 1, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 1, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 1, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': True, 'duration-required': True, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10})], 2: [({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10}), ({'duration': 1, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': True, 'duration-required': True, 'freeze-action': 12}), ({'duration': 1, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 1, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': True, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10})], 3: [({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': True, 'duration-required': False, 'freeze-action': 12}), ({'duration': 1, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 1, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10})], 4: [({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10}), ({'duration': 0, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10})], 5: [({'duration': 0, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': True, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10}), ({'duration': 0, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': True, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': False, 'freeze-action': 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 {'symbolic-payload':({'duration':d['duration'],'direction':d['direction']} if d['mode']=='live' else {'anchor':d['anchor'],'duration':d['duration'],'direction':d['direction']}), 'direction-caption':('past' if d['direction']==-1 else 'next'), 'anchor-control':(d['mode']=='frozen'), 'preview-validity':(d['preview_anchor']==d['anchor'] and d['preview_direction']==d['direction']), 'duration-required':(d['duration']>0), 'freeze-action':(d['now'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10}), ({'duration': 0, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': True, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': False, 'freeze-action': 10}), ({'duration': 1, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 1, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 1, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': True, 'duration-required': True, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10})], 2: [({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10}), ({'duration': 1, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': True, 'duration-required': True, 'freeze-action': 12}), ({'duration': 1, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 1, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': True, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10})], 3: [({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': -1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': True, 'duration-required': False, 'freeze-action': 12}), ({'duration': 1, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 1, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10})], 4: [({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10}), ({'duration': 0, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10})], 5: [({'duration': 0, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 9, 'preview_direction': -1}, {'symbolic-payload': {'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 1, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 1, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': True, 'freeze-action': 10}), ({'duration': 7, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': True, 'duration-required': True, 'freeze-action': 12}), ({'duration': 7, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 7, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': True, 'freeze-action': 10}), ({'duration': 0, 'direction': -1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': False, 'preview-validity': False, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': -1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': -1}, 'direction-caption': 'past', 'anchor-control': True, 'preview-validity': False, 'duration-required': False, 'freeze-action': 10}), ({'duration': 0, 'direction': 1, 'mode': 'live', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': False, 'preview-validity': True, 'duration-required': False, 'freeze-action': 12}), ({'duration': 0, 'direction': 1, 'mode': 'frozen', 'anchor': 10, 'now': 12, 'preview_anchor': 10, 'preview_direction': 1}, {'symbolic-payload': {'anchor': 10, 'duration': 0, 'direction': 1}, 'direction-caption': 'next', 'anchor-control': True, 'preview-validity': True, 'duration-required': False, 'freeze-action': 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:
Freezing a live date filter captures current time once is violated by the widget projection.

Relative filter presets retain symbolic duration until apply when frozen mode is selected; changing anchor or direction invalidates an absolute draft preview. This example checks: Freezing a live date filter captures current time once.

split: open-access