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

N = 1
observations = []
def solve(operation, s):
    active, result, request, latest, mounted, data, error, prior = s
    if operation == 'route-and-request-admission':
        return mounted and active==result and request==latest
    if operation == 'unmount-write-suppression':
        return data if mounted else prior
    if operation == 'error-null-distinction':
        return error is not None
    if operation == 'empty-loader-result':
        return data if data is not None else prior
    if operation == 'stale-error-isolation':
        return error
    if operation == 'loading-settlement':
        return request!=latest
    if operation == 'retained-data-on-error':
        return prior if error is not None else data
    if operation == 'route-transition-clear':
        return prior if active==result else {}
    if operation == 'error-boundary-reset-key':
        return (active,latest)
    if operation == 'resource-disposition':
        return 'discard' if not mounted else ('commit' if active==result and request==latest else 'stale')
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('route-and-request-admission scenario 1', solve('route-and-request-admission', ('a','a',1,1,True,{'v':N},None,{'old':1})), True)
check('route-and-request-admission scenario 2', solve('route-and-request-admission', ('a','b',1,2,True,{},'bad',{'old':N})), False)
check('route-and-request-admission scenario 3', solve('route-and-request-admission', ('a','a',1,2,True,None,'bad',{'old':N})), False)
check('route-and-request-admission scenario 4', solve('route-and-request-admission', ('a','a',2,2,False,{'v':N},None,{})), False)
check('route-and-request-admission scenario 5', solve('route-and-request-admission', ('b','b',2,2,True,{},None,{'old':N})), True)
check('route-and-request-admission scenario 6', solve('route-and-request-admission', ('a','a',3,3,True,None,'',{'old':N})), True)
check('unmount-write-suppression scenario 1', solve('unmount-write-suppression', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('unmount-write-suppression scenario 2', solve('unmount-write-suppression', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('unmount-write-suppression scenario 3', solve('unmount-write-suppression', ('a','a',1,2,True,None,'bad',{'old':N})), None)
check('unmount-write-suppression scenario 4', solve('unmount-write-suppression', ('a','a',2,2,False,{'v':N},None,{})), {})
check('unmount-write-suppression scenario 5', solve('unmount-write-suppression', ('b','b',2,2,True,{},None,{'old':N})), {})
check('unmount-write-suppression scenario 6', solve('unmount-write-suppression', ('a','a',3,3,True,None,'',{'old':N})), None)
check('error-null-distinction scenario 1', solve('error-null-distinction', ('a','a',1,1,True,{'v':N},None,{'old':1})), False)
check('error-null-distinction scenario 2', solve('error-null-distinction', ('a','b',1,2,True,{},'bad',{'old':N})), True)
check('error-null-distinction scenario 3', solve('error-null-distinction', ('a','a',1,2,True,None,'bad',{'old':N})), True)
check('error-null-distinction scenario 4', solve('error-null-distinction', ('a','a',2,2,False,{'v':N},None,{})), False)
check('error-null-distinction scenario 5', solve('error-null-distinction', ('b','b',2,2,True,{},None,{'old':N})), False)
check('error-null-distinction scenario 6', solve('error-null-distinction', ('a','a',3,3,True,None,'',{'old':N})), True)
check('empty-loader-result scenario 1', solve('empty-loader-result', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('empty-loader-result scenario 2', solve('empty-loader-result', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('empty-loader-result scenario 3', solve('empty-loader-result', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('empty-loader-result scenario 4', solve('empty-loader-result', ('a','a',2,2,False,{'v':N},None,{})), {'v':N})
check('empty-loader-result scenario 5', solve('empty-loader-result', ('b','b',2,2,True,{},None,{'old':N})), {})
check('empty-loader-result scenario 6', solve('empty-loader-result', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('stale-error-isolation scenario 1', solve('stale-error-isolation', ('a','a',1,1,True,{'v':N},None,{'old':1})), None)
check('stale-error-isolation scenario 2', solve('stale-error-isolation', ('a','b',1,2,True,{},'bad',{'old':N})), None)
check('stale-error-isolation scenario 3', solve('stale-error-isolation', ('a','a',1,2,True,None,'bad',{'old':N})), None)
check('stale-error-isolation scenario 4', solve('stale-error-isolation', ('a','a',2,2,False,{'v':N},None,{})), None)
check('stale-error-isolation scenario 5', solve('stale-error-isolation', ('b','b',2,2,True,{},None,{'old':N})), None)
check('stale-error-isolation scenario 6', solve('stale-error-isolation', ('a','a',3,3,True,None,'',{'old':N})), '')
check('loading-settlement scenario 1', solve('loading-settlement', ('a','a',1,1,True,{'v':N},None,{'old':1})), False)
check('loading-settlement scenario 2', solve('loading-settlement', ('a','b',1,2,True,{},'bad',{'old':N})), True)
check('loading-settlement scenario 3', solve('loading-settlement', ('a','a',1,2,True,None,'bad',{'old':N})), True)
check('loading-settlement scenario 4', solve('loading-settlement', ('a','a',2,2,False,{'v':N},None,{})), False)
check('loading-settlement scenario 5', solve('loading-settlement', ('b','b',2,2,True,{},None,{'old':N})), False)
check('loading-settlement scenario 6', solve('loading-settlement', ('a','a',3,3,True,None,'',{'old':N})), False)
check('retained-data-on-error scenario 1', solve('retained-data-on-error', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('retained-data-on-error scenario 2', solve('retained-data-on-error', ('a','b',1,2,True,{},'bad',{'old':N})), {'old':N})
check('retained-data-on-error scenario 3', solve('retained-data-on-error', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('retained-data-on-error scenario 4', solve('retained-data-on-error', ('a','a',2,2,False,{'v':N},None,{})), {'v':N})
check('retained-data-on-error scenario 5', solve('retained-data-on-error', ('b','b',2,2,True,{},None,{'old':N})), {})
check('retained-data-on-error scenario 6', solve('retained-data-on-error', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('route-transition-clear scenario 1', solve('route-transition-clear', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'old':1})
check('route-transition-clear scenario 2', solve('route-transition-clear', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('route-transition-clear scenario 3', solve('route-transition-clear', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('route-transition-clear scenario 4', solve('route-transition-clear', ('a','a',2,2,False,{'v':N},None,{})), {})
check('route-transition-clear scenario 5', solve('route-transition-clear', ('b','b',2,2,True,{},None,{'old':N})), {'old':N})
check('route-transition-clear scenario 6', solve('route-transition-clear', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('error-boundary-reset-key scenario 1', solve('error-boundary-reset-key', ('a','a',1,1,True,{'v':N},None,{'old':1})), ('a',1))
check('error-boundary-reset-key scenario 2', solve('error-boundary-reset-key', ('a','b',1,2,True,{},'bad',{'old':N})), ('a',2))
check('error-boundary-reset-key scenario 3', solve('error-boundary-reset-key', ('a','a',1,2,True,None,'bad',{'old':N})), ('a',2))
check('error-boundary-reset-key scenario 4', solve('error-boundary-reset-key', ('a','a',2,2,False,{'v':N},None,{})), ('a',2))
check('error-boundary-reset-key scenario 5', solve('error-boundary-reset-key', ('b','b',2,2,True,{},None,{'old':N})), ('b',2))
check('error-boundary-reset-key scenario 6', solve('error-boundary-reset-key', ('a','a',3,3,True,None,'',{'old':N})), ('a',3))
check('resource-disposition scenario 1', solve('resource-disposition', ('a','a',1,1,True,{'v':N},None,{'old':1})), 'commit')
check('resource-disposition scenario 2', solve('resource-disposition', ('a','b',1,2,True,{},'bad',{'old':N})), 'stale')
check('resource-disposition scenario 3', solve('resource-disposition', ('a','a',1,2,True,None,'bad',{'old':N})), 'stale')
check('resource-disposition scenario 4', solve('resource-disposition', ('a','a',2,2,False,{'v':N},None,{})), 'discard')
check('resource-disposition scenario 5', solve('resource-disposition', ('b','b',2,2,True,{},None,{'old':N})), 'commit')
check('resource-disposition scenario 6', solve('resource-disposition', ('a','a',3,3,True,None,'',{'old':N})), 'commit')
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(operation, s):
    active, result, request, latest, mounted, data, error, prior = s
    if operation == 'route-and-request-admission':
        return mounted and active==result and request==latest
    if operation == 'unmount-write-suppression':
        return data if mounted else prior
    if operation == 'error-null-distinction':
        return error is not None
    if operation == 'empty-loader-result':
        return data if data is not None else prior
    if operation == 'stale-error-isolation':
        return error if active==result else None
    if operation == 'loading-settlement':
        return request!=latest
    if operation == 'retained-data-on-error':
        return prior if error is not None else data
    if operation == 'route-transition-clear':
        return prior if active==result else {}
    if operation == 'error-boundary-reset-key':
        return (active,latest)
    if operation == 'resource-disposition':
        return 'discard' if not mounted else ('commit' if active==result and request==latest else 'stale')
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('route-and-request-admission scenario 1', solve('route-and-request-admission', ('a','a',1,1,True,{'v':N},None,{'old':1})), True)
check('route-and-request-admission scenario 2', solve('route-and-request-admission', ('a','b',1,2,True,{},'bad',{'old':N})), False)
check('route-and-request-admission scenario 3', solve('route-and-request-admission', ('a','a',1,2,True,None,'bad',{'old':N})), False)
check('route-and-request-admission scenario 4', solve('route-and-request-admission', ('a','a',2,2,False,{'v':N},None,{})), False)
check('route-and-request-admission scenario 5', solve('route-and-request-admission', ('b','b',2,2,True,{},None,{'old':N})), True)
check('route-and-request-admission scenario 6', solve('route-and-request-admission', ('a','a',3,3,True,None,'',{'old':N})), True)
check('unmount-write-suppression scenario 1', solve('unmount-write-suppression', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('unmount-write-suppression scenario 2', solve('unmount-write-suppression', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('unmount-write-suppression scenario 3', solve('unmount-write-suppression', ('a','a',1,2,True,None,'bad',{'old':N})), None)
check('unmount-write-suppression scenario 4', solve('unmount-write-suppression', ('a','a',2,2,False,{'v':N},None,{})), {})
check('unmount-write-suppression scenario 5', solve('unmount-write-suppression', ('b','b',2,2,True,{},None,{'old':N})), {})
check('unmount-write-suppression scenario 6', solve('unmount-write-suppression', ('a','a',3,3,True,None,'',{'old':N})), None)
check('error-null-distinction scenario 1', solve('error-null-distinction', ('a','a',1,1,True,{'v':N},None,{'old':1})), False)
check('error-null-distinction scenario 2', solve('error-null-distinction', ('a','b',1,2,True,{},'bad',{'old':N})), True)
check('error-null-distinction scenario 3', solve('error-null-distinction', ('a','a',1,2,True,None,'bad',{'old':N})), True)
check('error-null-distinction scenario 4', solve('error-null-distinction', ('a','a',2,2,False,{'v':N},None,{})), False)
check('error-null-distinction scenario 5', solve('error-null-distinction', ('b','b',2,2,True,{},None,{'old':N})), False)
check('error-null-distinction scenario 6', solve('error-null-distinction', ('a','a',3,3,True,None,'',{'old':N})), True)
check('empty-loader-result scenario 1', solve('empty-loader-result', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('empty-loader-result scenario 2', solve('empty-loader-result', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('empty-loader-result scenario 3', solve('empty-loader-result', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('empty-loader-result scenario 4', solve('empty-loader-result', ('a','a',2,2,False,{'v':N},None,{})), {'v':N})
check('empty-loader-result scenario 5', solve('empty-loader-result', ('b','b',2,2,True,{},None,{'old':N})), {})
check('empty-loader-result scenario 6', solve('empty-loader-result', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('stale-error-isolation scenario 1', solve('stale-error-isolation', ('a','a',1,1,True,{'v':N},None,{'old':1})), None)
check('stale-error-isolation scenario 2', solve('stale-error-isolation', ('a','b',1,2,True,{},'bad',{'old':N})), None)
check('stale-error-isolation scenario 3', solve('stale-error-isolation', ('a','a',1,2,True,None,'bad',{'old':N})), None)
check('stale-error-isolation scenario 4', solve('stale-error-isolation', ('a','a',2,2,False,{'v':N},None,{})), None)
check('stale-error-isolation scenario 5', solve('stale-error-isolation', ('b','b',2,2,True,{},None,{'old':N})), None)
check('stale-error-isolation scenario 6', solve('stale-error-isolation', ('a','a',3,3,True,None,'',{'old':N})), '')
check('loading-settlement scenario 1', solve('loading-settlement', ('a','a',1,1,True,{'v':N},None,{'old':1})), False)
check('loading-settlement scenario 2', solve('loading-settlement', ('a','b',1,2,True,{},'bad',{'old':N})), True)
check('loading-settlement scenario 3', solve('loading-settlement', ('a','a',1,2,True,None,'bad',{'old':N})), True)
check('loading-settlement scenario 4', solve('loading-settlement', ('a','a',2,2,False,{'v':N},None,{})), False)
check('loading-settlement scenario 5', solve('loading-settlement', ('b','b',2,2,True,{},None,{'old':N})), False)
check('loading-settlement scenario 6', solve('loading-settlement', ('a','a',3,3,True,None,'',{'old':N})), False)
check('retained-data-on-error scenario 1', solve('retained-data-on-error', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('retained-data-on-error scenario 2', solve('retained-data-on-error', ('a','b',1,2,True,{},'bad',{'old':N})), {'old':N})
check('retained-data-on-error scenario 3', solve('retained-data-on-error', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('retained-data-on-error scenario 4', solve('retained-data-on-error', ('a','a',2,2,False,{'v':N},None,{})), {'v':N})
check('retained-data-on-error scenario 5', solve('retained-data-on-error', ('b','b',2,2,True,{},None,{'old':N})), {})
check('retained-data-on-error scenario 6', solve('retained-data-on-error', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('route-transition-clear scenario 1', solve('route-transition-clear', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'old':1})
check('route-transition-clear scenario 2', solve('route-transition-clear', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('route-transition-clear scenario 3', solve('route-transition-clear', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('route-transition-clear scenario 4', solve('route-transition-clear', ('a','a',2,2,False,{'v':N},None,{})), {})
check('route-transition-clear scenario 5', solve('route-transition-clear', ('b','b',2,2,True,{},None,{'old':N})), {'old':N})
check('route-transition-clear scenario 6', solve('route-transition-clear', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('error-boundary-reset-key scenario 1', solve('error-boundary-reset-key', ('a','a',1,1,True,{'v':N},None,{'old':1})), ('a',1))
check('error-boundary-reset-key scenario 2', solve('error-boundary-reset-key', ('a','b',1,2,True,{},'bad',{'old':N})), ('a',2))
check('error-boundary-reset-key scenario 3', solve('error-boundary-reset-key', ('a','a',1,2,True,None,'bad',{'old':N})), ('a',2))
check('error-boundary-reset-key scenario 4', solve('error-boundary-reset-key', ('a','a',2,2,False,{'v':N},None,{})), ('a',2))
check('error-boundary-reset-key scenario 5', solve('error-boundary-reset-key', ('b','b',2,2,True,{},None,{'old':N})), ('b',2))
check('error-boundary-reset-key scenario 6', solve('error-boundary-reset-key', ('a','a',3,3,True,None,'',{'old':N})), ('a',3))
check('resource-disposition scenario 1', solve('resource-disposition', ('a','a',1,1,True,{'v':N},None,{'old':1})), 'commit')
check('resource-disposition scenario 2', solve('resource-disposition', ('a','b',1,2,True,{},'bad',{'old':N})), 'stale')
check('resource-disposition scenario 3', solve('resource-disposition', ('a','a',1,2,True,None,'bad',{'old':N})), 'stale')
check('resource-disposition scenario 4', solve('resource-disposition', ('a','a',2,2,False,{'v':N},None,{})), 'discard')
check('resource-disposition scenario 5', solve('resource-disposition', ('b','b',2,2,True,{},None,{'old':N})), 'commit')
check('resource-disposition scenario 6', solve('resource-disposition', ('a','a',3,3,True,None,'',{'old':N})), 'commit')
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:
Stale error isolation.

A mounted route owns only its current route key and request generation. Empty mappings are successful data; null is no data; even an empty error string is an error. Old requests cannot settle current loading. Operation stale-error-isolation has the six explicit input/output oracles below.

split: open-access


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

N = 1
observations = []
def solve(operation, s):
    active, result, request, latest, mounted, data, error, prior = s
    if operation == 'route-and-request-admission':
        return mounted and active==result and request==latest
    if operation == 'unmount-write-suppression':
        return data if mounted else prior
    if operation == 'error-null-distinction':
        return error is not None
    if operation == 'empty-loader-result':
        return data if data is not None else prior
    if operation == 'stale-error-isolation':
        return error if active==result and request==latest else None
    if operation == 'loading-settlement':
        return request!=latest
    if operation == 'retained-data-on-error':
        return data
    if operation == 'route-transition-clear':
        return prior if active==result else {}
    if operation == 'error-boundary-reset-key':
        return (active,latest)
    if operation == 'resource-disposition':
        return 'discard' if not mounted else ('commit' if active==result and request==latest else 'stale')
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('route-and-request-admission scenario 1', solve('route-and-request-admission', ('a','a',1,1,True,{'v':N},None,{'old':1})), True)
check('route-and-request-admission scenario 2', solve('route-and-request-admission', ('a','b',1,2,True,{},'bad',{'old':N})), False)
check('route-and-request-admission scenario 3', solve('route-and-request-admission', ('a','a',1,2,True,None,'bad',{'old':N})), False)
check('route-and-request-admission scenario 4', solve('route-and-request-admission', ('a','a',2,2,False,{'v':N},None,{})), False)
check('route-and-request-admission scenario 5', solve('route-and-request-admission', ('b','b',2,2,True,{},None,{'old':N})), True)
check('route-and-request-admission scenario 6', solve('route-and-request-admission', ('a','a',3,3,True,None,'',{'old':N})), True)
check('unmount-write-suppression scenario 1', solve('unmount-write-suppression', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('unmount-write-suppression scenario 2', solve('unmount-write-suppression', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('unmount-write-suppression scenario 3', solve('unmount-write-suppression', ('a','a',1,2,True,None,'bad',{'old':N})), None)
check('unmount-write-suppression scenario 4', solve('unmount-write-suppression', ('a','a',2,2,False,{'v':N},None,{})), {})
check('unmount-write-suppression scenario 5', solve('unmount-write-suppression', ('b','b',2,2,True,{},None,{'old':N})), {})
check('unmount-write-suppression scenario 6', solve('unmount-write-suppression', ('a','a',3,3,True,None,'',{'old':N})), None)
check('error-null-distinction scenario 1', solve('error-null-distinction', ('a','a',1,1,True,{'v':N},None,{'old':1})), False)
check('error-null-distinction scenario 2', solve('error-null-distinction', ('a','b',1,2,True,{},'bad',{'old':N})), True)
check('error-null-distinction scenario 3', solve('error-null-distinction', ('a','a',1,2,True,None,'bad',{'old':N})), True)
check('error-null-distinction scenario 4', solve('error-null-distinction', ('a','a',2,2,False,{'v':N},None,{})), False)
check('error-null-distinction scenario 5', solve('error-null-distinction', ('b','b',2,2,True,{},None,{'old':N})), False)
check('error-null-distinction scenario 6', solve('error-null-distinction', ('a','a',3,3,True,None,'',{'old':N})), True)
check('empty-loader-result scenario 1', solve('empty-loader-result', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('empty-loader-result scenario 2', solve('empty-loader-result', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('empty-loader-result scenario 3', solve('empty-loader-result', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('empty-loader-result scenario 4', solve('empty-loader-result', ('a','a',2,2,False,{'v':N},None,{})), {'v':N})
check('empty-loader-result scenario 5', solve('empty-loader-result', ('b','b',2,2,True,{},None,{'old':N})), {})
check('empty-loader-result scenario 6', solve('empty-loader-result', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('stale-error-isolation scenario 1', solve('stale-error-isolation', ('a','a',1,1,True,{'v':N},None,{'old':1})), None)
check('stale-error-isolation scenario 2', solve('stale-error-isolation', ('a','b',1,2,True,{},'bad',{'old':N})), None)
check('stale-error-isolation scenario 3', solve('stale-error-isolation', ('a','a',1,2,True,None,'bad',{'old':N})), None)
check('stale-error-isolation scenario 4', solve('stale-error-isolation', ('a','a',2,2,False,{'v':N},None,{})), None)
check('stale-error-isolation scenario 5', solve('stale-error-isolation', ('b','b',2,2,True,{},None,{'old':N})), None)
check('stale-error-isolation scenario 6', solve('stale-error-isolation', ('a','a',3,3,True,None,'',{'old':N})), '')
check('loading-settlement scenario 1', solve('loading-settlement', ('a','a',1,1,True,{'v':N},None,{'old':1})), False)
check('loading-settlement scenario 2', solve('loading-settlement', ('a','b',1,2,True,{},'bad',{'old':N})), True)
check('loading-settlement scenario 3', solve('loading-settlement', ('a','a',1,2,True,None,'bad',{'old':N})), True)
check('loading-settlement scenario 4', solve('loading-settlement', ('a','a',2,2,False,{'v':N},None,{})), False)
check('loading-settlement scenario 5', solve('loading-settlement', ('b','b',2,2,True,{},None,{'old':N})), False)
check('loading-settlement scenario 6', solve('loading-settlement', ('a','a',3,3,True,None,'',{'old':N})), False)
check('retained-data-on-error scenario 1', solve('retained-data-on-error', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('retained-data-on-error scenario 2', solve('retained-data-on-error', ('a','b',1,2,True,{},'bad',{'old':N})), {'old':N})
check('retained-data-on-error scenario 3', solve('retained-data-on-error', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('retained-data-on-error scenario 4', solve('retained-data-on-error', ('a','a',2,2,False,{'v':N},None,{})), {'v':N})
check('retained-data-on-error scenario 5', solve('retained-data-on-error', ('b','b',2,2,True,{},None,{'old':N})), {})
check('retained-data-on-error scenario 6', solve('retained-data-on-error', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('route-transition-clear scenario 1', solve('route-transition-clear', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'old':1})
check('route-transition-clear scenario 2', solve('route-transition-clear', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('route-transition-clear scenario 3', solve('route-transition-clear', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('route-transition-clear scenario 4', solve('route-transition-clear', ('a','a',2,2,False,{'v':N},None,{})), {})
check('route-transition-clear scenario 5', solve('route-transition-clear', ('b','b',2,2,True,{},None,{'old':N})), {'old':N})
check('route-transition-clear scenario 6', solve('route-transition-clear', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('error-boundary-reset-key scenario 1', solve('error-boundary-reset-key', ('a','a',1,1,True,{'v':N},None,{'old':1})), ('a',1))
check('error-boundary-reset-key scenario 2', solve('error-boundary-reset-key', ('a','b',1,2,True,{},'bad',{'old':N})), ('a',2))
check('error-boundary-reset-key scenario 3', solve('error-boundary-reset-key', ('a','a',1,2,True,None,'bad',{'old':N})), ('a',2))
check('error-boundary-reset-key scenario 4', solve('error-boundary-reset-key', ('a','a',2,2,False,{'v':N},None,{})), ('a',2))
check('error-boundary-reset-key scenario 5', solve('error-boundary-reset-key', ('b','b',2,2,True,{},None,{'old':N})), ('b',2))
check('error-boundary-reset-key scenario 6', solve('error-boundary-reset-key', ('a','a',3,3,True,None,'',{'old':N})), ('a',3))
check('resource-disposition scenario 1', solve('resource-disposition', ('a','a',1,1,True,{'v':N},None,{'old':1})), 'commit')
check('resource-disposition scenario 2', solve('resource-disposition', ('a','b',1,2,True,{},'bad',{'old':N})), 'stale')
check('resource-disposition scenario 3', solve('resource-disposition', ('a','a',1,2,True,None,'bad',{'old':N})), 'stale')
check('resource-disposition scenario 4', solve('resource-disposition', ('a','a',2,2,False,{'v':N},None,{})), 'discard')
check('resource-disposition scenario 5', solve('resource-disposition', ('b','b',2,2,True,{},None,{'old':N})), 'commit')
check('resource-disposition scenario 6', solve('resource-disposition', ('a','a',3,3,True,None,'',{'old':N})), 'commit')
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(operation, s):
    active, result, request, latest, mounted, data, error, prior = s
    if operation == 'route-and-request-admission':
        return mounted and active==result and request==latest
    if operation == 'unmount-write-suppression':
        return data if mounted else prior
    if operation == 'error-null-distinction':
        return error is not None
    if operation == 'empty-loader-result':
        return data if data is not None else prior
    if operation == 'stale-error-isolation':
        return error if active==result and request==latest else None
    if operation == 'loading-settlement':
        return request!=latest
    if operation == 'retained-data-on-error':
        return prior if error else data
    if operation == 'route-transition-clear':
        return prior if active==result else {}
    if operation == 'error-boundary-reset-key':
        return (active,latest)
    if operation == 'resource-disposition':
        return 'discard' if not mounted else ('commit' if active==result and request==latest else 'stale')
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('route-and-request-admission scenario 1', solve('route-and-request-admission', ('a','a',1,1,True,{'v':N},None,{'old':1})), True)
check('route-and-request-admission scenario 2', solve('route-and-request-admission', ('a','b',1,2,True,{},'bad',{'old':N})), False)
check('route-and-request-admission scenario 3', solve('route-and-request-admission', ('a','a',1,2,True,None,'bad',{'old':N})), False)
check('route-and-request-admission scenario 4', solve('route-and-request-admission', ('a','a',2,2,False,{'v':N},None,{})), False)
check('route-and-request-admission scenario 5', solve('route-and-request-admission', ('b','b',2,2,True,{},None,{'old':N})), True)
check('route-and-request-admission scenario 6', solve('route-and-request-admission', ('a','a',3,3,True,None,'',{'old':N})), True)
check('unmount-write-suppression scenario 1', solve('unmount-write-suppression', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('unmount-write-suppression scenario 2', solve('unmount-write-suppression', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('unmount-write-suppression scenario 3', solve('unmount-write-suppression', ('a','a',1,2,True,None,'bad',{'old':N})), None)
check('unmount-write-suppression scenario 4', solve('unmount-write-suppression', ('a','a',2,2,False,{'v':N},None,{})), {})
check('unmount-write-suppression scenario 5', solve('unmount-write-suppression', ('b','b',2,2,True,{},None,{'old':N})), {})
check('unmount-write-suppression scenario 6', solve('unmount-write-suppression', ('a','a',3,3,True,None,'',{'old':N})), None)
check('error-null-distinction scenario 1', solve('error-null-distinction', ('a','a',1,1,True,{'v':N},None,{'old':1})), False)
check('error-null-distinction scenario 2', solve('error-null-distinction', ('a','b',1,2,True,{},'bad',{'old':N})), True)
check('error-null-distinction scenario 3', solve('error-null-distinction', ('a','a',1,2,True,None,'bad',{'old':N})), True)
check('error-null-distinction scenario 4', solve('error-null-distinction', ('a','a',2,2,False,{'v':N},None,{})), False)
check('error-null-distinction scenario 5', solve('error-null-distinction', ('b','b',2,2,True,{},None,{'old':N})), False)
check('error-null-distinction scenario 6', solve('error-null-distinction', ('a','a',3,3,True,None,'',{'old':N})), True)
check('empty-loader-result scenario 1', solve('empty-loader-result', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('empty-loader-result scenario 2', solve('empty-loader-result', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('empty-loader-result scenario 3', solve('empty-loader-result', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('empty-loader-result scenario 4', solve('empty-loader-result', ('a','a',2,2,False,{'v':N},None,{})), {'v':N})
check('empty-loader-result scenario 5', solve('empty-loader-result', ('b','b',2,2,True,{},None,{'old':N})), {})
check('empty-loader-result scenario 6', solve('empty-loader-result', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('stale-error-isolation scenario 1', solve('stale-error-isolation', ('a','a',1,1,True,{'v':N},None,{'old':1})), None)
check('stale-error-isolation scenario 2', solve('stale-error-isolation', ('a','b',1,2,True,{},'bad',{'old':N})), None)
check('stale-error-isolation scenario 3', solve('stale-error-isolation', ('a','a',1,2,True,None,'bad',{'old':N})), None)
check('stale-error-isolation scenario 4', solve('stale-error-isolation', ('a','a',2,2,False,{'v':N},None,{})), None)
check('stale-error-isolation scenario 5', solve('stale-error-isolation', ('b','b',2,2,True,{},None,{'old':N})), None)
check('stale-error-isolation scenario 6', solve('stale-error-isolation', ('a','a',3,3,True,None,'',{'old':N})), '')
check('loading-settlement scenario 1', solve('loading-settlement', ('a','a',1,1,True,{'v':N},None,{'old':1})), False)
check('loading-settlement scenario 2', solve('loading-settlement', ('a','b',1,2,True,{},'bad',{'old':N})), True)
check('loading-settlement scenario 3', solve('loading-settlement', ('a','a',1,2,True,None,'bad',{'old':N})), True)
check('loading-settlement scenario 4', solve('loading-settlement', ('a','a',2,2,False,{'v':N},None,{})), False)
check('loading-settlement scenario 5', solve('loading-settlement', ('b','b',2,2,True,{},None,{'old':N})), False)
check('loading-settlement scenario 6', solve('loading-settlement', ('a','a',3,3,True,None,'',{'old':N})), False)
check('retained-data-on-error scenario 1', solve('retained-data-on-error', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('retained-data-on-error scenario 2', solve('retained-data-on-error', ('a','b',1,2,True,{},'bad',{'old':N})), {'old':N})
check('retained-data-on-error scenario 3', solve('retained-data-on-error', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('retained-data-on-error scenario 4', solve('retained-data-on-error', ('a','a',2,2,False,{'v':N},None,{})), {'v':N})
check('retained-data-on-error scenario 5', solve('retained-data-on-error', ('b','b',2,2,True,{},None,{'old':N})), {})
check('retained-data-on-error scenario 6', solve('retained-data-on-error', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('route-transition-clear scenario 1', solve('route-transition-clear', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'old':1})
check('route-transition-clear scenario 2', solve('route-transition-clear', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('route-transition-clear scenario 3', solve('route-transition-clear', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('route-transition-clear scenario 4', solve('route-transition-clear', ('a','a',2,2,False,{'v':N},None,{})), {})
check('route-transition-clear scenario 5', solve('route-transition-clear', ('b','b',2,2,True,{},None,{'old':N})), {'old':N})
check('route-transition-clear scenario 6', solve('route-transition-clear', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('error-boundary-reset-key scenario 1', solve('error-boundary-reset-key', ('a','a',1,1,True,{'v':N},None,{'old':1})), ('a',1))
check('error-boundary-reset-key scenario 2', solve('error-boundary-reset-key', ('a','b',1,2,True,{},'bad',{'old':N})), ('a',2))
check('error-boundary-reset-key scenario 3', solve('error-boundary-reset-key', ('a','a',1,2,True,None,'bad',{'old':N})), ('a',2))
check('error-boundary-reset-key scenario 4', solve('error-boundary-reset-key', ('a','a',2,2,False,{'v':N},None,{})), ('a',2))
check('error-boundary-reset-key scenario 5', solve('error-boundary-reset-key', ('b','b',2,2,True,{},None,{'old':N})), ('b',2))
check('error-boundary-reset-key scenario 6', solve('error-boundary-reset-key', ('a','a',3,3,True,None,'',{'old':N})), ('a',3))
check('resource-disposition scenario 1', solve('resource-disposition', ('a','a',1,1,True,{'v':N},None,{'old':1})), 'commit')
check('resource-disposition scenario 2', solve('resource-disposition', ('a','b',1,2,True,{},'bad',{'old':N})), 'stale')
check('resource-disposition scenario 3', solve('resource-disposition', ('a','a',1,2,True,None,'bad',{'old':N})), 'stale')
check('resource-disposition scenario 4', solve('resource-disposition', ('a','a',2,2,False,{'v':N},None,{})), 'discard')
check('resource-disposition scenario 5', solve('resource-disposition', ('b','b',2,2,True,{},None,{'old':N})), 'commit')
check('resource-disposition scenario 6', solve('resource-disposition', ('a','a',3,3,True,None,'',{'old':N})), 'commit')
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:
Retained data on error.

A mounted route owns only its current route key and request generation. Empty mappings are successful data; null is no data; even an empty error string is an error. Old requests cannot settle current loading. Operation retained-data-on-error has the six explicit input/output oracles below.

split: open-access


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

N = 1
observations = []
def solve(operation, s):
    active, result, request, latest, mounted, data, error, prior = s
    if operation == 'route-and-request-admission':
        return mounted and active==result and request==latest
    if operation == 'unmount-write-suppression':
        return data if mounted else prior
    if operation == 'error-null-distinction':
        return error is not None
    if operation == 'empty-loader-result':
        return data if data is not None else prior
    if operation == 'stale-error-isolation':
        return error if active==result and request==latest else None
    if operation == 'loading-settlement':
        return request!=latest
    if operation == 'retained-data-on-error':
        return prior if error is not None else data
    if operation == 'route-transition-clear':
        return prior
    if operation == 'error-boundary-reset-key':
        return (active,latest)
    if operation == 'resource-disposition':
        return 'discard' if not mounted else ('commit' if active==result and request==latest else 'stale')
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('route-and-request-admission scenario 1', solve('route-and-request-admission', ('a','a',1,1,True,{'v':N},None,{'old':1})), True)
check('route-and-request-admission scenario 2', solve('route-and-request-admission', ('a','b',1,2,True,{},'bad',{'old':N})), False)
check('route-and-request-admission scenario 3', solve('route-and-request-admission', ('a','a',1,2,True,None,'bad',{'old':N})), False)
check('route-and-request-admission scenario 4', solve('route-and-request-admission', ('a','a',2,2,False,{'v':N},None,{})), False)
check('route-and-request-admission scenario 5', solve('route-and-request-admission', ('b','b',2,2,True,{},None,{'old':N})), True)
check('route-and-request-admission scenario 6', solve('route-and-request-admission', ('a','a',3,3,True,None,'',{'old':N})), True)
check('unmount-write-suppression scenario 1', solve('unmount-write-suppression', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('unmount-write-suppression scenario 2', solve('unmount-write-suppression', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('unmount-write-suppression scenario 3', solve('unmount-write-suppression', ('a','a',1,2,True,None,'bad',{'old':N})), None)
check('unmount-write-suppression scenario 4', solve('unmount-write-suppression', ('a','a',2,2,False,{'v':N},None,{})), {})
check('unmount-write-suppression scenario 5', solve('unmount-write-suppression', ('b','b',2,2,True,{},None,{'old':N})), {})
check('unmount-write-suppression scenario 6', solve('unmount-write-suppression', ('a','a',3,3,True,None,'',{'old':N})), None)
check('error-null-distinction scenario 1', solve('error-null-distinction', ('a','a',1,1,True,{'v':N},None,{'old':1})), False)
check('error-null-distinction scenario 2', solve('error-null-distinction', ('a','b',1,2,True,{},'bad',{'old':N})), True)
check('error-null-distinction scenario 3', solve('error-null-distinction', ('a','a',1,2,True,None,'bad',{'old':N})), True)
check('error-null-distinction scenario 4', solve('error-null-distinction', ('a','a',2,2,False,{'v':N},None,{})), False)
check('error-null-distinction scenario 5', solve('error-null-distinction', ('b','b',2,2,True,{},None,{'old':N})), False)
check('error-null-distinction scenario 6', solve('error-null-distinction', ('a','a',3,3,True,None,'',{'old':N})), True)
check('empty-loader-result scenario 1', solve('empty-loader-result', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('empty-loader-result scenario 2', solve('empty-loader-result', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('empty-loader-result scenario 3', solve('empty-loader-result', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('empty-loader-result scenario 4', solve('empty-loader-result', ('a','a',2,2,False,{'v':N},None,{})), {'v':N})
check('empty-loader-result scenario 5', solve('empty-loader-result', ('b','b',2,2,True,{},None,{'old':N})), {})
check('empty-loader-result scenario 6', solve('empty-loader-result', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('stale-error-isolation scenario 1', solve('stale-error-isolation', ('a','a',1,1,True,{'v':N},None,{'old':1})), None)
check('stale-error-isolation scenario 2', solve('stale-error-isolation', ('a','b',1,2,True,{},'bad',{'old':N})), None)
check('stale-error-isolation scenario 3', solve('stale-error-isolation', ('a','a',1,2,True,None,'bad',{'old':N})), None)
check('stale-error-isolation scenario 4', solve('stale-error-isolation', ('a','a',2,2,False,{'v':N},None,{})), None)
check('stale-error-isolation scenario 5', solve('stale-error-isolation', ('b','b',2,2,True,{},None,{'old':N})), None)
check('stale-error-isolation scenario 6', solve('stale-error-isolation', ('a','a',3,3,True,None,'',{'old':N})), '')
check('loading-settlement scenario 1', solve('loading-settlement', ('a','a',1,1,True,{'v':N},None,{'old':1})), False)
check('loading-settlement scenario 2', solve('loading-settlement', ('a','b',1,2,True,{},'bad',{'old':N})), True)
check('loading-settlement scenario 3', solve('loading-settlement', ('a','a',1,2,True,None,'bad',{'old':N})), True)
check('loading-settlement scenario 4', solve('loading-settlement', ('a','a',2,2,False,{'v':N},None,{})), False)
check('loading-settlement scenario 5', solve('loading-settlement', ('b','b',2,2,True,{},None,{'old':N})), False)
check('loading-settlement scenario 6', solve('loading-settlement', ('a','a',3,3,True,None,'',{'old':N})), False)
check('retained-data-on-error scenario 1', solve('retained-data-on-error', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('retained-data-on-error scenario 2', solve('retained-data-on-error', ('a','b',1,2,True,{},'bad',{'old':N})), {'old':N})
check('retained-data-on-error scenario 3', solve('retained-data-on-error', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('retained-data-on-error scenario 4', solve('retained-data-on-error', ('a','a',2,2,False,{'v':N},None,{})), {'v':N})
check('retained-data-on-error scenario 5', solve('retained-data-on-error', ('b','b',2,2,True,{},None,{'old':N})), {})
check('retained-data-on-error scenario 6', solve('retained-data-on-error', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('route-transition-clear scenario 1', solve('route-transition-clear', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'old':1})
check('route-transition-clear scenario 2', solve('route-transition-clear', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('route-transition-clear scenario 3', solve('route-transition-clear', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('route-transition-clear scenario 4', solve('route-transition-clear', ('a','a',2,2,False,{'v':N},None,{})), {})
check('route-transition-clear scenario 5', solve('route-transition-clear', ('b','b',2,2,True,{},None,{'old':N})), {'old':N})
check('route-transition-clear scenario 6', solve('route-transition-clear', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('error-boundary-reset-key scenario 1', solve('error-boundary-reset-key', ('a','a',1,1,True,{'v':N},None,{'old':1})), ('a',1))
check('error-boundary-reset-key scenario 2', solve('error-boundary-reset-key', ('a','b',1,2,True,{},'bad',{'old':N})), ('a',2))
check('error-boundary-reset-key scenario 3', solve('error-boundary-reset-key', ('a','a',1,2,True,None,'bad',{'old':N})), ('a',2))
check('error-boundary-reset-key scenario 4', solve('error-boundary-reset-key', ('a','a',2,2,False,{'v':N},None,{})), ('a',2))
check('error-boundary-reset-key scenario 5', solve('error-boundary-reset-key', ('b','b',2,2,True,{},None,{'old':N})), ('b',2))
check('error-boundary-reset-key scenario 6', solve('error-boundary-reset-key', ('a','a',3,3,True,None,'',{'old':N})), ('a',3))
check('resource-disposition scenario 1', solve('resource-disposition', ('a','a',1,1,True,{'v':N},None,{'old':1})), 'commit')
check('resource-disposition scenario 2', solve('resource-disposition', ('a','b',1,2,True,{},'bad',{'old':N})), 'stale')
check('resource-disposition scenario 3', solve('resource-disposition', ('a','a',1,2,True,None,'bad',{'old':N})), 'stale')
check('resource-disposition scenario 4', solve('resource-disposition', ('a','a',2,2,False,{'v':N},None,{})), 'discard')
check('resource-disposition scenario 5', solve('resource-disposition', ('b','b',2,2,True,{},None,{'old':N})), 'commit')
check('resource-disposition scenario 6', solve('resource-disposition', ('a','a',3,3,True,None,'',{'old':N})), 'commit')
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(operation, s):
    active, result, request, latest, mounted, data, error, prior = s
    if operation == 'route-and-request-admission':
        return mounted and active==result and request==latest
    if operation == 'unmount-write-suppression':
        return data if mounted else prior
    if operation == 'error-null-distinction':
        return error is not None
    if operation == 'empty-loader-result':
        return data if data is not None else prior
    if operation == 'stale-error-isolation':
        return error if active==result and request==latest else None
    if operation == 'loading-settlement':
        return request!=latest
    if operation == 'retained-data-on-error':
        return prior if error is not None else data
    if operation == 'route-transition-clear':
        return {}
    if operation == 'error-boundary-reset-key':
        return (active,latest)
    if operation == 'resource-disposition':
        return 'discard' if not mounted else ('commit' if active==result and request==latest else 'stale')
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('route-and-request-admission scenario 1', solve('route-and-request-admission', ('a','a',1,1,True,{'v':N},None,{'old':1})), True)
check('route-and-request-admission scenario 2', solve('route-and-request-admission', ('a','b',1,2,True,{},'bad',{'old':N})), False)
check('route-and-request-admission scenario 3', solve('route-and-request-admission', ('a','a',1,2,True,None,'bad',{'old':N})), False)
check('route-and-request-admission scenario 4', solve('route-and-request-admission', ('a','a',2,2,False,{'v':N},None,{})), False)
check('route-and-request-admission scenario 5', solve('route-and-request-admission', ('b','b',2,2,True,{},None,{'old':N})), True)
check('route-and-request-admission scenario 6', solve('route-and-request-admission', ('a','a',3,3,True,None,'',{'old':N})), True)
check('unmount-write-suppression scenario 1', solve('unmount-write-suppression', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('unmount-write-suppression scenario 2', solve('unmount-write-suppression', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('unmount-write-suppression scenario 3', solve('unmount-write-suppression', ('a','a',1,2,True,None,'bad',{'old':N})), None)
check('unmount-write-suppression scenario 4', solve('unmount-write-suppression', ('a','a',2,2,False,{'v':N},None,{})), {})
check('unmount-write-suppression scenario 5', solve('unmount-write-suppression', ('b','b',2,2,True,{},None,{'old':N})), {})
check('unmount-write-suppression scenario 6', solve('unmount-write-suppression', ('a','a',3,3,True,None,'',{'old':N})), None)
check('error-null-distinction scenario 1', solve('error-null-distinction', ('a','a',1,1,True,{'v':N},None,{'old':1})), False)
check('error-null-distinction scenario 2', solve('error-null-distinction', ('a','b',1,2,True,{},'bad',{'old':N})), True)
check('error-null-distinction scenario 3', solve('error-null-distinction', ('a','a',1,2,True,None,'bad',{'old':N})), True)
check('error-null-distinction scenario 4', solve('error-null-distinction', ('a','a',2,2,False,{'v':N},None,{})), False)
check('error-null-distinction scenario 5', solve('error-null-distinction', ('b','b',2,2,True,{},None,{'old':N})), False)
check('error-null-distinction scenario 6', solve('error-null-distinction', ('a','a',3,3,True,None,'',{'old':N})), True)
check('empty-loader-result scenario 1', solve('empty-loader-result', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('empty-loader-result scenario 2', solve('empty-loader-result', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('empty-loader-result scenario 3', solve('empty-loader-result', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('empty-loader-result scenario 4', solve('empty-loader-result', ('a','a',2,2,False,{'v':N},None,{})), {'v':N})
check('empty-loader-result scenario 5', solve('empty-loader-result', ('b','b',2,2,True,{},None,{'old':N})), {})
check('empty-loader-result scenario 6', solve('empty-loader-result', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('stale-error-isolation scenario 1', solve('stale-error-isolation', ('a','a',1,1,True,{'v':N},None,{'old':1})), None)
check('stale-error-isolation scenario 2', solve('stale-error-isolation', ('a','b',1,2,True,{},'bad',{'old':N})), None)
check('stale-error-isolation scenario 3', solve('stale-error-isolation', ('a','a',1,2,True,None,'bad',{'old':N})), None)
check('stale-error-isolation scenario 4', solve('stale-error-isolation', ('a','a',2,2,False,{'v':N},None,{})), None)
check('stale-error-isolation scenario 5', solve('stale-error-isolation', ('b','b',2,2,True,{},None,{'old':N})), None)
check('stale-error-isolation scenario 6', solve('stale-error-isolation', ('a','a',3,3,True,None,'',{'old':N})), '')
check('loading-settlement scenario 1', solve('loading-settlement', ('a','a',1,1,True,{'v':N},None,{'old':1})), False)
check('loading-settlement scenario 2', solve('loading-settlement', ('a','b',1,2,True,{},'bad',{'old':N})), True)
check('loading-settlement scenario 3', solve('loading-settlement', ('a','a',1,2,True,None,'bad',{'old':N})), True)
check('loading-settlement scenario 4', solve('loading-settlement', ('a','a',2,2,False,{'v':N},None,{})), False)
check('loading-settlement scenario 5', solve('loading-settlement', ('b','b',2,2,True,{},None,{'old':N})), False)
check('loading-settlement scenario 6', solve('loading-settlement', ('a','a',3,3,True,None,'',{'old':N})), False)
check('retained-data-on-error scenario 1', solve('retained-data-on-error', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('retained-data-on-error scenario 2', solve('retained-data-on-error', ('a','b',1,2,True,{},'bad',{'old':N})), {'old':N})
check('retained-data-on-error scenario 3', solve('retained-data-on-error', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('retained-data-on-error scenario 4', solve('retained-data-on-error', ('a','a',2,2,False,{'v':N},None,{})), {'v':N})
check('retained-data-on-error scenario 5', solve('retained-data-on-error', ('b','b',2,2,True,{},None,{'old':N})), {})
check('retained-data-on-error scenario 6', solve('retained-data-on-error', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('route-transition-clear scenario 1', solve('route-transition-clear', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'old':1})
check('route-transition-clear scenario 2', solve('route-transition-clear', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('route-transition-clear scenario 3', solve('route-transition-clear', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('route-transition-clear scenario 4', solve('route-transition-clear', ('a','a',2,2,False,{'v':N},None,{})), {})
check('route-transition-clear scenario 5', solve('route-transition-clear', ('b','b',2,2,True,{},None,{'old':N})), {'old':N})
check('route-transition-clear scenario 6', solve('route-transition-clear', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('error-boundary-reset-key scenario 1', solve('error-boundary-reset-key', ('a','a',1,1,True,{'v':N},None,{'old':1})), ('a',1))
check('error-boundary-reset-key scenario 2', solve('error-boundary-reset-key', ('a','b',1,2,True,{},'bad',{'old':N})), ('a',2))
check('error-boundary-reset-key scenario 3', solve('error-boundary-reset-key', ('a','a',1,2,True,None,'bad',{'old':N})), ('a',2))
check('error-boundary-reset-key scenario 4', solve('error-boundary-reset-key', ('a','a',2,2,False,{'v':N},None,{})), ('a',2))
check('error-boundary-reset-key scenario 5', solve('error-boundary-reset-key', ('b','b',2,2,True,{},None,{'old':N})), ('b',2))
check('error-boundary-reset-key scenario 6', solve('error-boundary-reset-key', ('a','a',3,3,True,None,'',{'old':N})), ('a',3))
check('resource-disposition scenario 1', solve('resource-disposition', ('a','a',1,1,True,{'v':N},None,{'old':1})), 'commit')
check('resource-disposition scenario 2', solve('resource-disposition', ('a','b',1,2,True,{},'bad',{'old':N})), 'stale')
check('resource-disposition scenario 3', solve('resource-disposition', ('a','a',1,2,True,None,'bad',{'old':N})), 'stale')
check('resource-disposition scenario 4', solve('resource-disposition', ('a','a',2,2,False,{'v':N},None,{})), 'discard')
check('resource-disposition scenario 5', solve('resource-disposition', ('b','b',2,2,True,{},None,{'old':N})), 'commit')
check('resource-disposition scenario 6', solve('resource-disposition', ('a','a',3,3,True,None,'',{'old':N})), 'commit')
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:
Route transition clear.

A mounted route owns only its current route key and request generation. Empty mappings are successful data; null is no data; even an empty error string is an error. Old requests cannot settle current loading. Operation route-transition-clear has the six explicit input/output oracles below.

split: open-access


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

N = 1
observations = []
def solve(operation, s):
    active, result, request, latest, mounted, data, error, prior = s
    if operation == 'route-and-request-admission':
        return mounted and active==result and request==latest
    if operation == 'unmount-write-suppression':
        return data if mounted else prior
    if operation == 'error-null-distinction':
        return error is not None
    if operation == 'empty-loader-result':
        return data if data is not None else prior
    if operation == 'stale-error-isolation':
        return error if active==result and request==latest else None
    if operation == 'loading-settlement':
        return request!=latest
    if operation == 'retained-data-on-error':
        return prior if error is not None else data
    if operation == 'route-transition-clear':
        return prior if active==result else {}
    if operation == 'error-boundary-reset-key':
        return (active,latest)
    if operation == 'resource-disposition':
        return 'commit'
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('route-and-request-admission scenario 1', solve('route-and-request-admission', ('a','a',1,1,True,{'v':N},None,{'old':1})), True)
check('route-and-request-admission scenario 2', solve('route-and-request-admission', ('a','b',1,2,True,{},'bad',{'old':N})), False)
check('route-and-request-admission scenario 3', solve('route-and-request-admission', ('a','a',1,2,True,None,'bad',{'old':N})), False)
check('route-and-request-admission scenario 4', solve('route-and-request-admission', ('a','a',2,2,False,{'v':N},None,{})), False)
check('route-and-request-admission scenario 5', solve('route-and-request-admission', ('b','b',2,2,True,{},None,{'old':N})), True)
check('route-and-request-admission scenario 6', solve('route-and-request-admission', ('a','a',3,3,True,None,'',{'old':N})), True)
check('unmount-write-suppression scenario 1', solve('unmount-write-suppression', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('unmount-write-suppression scenario 2', solve('unmount-write-suppression', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('unmount-write-suppression scenario 3', solve('unmount-write-suppression', ('a','a',1,2,True,None,'bad',{'old':N})), None)
check('unmount-write-suppression scenario 4', solve('unmount-write-suppression', ('a','a',2,2,False,{'v':N},None,{})), {})
check('unmount-write-suppression scenario 5', solve('unmount-write-suppression', ('b','b',2,2,True,{},None,{'old':N})), {})
check('unmount-write-suppression scenario 6', solve('unmount-write-suppression', ('a','a',3,3,True,None,'',{'old':N})), None)
check('error-null-distinction scenario 1', solve('error-null-distinction', ('a','a',1,1,True,{'v':N},None,{'old':1})), False)
check('error-null-distinction scenario 2', solve('error-null-distinction', ('a','b',1,2,True,{},'bad',{'old':N})), True)
check('error-null-distinction scenario 3', solve('error-null-distinction', ('a','a',1,2,True,None,'bad',{'old':N})), True)
check('error-null-distinction scenario 4', solve('error-null-distinction', ('a','a',2,2,False,{'v':N},None,{})), False)
check('error-null-distinction scenario 5', solve('error-null-distinction', ('b','b',2,2,True,{},None,{'old':N})), False)
check('error-null-distinction scenario 6', solve('error-null-distinction', ('a','a',3,3,True,None,'',{'old':N})), True)
check('empty-loader-result scenario 1', solve('empty-loader-result', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('empty-loader-result scenario 2', solve('empty-loader-result', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('empty-loader-result scenario 3', solve('empty-loader-result', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('empty-loader-result scenario 4', solve('empty-loader-result', ('a','a',2,2,False,{'v':N},None,{})), {'v':N})
check('empty-loader-result scenario 5', solve('empty-loader-result', ('b','b',2,2,True,{},None,{'old':N})), {})
check('empty-loader-result scenario 6', solve('empty-loader-result', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('stale-error-isolation scenario 1', solve('stale-error-isolation', ('a','a',1,1,True,{'v':N},None,{'old':1})), None)
check('stale-error-isolation scenario 2', solve('stale-error-isolation', ('a','b',1,2,True,{},'bad',{'old':N})), None)
check('stale-error-isolation scenario 3', solve('stale-error-isolation', ('a','a',1,2,True,None,'bad',{'old':N})), None)
check('stale-error-isolation scenario 4', solve('stale-error-isolation', ('a','a',2,2,False,{'v':N},None,{})), None)
check('stale-error-isolation scenario 5', solve('stale-error-isolation', ('b','b',2,2,True,{},None,{'old':N})), None)
check('stale-error-isolation scenario 6', solve('stale-error-isolation', ('a','a',3,3,True,None,'',{'old':N})), '')
check('loading-settlement scenario 1', solve('loading-settlement', ('a','a',1,1,True,{'v':N},None,{'old':1})), False)
check('loading-settlement scenario 2', solve('loading-settlement', ('a','b',1,2,True,{},'bad',{'old':N})), True)
check('loading-settlement scenario 3', solve('loading-settlement', ('a','a',1,2,True,None,'bad',{'old':N})), True)
check('loading-settlement scenario 4', solve('loading-settlement', ('a','a',2,2,False,{'v':N},None,{})), False)
check('loading-settlement scenario 5', solve('loading-settlement', ('b','b',2,2,True,{},None,{'old':N})), False)
check('loading-settlement scenario 6', solve('loading-settlement', ('a','a',3,3,True,None,'',{'old':N})), False)
check('retained-data-on-error scenario 1', solve('retained-data-on-error', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('retained-data-on-error scenario 2', solve('retained-data-on-error', ('a','b',1,2,True,{},'bad',{'old':N})), {'old':N})
check('retained-data-on-error scenario 3', solve('retained-data-on-error', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('retained-data-on-error scenario 4', solve('retained-data-on-error', ('a','a',2,2,False,{'v':N},None,{})), {'v':N})
check('retained-data-on-error scenario 5', solve('retained-data-on-error', ('b','b',2,2,True,{},None,{'old':N})), {})
check('retained-data-on-error scenario 6', solve('retained-data-on-error', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('route-transition-clear scenario 1', solve('route-transition-clear', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'old':1})
check('route-transition-clear scenario 2', solve('route-transition-clear', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('route-transition-clear scenario 3', solve('route-transition-clear', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('route-transition-clear scenario 4', solve('route-transition-clear', ('a','a',2,2,False,{'v':N},None,{})), {})
check('route-transition-clear scenario 5', solve('route-transition-clear', ('b','b',2,2,True,{},None,{'old':N})), {'old':N})
check('route-transition-clear scenario 6', solve('route-transition-clear', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('error-boundary-reset-key scenario 1', solve('error-boundary-reset-key', ('a','a',1,1,True,{'v':N},None,{'old':1})), ('a',1))
check('error-boundary-reset-key scenario 2', solve('error-boundary-reset-key', ('a','b',1,2,True,{},'bad',{'old':N})), ('a',2))
check('error-boundary-reset-key scenario 3', solve('error-boundary-reset-key', ('a','a',1,2,True,None,'bad',{'old':N})), ('a',2))
check('error-boundary-reset-key scenario 4', solve('error-boundary-reset-key', ('a','a',2,2,False,{'v':N},None,{})), ('a',2))
check('error-boundary-reset-key scenario 5', solve('error-boundary-reset-key', ('b','b',2,2,True,{},None,{'old':N})), ('b',2))
check('error-boundary-reset-key scenario 6', solve('error-boundary-reset-key', ('a','a',3,3,True,None,'',{'old':N})), ('a',3))
check('resource-disposition scenario 1', solve('resource-disposition', ('a','a',1,1,True,{'v':N},None,{'old':1})), 'commit')
check('resource-disposition scenario 2', solve('resource-disposition', ('a','b',1,2,True,{},'bad',{'old':N})), 'stale')
check('resource-disposition scenario 3', solve('resource-disposition', ('a','a',1,2,True,None,'bad',{'old':N})), 'stale')
check('resource-disposition scenario 4', solve('resource-disposition', ('a','a',2,2,False,{'v':N},None,{})), 'discard')
check('resource-disposition scenario 5', solve('resource-disposition', ('b','b',2,2,True,{},None,{'old':N})), 'commit')
check('resource-disposition scenario 6', solve('resource-disposition', ('a','a',3,3,True,None,'',{'old':N})), 'commit')
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(operation, s):
    active, result, request, latest, mounted, data, error, prior = s
    if operation == 'route-and-request-admission':
        return mounted and active==result and request==latest
    if operation == 'unmount-write-suppression':
        return data if mounted else prior
    if operation == 'error-null-distinction':
        return error is not None
    if operation == 'empty-loader-result':
        return data if data is not None else prior
    if operation == 'stale-error-isolation':
        return error if active==result and request==latest else None
    if operation == 'loading-settlement':
        return request!=latest
    if operation == 'retained-data-on-error':
        return prior if error is not None else data
    if operation == 'route-transition-clear':
        return prior if active==result else {}
    if operation == 'error-boundary-reset-key':
        return (active,latest)
    if operation == 'resource-disposition':
        return 'discard' if not mounted else ('commit' if active==result else 'stale')
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('route-and-request-admission scenario 1', solve('route-and-request-admission', ('a','a',1,1,True,{'v':N},None,{'old':1})), True)
check('route-and-request-admission scenario 2', solve('route-and-request-admission', ('a','b',1,2,True,{},'bad',{'old':N})), False)
check('route-and-request-admission scenario 3', solve('route-and-request-admission', ('a','a',1,2,True,None,'bad',{'old':N})), False)
check('route-and-request-admission scenario 4', solve('route-and-request-admission', ('a','a',2,2,False,{'v':N},None,{})), False)
check('route-and-request-admission scenario 5', solve('route-and-request-admission', ('b','b',2,2,True,{},None,{'old':N})), True)
check('route-and-request-admission scenario 6', solve('route-and-request-admission', ('a','a',3,3,True,None,'',{'old':N})), True)
check('unmount-write-suppression scenario 1', solve('unmount-write-suppression', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('unmount-write-suppression scenario 2', solve('unmount-write-suppression', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('unmount-write-suppression scenario 3', solve('unmount-write-suppression', ('a','a',1,2,True,None,'bad',{'old':N})), None)
check('unmount-write-suppression scenario 4', solve('unmount-write-suppression', ('a','a',2,2,False,{'v':N},None,{})), {})
check('unmount-write-suppression scenario 5', solve('unmount-write-suppression', ('b','b',2,2,True,{},None,{'old':N})), {})
check('unmount-write-suppression scenario 6', solve('unmount-write-suppression', ('a','a',3,3,True,None,'',{'old':N})), None)
check('error-null-distinction scenario 1', solve('error-null-distinction', ('a','a',1,1,True,{'v':N},None,{'old':1})), False)
check('error-null-distinction scenario 2', solve('error-null-distinction', ('a','b',1,2,True,{},'bad',{'old':N})), True)
check('error-null-distinction scenario 3', solve('error-null-distinction', ('a','a',1,2,True,None,'bad',{'old':N})), True)
check('error-null-distinction scenario 4', solve('error-null-distinction', ('a','a',2,2,False,{'v':N},None,{})), False)
check('error-null-distinction scenario 5', solve('error-null-distinction', ('b','b',2,2,True,{},None,{'old':N})), False)
check('error-null-distinction scenario 6', solve('error-null-distinction', ('a','a',3,3,True,None,'',{'old':N})), True)
check('empty-loader-result scenario 1', solve('empty-loader-result', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('empty-loader-result scenario 2', solve('empty-loader-result', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('empty-loader-result scenario 3', solve('empty-loader-result', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('empty-loader-result scenario 4', solve('empty-loader-result', ('a','a',2,2,False,{'v':N},None,{})), {'v':N})
check('empty-loader-result scenario 5', solve('empty-loader-result', ('b','b',2,2,True,{},None,{'old':N})), {})
check('empty-loader-result scenario 6', solve('empty-loader-result', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('stale-error-isolation scenario 1', solve('stale-error-isolation', ('a','a',1,1,True,{'v':N},None,{'old':1})), None)
check('stale-error-isolation scenario 2', solve('stale-error-isolation', ('a','b',1,2,True,{},'bad',{'old':N})), None)
check('stale-error-isolation scenario 3', solve('stale-error-isolation', ('a','a',1,2,True,None,'bad',{'old':N})), None)
check('stale-error-isolation scenario 4', solve('stale-error-isolation', ('a','a',2,2,False,{'v':N},None,{})), None)
check('stale-error-isolation scenario 5', solve('stale-error-isolation', ('b','b',2,2,True,{},None,{'old':N})), None)
check('stale-error-isolation scenario 6', solve('stale-error-isolation', ('a','a',3,3,True,None,'',{'old':N})), '')
check('loading-settlement scenario 1', solve('loading-settlement', ('a','a',1,1,True,{'v':N},None,{'old':1})), False)
check('loading-settlement scenario 2', solve('loading-settlement', ('a','b',1,2,True,{},'bad',{'old':N})), True)
check('loading-settlement scenario 3', solve('loading-settlement', ('a','a',1,2,True,None,'bad',{'old':N})), True)
check('loading-settlement scenario 4', solve('loading-settlement', ('a','a',2,2,False,{'v':N},None,{})), False)
check('loading-settlement scenario 5', solve('loading-settlement', ('b','b',2,2,True,{},None,{'old':N})), False)
check('loading-settlement scenario 6', solve('loading-settlement', ('a','a',3,3,True,None,'',{'old':N})), False)
check('retained-data-on-error scenario 1', solve('retained-data-on-error', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'v':N})
check('retained-data-on-error scenario 2', solve('retained-data-on-error', ('a','b',1,2,True,{},'bad',{'old':N})), {'old':N})
check('retained-data-on-error scenario 3', solve('retained-data-on-error', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('retained-data-on-error scenario 4', solve('retained-data-on-error', ('a','a',2,2,False,{'v':N},None,{})), {'v':N})
check('retained-data-on-error scenario 5', solve('retained-data-on-error', ('b','b',2,2,True,{},None,{'old':N})), {})
check('retained-data-on-error scenario 6', solve('retained-data-on-error', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('route-transition-clear scenario 1', solve('route-transition-clear', ('a','a',1,1,True,{'v':N},None,{'old':1})), {'old':1})
check('route-transition-clear scenario 2', solve('route-transition-clear', ('a','b',1,2,True,{},'bad',{'old':N})), {})
check('route-transition-clear scenario 3', solve('route-transition-clear', ('a','a',1,2,True,None,'bad',{'old':N})), {'old':N})
check('route-transition-clear scenario 4', solve('route-transition-clear', ('a','a',2,2,False,{'v':N},None,{})), {})
check('route-transition-clear scenario 5', solve('route-transition-clear', ('b','b',2,2,True,{},None,{'old':N})), {'old':N})
check('route-transition-clear scenario 6', solve('route-transition-clear', ('a','a',3,3,True,None,'',{'old':N})), {'old':N})
check('error-boundary-reset-key scenario 1', solve('error-boundary-reset-key', ('a','a',1,1,True,{'v':N},None,{'old':1})), ('a',1))
check('error-boundary-reset-key scenario 2', solve('error-boundary-reset-key', ('a','b',1,2,True,{},'bad',{'old':N})), ('a',2))
check('error-boundary-reset-key scenario 3', solve('error-boundary-reset-key', ('a','a',1,2,True,None,'bad',{'old':N})), ('a',2))
check('error-boundary-reset-key scenario 4', solve('error-boundary-reset-key', ('a','a',2,2,False,{'v':N},None,{})), ('a',2))
check('error-boundary-reset-key scenario 5', solve('error-boundary-reset-key', ('b','b',2,2,True,{},None,{'old':N})), ('b',2))
check('error-boundary-reset-key scenario 6', solve('error-boundary-reset-key', ('a','a',3,3,True,None,'',{'old':N})), ('a',3))
check('resource-disposition scenario 1', solve('resource-disposition', ('a','a',1,1,True,{'v':N},None,{'old':1})), 'commit')
check('resource-disposition scenario 2', solve('resource-disposition', ('a','b',1,2,True,{},'bad',{'old':N})), 'stale')
check('resource-disposition scenario 3', solve('resource-disposition', ('a','a',1,2,True,None,'bad',{'old':N})), 'stale')
check('resource-disposition scenario 4', solve('resource-disposition', ('a','a',2,2,False,{'v':N},None,{})), 'discard')
check('resource-disposition scenario 5', solve('resource-disposition', ('b','b',2,2,True,{},None,{'old':N})), 'commit')
check('resource-disposition scenario 6', solve('resource-disposition', ('a','a',3,3,True,None,'',{'old':N})), 'commit')
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:
Resource disposition.

A mounted route owns only its current route key and request generation. Empty mappings are successful data; null is no data; even an empty error string is an error. Old requests cannot settle current loading. Operation resource-disposition has the six explicit input/output oracles below.

split: open-access


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

N = 1
observations = []
def solve(operation, s):
    stored, version, current, allowed, defaults, transient = s
    if operation == 'unknown-field-projection':
        return stored
    if operation == 'default-overlay-order':
        return {**defaults,**stored}
    if operation == 'future-version-readonly':
        return version>current
    if operation == 'migration-step-list':
        return list(range(version,current)) if version<=current else []
    if operation == 'transient-exclusion':
        return {k:v for k,v in stored.items() if k not in transient}
    if operation == 'missing-default-identification':
        return sorted(set(defaults)-set(stored))
    if operation == 'nullable-persisted-value':
        return stored['a'] if 'a' in stored else defaults.get('a')
    if operation == 'write-version-stamp':
        return max(version,current)
    if operation == 'schema-fallback-policy':
        return 'read-only' if version>current else ('migrate' if version<current else 'load')
    if operation == 'serialized-field-order':
        return sorted(k for k in stored if k in allowed and k not in transient)
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unknown-field-projection scenario 1', solve('unknown-field-projection', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('unknown-field-projection scenario 2', solve('unknown-field-projection', ({},2,2,['a'],{'a':N},[])), {})
check('unknown-field-projection scenario 3', solve('unknown-field-projection', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('unknown-field-projection scenario 4', solve('unknown-field-projection', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('unknown-field-projection scenario 5', solve('unknown-field-projection', ({'a':'','b':True},2,2,[],{},[])), {})
check('unknown-field-projection scenario 6', solve('unknown-field-projection', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('default-overlay-order scenario 1', solve('default-overlay-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False,'temp':7})
check('default-overlay-order scenario 2', solve('default-overlay-order', ({},2,2,['a'],{'a':N},[])), {'a':N})
check('default-overlay-order scenario 3', solve('default-overlay-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None,'extra':1})
check('default-overlay-order scenario 4', solve('default-overlay-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N,'a':0})
check('default-overlay-order scenario 5', solve('default-overlay-order', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('default-overlay-order scenario 6', solve('default-overlay-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N,'temp':1})
check('future-version-readonly scenario 1', solve('future-version-readonly', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), False)
check('future-version-readonly scenario 2', solve('future-version-readonly', ({},2,2,['a'],{'a':N},[])), False)
check('future-version-readonly scenario 3', solve('future-version-readonly', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), True)
check('future-version-readonly scenario 4', solve('future-version-readonly', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), False)
check('future-version-readonly scenario 5', solve('future-version-readonly', ({'a':'','b':True},2,2,[],{},[])), False)
check('future-version-readonly scenario 6', solve('future-version-readonly', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), False)
check('migration-step-list scenario 1', solve('migration-step-list', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [1])
check('migration-step-list scenario 2', solve('migration-step-list', ({},2,2,['a'],{'a':N},[])), [])
check('migration-step-list scenario 3', solve('migration-step-list', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('migration-step-list scenario 4', solve('migration-step-list', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [0,1])
check('migration-step-list scenario 5', solve('migration-step-list', ({'a':'','b':True},2,2,[],{},[])), [])
check('migration-step-list scenario 6', solve('migration-step-list', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('transient-exclusion scenario 1', solve('transient-exclusion', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('transient-exclusion scenario 2', solve('transient-exclusion', ({},2,2,['a'],{'a':N},[])), {})
check('transient-exclusion scenario 3', solve('transient-exclusion', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('transient-exclusion scenario 4', solve('transient-exclusion', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('transient-exclusion scenario 5', solve('transient-exclusion', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('transient-exclusion scenario 6', solve('transient-exclusion', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('missing-default-identification scenario 1', solve('missing-default-identification', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [])
check('missing-default-identification scenario 2', solve('missing-default-identification', ({},2,2,['a'],{'a':N},[])), ['a'])
check('missing-default-identification scenario 3', solve('missing-default-identification', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('missing-default-identification scenario 4', solve('missing-default-identification', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [])
check('missing-default-identification scenario 5', solve('missing-default-identification', ({'a':'','b':True},2,2,[],{},[])), [])
check('missing-default-identification scenario 6', solve('missing-default-identification', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('nullable-persisted-value scenario 1', solve('nullable-persisted-value', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), N)
check('nullable-persisted-value scenario 2', solve('nullable-persisted-value', ({},2,2,['a'],{'a':N},[])), N)
check('nullable-persisted-value scenario 3', solve('nullable-persisted-value', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), None)
check('nullable-persisted-value scenario 4', solve('nullable-persisted-value', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 0)
check('nullable-persisted-value scenario 5', solve('nullable-persisted-value', ({'a':'','b':True},2,2,[],{},[])), '')
check('nullable-persisted-value scenario 6', solve('nullable-persisted-value', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), N)
check('write-version-stamp scenario 1', solve('write-version-stamp', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 2)
check('write-version-stamp scenario 2', solve('write-version-stamp', ({},2,2,['a'],{'a':N},[])), 2)
check('write-version-stamp scenario 3', solve('write-version-stamp', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 3)
check('write-version-stamp scenario 4', solve('write-version-stamp', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 2)
check('write-version-stamp scenario 5', solve('write-version-stamp', ({'a':'','b':True},2,2,[],{},[])), 2)
check('write-version-stamp scenario 6', solve('write-version-stamp', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 1)
check('schema-fallback-policy scenario 1', solve('schema-fallback-policy', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 'migrate')
check('schema-fallback-policy scenario 2', solve('schema-fallback-policy', ({},2,2,['a'],{'a':N},[])), 'load')
check('schema-fallback-policy scenario 3', solve('schema-fallback-policy', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 'read-only')
check('schema-fallback-policy scenario 4', solve('schema-fallback-policy', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 'migrate')
check('schema-fallback-policy scenario 5', solve('schema-fallback-policy', ({'a':'','b':True},2,2,[],{},[])), 'load')
check('schema-fallback-policy scenario 6', solve('schema-fallback-policy', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 'load')
check('serialized-field-order scenario 1', solve('serialized-field-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), ['a','b'])
check('serialized-field-order scenario 2', solve('serialized-field-order', ({},2,2,['a'],{'a':N},[])), [])
check('serialized-field-order scenario 3', solve('serialized-field-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), ['a'])
check('serialized-field-order scenario 4', solve('serialized-field-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), ['b'])
check('serialized-field-order scenario 5', solve('serialized-field-order', ({'a':'','b':True},2,2,[],{},[])), [])
check('serialized-field-order scenario 6', solve('serialized-field-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), ['a'])
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(operation, s):
    stored, version, current, allowed, defaults, transient = s
    if operation == 'unknown-field-projection':
        return {k:v for k,v in stored.items() if k in defaults}
    if operation == 'default-overlay-order':
        return {**defaults,**stored}
    if operation == 'future-version-readonly':
        return version>current
    if operation == 'migration-step-list':
        return list(range(version,current)) if version<=current else []
    if operation == 'transient-exclusion':
        return {k:v for k,v in stored.items() if k not in transient}
    if operation == 'missing-default-identification':
        return sorted(set(defaults)-set(stored))
    if operation == 'nullable-persisted-value':
        return stored['a'] if 'a' in stored else defaults.get('a')
    if operation == 'write-version-stamp':
        return max(version,current)
    if operation == 'schema-fallback-policy':
        return 'read-only' if version>current else ('migrate' if version<current else 'load')
    if operation == 'serialized-field-order':
        return sorted(k for k in stored if k in allowed and k not in transient)
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unknown-field-projection scenario 1', solve('unknown-field-projection', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('unknown-field-projection scenario 2', solve('unknown-field-projection', ({},2,2,['a'],{'a':N},[])), {})
check('unknown-field-projection scenario 3', solve('unknown-field-projection', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('unknown-field-projection scenario 4', solve('unknown-field-projection', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('unknown-field-projection scenario 5', solve('unknown-field-projection', ({'a':'','b':True},2,2,[],{},[])), {})
check('unknown-field-projection scenario 6', solve('unknown-field-projection', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('default-overlay-order scenario 1', solve('default-overlay-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False,'temp':7})
check('default-overlay-order scenario 2', solve('default-overlay-order', ({},2,2,['a'],{'a':N},[])), {'a':N})
check('default-overlay-order scenario 3', solve('default-overlay-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None,'extra':1})
check('default-overlay-order scenario 4', solve('default-overlay-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N,'a':0})
check('default-overlay-order scenario 5', solve('default-overlay-order', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('default-overlay-order scenario 6', solve('default-overlay-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N,'temp':1})
check('future-version-readonly scenario 1', solve('future-version-readonly', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), False)
check('future-version-readonly scenario 2', solve('future-version-readonly', ({},2,2,['a'],{'a':N},[])), False)
check('future-version-readonly scenario 3', solve('future-version-readonly', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), True)
check('future-version-readonly scenario 4', solve('future-version-readonly', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), False)
check('future-version-readonly scenario 5', solve('future-version-readonly', ({'a':'','b':True},2,2,[],{},[])), False)
check('future-version-readonly scenario 6', solve('future-version-readonly', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), False)
check('migration-step-list scenario 1', solve('migration-step-list', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [1])
check('migration-step-list scenario 2', solve('migration-step-list', ({},2,2,['a'],{'a':N},[])), [])
check('migration-step-list scenario 3', solve('migration-step-list', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('migration-step-list scenario 4', solve('migration-step-list', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [0,1])
check('migration-step-list scenario 5', solve('migration-step-list', ({'a':'','b':True},2,2,[],{},[])), [])
check('migration-step-list scenario 6', solve('migration-step-list', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('transient-exclusion scenario 1', solve('transient-exclusion', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), {'a':N,'b':False})
check('transient-exclusion scenario 2', solve('transient-exclusion', ({},2,2,['a'],{'a':N},[])), {})
check('transient-exclusion scenario 3', solve('transient-exclusion', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), {'a':None})
check('transient-exclusion scenario 4', solve('transient-exclusion', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), {'b':N})
check('transient-exclusion scenario 5', solve('transient-exclusion', ({'a':'','b':True},2,2,[],{},[])), {'a':'','b':True})
check('transient-exclusion scenario 6', solve('transient-exclusion', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), {'a':N})
check('missing-default-identification scenario 1', solve('missing-default-identification', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), [])
check('missing-default-identification scenario 2', solve('missing-default-identification', ({},2,2,['a'],{'a':N},[])), ['a'])
check('missing-default-identification scenario 3', solve('missing-default-identification', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), [])
check('missing-default-identification scenario 4', solve('missing-default-identification', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), [])
check('missing-default-identification scenario 5', solve('missing-default-identification', ({'a':'','b':True},2,2,[],{},[])), [])
check('missing-default-identification scenario 6', solve('missing-default-identification', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), [])
check('nullable-persisted-value scenario 1', solve('nullable-persisted-value', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), N)
check('nullable-persisted-value scenario 2', solve('nullable-persisted-value', ({},2,2,['a'],{'a':N},[])), N)
check('nullable-persisted-value scenario 3', solve('nullable-persisted-value', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), None)
check('nullable-persisted-value scenario 4', solve('nullable-persisted-value', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 0)
check('nullable-persisted-value scenario 5', solve('nullable-persisted-value', ({'a':'','b':True},2,2,[],{},[])), '')
check('nullable-persisted-value scenario 6', solve('nullable-persisted-value', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), N)
check('write-version-stamp scenario 1', solve('write-version-stamp', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 2)
check('write-version-stamp scenario 2', solve('write-version-stamp', ({},2,2,['a'],{'a':N},[])), 2)
check('write-version-stamp scenario 3', solve('write-version-stamp', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 3)
check('write-version-stamp scenario 4', solve('write-version-stamp', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 2)
check('write-version-stamp scenario 5', solve('write-version-stamp', ({'a':'','b':True},2,2,[],{},[])), 2)
check('write-version-stamp scenario 6', solve('write-version-stamp', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 1)
check('schema-fallback-policy scenario 1', solve('schema-fallback-policy', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), 'migrate')
check('schema-fallback-policy scenario 2', solve('schema-fallback-policy', ({},2,2,['a'],{'a':N},[])), 'load')
check('schema-fallback-policy scenario 3', solve('schema-fallback-policy', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), 'read-only')
check('schema-fallback-policy scenario 4', solve('schema-fallback-policy', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), 'migrate')
check('schema-fallback-policy scenario 5', solve('schema-fallback-policy', ({'a':'','b':True},2,2,[],{},[])), 'load')
check('schema-fallback-policy scenario 6', solve('schema-fallback-policy', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), 'load')
check('serialized-field-order scenario 1', solve('serialized-field-order', ({'a':N,'b':False,'temp':7},1,2,['a','b'],{'a':0,'b':True},['temp'])), ['a','b'])
check('serialized-field-order scenario 2', solve('serialized-field-order', ({},2,2,['a'],{'a':N},[])), [])
check('serialized-field-order scenario 3', solve('serialized-field-order', ({'a':None,'extra':1},3,2,['a'],{'a':N},['extra'])), ['a'])
check('serialized-field-order scenario 4', solve('serialized-field-order', ({'a':0,'b':N},0,2,['b'],{'b':9},['a'])), ['b'])
check('serialized-field-order scenario 5', solve('serialized-field-order', ({'a':'','b':True},2,2,[],{},[])), [])
check('serialized-field-order scenario 6', solve('serialized-field-order', ({'a':N,'temp':1},1,1,['a'],{},['temp'])), ['a'])
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:
Unknown field projection.

Persist only declared nontransient keys. Missing defaults are filled without replacing null/falsy data. Older schema versions migrate through each intermediate step; future versions stay read-only and keep their version stamp. Operation unknown-field-projection has the six explicit input/output oracles below.

split: open-access