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

N = 1
observations = []
def solve(event, d):
    if event == 'query': return {'text':d['scope']}
    if event == 'epoch': return d['epoch']
    if event == 'field': return d['field']
    if event == 'instance': return d['instance']
    if event == 'locale': return d['locale']
    if event == 'scope': return d['scope']
    if event == 'range': return [d['start'],d['end']]
    if event == 'exclusions': return d['selected']
    if event == 'limit': return d['limit']
    if event == 'accept': return d['response_epoch']==d['epoch'] and d['response_field']==d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'query': return {'text':''}
    if event == 'epoch': return d['epoch']
    if event == 'field': return d['field']
    if event == 'instance': return d['instance']
    if event == 'locale': return d['locale']
    if event == 'scope': return d['scope']
    if event == 'range': return [d['start'],d['end']]
    if event == 'exclusions': return d['selected']
    if event == 'limit': return d['limit']
    if event == 'accept': return d['response_epoch']==d['epoch'] and d['response_field']==d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The query completion transition produces an incorrect observable state.

A suggestion request is bound to draft, field identity, selection range, locale and dependency scope. Each outgoing descriptor carries those values from the initiating snapshot; accepting a response requires the same query epoch and field instance. No transport behavior is modeled.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'query': return {'text':d['query']}
    if event == 'epoch': return d['epoch']+1
    if event == 'field': return d['field']
    if event == 'instance': return d['instance']
    if event == 'locale': return d['locale']
    if event == 'scope': return d['scope']
    if event == 'range': return [d['start'],d['end']]
    if event == 'exclusions': return d['selected']
    if event == 'limit': return d['limit']
    if event == 'accept': return d['response_epoch']==d['epoch'] and d['response_field']==d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'query': return {'text':d['query']}
    if event == 'epoch': return d['epoch']-1
    if event == 'field': return d['field']
    if event == 'instance': return d['instance']
    if event == 'locale': return d['locale']
    if event == 'scope': return d['scope']
    if event == 'range': return [d['start'],d['end']]
    if event == 'exclusions': return d['selected']
    if event == 'limit': return d['limit']
    if event == 'accept': return d['response_epoch']==d['epoch'] and d['response_field']==d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The epoch completion transition produces an incorrect observable state.

A suggestion request is bound to draft, field identity, selection range, locale and dependency scope. Each outgoing descriptor carries those values from the initiating snapshot; accepting a response requires the same query epoch and field instance. No transport behavior is modeled.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'query': return {'text':d['query']}
    if event == 'epoch': return d['epoch']
    if event == 'field': return 'shared'
    if event == 'instance': return d['instance']
    if event == 'locale': return d['locale']
    if event == 'scope': return d['scope']
    if event == 'range': return [d['start'],d['end']]
    if event == 'exclusions': return d['selected']
    if event == 'limit': return d['limit']
    if event == 'accept': return d['response_epoch']==d['epoch'] and d['response_field']==d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'query': return {'text':d['query']}
    if event == 'epoch': return d['epoch']
    if event == 'field': return d['response_field']
    if event == 'instance': return d['instance']
    if event == 'locale': return d['locale']
    if event == 'scope': return d['scope']
    if event == 'range': return [d['start'],d['end']]
    if event == 'exclusions': return d['selected']
    if event == 'limit': return d['limit']
    if event == 'accept': return d['response_epoch']==d['epoch'] and d['response_field']==d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The field completion transition produces an incorrect observable state.

A suggestion request is bound to draft, field identity, selection range, locale and dependency scope. Each outgoing descriptor carries those values from the initiating snapshot; accepting a response requires the same query epoch and field instance. No transport behavior is modeled.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'query': return {'text':d['query']}
    if event == 'epoch': return d['epoch']
    if event == 'field': return d['field']
    if event == 'instance': return d['epoch']
    if event == 'locale': return d['locale']
    if event == 'scope': return d['scope']
    if event == 'range': return [d['start'],d['end']]
    if event == 'exclusions': return d['selected']
    if event == 'limit': return d['limit']
    if event == 'accept': return d['response_epoch']==d['epoch'] and d['response_field']==d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'query': return {'text':d['query']}
    if event == 'epoch': return d['epoch']
    if event == 'field': return d['field']
    if event == 'instance': return 0
    if event == 'locale': return d['locale']
    if event == 'scope': return d['scope']
    if event == 'range': return [d['start'],d['end']]
    if event == 'exclusions': return d['selected']
    if event == 'limit': return d['limit']
    if event == 'accept': return d['response_epoch']==d['epoch'] and d['response_field']==d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The instance completion transition produces an incorrect observable state.

A suggestion request is bound to draft, field identity, selection range, locale and dependency scope. Each outgoing descriptor carries those values from the initiating snapshot; accepting a response requires the same query epoch and field instance. No transport behavior is modeled.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'query': return {'text':d['query']}
    if event == 'epoch': return d['epoch']
    if event == 'field': return d['field']
    if event == 'instance': return d['instance']
    if event == 'locale': return 'en'
    if event == 'scope': return d['scope']
    if event == 'range': return [d['start'],d['end']]
    if event == 'exclusions': return d['selected']
    if event == 'limit': return d['limit']
    if event == 'accept': return d['response_epoch']==d['epoch'] and d['response_field']==d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'query': return {'text':d['query']}
    if event == 'epoch': return d['epoch']
    if event == 'field': return d['field']
    if event == 'instance': return d['instance']
    if event == 'locale': return 'fr'
    if event == 'scope': return d['scope']
    if event == 'range': return [d['start'],d['end']]
    if event == 'exclusions': return d['selected']
    if event == 'limit': return d['limit']
    if event == 'accept': return d['response_epoch']==d['epoch'] and d['response_field']==d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The locale completion transition produces an incorrect observable state.

A suggestion request is bound to draft, field identity, selection range, locale and dependency scope. Each outgoing descriptor carries those values from the initiating snapshot; accepting a response requires the same query epoch and field instance. No transport behavior is modeled.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'query': return {'text':d['query']}
    if event == 'epoch': return d['epoch']
    if event == 'field': return d['field']
    if event == 'instance': return d['instance']
    if event == 'locale': return d['locale']
    if event == 'scope': return 'all'
    if event == 'range': return [d['start'],d['end']]
    if event == 'exclusions': return d['selected']
    if event == 'limit': return d['limit']
    if event == 'accept': return d['response_epoch']==d['epoch'] and d['response_field']==d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'query': return {'text':d['query']}
    if event == 'epoch': return d['epoch']
    if event == 'field': return d['field']
    if event == 'instance': return d['instance']
    if event == 'locale': return d['locale']
    if event == 'scope': return d['field']
    if event == 'range': return [d['start'],d['end']]
    if event == 'exclusions': return d['selected']
    if event == 'limit': return d['limit']
    if event == 'accept': return d['response_epoch']==d['epoch'] and d['response_field']==d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The scope completion transition produces an incorrect observable state.

A suggestion request is bound to draft, field identity, selection range, locale and dependency scope. Each outgoing descriptor carries those values from the initiating snapshot; accepting a response requires the same query epoch and field instance. No transport behavior is modeled.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'query': return {'text':d['query']}
    if event == 'epoch': return d['epoch']
    if event == 'field': return d['field']
    if event == 'instance': return d['instance']
    if event == 'locale': return d['locale']
    if event == 'scope': return d['scope']
    if event == 'range': return [d['end'],d['end']]
    if event == 'exclusions': return d['selected']
    if event == 'limit': return d['limit']
    if event == 'accept': return d['response_epoch']==d['epoch'] and d['response_field']==d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'query': return {'text':d['query']}
    if event == 'epoch': return d['epoch']
    if event == 'field': return d['field']
    if event == 'instance': return d['instance']
    if event == 'locale': return d['locale']
    if event == 'scope': return d['scope']
    if event == 'range': return [0,d['end']]
    if event == 'exclusions': return d['selected']
    if event == 'limit': return d['limit']
    if event == 'accept': return d['response_epoch']==d['epoch'] and d['response_field']==d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The range completion transition produces an incorrect observable state.

A suggestion request is bound to draft, field identity, selection range, locale and dependency scope. Each outgoing descriptor carries those values from the initiating snapshot; accepting a response requires the same query epoch and field instance. No transport behavior is modeled.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'query': return {'text':d['query']}
    if event == 'epoch': return d['epoch']
    if event == 'field': return d['field']
    if event == 'instance': return d['instance']
    if event == 'locale': return d['locale']
    if event == 'scope': return d['scope']
    if event == 'range': return [d['start'],d['end']]
    if event == 'exclusions': return []
    if event == 'limit': return d['limit']
    if event == 'accept': return d['response_epoch']==d['epoch'] and d['response_field']==d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'query': return {'text':d['query']}
    if event == 'epoch': return d['epoch']
    if event == 'field': return d['field']
    if event == 'instance': return d['instance']
    if event == 'locale': return d['locale']
    if event == 'scope': return d['scope']
    if event == 'range': return [d['start'],d['end']]
    if event == 'exclusions': return [d['query']]
    if event == 'limit': return d['limit']
    if event == 'accept': return d['response_epoch']==d['epoch'] and d['response_field']==d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The exclusions completion transition produces an incorrect observable state.

A suggestion request is bound to draft, field identity, selection range, locale and dependency scope. Each outgoing descriptor carries those values from the initiating snapshot; accepting a response requires the same query epoch and field instance. No transport behavior is modeled.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'query': return {'text':d['query']}
    if event == 'epoch': return d['epoch']
    if event == 'field': return d['field']
    if event == 'instance': return d['instance']
    if event == 'locale': return d['locale']
    if event == 'scope': return d['scope']
    if event == 'range': return [d['start'],d['end']]
    if event == 'exclusions': return d['selected']
    if event == 'limit': return max(1,d['limit'])
    if event == 'accept': return d['response_epoch']==d['epoch'] and d['response_field']==d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'query': return {'text':d['query']}
    if event == 'epoch': return d['epoch']
    if event == 'field': return d['field']
    if event == 'instance': return d['instance']
    if event == 'locale': return d['locale']
    if event == 'scope': return d['scope']
    if event == 'range': return [d['start'],d['end']]
    if event == 'exclusions': return d['selected']
    if event == 'limit': return d['limit'] or 10
    if event == 'accept': return d['response_epoch']==d['epoch'] and d['response_field']==d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The limit completion transition produces an incorrect observable state.

A suggestion request is bound to draft, field identity, selection range, locale and dependency scope. Each outgoing descriptor carries those values from the initiating snapshot; accepting a response requires the same query epoch and field instance. No transport behavior is modeled.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'query': return {'text':d['query']}
    if event == 'epoch': return d['epoch']
    if event == 'field': return d['field']
    if event == 'instance': return d['instance']
    if event == 'locale': return d['locale']
    if event == 'scope': return d['scope']
    if event == 'range': return [d['start'],d['end']]
    if event == 'exclusions': return d['selected']
    if event == 'limit': return d['limit']
    if event == 'accept': return d['response_epoch']<=d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'query': return {'text':d['query']}
    if event == 'epoch': return d['epoch']
    if event == 'field': return d['field']
    if event == 'instance': return d['instance']
    if event == 'locale': return d['locale']
    if event == 'scope': return d['scope']
    if event == 'range': return [d['start'],d['end']]
    if event == 'exclusions': return d['selected']
    if event == 'limit': return d['limit']
    if event == 'accept': return d['response_epoch']<=d['epoch'] and d['response_field']!=d['field']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pear','epoch':N,'field':'billing','instance':N+2,'locale':'fr','scope':'fruit','start':1,'end':3,'selected':['p1'],'limit':7,'response_epoch':N-1,'response_field':'shipping'}
boundary = {'query':'','epoch':N,'field':'billing','instance':N,'locale':'en','scope':'all','start':0,'end':0,'selected':[],'limit':0,'response_epoch':N,'response_field':'billing'}
check('normal query', solve('query', normal), {'text':'pear'})
check('boundary query', solve('query', boundary), {'text':''})
check('normal epoch', solve('epoch', normal), N)
check('boundary epoch', solve('epoch', boundary), N)
check('normal field', solve('field', normal), 'billing')
check('boundary field', solve('field', boundary), 'billing')
check('normal instance', solve('instance', normal), N+2)
check('boundary instance', solve('instance', boundary), N)
check('normal locale', solve('locale', normal), 'fr')
check('boundary locale', solve('locale', boundary), 'en')
check('normal scope', solve('scope', normal), 'fruit')
check('boundary scope', solve('scope', boundary), 'all')
check('normal range', solve('range', normal), [1,3])
check('boundary range', solve('range', boundary), [0,0])
check('normal exclusions', solve('exclusions', normal), ['p1'])
check('boundary exclusions', solve('exclusions', boundary), [])
check('normal limit', solve('limit', normal), 7)
check('boundary limit', solve('limit', boundary), 0)
check('normal accept', solve('accept', normal), False)
check('boundary accept', solve('accept', boundary), True)
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('query', variant), {'text':'q'*N})
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The accept completion transition produces an incorrect observable state.

A suggestion request is bound to draft, field identity, selection range, locale and dependency scope. Each outgoing descriptor carries those values from the initiating snapshot; accepting a response requires the same query epoch and field instance. No transport behavior is modeled.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'replace': return (d['pending'] or '')+d['query']
    if event == 'deadline': return d['now']+d['delay']
    if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
    if event == 'suspend': return None if d['composing'] else d['deadline']
    if event == 'duplicate': return d['query']==d['sent']
    if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
    if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'replace': return d['pending']
    if event == 'deadline': return d['now']+d['delay']
    if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
    if event == 'suspend': return None if d['composing'] else d['deadline']
    if event == 'duplicate': return d['query']==d['sent']
    if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
    if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The replace completion transition produces an incorrect observable state.

A new draft replaces the pending autocomplete job and its deadline. A deadline emits only its exact draft epoch; flush emits pending text once; cancellation discards pending text. Leading search marks its own query, and composition suspends timers. Time values are integer ticks.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'replace': return d['query']
    if event == 'deadline': return d['deadline']+d['delay']
    if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
    if event == 'suspend': return None if d['composing'] else d['deadline']
    if event == 'duplicate': return d['query']==d['sent']
    if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
    if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'replace': return d['query']
    if event == 'deadline': return d['now']
    if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
    if event == 'suspend': return None if d['composing'] else d['deadline']
    if event == 'duplicate': return d['query']==d['sent']
    if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
    if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The deadline completion transition produces an incorrect observable state.

A new draft replaces the pending autocomplete job and its deadline. A deadline emits only its exact draft epoch; flush emits pending text once; cancellation discards pending text. Leading search marks its own query, and composition suspends timers. Time values are integer ticks.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'replace': return d['query']
    if event == 'deadline': return d['now']+d['delay']
    if event == 'expired': return d['pending'] if d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
    if event == 'suspend': return None if d['composing'] else d['deadline']
    if event == 'duplicate': return d['query']==d['sent']
    if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
    if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'replace': return d['query']
    if event == 'deadline': return d['now']+d['delay']
    if event == 'expired': return d['query'] if d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
    if event == 'suspend': return None if d['composing'] else d['deadline']
    if event == 'duplicate': return d['query']==d['sent']
    if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
    if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The expired completion transition produces an incorrect observable state.

A new draft replaces the pending autocomplete job and its deadline. A deadline emits only its exact draft epoch; flush emits pending text once; cancellation discards pending text. Leading search marks its own query, and composition suspends timers. Time values are integer ticks.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'replace': return d['query']
    if event == 'deadline': return d['now']+d['delay']
    if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
    if event == 'flush': return [d['query']]
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
    if event == 'suspend': return None if d['composing'] else d['deadline']
    if event == 'duplicate': return d['query']==d['sent']
    if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
    if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'replace': return d['query']
    if event == 'deadline': return d['now']+d['delay']
    if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']]
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
    if event == 'suspend': return None if d['composing'] else d['deadline']
    if event == 'duplicate': return d['query']==d['sent']
    if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
    if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The flush completion transition produces an incorrect observable state.

A new draft replaces the pending autocomplete job and its deadline. A deadline emits only its exact draft epoch; flush emits pending text once; cancellation discards pending text. Leading search marks its own query, and composition suspends timers. Time values are integer ticks.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'replace': return d['query']
    if event == 'deadline': return d['now']+d['delay']
    if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':d['pending'],'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
    if event == 'suspend': return None if d['composing'] else d['deadline']
    if event == 'duplicate': return d['query']==d['sent']
    if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
    if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'replace': return d['query']
    if event == 'deadline': return d['now']+d['delay']
    if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':d['deadline']}
    if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
    if event == 'suspend': return None if d['composing'] else d['deadline']
    if event == 'duplicate': return d['query']==d['sent']
    if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
    if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The cancel completion transition produces an incorrect observable state.

A new draft replaces the pending autocomplete job and its deadline. A deadline emits only its exact draft epoch; flush emits pending text once; cancellation discards pending text. Leading search marks its own query, and composition suspends timers. Time values are integer ticks.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'replace': return d['query']
    if event == 'deadline': return d['now']+d['delay']
    if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['sent'],'epoch':d['epoch']}
    if event == 'suspend': return None if d['composing'] else d['deadline']
    if event == 'duplicate': return d['query']==d['sent']
    if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
    if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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(event, d):
    if event == 'replace': return d['query']
    if event == 'deadline': return d['now']+d['delay']
    if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['job_epoch']}
    if event == 'suspend': return None if d['composing'] else d['deadline']
    if event == 'duplicate': return d['query']==d['sent']
    if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
    if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The leading completion transition produces an incorrect observable state.

A new draft replaces the pending autocomplete job and its deadline. A deadline emits only its exact draft epoch; flush emits pending text once; cancellation discards pending text. Leading search marks its own query, and composition suspends timers. Time values are integer ticks.

split: open-access