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

N = 1
observations = []
def solve(d):
    return {'request-gate':(d['open']), 'reply-accept':(d['reply_revision']==d['draft_revision'] and d['reply_scope']==d['scope']), 'committed-preserve':(d['committed']), 'estimate-display':(d['count'] if d['valid'] and d['reply_revision']==d['draft_revision'] else None), 'empty-estimate':(d['count']==0 and d['reply_revision']==d['draft_revision'] and d['valid']), 'preview-busy':(d['open'] and d['valid'] and d['reply_revision']!=d['draft_revision'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False})], 2: [({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': True}), ({'valid': True, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': True}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False})], 3: [({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': True}), ({'valid': True, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': True}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': True, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False})], 4: [({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False})], 5: [({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    return {'request-gate':(d['valid']), 'reply-accept':(d['reply_revision']==d['draft_revision'] and d['reply_scope']==d['scope']), 'committed-preserve':(d['committed']), 'estimate-display':(d['count'] if d['valid'] and d['reply_revision']==d['draft_revision'] else None), 'empty-estimate':(d['count']==0 and d['reply_revision']==d['draft_revision'] and d['valid']), 'preview-busy':(d['open'] and d['valid'] and d['reply_revision']!=d['draft_revision'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False})], 2: [({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': True}), ({'valid': True, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': True}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False})], 3: [({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': True}), ({'valid': True, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': True}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': True, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False})], 4: [({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False})], 5: [({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Preview requests require a valid draft in an open editor is violated by the widget projection.

A filter preview is a noncommitting projection tagged with draft revision and scope. Invalid drafts cancel preview and stale replies do not replace the current estimate. This example checks: Preview requests require a valid draft in an open editor.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'request-gate':(d['valid'] and d['open']), 'reply-accept':(d['reply_revision']==d['draft_revision']), 'committed-preserve':(d['committed']), 'estimate-display':(d['count'] if d['valid'] and d['reply_revision']==d['draft_revision'] else None), 'empty-estimate':(d['count']==0 and d['reply_revision']==d['draft_revision'] and d['valid']), 'preview-busy':(d['open'] and d['valid'] and d['reply_revision']!=d['draft_revision'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False})], 2: [({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': True}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': True}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False})], 3: [({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': True}), ({'valid': True, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': True}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': True, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False})], 4: [({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False})], 5: [({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': True}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(d):
    return {'request-gate':(d['valid'] and d['open']), 'reply-accept':(d['reply_scope']==d['scope']), 'committed-preserve':(d['committed']), 'estimate-display':(d['count'] if d['valid'] and d['reply_revision']==d['draft_revision'] else None), 'empty-estimate':(d['count']==0 and d['reply_revision']==d['draft_revision'] and d['valid']), 'preview-busy':(d['open'] and d['valid'] and d['reply_revision']!=d['draft_revision'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False})], 2: [({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': True}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': True}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False})], 3: [({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': True}), ({'valid': True, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': True}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': True, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 5, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False})], 4: [({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False})], 5: [({'valid': True, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 0}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': 0, 'empty-estimate': True, 'preview-busy': False}), ({'valid': True, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': True, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': True}), ({'valid': False, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': False, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': True, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': False, 'open': True, 'reply_revision': 2, 'draft_revision': 2, 'reply_scope': 'b', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False}), ({'valid': True, 'open': False, 'reply_revision': 1, 'draft_revision': 2, 'reply_scope': 'a', 'scope': 'a', 'committed': ['x'], 'draft': ['y'], 'count': 5}, {'request-gate': False, 'reply-accept': False, 'committed-preserve': ['x'], 'estimate-display': None, 'empty-estimate': False, 'preview-busy': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Preview replies match both current draft revision and scope is violated by the widget projection.

A filter preview is a noncommitting projection tagged with draft revision and scope. Invalid drafts cancel preview and stale replies do not replace the current estimate. This example checks: Preview replies match both current draft revision and scope.

split: open-access