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

N = 1
observations = []
def solve(operation, s):
    old, incoming, state = s
    if operation == 'type-and-key-reuse':
        return [k for k,t in incoming if (k,t) in old]
    if operation == 'new-instance-mounts':
        return [k for k,t in incoming if (k,t) not in old]
    if operation == 'old-instance-unmounts':
        return [k for k,t in old if (k,t) not in incoming]
    if operation == 'state-follows-key-through-reorder':
        return [state.get(k) for k,t in incoming if (k,t) in old]
    if operation == 'render-order-follows-incoming':
        return [k for k,t in incoming]
    if operation == 'changed-type-state-reset':
        return {k:state.get(k) if (k,t) in old else None for k,t in incoming}
    if operation == 'cleanup-before-replacement-mount':
        return [(k,'cleanup') for k,t in old if k in dict(incoming) and (k,t) not in incoming]+[(k,'mount') for k,t in incoming if k in dict(old) and (k,t) not in old]
    if operation == 'removed-state-pruning':
        return {k:v for k,v in state.items() if k in dict(incoming)}
    if operation == 'insertion-position':
        return {k:i for i,(k,t) in enumerate(incoming)}
    if operation == 'retained-instance-moves':
        return []
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('type-and-key-reuse scenario 1', solve('type-and-key-reuse', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), ['b','a'])
check('type-and-key-reuse scenario 2', solve('type-and-key-reuse', ([], [('a','card')],{})), [])
check('type-and-key-reuse scenario 3', solve('type-and-key-reuse', ([('a','card')],[('a','panel')],{'a':0})), [])
check('type-and-key-reuse scenario 4', solve('type-and-key-reuse', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), ['b'])
check('type-and-key-reuse scenario 5', solve('type-and-key-reuse', ([('a','card')],[],{'a':N})), [])
check('type-and-key-reuse scenario 6', solve('type-and-key-reuse', ([('a','card')],[('a','card'),('b','card')],{'a':False})), ['a'])
check('new-instance-mounts scenario 1', solve('new-instance-mounts', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), [])
check('new-instance-mounts scenario 2', solve('new-instance-mounts', ([], [('a','card')],{})), ['a'])
check('new-instance-mounts scenario 3', solve('new-instance-mounts', ([('a','card')],[('a','panel')],{'a':0})), ['a'])
check('new-instance-mounts scenario 4', solve('new-instance-mounts', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), [])
check('new-instance-mounts scenario 5', solve('new-instance-mounts', ([('a','card')],[],{'a':N})), [])
check('new-instance-mounts scenario 6', solve('new-instance-mounts', ([('a','card')],[('a','card'),('b','card')],{'a':False})), ['b'])
check('old-instance-unmounts scenario 1', solve('old-instance-unmounts', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), [])
check('old-instance-unmounts scenario 2', solve('old-instance-unmounts', ([], [('a','card')],{})), [])
check('old-instance-unmounts scenario 3', solve('old-instance-unmounts', ([('a','card')],[('a','panel')],{'a':0})), ['a'])
check('old-instance-unmounts scenario 4', solve('old-instance-unmounts', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), ['a'])
check('old-instance-unmounts scenario 5', solve('old-instance-unmounts', ([('a','card')],[],{'a':N})), ['a'])
check('old-instance-unmounts scenario 6', solve('old-instance-unmounts', ([('a','card')],[('a','card'),('b','card')],{'a':False})), [])
check('state-follows-key-through-reorder scenario 1', solve('state-follows-key-through-reorder', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), [2,N])
check('state-follows-key-through-reorder scenario 2', solve('state-follows-key-through-reorder', ([], [('a','card')],{})), [])
check('state-follows-key-through-reorder scenario 3', solve('state-follows-key-through-reorder', ([('a','card')],[('a','panel')],{'a':0})), [])
check('state-follows-key-through-reorder scenario 4', solve('state-follows-key-through-reorder', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), [None])
check('state-follows-key-through-reorder scenario 5', solve('state-follows-key-through-reorder', ([('a','card')],[],{'a':N})), [])
check('state-follows-key-through-reorder scenario 6', solve('state-follows-key-through-reorder', ([('a','card')],[('a','card'),('b','card')],{'a':False})), [False])
check('render-order-follows-incoming scenario 1', solve('render-order-follows-incoming', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), ['b','a'])
check('render-order-follows-incoming scenario 2', solve('render-order-follows-incoming', ([], [('a','card')],{})), ['a'])
check('render-order-follows-incoming scenario 3', solve('render-order-follows-incoming', ([('a','card')],[('a','panel')],{'a':0})), ['a'])
check('render-order-follows-incoming scenario 4', solve('render-order-follows-incoming', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), ['b'])
check('render-order-follows-incoming scenario 5', solve('render-order-follows-incoming', ([('a','card')],[],{'a':N})), [])
check('render-order-follows-incoming scenario 6', solve('render-order-follows-incoming', ([('a','card')],[('a','card'),('b','card')],{'a':False})), ['a','b'])
check('changed-type-state-reset scenario 1', solve('changed-type-state-reset', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), {'b':2,'a':N})
check('changed-type-state-reset scenario 2', solve('changed-type-state-reset', ([], [('a','card')],{})), {'a':None})
check('changed-type-state-reset scenario 3', solve('changed-type-state-reset', ([('a','card')],[('a','panel')],{'a':0})), {'a':None})
check('changed-type-state-reset scenario 4', solve('changed-type-state-reset', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), {'b':None})
check('changed-type-state-reset scenario 5', solve('changed-type-state-reset', ([('a','card')],[],{'a':N})), {})
check('changed-type-state-reset scenario 6', solve('changed-type-state-reset', ([('a','card')],[('a','card'),('b','card')],{'a':False})), {'a':False,'b':None})
check('cleanup-before-replacement-mount scenario 1', solve('cleanup-before-replacement-mount', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), [])
check('cleanup-before-replacement-mount scenario 2', solve('cleanup-before-replacement-mount', ([], [('a','card')],{})), [])
check('cleanup-before-replacement-mount scenario 3', solve('cleanup-before-replacement-mount', ([('a','card')],[('a','panel')],{'a':0})), [('a','cleanup'),('a','mount')])
check('cleanup-before-replacement-mount scenario 4', solve('cleanup-before-replacement-mount', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), [])
check('cleanup-before-replacement-mount scenario 5', solve('cleanup-before-replacement-mount', ([('a','card')],[],{'a':N})), [])
check('cleanup-before-replacement-mount scenario 6', solve('cleanup-before-replacement-mount', ([('a','card')],[('a','card'),('b','card')],{'a':False})), [])
check('removed-state-pruning scenario 1', solve('removed-state-pruning', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), {'a':N,'b':2})
check('removed-state-pruning scenario 2', solve('removed-state-pruning', ([], [('a','card')],{})), {})
check('removed-state-pruning scenario 3', solve('removed-state-pruning', ([('a','card')],[('a','panel')],{'a':0})), {'a':0})
check('removed-state-pruning scenario 4', solve('removed-state-pruning', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), {'b':None})
check('removed-state-pruning scenario 5', solve('removed-state-pruning', ([('a','card')],[],{'a':N})), {})
check('removed-state-pruning scenario 6', solve('removed-state-pruning', ([('a','card')],[('a','card'),('b','card')],{'a':False})), {'a':False})
check('insertion-position scenario 1', solve('insertion-position', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), {'b':0,'a':1})
check('insertion-position scenario 2', solve('insertion-position', ([], [('a','card')],{})), {'a':0})
check('insertion-position scenario 3', solve('insertion-position', ([('a','card')],[('a','panel')],{'a':0})), {'a':0})
check('insertion-position scenario 4', solve('insertion-position', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), {'b':0})
check('insertion-position scenario 5', solve('insertion-position', ([('a','card')],[],{'a':N})), {})
check('insertion-position scenario 6', solve('insertion-position', ([('a','card')],[('a','card'),('b','card')],{'a':False})), {'a':0,'b':1})
check('retained-instance-moves scenario 1', solve('retained-instance-moves', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), ['b','a'])
check('retained-instance-moves scenario 2', solve('retained-instance-moves', ([], [('a','card')],{})), [])
check('retained-instance-moves scenario 3', solve('retained-instance-moves', ([('a','card')],[('a','panel')],{'a':0})), [])
check('retained-instance-moves scenario 4', solve('retained-instance-moves', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), ['b'])
check('retained-instance-moves scenario 5', solve('retained-instance-moves', ([('a','card')],[],{'a':N})), [])
check('retained-instance-moves scenario 6', solve('retained-instance-moves', ([('a','card')],[('a','card'),('b','card')],{'a':False})), [])
check('reordering distinct state values for every seed: type-and-key-reuse', solve('type-and-key-reuse', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), ['b','a'])
check('reordering distinct state values for every seed: new-instance-mounts', solve('new-instance-mounts', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), [])
check('reordering distinct state values for every seed: old-instance-unmounts', solve('old-instance-unmounts', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), [])
check('reordering distinct state values for every seed: state-follows-key-through-reorder', solve('state-follows-key-through-reorder', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), [2,N+10])
check('reordering distinct state values for every seed: render-order-follows-incoming', solve('render-order-follows-incoming', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), ['b','a'])
check('reordering distinct state values for every seed: changed-type-state-reset', solve('changed-type-state-reset', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), {'b':2,'a':N+10})
check('reordering distinct state values for every seed: cleanup-before-replacement-mount', solve('cleanup-before-replacement-mount', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), [])
check('reordering distinct state values for every seed: removed-state-pruning', solve('removed-state-pruning', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), {'a':N+10,'b':2})
check('reordering distinct state values for every seed: insertion-position', solve('insertion-position', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), {'b':0,'a':1})
check('reordering distinct state values for every seed: retained-instance-moves', solve('retained-instance-moves', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), ['b','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):
    old, incoming, state = s
    if operation == 'type-and-key-reuse':
        return [k for k,t in incoming if (k,t) in old]
    if operation == 'new-instance-mounts':
        return [k for k,t in incoming if (k,t) not in old]
    if operation == 'old-instance-unmounts':
        return [k for k,t in old if (k,t) not in incoming]
    if operation == 'state-follows-key-through-reorder':
        return [state.get(k) for k,t in incoming if (k,t) in old]
    if operation == 'render-order-follows-incoming':
        return [k for k,t in incoming]
    if operation == 'changed-type-state-reset':
        return {k:state.get(k) if (k,t) in old else None for k,t in incoming}
    if operation == 'cleanup-before-replacement-mount':
        return [(k,'cleanup') for k,t in old if k in dict(incoming) and (k,t) not in incoming]+[(k,'mount') for k,t in incoming if k in dict(old) and (k,t) not in old]
    if operation == 'removed-state-pruning':
        return {k:v for k,v in state.items() if k in dict(incoming)}
    if operation == 'insertion-position':
        return {k:i for i,(k,t) in enumerate(incoming)}
    if operation == 'retained-instance-moves':
        return [k for k,t in incoming if (k,t) in old]
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('type-and-key-reuse scenario 1', solve('type-and-key-reuse', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), ['b','a'])
check('type-and-key-reuse scenario 2', solve('type-and-key-reuse', ([], [('a','card')],{})), [])
check('type-and-key-reuse scenario 3', solve('type-and-key-reuse', ([('a','card')],[('a','panel')],{'a':0})), [])
check('type-and-key-reuse scenario 4', solve('type-and-key-reuse', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), ['b'])
check('type-and-key-reuse scenario 5', solve('type-and-key-reuse', ([('a','card')],[],{'a':N})), [])
check('type-and-key-reuse scenario 6', solve('type-and-key-reuse', ([('a','card')],[('a','card'),('b','card')],{'a':False})), ['a'])
check('new-instance-mounts scenario 1', solve('new-instance-mounts', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), [])
check('new-instance-mounts scenario 2', solve('new-instance-mounts', ([], [('a','card')],{})), ['a'])
check('new-instance-mounts scenario 3', solve('new-instance-mounts', ([('a','card')],[('a','panel')],{'a':0})), ['a'])
check('new-instance-mounts scenario 4', solve('new-instance-mounts', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), [])
check('new-instance-mounts scenario 5', solve('new-instance-mounts', ([('a','card')],[],{'a':N})), [])
check('new-instance-mounts scenario 6', solve('new-instance-mounts', ([('a','card')],[('a','card'),('b','card')],{'a':False})), ['b'])
check('old-instance-unmounts scenario 1', solve('old-instance-unmounts', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), [])
check('old-instance-unmounts scenario 2', solve('old-instance-unmounts', ([], [('a','card')],{})), [])
check('old-instance-unmounts scenario 3', solve('old-instance-unmounts', ([('a','card')],[('a','panel')],{'a':0})), ['a'])
check('old-instance-unmounts scenario 4', solve('old-instance-unmounts', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), ['a'])
check('old-instance-unmounts scenario 5', solve('old-instance-unmounts', ([('a','card')],[],{'a':N})), ['a'])
check('old-instance-unmounts scenario 6', solve('old-instance-unmounts', ([('a','card')],[('a','card'),('b','card')],{'a':False})), [])
check('state-follows-key-through-reorder scenario 1', solve('state-follows-key-through-reorder', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), [2,N])
check('state-follows-key-through-reorder scenario 2', solve('state-follows-key-through-reorder', ([], [('a','card')],{})), [])
check('state-follows-key-through-reorder scenario 3', solve('state-follows-key-through-reorder', ([('a','card')],[('a','panel')],{'a':0})), [])
check('state-follows-key-through-reorder scenario 4', solve('state-follows-key-through-reorder', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), [None])
check('state-follows-key-through-reorder scenario 5', solve('state-follows-key-through-reorder', ([('a','card')],[],{'a':N})), [])
check('state-follows-key-through-reorder scenario 6', solve('state-follows-key-through-reorder', ([('a','card')],[('a','card'),('b','card')],{'a':False})), [False])
check('render-order-follows-incoming scenario 1', solve('render-order-follows-incoming', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), ['b','a'])
check('render-order-follows-incoming scenario 2', solve('render-order-follows-incoming', ([], [('a','card')],{})), ['a'])
check('render-order-follows-incoming scenario 3', solve('render-order-follows-incoming', ([('a','card')],[('a','panel')],{'a':0})), ['a'])
check('render-order-follows-incoming scenario 4', solve('render-order-follows-incoming', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), ['b'])
check('render-order-follows-incoming scenario 5', solve('render-order-follows-incoming', ([('a','card')],[],{'a':N})), [])
check('render-order-follows-incoming scenario 6', solve('render-order-follows-incoming', ([('a','card')],[('a','card'),('b','card')],{'a':False})), ['a','b'])
check('changed-type-state-reset scenario 1', solve('changed-type-state-reset', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), {'b':2,'a':N})
check('changed-type-state-reset scenario 2', solve('changed-type-state-reset', ([], [('a','card')],{})), {'a':None})
check('changed-type-state-reset scenario 3', solve('changed-type-state-reset', ([('a','card')],[('a','panel')],{'a':0})), {'a':None})
check('changed-type-state-reset scenario 4', solve('changed-type-state-reset', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), {'b':None})
check('changed-type-state-reset scenario 5', solve('changed-type-state-reset', ([('a','card')],[],{'a':N})), {})
check('changed-type-state-reset scenario 6', solve('changed-type-state-reset', ([('a','card')],[('a','card'),('b','card')],{'a':False})), {'a':False,'b':None})
check('cleanup-before-replacement-mount scenario 1', solve('cleanup-before-replacement-mount', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), [])
check('cleanup-before-replacement-mount scenario 2', solve('cleanup-before-replacement-mount', ([], [('a','card')],{})), [])
check('cleanup-before-replacement-mount scenario 3', solve('cleanup-before-replacement-mount', ([('a','card')],[('a','panel')],{'a':0})), [('a','cleanup'),('a','mount')])
check('cleanup-before-replacement-mount scenario 4', solve('cleanup-before-replacement-mount', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), [])
check('cleanup-before-replacement-mount scenario 5', solve('cleanup-before-replacement-mount', ([('a','card')],[],{'a':N})), [])
check('cleanup-before-replacement-mount scenario 6', solve('cleanup-before-replacement-mount', ([('a','card')],[('a','card'),('b','card')],{'a':False})), [])
check('removed-state-pruning scenario 1', solve('removed-state-pruning', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), {'a':N,'b':2})
check('removed-state-pruning scenario 2', solve('removed-state-pruning', ([], [('a','card')],{})), {})
check('removed-state-pruning scenario 3', solve('removed-state-pruning', ([('a','card')],[('a','panel')],{'a':0})), {'a':0})
check('removed-state-pruning scenario 4', solve('removed-state-pruning', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), {'b':None})
check('removed-state-pruning scenario 5', solve('removed-state-pruning', ([('a','card')],[],{'a':N})), {})
check('removed-state-pruning scenario 6', solve('removed-state-pruning', ([('a','card')],[('a','card'),('b','card')],{'a':False})), {'a':False})
check('insertion-position scenario 1', solve('insertion-position', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), {'b':0,'a':1})
check('insertion-position scenario 2', solve('insertion-position', ([], [('a','card')],{})), {'a':0})
check('insertion-position scenario 3', solve('insertion-position', ([('a','card')],[('a','panel')],{'a':0})), {'a':0})
check('insertion-position scenario 4', solve('insertion-position', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), {'b':0})
check('insertion-position scenario 5', solve('insertion-position', ([('a','card')],[],{'a':N})), {})
check('insertion-position scenario 6', solve('insertion-position', ([('a','card')],[('a','card'),('b','card')],{'a':False})), {'a':0,'b':1})
check('retained-instance-moves scenario 1', solve('retained-instance-moves', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N,'b':2})), ['b','a'])
check('retained-instance-moves scenario 2', solve('retained-instance-moves', ([], [('a','card')],{})), [])
check('retained-instance-moves scenario 3', solve('retained-instance-moves', ([('a','card')],[('a','panel')],{'a':0})), [])
check('retained-instance-moves scenario 4', solve('retained-instance-moves', ([('a','card'),('b','panel')],[('b','panel')],{'a':1,'b':None})), ['b'])
check('retained-instance-moves scenario 5', solve('retained-instance-moves', ([('a','card')],[],{'a':N})), [])
check('retained-instance-moves scenario 6', solve('retained-instance-moves', ([('a','card')],[('a','card'),('b','card')],{'a':False})), [])
check('reordering distinct state values for every seed: type-and-key-reuse', solve('type-and-key-reuse', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), ['b','a'])
check('reordering distinct state values for every seed: new-instance-mounts', solve('new-instance-mounts', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), [])
check('reordering distinct state values for every seed: old-instance-unmounts', solve('old-instance-unmounts', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), [])
check('reordering distinct state values for every seed: state-follows-key-through-reorder', solve('state-follows-key-through-reorder', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), [2,N+10])
check('reordering distinct state values for every seed: render-order-follows-incoming', solve('render-order-follows-incoming', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), ['b','a'])
check('reordering distinct state values for every seed: changed-type-state-reset', solve('changed-type-state-reset', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), {'b':2,'a':N+10})
check('reordering distinct state values for every seed: cleanup-before-replacement-mount', solve('cleanup-before-replacement-mount', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), [])
check('reordering distinct state values for every seed: removed-state-pruning', solve('removed-state-pruning', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), {'a':N+10,'b':2})
check('reordering distinct state values for every seed: insertion-position', solve('insertion-position', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), {'b':0,'a':1})
check('reordering distinct state values for every seed: retained-instance-moves', solve('retained-instance-moves', ([('a','card'),('b','card')],[('b','card'),('a','card')],{'a':N+10,'b':2})), ['b','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:
Retained instance moves.

A component instance is identified by sibling key plus component type. Reordering preserves its state, changing type remounts, removed keys lose state, and replacement cleanup happens before mount. Operation retained-instance-moves 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):
    ancestors, failed, reset_keys, previous_keys, handled, event_kind = s
    if operation == 'nearest-eligible-boundary':
        return next((k for k,enabled in ancestors if enabled),None)
    if operation == 'boundary-cannot-catch-itself':
        return [k for k,enabled in ancestors if enabled and k!=failed]
    if operation == 'reset-key-type-and-length':
        return len(reset_keys)!=len(previous_keys) or any(type(a)!=type(b) or a!=b for a,b in zip(reset_keys,previous_keys))
    if operation == 'render-only-catch':
        return event_kind=='render'
    if operation == 'unhandled-root-escalation':
        return not any(enabled and k!=failed for k,enabled in ancestors)
    if operation == 'capture-path-inside-out':
        return [k for k,enabled in reversed(ancestors) if enabled and k!=failed]
    if operation == 'reported-error-dedup':
        return not handled
    if operation == 'boundary-disabled-fallback':
        return [k for k,enabled in ancestors if not enabled]
    if operation == 'reset-clears-handled-marker':
        return handled and reset_keys==previous_keys
    if operation == 'event-error-propagation':
        return 'caller' if event_kind!='render' else 'boundary'
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nearest-eligible-boundary scenario 1', solve('nearest-eligible-boundary', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), 'outer')
check('nearest-eligible-boundary scenario 2', solve('nearest-eligible-boundary', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), 'outer')
check('nearest-eligible-boundary scenario 3', solve('nearest-eligible-boundary', ([], 'root',[1],[1],False,'render')), None)
check('nearest-eligible-boundary scenario 4', solve('nearest-eligible-boundary', ([('outer',True)],'leaf',[0],[False],True,'event')), 'outer')
check('nearest-eligible-boundary scenario 5', solve('nearest-eligible-boundary', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), 'inner')
check('nearest-eligible-boundary scenario 6', solve('nearest-eligible-boundary', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), 'inner')
check('boundary-cannot-catch-itself scenario 1', solve('boundary-cannot-catch-itself', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), ['outer'])
check('boundary-cannot-catch-itself scenario 2', solve('boundary-cannot-catch-itself', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), ['outer'])
check('boundary-cannot-catch-itself scenario 3', solve('boundary-cannot-catch-itself', ([], 'root',[1],[1],False,'render')), [])
check('boundary-cannot-catch-itself scenario 4', solve('boundary-cannot-catch-itself', ([('outer',True)],'leaf',[0],[False],True,'event')), ['outer'])
check('boundary-cannot-catch-itself scenario 5', solve('boundary-cannot-catch-itself', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), ['outer','inner'])
check('boundary-cannot-catch-itself scenario 6', solve('boundary-cannot-catch-itself', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), ['inner'])
check('reset-key-type-and-length scenario 1', solve('reset-key-type-and-length', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), True)
check('reset-key-type-and-length scenario 2', solve('reset-key-type-and-length', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), False)
check('reset-key-type-and-length scenario 3', solve('reset-key-type-and-length', ([], 'root',[1],[1],False,'render')), False)
check('reset-key-type-and-length scenario 4', solve('reset-key-type-and-length', ([('outer',True)],'leaf',[0],[False],True,'event')), True)
check('reset-key-type-and-length scenario 5', solve('reset-key-type-and-length', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), True)
check('reset-key-type-and-length scenario 6', solve('reset-key-type-and-length', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('render-only-catch scenario 1', solve('render-only-catch', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), True)
check('render-only-catch scenario 2', solve('render-only-catch', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), True)
check('render-only-catch scenario 3', solve('render-only-catch', ([], 'root',[1],[1],False,'render')), True)
check('render-only-catch scenario 4', solve('render-only-catch', ([('outer',True)],'leaf',[0],[False],True,'event')), False)
check('render-only-catch scenario 5', solve('render-only-catch', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), True)
check('render-only-catch scenario 6', solve('render-only-catch', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('unhandled-root-escalation scenario 1', solve('unhandled-root-escalation', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), False)
check('unhandled-root-escalation scenario 2', solve('unhandled-root-escalation', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), False)
check('unhandled-root-escalation scenario 3', solve('unhandled-root-escalation', ([], 'root',[1],[1],False,'render')), True)
check('unhandled-root-escalation scenario 4', solve('unhandled-root-escalation', ([('outer',True)],'leaf',[0],[False],True,'event')), False)
check('unhandled-root-escalation scenario 5', solve('unhandled-root-escalation', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), False)
check('unhandled-root-escalation scenario 6', solve('unhandled-root-escalation', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('capture-path-inside-out scenario 1', solve('capture-path-inside-out', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), ['outer'])
check('capture-path-inside-out scenario 2', solve('capture-path-inside-out', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), ['outer'])
check('capture-path-inside-out scenario 3', solve('capture-path-inside-out', ([], 'root',[1],[1],False,'render')), [])
check('capture-path-inside-out scenario 4', solve('capture-path-inside-out', ([('outer',True)],'leaf',[0],[False],True,'event')), ['outer'])
check('capture-path-inside-out scenario 5', solve('capture-path-inside-out', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), ['inner','outer'])
check('capture-path-inside-out scenario 6', solve('capture-path-inside-out', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), ['inner'])
check('reported-error-dedup scenario 1', solve('reported-error-dedup', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), True)
check('reported-error-dedup scenario 2', solve('reported-error-dedup', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), True)
check('reported-error-dedup scenario 3', solve('reported-error-dedup', ([], 'root',[1],[1],False,'render')), True)
check('reported-error-dedup scenario 4', solve('reported-error-dedup', ([('outer',True)],'leaf',[0],[False],True,'event')), False)
check('reported-error-dedup scenario 5', solve('reported-error-dedup', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), False)
check('reported-error-dedup scenario 6', solve('reported-error-dedup', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), True)
check('boundary-disabled-fallback scenario 1', solve('boundary-disabled-fallback', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), [])
check('boundary-disabled-fallback scenario 2', solve('boundary-disabled-fallback', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), ['inner'])
check('boundary-disabled-fallback scenario 3', solve('boundary-disabled-fallback', ([], 'root',[1],[1],False,'render')), [])
check('boundary-disabled-fallback scenario 4', solve('boundary-disabled-fallback', ([('outer',True)],'leaf',[0],[False],True,'event')), [])
check('boundary-disabled-fallback scenario 5', solve('boundary-disabled-fallback', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), [])
check('boundary-disabled-fallback scenario 6', solve('boundary-disabled-fallback', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), ['outer'])
check('reset-clears-handled-marker scenario 1', solve('reset-clears-handled-marker', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), False)
check('reset-clears-handled-marker scenario 2', solve('reset-clears-handled-marker', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), False)
check('reset-clears-handled-marker scenario 3', solve('reset-clears-handled-marker', ([], 'root',[1],[1],False,'render')), False)
check('reset-clears-handled-marker scenario 4', solve('reset-clears-handled-marker', ([('outer',True)],'leaf',[0],[False],True,'event')), True)
check('reset-clears-handled-marker scenario 5', solve('reset-clears-handled-marker', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), False)
check('reset-clears-handled-marker scenario 6', solve('reset-clears-handled-marker', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('event-error-propagation scenario 1', solve('event-error-propagation', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), 'boundary')
check('event-error-propagation scenario 2', solve('event-error-propagation', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), 'boundary')
check('event-error-propagation scenario 3', solve('event-error-propagation', ([], 'root',[1],[1],False,'render')), 'boundary')
check('event-error-propagation scenario 4', solve('event-error-propagation', ([('outer',True)],'leaf',[0],[False],True,'event')), 'caller')
check('event-error-propagation scenario 5', solve('event-error-propagation', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), 'boundary')
check('event-error-propagation scenario 6', solve('event-error-propagation', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), 'caller')
check('only disabled ancestor cannot intercept failure: nearest-eligible-boundary', solve('nearest-eligible-boundary', ([('outer',False)],'leaf',[],[],False,'render')), None)
check('only disabled ancestor cannot intercept failure: boundary-cannot-catch-itself', solve('boundary-cannot-catch-itself', ([('outer',False)],'leaf',[],[],False,'render')), [])
check('only disabled ancestor cannot intercept failure: reset-key-type-and-length', solve('reset-key-type-and-length', ([('outer',False)],'leaf',[],[],False,'render')), False)
check('only disabled ancestor cannot intercept failure: render-only-catch', solve('render-only-catch', ([('outer',False)],'leaf',[],[],False,'render')), True)
check('only disabled ancestor cannot intercept failure: unhandled-root-escalation', solve('unhandled-root-escalation', ([('outer',False)],'leaf',[],[],False,'render')), True)
check('only disabled ancestor cannot intercept failure: capture-path-inside-out', solve('capture-path-inside-out', ([('outer',False)],'leaf',[],[],False,'render')), [])
check('only disabled ancestor cannot intercept failure: reported-error-dedup', solve('reported-error-dedup', ([('outer',False)],'leaf',[],[],False,'render')), True)
check('only disabled ancestor cannot intercept failure: boundary-disabled-fallback', solve('boundary-disabled-fallback', ([('outer',False)],'leaf',[],[],False,'render')), ['outer'])
check('only disabled ancestor cannot intercept failure: reset-clears-handled-marker', solve('reset-clears-handled-marker', ([('outer',False)],'leaf',[],[],False,'render')), False)
check('only disabled ancestor cannot intercept failure: event-error-propagation', solve('event-error-propagation', ([('outer',False)],'leaf',[],[],False,'render')), 'boundary')
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):
    ancestors, failed, reset_keys, previous_keys, handled, event_kind = s
    if operation == 'nearest-eligible-boundary':
        return next((k for k,enabled in reversed(ancestors) if enabled),None)
    if operation == 'boundary-cannot-catch-itself':
        return [k for k,enabled in ancestors if enabled and k!=failed]
    if operation == 'reset-key-type-and-length':
        return len(reset_keys)!=len(previous_keys) or any(type(a)!=type(b) or a!=b for a,b in zip(reset_keys,previous_keys))
    if operation == 'render-only-catch':
        return event_kind=='render'
    if operation == 'unhandled-root-escalation':
        return not any(enabled and k!=failed for k,enabled in ancestors)
    if operation == 'capture-path-inside-out':
        return [k for k,enabled in reversed(ancestors) if enabled and k!=failed]
    if operation == 'reported-error-dedup':
        return not handled
    if operation == 'boundary-disabled-fallback':
        return [k for k,enabled in ancestors if not enabled]
    if operation == 'reset-clears-handled-marker':
        return handled and reset_keys==previous_keys
    if operation == 'event-error-propagation':
        return 'caller' if event_kind!='render' else 'boundary'
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nearest-eligible-boundary scenario 1', solve('nearest-eligible-boundary', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), 'outer')
check('nearest-eligible-boundary scenario 2', solve('nearest-eligible-boundary', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), 'outer')
check('nearest-eligible-boundary scenario 3', solve('nearest-eligible-boundary', ([], 'root',[1],[1],False,'render')), None)
check('nearest-eligible-boundary scenario 4', solve('nearest-eligible-boundary', ([('outer',True)],'leaf',[0],[False],True,'event')), 'outer')
check('nearest-eligible-boundary scenario 5', solve('nearest-eligible-boundary', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), 'inner')
check('nearest-eligible-boundary scenario 6', solve('nearest-eligible-boundary', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), 'inner')
check('boundary-cannot-catch-itself scenario 1', solve('boundary-cannot-catch-itself', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), ['outer'])
check('boundary-cannot-catch-itself scenario 2', solve('boundary-cannot-catch-itself', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), ['outer'])
check('boundary-cannot-catch-itself scenario 3', solve('boundary-cannot-catch-itself', ([], 'root',[1],[1],False,'render')), [])
check('boundary-cannot-catch-itself scenario 4', solve('boundary-cannot-catch-itself', ([('outer',True)],'leaf',[0],[False],True,'event')), ['outer'])
check('boundary-cannot-catch-itself scenario 5', solve('boundary-cannot-catch-itself', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), ['outer','inner'])
check('boundary-cannot-catch-itself scenario 6', solve('boundary-cannot-catch-itself', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), ['inner'])
check('reset-key-type-and-length scenario 1', solve('reset-key-type-and-length', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), True)
check('reset-key-type-and-length scenario 2', solve('reset-key-type-and-length', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), False)
check('reset-key-type-and-length scenario 3', solve('reset-key-type-and-length', ([], 'root',[1],[1],False,'render')), False)
check('reset-key-type-and-length scenario 4', solve('reset-key-type-and-length', ([('outer',True)],'leaf',[0],[False],True,'event')), True)
check('reset-key-type-and-length scenario 5', solve('reset-key-type-and-length', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), True)
check('reset-key-type-and-length scenario 6', solve('reset-key-type-and-length', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('render-only-catch scenario 1', solve('render-only-catch', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), True)
check('render-only-catch scenario 2', solve('render-only-catch', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), True)
check('render-only-catch scenario 3', solve('render-only-catch', ([], 'root',[1],[1],False,'render')), True)
check('render-only-catch scenario 4', solve('render-only-catch', ([('outer',True)],'leaf',[0],[False],True,'event')), False)
check('render-only-catch scenario 5', solve('render-only-catch', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), True)
check('render-only-catch scenario 6', solve('render-only-catch', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('unhandled-root-escalation scenario 1', solve('unhandled-root-escalation', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), False)
check('unhandled-root-escalation scenario 2', solve('unhandled-root-escalation', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), False)
check('unhandled-root-escalation scenario 3', solve('unhandled-root-escalation', ([], 'root',[1],[1],False,'render')), True)
check('unhandled-root-escalation scenario 4', solve('unhandled-root-escalation', ([('outer',True)],'leaf',[0],[False],True,'event')), False)
check('unhandled-root-escalation scenario 5', solve('unhandled-root-escalation', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), False)
check('unhandled-root-escalation scenario 6', solve('unhandled-root-escalation', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('capture-path-inside-out scenario 1', solve('capture-path-inside-out', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), ['outer'])
check('capture-path-inside-out scenario 2', solve('capture-path-inside-out', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), ['outer'])
check('capture-path-inside-out scenario 3', solve('capture-path-inside-out', ([], 'root',[1],[1],False,'render')), [])
check('capture-path-inside-out scenario 4', solve('capture-path-inside-out', ([('outer',True)],'leaf',[0],[False],True,'event')), ['outer'])
check('capture-path-inside-out scenario 5', solve('capture-path-inside-out', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), ['inner','outer'])
check('capture-path-inside-out scenario 6', solve('capture-path-inside-out', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), ['inner'])
check('reported-error-dedup scenario 1', solve('reported-error-dedup', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), True)
check('reported-error-dedup scenario 2', solve('reported-error-dedup', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), True)
check('reported-error-dedup scenario 3', solve('reported-error-dedup', ([], 'root',[1],[1],False,'render')), True)
check('reported-error-dedup scenario 4', solve('reported-error-dedup', ([('outer',True)],'leaf',[0],[False],True,'event')), False)
check('reported-error-dedup scenario 5', solve('reported-error-dedup', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), False)
check('reported-error-dedup scenario 6', solve('reported-error-dedup', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), True)
check('boundary-disabled-fallback scenario 1', solve('boundary-disabled-fallback', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), [])
check('boundary-disabled-fallback scenario 2', solve('boundary-disabled-fallback', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), ['inner'])
check('boundary-disabled-fallback scenario 3', solve('boundary-disabled-fallback', ([], 'root',[1],[1],False,'render')), [])
check('boundary-disabled-fallback scenario 4', solve('boundary-disabled-fallback', ([('outer',True)],'leaf',[0],[False],True,'event')), [])
check('boundary-disabled-fallback scenario 5', solve('boundary-disabled-fallback', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), [])
check('boundary-disabled-fallback scenario 6', solve('boundary-disabled-fallback', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), ['outer'])
check('reset-clears-handled-marker scenario 1', solve('reset-clears-handled-marker', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), False)
check('reset-clears-handled-marker scenario 2', solve('reset-clears-handled-marker', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), False)
check('reset-clears-handled-marker scenario 3', solve('reset-clears-handled-marker', ([], 'root',[1],[1],False,'render')), False)
check('reset-clears-handled-marker scenario 4', solve('reset-clears-handled-marker', ([('outer',True)],'leaf',[0],[False],True,'event')), True)
check('reset-clears-handled-marker scenario 5', solve('reset-clears-handled-marker', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), False)
check('reset-clears-handled-marker scenario 6', solve('reset-clears-handled-marker', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('event-error-propagation scenario 1', solve('event-error-propagation', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), 'boundary')
check('event-error-propagation scenario 2', solve('event-error-propagation', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), 'boundary')
check('event-error-propagation scenario 3', solve('event-error-propagation', ([], 'root',[1],[1],False,'render')), 'boundary')
check('event-error-propagation scenario 4', solve('event-error-propagation', ([('outer',True)],'leaf',[0],[False],True,'event')), 'caller')
check('event-error-propagation scenario 5', solve('event-error-propagation', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), 'boundary')
check('event-error-propagation scenario 6', solve('event-error-propagation', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), 'caller')
check('only disabled ancestor cannot intercept failure: nearest-eligible-boundary', solve('nearest-eligible-boundary', ([('outer',False)],'leaf',[],[],False,'render')), None)
check('only disabled ancestor cannot intercept failure: boundary-cannot-catch-itself', solve('boundary-cannot-catch-itself', ([('outer',False)],'leaf',[],[],False,'render')), [])
check('only disabled ancestor cannot intercept failure: reset-key-type-and-length', solve('reset-key-type-and-length', ([('outer',False)],'leaf',[],[],False,'render')), False)
check('only disabled ancestor cannot intercept failure: render-only-catch', solve('render-only-catch', ([('outer',False)],'leaf',[],[],False,'render')), True)
check('only disabled ancestor cannot intercept failure: unhandled-root-escalation', solve('unhandled-root-escalation', ([('outer',False)],'leaf',[],[],False,'render')), True)
check('only disabled ancestor cannot intercept failure: capture-path-inside-out', solve('capture-path-inside-out', ([('outer',False)],'leaf',[],[],False,'render')), [])
check('only disabled ancestor cannot intercept failure: reported-error-dedup', solve('reported-error-dedup', ([('outer',False)],'leaf',[],[],False,'render')), True)
check('only disabled ancestor cannot intercept failure: boundary-disabled-fallback', solve('boundary-disabled-fallback', ([('outer',False)],'leaf',[],[],False,'render')), ['outer'])
check('only disabled ancestor cannot intercept failure: reset-clears-handled-marker', solve('reset-clears-handled-marker', ([('outer',False)],'leaf',[],[],False,'render')), False)
check('only disabled ancestor cannot intercept failure: event-error-propagation', solve('event-error-propagation', ([('outer',False)],'leaf',[],[],False,'render')), 'boundary')
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:
Nearest eligible boundary.

This bounded render boundary model walks ancestors inside-out, excludes a failing boundary from catching itself, and catches render failures only. Reset keys compare shape and scalar types; event and asynchronous failures propagate to their callers. Operation nearest-eligible-boundary 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):
    ancestors, failed, reset_keys, previous_keys, handled, event_kind = s
    if operation == 'nearest-eligible-boundary':
        return next((k for k,enabled in reversed(ancestors) if enabled and k!=failed),None)
    if operation == 'boundary-cannot-catch-itself':
        return [k for k,enabled in ancestors if enabled]
    if operation == 'reset-key-type-and-length':
        return len(reset_keys)!=len(previous_keys) or any(type(a)!=type(b) or a!=b for a,b in zip(reset_keys,previous_keys))
    if operation == 'render-only-catch':
        return event_kind=='render'
    if operation == 'unhandled-root-escalation':
        return not any(enabled and k!=failed for k,enabled in ancestors)
    if operation == 'capture-path-inside-out':
        return [k for k,enabled in reversed(ancestors) if enabled and k!=failed]
    if operation == 'reported-error-dedup':
        return not handled
    if operation == 'boundary-disabled-fallback':
        return [k for k,enabled in ancestors if not enabled]
    if operation == 'reset-clears-handled-marker':
        return handled and reset_keys==previous_keys
    if operation == 'event-error-propagation':
        return 'caller' if event_kind!='render' else 'boundary'
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nearest-eligible-boundary scenario 1', solve('nearest-eligible-boundary', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), 'outer')
check('nearest-eligible-boundary scenario 2', solve('nearest-eligible-boundary', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), 'outer')
check('nearest-eligible-boundary scenario 3', solve('nearest-eligible-boundary', ([], 'root',[1],[1],False,'render')), None)
check('nearest-eligible-boundary scenario 4', solve('nearest-eligible-boundary', ([('outer',True)],'leaf',[0],[False],True,'event')), 'outer')
check('nearest-eligible-boundary scenario 5', solve('nearest-eligible-boundary', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), 'inner')
check('nearest-eligible-boundary scenario 6', solve('nearest-eligible-boundary', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), 'inner')
check('boundary-cannot-catch-itself scenario 1', solve('boundary-cannot-catch-itself', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), ['outer'])
check('boundary-cannot-catch-itself scenario 2', solve('boundary-cannot-catch-itself', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), ['outer'])
check('boundary-cannot-catch-itself scenario 3', solve('boundary-cannot-catch-itself', ([], 'root',[1],[1],False,'render')), [])
check('boundary-cannot-catch-itself scenario 4', solve('boundary-cannot-catch-itself', ([('outer',True)],'leaf',[0],[False],True,'event')), ['outer'])
check('boundary-cannot-catch-itself scenario 5', solve('boundary-cannot-catch-itself', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), ['outer','inner'])
check('boundary-cannot-catch-itself scenario 6', solve('boundary-cannot-catch-itself', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), ['inner'])
check('reset-key-type-and-length scenario 1', solve('reset-key-type-and-length', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), True)
check('reset-key-type-and-length scenario 2', solve('reset-key-type-and-length', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), False)
check('reset-key-type-and-length scenario 3', solve('reset-key-type-and-length', ([], 'root',[1],[1],False,'render')), False)
check('reset-key-type-and-length scenario 4', solve('reset-key-type-and-length', ([('outer',True)],'leaf',[0],[False],True,'event')), True)
check('reset-key-type-and-length scenario 5', solve('reset-key-type-and-length', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), True)
check('reset-key-type-and-length scenario 6', solve('reset-key-type-and-length', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('render-only-catch scenario 1', solve('render-only-catch', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), True)
check('render-only-catch scenario 2', solve('render-only-catch', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), True)
check('render-only-catch scenario 3', solve('render-only-catch', ([], 'root',[1],[1],False,'render')), True)
check('render-only-catch scenario 4', solve('render-only-catch', ([('outer',True)],'leaf',[0],[False],True,'event')), False)
check('render-only-catch scenario 5', solve('render-only-catch', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), True)
check('render-only-catch scenario 6', solve('render-only-catch', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('unhandled-root-escalation scenario 1', solve('unhandled-root-escalation', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), False)
check('unhandled-root-escalation scenario 2', solve('unhandled-root-escalation', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), False)
check('unhandled-root-escalation scenario 3', solve('unhandled-root-escalation', ([], 'root',[1],[1],False,'render')), True)
check('unhandled-root-escalation scenario 4', solve('unhandled-root-escalation', ([('outer',True)],'leaf',[0],[False],True,'event')), False)
check('unhandled-root-escalation scenario 5', solve('unhandled-root-escalation', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), False)
check('unhandled-root-escalation scenario 6', solve('unhandled-root-escalation', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('capture-path-inside-out scenario 1', solve('capture-path-inside-out', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), ['outer'])
check('capture-path-inside-out scenario 2', solve('capture-path-inside-out', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), ['outer'])
check('capture-path-inside-out scenario 3', solve('capture-path-inside-out', ([], 'root',[1],[1],False,'render')), [])
check('capture-path-inside-out scenario 4', solve('capture-path-inside-out', ([('outer',True)],'leaf',[0],[False],True,'event')), ['outer'])
check('capture-path-inside-out scenario 5', solve('capture-path-inside-out', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), ['inner','outer'])
check('capture-path-inside-out scenario 6', solve('capture-path-inside-out', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), ['inner'])
check('reported-error-dedup scenario 1', solve('reported-error-dedup', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), True)
check('reported-error-dedup scenario 2', solve('reported-error-dedup', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), True)
check('reported-error-dedup scenario 3', solve('reported-error-dedup', ([], 'root',[1],[1],False,'render')), True)
check('reported-error-dedup scenario 4', solve('reported-error-dedup', ([('outer',True)],'leaf',[0],[False],True,'event')), False)
check('reported-error-dedup scenario 5', solve('reported-error-dedup', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), False)
check('reported-error-dedup scenario 6', solve('reported-error-dedup', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), True)
check('boundary-disabled-fallback scenario 1', solve('boundary-disabled-fallback', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), [])
check('boundary-disabled-fallback scenario 2', solve('boundary-disabled-fallback', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), ['inner'])
check('boundary-disabled-fallback scenario 3', solve('boundary-disabled-fallback', ([], 'root',[1],[1],False,'render')), [])
check('boundary-disabled-fallback scenario 4', solve('boundary-disabled-fallback', ([('outer',True)],'leaf',[0],[False],True,'event')), [])
check('boundary-disabled-fallback scenario 5', solve('boundary-disabled-fallback', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), [])
check('boundary-disabled-fallback scenario 6', solve('boundary-disabled-fallback', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), ['outer'])
check('reset-clears-handled-marker scenario 1', solve('reset-clears-handled-marker', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), False)
check('reset-clears-handled-marker scenario 2', solve('reset-clears-handled-marker', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), False)
check('reset-clears-handled-marker scenario 3', solve('reset-clears-handled-marker', ([], 'root',[1],[1],False,'render')), False)
check('reset-clears-handled-marker scenario 4', solve('reset-clears-handled-marker', ([('outer',True)],'leaf',[0],[False],True,'event')), True)
check('reset-clears-handled-marker scenario 5', solve('reset-clears-handled-marker', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), False)
check('reset-clears-handled-marker scenario 6', solve('reset-clears-handled-marker', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('event-error-propagation scenario 1', solve('event-error-propagation', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), 'boundary')
check('event-error-propagation scenario 2', solve('event-error-propagation', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), 'boundary')
check('event-error-propagation scenario 3', solve('event-error-propagation', ([], 'root',[1],[1],False,'render')), 'boundary')
check('event-error-propagation scenario 4', solve('event-error-propagation', ([('outer',True)],'leaf',[0],[False],True,'event')), 'caller')
check('event-error-propagation scenario 5', solve('event-error-propagation', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), 'boundary')
check('event-error-propagation scenario 6', solve('event-error-propagation', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), 'caller')
check('only disabled ancestor cannot intercept failure: nearest-eligible-boundary', solve('nearest-eligible-boundary', ([('outer',False)],'leaf',[],[],False,'render')), None)
check('only disabled ancestor cannot intercept failure: boundary-cannot-catch-itself', solve('boundary-cannot-catch-itself', ([('outer',False)],'leaf',[],[],False,'render')), [])
check('only disabled ancestor cannot intercept failure: reset-key-type-and-length', solve('reset-key-type-and-length', ([('outer',False)],'leaf',[],[],False,'render')), False)
check('only disabled ancestor cannot intercept failure: render-only-catch', solve('render-only-catch', ([('outer',False)],'leaf',[],[],False,'render')), True)
check('only disabled ancestor cannot intercept failure: unhandled-root-escalation', solve('unhandled-root-escalation', ([('outer',False)],'leaf',[],[],False,'render')), True)
check('only disabled ancestor cannot intercept failure: capture-path-inside-out', solve('capture-path-inside-out', ([('outer',False)],'leaf',[],[],False,'render')), [])
check('only disabled ancestor cannot intercept failure: reported-error-dedup', solve('reported-error-dedup', ([('outer',False)],'leaf',[],[],False,'render')), True)
check('only disabled ancestor cannot intercept failure: boundary-disabled-fallback', solve('boundary-disabled-fallback', ([('outer',False)],'leaf',[],[],False,'render')), ['outer'])
check('only disabled ancestor cannot intercept failure: reset-clears-handled-marker', solve('reset-clears-handled-marker', ([('outer',False)],'leaf',[],[],False,'render')), False)
check('only disabled ancestor cannot intercept failure: event-error-propagation', solve('event-error-propagation', ([('outer',False)],'leaf',[],[],False,'render')), 'boundary')
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):
    ancestors, failed, reset_keys, previous_keys, handled, event_kind = s
    if operation == 'nearest-eligible-boundary':
        return next((k for k,enabled in reversed(ancestors) if enabled and k!=failed),None)
    if operation == 'boundary-cannot-catch-itself':
        return [k for k,enabled in ancestors if k!=failed]
    if operation == 'reset-key-type-and-length':
        return len(reset_keys)!=len(previous_keys) or any(type(a)!=type(b) or a!=b for a,b in zip(reset_keys,previous_keys))
    if operation == 'render-only-catch':
        return event_kind=='render'
    if operation == 'unhandled-root-escalation':
        return not any(enabled and k!=failed for k,enabled in ancestors)
    if operation == 'capture-path-inside-out':
        return [k for k,enabled in reversed(ancestors) if enabled and k!=failed]
    if operation == 'reported-error-dedup':
        return not handled
    if operation == 'boundary-disabled-fallback':
        return [k for k,enabled in ancestors if not enabled]
    if operation == 'reset-clears-handled-marker':
        return handled and reset_keys==previous_keys
    if operation == 'event-error-propagation':
        return 'caller' if event_kind!='render' else 'boundary'
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nearest-eligible-boundary scenario 1', solve('nearest-eligible-boundary', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), 'outer')
check('nearest-eligible-boundary scenario 2', solve('nearest-eligible-boundary', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), 'outer')
check('nearest-eligible-boundary scenario 3', solve('nearest-eligible-boundary', ([], 'root',[1],[1],False,'render')), None)
check('nearest-eligible-boundary scenario 4', solve('nearest-eligible-boundary', ([('outer',True)],'leaf',[0],[False],True,'event')), 'outer')
check('nearest-eligible-boundary scenario 5', solve('nearest-eligible-boundary', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), 'inner')
check('nearest-eligible-boundary scenario 6', solve('nearest-eligible-boundary', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), 'inner')
check('boundary-cannot-catch-itself scenario 1', solve('boundary-cannot-catch-itself', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), ['outer'])
check('boundary-cannot-catch-itself scenario 2', solve('boundary-cannot-catch-itself', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), ['outer'])
check('boundary-cannot-catch-itself scenario 3', solve('boundary-cannot-catch-itself', ([], 'root',[1],[1],False,'render')), [])
check('boundary-cannot-catch-itself scenario 4', solve('boundary-cannot-catch-itself', ([('outer',True)],'leaf',[0],[False],True,'event')), ['outer'])
check('boundary-cannot-catch-itself scenario 5', solve('boundary-cannot-catch-itself', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), ['outer','inner'])
check('boundary-cannot-catch-itself scenario 6', solve('boundary-cannot-catch-itself', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), ['inner'])
check('reset-key-type-and-length scenario 1', solve('reset-key-type-and-length', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), True)
check('reset-key-type-and-length scenario 2', solve('reset-key-type-and-length', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), False)
check('reset-key-type-and-length scenario 3', solve('reset-key-type-and-length', ([], 'root',[1],[1],False,'render')), False)
check('reset-key-type-and-length scenario 4', solve('reset-key-type-and-length', ([('outer',True)],'leaf',[0],[False],True,'event')), True)
check('reset-key-type-and-length scenario 5', solve('reset-key-type-and-length', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), True)
check('reset-key-type-and-length scenario 6', solve('reset-key-type-and-length', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('render-only-catch scenario 1', solve('render-only-catch', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), True)
check('render-only-catch scenario 2', solve('render-only-catch', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), True)
check('render-only-catch scenario 3', solve('render-only-catch', ([], 'root',[1],[1],False,'render')), True)
check('render-only-catch scenario 4', solve('render-only-catch', ([('outer',True)],'leaf',[0],[False],True,'event')), False)
check('render-only-catch scenario 5', solve('render-only-catch', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), True)
check('render-only-catch scenario 6', solve('render-only-catch', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('unhandled-root-escalation scenario 1', solve('unhandled-root-escalation', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), False)
check('unhandled-root-escalation scenario 2', solve('unhandled-root-escalation', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), False)
check('unhandled-root-escalation scenario 3', solve('unhandled-root-escalation', ([], 'root',[1],[1],False,'render')), True)
check('unhandled-root-escalation scenario 4', solve('unhandled-root-escalation', ([('outer',True)],'leaf',[0],[False],True,'event')), False)
check('unhandled-root-escalation scenario 5', solve('unhandled-root-escalation', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), False)
check('unhandled-root-escalation scenario 6', solve('unhandled-root-escalation', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('capture-path-inside-out scenario 1', solve('capture-path-inside-out', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), ['outer'])
check('capture-path-inside-out scenario 2', solve('capture-path-inside-out', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), ['outer'])
check('capture-path-inside-out scenario 3', solve('capture-path-inside-out', ([], 'root',[1],[1],False,'render')), [])
check('capture-path-inside-out scenario 4', solve('capture-path-inside-out', ([('outer',True)],'leaf',[0],[False],True,'event')), ['outer'])
check('capture-path-inside-out scenario 5', solve('capture-path-inside-out', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), ['inner','outer'])
check('capture-path-inside-out scenario 6', solve('capture-path-inside-out', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), ['inner'])
check('reported-error-dedup scenario 1', solve('reported-error-dedup', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), True)
check('reported-error-dedup scenario 2', solve('reported-error-dedup', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), True)
check('reported-error-dedup scenario 3', solve('reported-error-dedup', ([], 'root',[1],[1],False,'render')), True)
check('reported-error-dedup scenario 4', solve('reported-error-dedup', ([('outer',True)],'leaf',[0],[False],True,'event')), False)
check('reported-error-dedup scenario 5', solve('reported-error-dedup', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), False)
check('reported-error-dedup scenario 6', solve('reported-error-dedup', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), True)
check('boundary-disabled-fallback scenario 1', solve('boundary-disabled-fallback', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), [])
check('boundary-disabled-fallback scenario 2', solve('boundary-disabled-fallback', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), ['inner'])
check('boundary-disabled-fallback scenario 3', solve('boundary-disabled-fallback', ([], 'root',[1],[1],False,'render')), [])
check('boundary-disabled-fallback scenario 4', solve('boundary-disabled-fallback', ([('outer',True)],'leaf',[0],[False],True,'event')), [])
check('boundary-disabled-fallback scenario 5', solve('boundary-disabled-fallback', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), [])
check('boundary-disabled-fallback scenario 6', solve('boundary-disabled-fallback', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), ['outer'])
check('reset-clears-handled-marker scenario 1', solve('reset-clears-handled-marker', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), False)
check('reset-clears-handled-marker scenario 2', solve('reset-clears-handled-marker', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), False)
check('reset-clears-handled-marker scenario 3', solve('reset-clears-handled-marker', ([], 'root',[1],[1],False,'render')), False)
check('reset-clears-handled-marker scenario 4', solve('reset-clears-handled-marker', ([('outer',True)],'leaf',[0],[False],True,'event')), True)
check('reset-clears-handled-marker scenario 5', solve('reset-clears-handled-marker', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), False)
check('reset-clears-handled-marker scenario 6', solve('reset-clears-handled-marker', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('event-error-propagation scenario 1', solve('event-error-propagation', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), 'boundary')
check('event-error-propagation scenario 2', solve('event-error-propagation', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), 'boundary')
check('event-error-propagation scenario 3', solve('event-error-propagation', ([], 'root',[1],[1],False,'render')), 'boundary')
check('event-error-propagation scenario 4', solve('event-error-propagation', ([('outer',True)],'leaf',[0],[False],True,'event')), 'caller')
check('event-error-propagation scenario 5', solve('event-error-propagation', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), 'boundary')
check('event-error-propagation scenario 6', solve('event-error-propagation', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), 'caller')
check('only disabled ancestor cannot intercept failure: nearest-eligible-boundary', solve('nearest-eligible-boundary', ([('outer',False)],'leaf',[],[],False,'render')), None)
check('only disabled ancestor cannot intercept failure: boundary-cannot-catch-itself', solve('boundary-cannot-catch-itself', ([('outer',False)],'leaf',[],[],False,'render')), [])
check('only disabled ancestor cannot intercept failure: reset-key-type-and-length', solve('reset-key-type-and-length', ([('outer',False)],'leaf',[],[],False,'render')), False)
check('only disabled ancestor cannot intercept failure: render-only-catch', solve('render-only-catch', ([('outer',False)],'leaf',[],[],False,'render')), True)
check('only disabled ancestor cannot intercept failure: unhandled-root-escalation', solve('unhandled-root-escalation', ([('outer',False)],'leaf',[],[],False,'render')), True)
check('only disabled ancestor cannot intercept failure: capture-path-inside-out', solve('capture-path-inside-out', ([('outer',False)],'leaf',[],[],False,'render')), [])
check('only disabled ancestor cannot intercept failure: reported-error-dedup', solve('reported-error-dedup', ([('outer',False)],'leaf',[],[],False,'render')), True)
check('only disabled ancestor cannot intercept failure: boundary-disabled-fallback', solve('boundary-disabled-fallback', ([('outer',False)],'leaf',[],[],False,'render')), ['outer'])
check('only disabled ancestor cannot intercept failure: reset-clears-handled-marker', solve('reset-clears-handled-marker', ([('outer',False)],'leaf',[],[],False,'render')), False)
check('only disabled ancestor cannot intercept failure: event-error-propagation', solve('event-error-propagation', ([('outer',False)],'leaf',[],[],False,'render')), 'boundary')
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:
Boundary cannot catch itself.

This bounded render boundary model walks ancestors inside-out, excludes a failing boundary from catching itself, and catches render failures only. Reset keys compare shape and scalar types; event and asynchronous failures propagate to their callers. Operation boundary-cannot-catch-itself 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):
    ancestors, failed, reset_keys, previous_keys, handled, event_kind = s
    if operation == 'nearest-eligible-boundary':
        return next((k for k,enabled in reversed(ancestors) if enabled and k!=failed),None)
    if operation == 'boundary-cannot-catch-itself':
        return [k for k,enabled in ancestors if enabled and k!=failed]
    if operation == 'reset-key-type-and-length':
        return reset_keys!=previous_keys
    if operation == 'render-only-catch':
        return event_kind=='render'
    if operation == 'unhandled-root-escalation':
        return not any(enabled and k!=failed for k,enabled in ancestors)
    if operation == 'capture-path-inside-out':
        return [k for k,enabled in reversed(ancestors) if enabled and k!=failed]
    if operation == 'reported-error-dedup':
        return not handled
    if operation == 'boundary-disabled-fallback':
        return [k for k,enabled in ancestors if not enabled]
    if operation == 'reset-clears-handled-marker':
        return handled and reset_keys==previous_keys
    if operation == 'event-error-propagation':
        return 'caller' if event_kind!='render' else 'boundary'
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nearest-eligible-boundary scenario 1', solve('nearest-eligible-boundary', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), 'outer')
check('nearest-eligible-boundary scenario 2', solve('nearest-eligible-boundary', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), 'outer')
check('nearest-eligible-boundary scenario 3', solve('nearest-eligible-boundary', ([], 'root',[1],[1],False,'render')), None)
check('nearest-eligible-boundary scenario 4', solve('nearest-eligible-boundary', ([('outer',True)],'leaf',[0],[False],True,'event')), 'outer')
check('nearest-eligible-boundary scenario 5', solve('nearest-eligible-boundary', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), 'inner')
check('nearest-eligible-boundary scenario 6', solve('nearest-eligible-boundary', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), 'inner')
check('boundary-cannot-catch-itself scenario 1', solve('boundary-cannot-catch-itself', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), ['outer'])
check('boundary-cannot-catch-itself scenario 2', solve('boundary-cannot-catch-itself', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), ['outer'])
check('boundary-cannot-catch-itself scenario 3', solve('boundary-cannot-catch-itself', ([], 'root',[1],[1],False,'render')), [])
check('boundary-cannot-catch-itself scenario 4', solve('boundary-cannot-catch-itself', ([('outer',True)],'leaf',[0],[False],True,'event')), ['outer'])
check('boundary-cannot-catch-itself scenario 5', solve('boundary-cannot-catch-itself', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), ['outer','inner'])
check('boundary-cannot-catch-itself scenario 6', solve('boundary-cannot-catch-itself', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), ['inner'])
check('reset-key-type-and-length scenario 1', solve('reset-key-type-and-length', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), True)
check('reset-key-type-and-length scenario 2', solve('reset-key-type-and-length', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), False)
check('reset-key-type-and-length scenario 3', solve('reset-key-type-and-length', ([], 'root',[1],[1],False,'render')), False)
check('reset-key-type-and-length scenario 4', solve('reset-key-type-and-length', ([('outer',True)],'leaf',[0],[False],True,'event')), True)
check('reset-key-type-and-length scenario 5', solve('reset-key-type-and-length', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), True)
check('reset-key-type-and-length scenario 6', solve('reset-key-type-and-length', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('render-only-catch scenario 1', solve('render-only-catch', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), True)
check('render-only-catch scenario 2', solve('render-only-catch', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), True)
check('render-only-catch scenario 3', solve('render-only-catch', ([], 'root',[1],[1],False,'render')), True)
check('render-only-catch scenario 4', solve('render-only-catch', ([('outer',True)],'leaf',[0],[False],True,'event')), False)
check('render-only-catch scenario 5', solve('render-only-catch', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), True)
check('render-only-catch scenario 6', solve('render-only-catch', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('unhandled-root-escalation scenario 1', solve('unhandled-root-escalation', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), False)
check('unhandled-root-escalation scenario 2', solve('unhandled-root-escalation', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), False)
check('unhandled-root-escalation scenario 3', solve('unhandled-root-escalation', ([], 'root',[1],[1],False,'render')), True)
check('unhandled-root-escalation scenario 4', solve('unhandled-root-escalation', ([('outer',True)],'leaf',[0],[False],True,'event')), False)
check('unhandled-root-escalation scenario 5', solve('unhandled-root-escalation', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), False)
check('unhandled-root-escalation scenario 6', solve('unhandled-root-escalation', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('capture-path-inside-out scenario 1', solve('capture-path-inside-out', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), ['outer'])
check('capture-path-inside-out scenario 2', solve('capture-path-inside-out', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), ['outer'])
check('capture-path-inside-out scenario 3', solve('capture-path-inside-out', ([], 'root',[1],[1],False,'render')), [])
check('capture-path-inside-out scenario 4', solve('capture-path-inside-out', ([('outer',True)],'leaf',[0],[False],True,'event')), ['outer'])
check('capture-path-inside-out scenario 5', solve('capture-path-inside-out', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), ['inner','outer'])
check('capture-path-inside-out scenario 6', solve('capture-path-inside-out', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), ['inner'])
check('reported-error-dedup scenario 1', solve('reported-error-dedup', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), True)
check('reported-error-dedup scenario 2', solve('reported-error-dedup', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), True)
check('reported-error-dedup scenario 3', solve('reported-error-dedup', ([], 'root',[1],[1],False,'render')), True)
check('reported-error-dedup scenario 4', solve('reported-error-dedup', ([('outer',True)],'leaf',[0],[False],True,'event')), False)
check('reported-error-dedup scenario 5', solve('reported-error-dedup', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), False)
check('reported-error-dedup scenario 6', solve('reported-error-dedup', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), True)
check('boundary-disabled-fallback scenario 1', solve('boundary-disabled-fallback', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), [])
check('boundary-disabled-fallback scenario 2', solve('boundary-disabled-fallback', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), ['inner'])
check('boundary-disabled-fallback scenario 3', solve('boundary-disabled-fallback', ([], 'root',[1],[1],False,'render')), [])
check('boundary-disabled-fallback scenario 4', solve('boundary-disabled-fallback', ([('outer',True)],'leaf',[0],[False],True,'event')), [])
check('boundary-disabled-fallback scenario 5', solve('boundary-disabled-fallback', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), [])
check('boundary-disabled-fallback scenario 6', solve('boundary-disabled-fallback', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), ['outer'])
check('reset-clears-handled-marker scenario 1', solve('reset-clears-handled-marker', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), False)
check('reset-clears-handled-marker scenario 2', solve('reset-clears-handled-marker', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), False)
check('reset-clears-handled-marker scenario 3', solve('reset-clears-handled-marker', ([], 'root',[1],[1],False,'render')), False)
check('reset-clears-handled-marker scenario 4', solve('reset-clears-handled-marker', ([('outer',True)],'leaf',[0],[False],True,'event')), True)
check('reset-clears-handled-marker scenario 5', solve('reset-clears-handled-marker', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), False)
check('reset-clears-handled-marker scenario 6', solve('reset-clears-handled-marker', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('event-error-propagation scenario 1', solve('event-error-propagation', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), 'boundary')
check('event-error-propagation scenario 2', solve('event-error-propagation', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), 'boundary')
check('event-error-propagation scenario 3', solve('event-error-propagation', ([], 'root',[1],[1],False,'render')), 'boundary')
check('event-error-propagation scenario 4', solve('event-error-propagation', ([('outer',True)],'leaf',[0],[False],True,'event')), 'caller')
check('event-error-propagation scenario 5', solve('event-error-propagation', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), 'boundary')
check('event-error-propagation scenario 6', solve('event-error-propagation', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), 'caller')
check('only disabled ancestor cannot intercept failure: nearest-eligible-boundary', solve('nearest-eligible-boundary', ([('outer',False)],'leaf',[],[],False,'render')), None)
check('only disabled ancestor cannot intercept failure: boundary-cannot-catch-itself', solve('boundary-cannot-catch-itself', ([('outer',False)],'leaf',[],[],False,'render')), [])
check('only disabled ancestor cannot intercept failure: reset-key-type-and-length', solve('reset-key-type-and-length', ([('outer',False)],'leaf',[],[],False,'render')), False)
check('only disabled ancestor cannot intercept failure: render-only-catch', solve('render-only-catch', ([('outer',False)],'leaf',[],[],False,'render')), True)
check('only disabled ancestor cannot intercept failure: unhandled-root-escalation', solve('unhandled-root-escalation', ([('outer',False)],'leaf',[],[],False,'render')), True)
check('only disabled ancestor cannot intercept failure: capture-path-inside-out', solve('capture-path-inside-out', ([('outer',False)],'leaf',[],[],False,'render')), [])
check('only disabled ancestor cannot intercept failure: reported-error-dedup', solve('reported-error-dedup', ([('outer',False)],'leaf',[],[],False,'render')), True)
check('only disabled ancestor cannot intercept failure: boundary-disabled-fallback', solve('boundary-disabled-fallback', ([('outer',False)],'leaf',[],[],False,'render')), ['outer'])
check('only disabled ancestor cannot intercept failure: reset-clears-handled-marker', solve('reset-clears-handled-marker', ([('outer',False)],'leaf',[],[],False,'render')), False)
check('only disabled ancestor cannot intercept failure: event-error-propagation', solve('event-error-propagation', ([('outer',False)],'leaf',[],[],False,'render')), 'boundary')
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):
    ancestors, failed, reset_keys, previous_keys, handled, event_kind = s
    if operation == 'nearest-eligible-boundary':
        return next((k for k,enabled in reversed(ancestors) if enabled and k!=failed),None)
    if operation == 'boundary-cannot-catch-itself':
        return [k for k,enabled in ancestors if enabled and k!=failed]
    if operation == 'reset-key-type-and-length':
        return any(a!=b for a,b in zip(reset_keys,previous_keys))
    if operation == 'render-only-catch':
        return event_kind=='render'
    if operation == 'unhandled-root-escalation':
        return not any(enabled and k!=failed for k,enabled in ancestors)
    if operation == 'capture-path-inside-out':
        return [k for k,enabled in reversed(ancestors) if enabled and k!=failed]
    if operation == 'reported-error-dedup':
        return not handled
    if operation == 'boundary-disabled-fallback':
        return [k for k,enabled in ancestors if not enabled]
    if operation == 'reset-clears-handled-marker':
        return handled and reset_keys==previous_keys
    if operation == 'event-error-propagation':
        return 'caller' if event_kind!='render' else 'boundary'
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nearest-eligible-boundary scenario 1', solve('nearest-eligible-boundary', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), 'outer')
check('nearest-eligible-boundary scenario 2', solve('nearest-eligible-boundary', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), 'outer')
check('nearest-eligible-boundary scenario 3', solve('nearest-eligible-boundary', ([], 'root',[1],[1],False,'render')), None)
check('nearest-eligible-boundary scenario 4', solve('nearest-eligible-boundary', ([('outer',True)],'leaf',[0],[False],True,'event')), 'outer')
check('nearest-eligible-boundary scenario 5', solve('nearest-eligible-boundary', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), 'inner')
check('nearest-eligible-boundary scenario 6', solve('nearest-eligible-boundary', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), 'inner')
check('boundary-cannot-catch-itself scenario 1', solve('boundary-cannot-catch-itself', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), ['outer'])
check('boundary-cannot-catch-itself scenario 2', solve('boundary-cannot-catch-itself', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), ['outer'])
check('boundary-cannot-catch-itself scenario 3', solve('boundary-cannot-catch-itself', ([], 'root',[1],[1],False,'render')), [])
check('boundary-cannot-catch-itself scenario 4', solve('boundary-cannot-catch-itself', ([('outer',True)],'leaf',[0],[False],True,'event')), ['outer'])
check('boundary-cannot-catch-itself scenario 5', solve('boundary-cannot-catch-itself', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), ['outer','inner'])
check('boundary-cannot-catch-itself scenario 6', solve('boundary-cannot-catch-itself', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), ['inner'])
check('reset-key-type-and-length scenario 1', solve('reset-key-type-and-length', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), True)
check('reset-key-type-and-length scenario 2', solve('reset-key-type-and-length', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), False)
check('reset-key-type-and-length scenario 3', solve('reset-key-type-and-length', ([], 'root',[1],[1],False,'render')), False)
check('reset-key-type-and-length scenario 4', solve('reset-key-type-and-length', ([('outer',True)],'leaf',[0],[False],True,'event')), True)
check('reset-key-type-and-length scenario 5', solve('reset-key-type-and-length', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), True)
check('reset-key-type-and-length scenario 6', solve('reset-key-type-and-length', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('render-only-catch scenario 1', solve('render-only-catch', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), True)
check('render-only-catch scenario 2', solve('render-only-catch', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), True)
check('render-only-catch scenario 3', solve('render-only-catch', ([], 'root',[1],[1],False,'render')), True)
check('render-only-catch scenario 4', solve('render-only-catch', ([('outer',True)],'leaf',[0],[False],True,'event')), False)
check('render-only-catch scenario 5', solve('render-only-catch', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), True)
check('render-only-catch scenario 6', solve('render-only-catch', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('unhandled-root-escalation scenario 1', solve('unhandled-root-escalation', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), False)
check('unhandled-root-escalation scenario 2', solve('unhandled-root-escalation', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), False)
check('unhandled-root-escalation scenario 3', solve('unhandled-root-escalation', ([], 'root',[1],[1],False,'render')), True)
check('unhandled-root-escalation scenario 4', solve('unhandled-root-escalation', ([('outer',True)],'leaf',[0],[False],True,'event')), False)
check('unhandled-root-escalation scenario 5', solve('unhandled-root-escalation', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), False)
check('unhandled-root-escalation scenario 6', solve('unhandled-root-escalation', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('capture-path-inside-out scenario 1', solve('capture-path-inside-out', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), ['outer'])
check('capture-path-inside-out scenario 2', solve('capture-path-inside-out', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), ['outer'])
check('capture-path-inside-out scenario 3', solve('capture-path-inside-out', ([], 'root',[1],[1],False,'render')), [])
check('capture-path-inside-out scenario 4', solve('capture-path-inside-out', ([('outer',True)],'leaf',[0],[False],True,'event')), ['outer'])
check('capture-path-inside-out scenario 5', solve('capture-path-inside-out', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), ['inner','outer'])
check('capture-path-inside-out scenario 6', solve('capture-path-inside-out', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), ['inner'])
check('reported-error-dedup scenario 1', solve('reported-error-dedup', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), True)
check('reported-error-dedup scenario 2', solve('reported-error-dedup', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), True)
check('reported-error-dedup scenario 3', solve('reported-error-dedup', ([], 'root',[1],[1],False,'render')), True)
check('reported-error-dedup scenario 4', solve('reported-error-dedup', ([('outer',True)],'leaf',[0],[False],True,'event')), False)
check('reported-error-dedup scenario 5', solve('reported-error-dedup', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), False)
check('reported-error-dedup scenario 6', solve('reported-error-dedup', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), True)
check('boundary-disabled-fallback scenario 1', solve('boundary-disabled-fallback', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), [])
check('boundary-disabled-fallback scenario 2', solve('boundary-disabled-fallback', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), ['inner'])
check('boundary-disabled-fallback scenario 3', solve('boundary-disabled-fallback', ([], 'root',[1],[1],False,'render')), [])
check('boundary-disabled-fallback scenario 4', solve('boundary-disabled-fallback', ([('outer',True)],'leaf',[0],[False],True,'event')), [])
check('boundary-disabled-fallback scenario 5', solve('boundary-disabled-fallback', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), [])
check('boundary-disabled-fallback scenario 6', solve('boundary-disabled-fallback', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), ['outer'])
check('reset-clears-handled-marker scenario 1', solve('reset-clears-handled-marker', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), False)
check('reset-clears-handled-marker scenario 2', solve('reset-clears-handled-marker', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), False)
check('reset-clears-handled-marker scenario 3', solve('reset-clears-handled-marker', ([], 'root',[1],[1],False,'render')), False)
check('reset-clears-handled-marker scenario 4', solve('reset-clears-handled-marker', ([('outer',True)],'leaf',[0],[False],True,'event')), True)
check('reset-clears-handled-marker scenario 5', solve('reset-clears-handled-marker', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), False)
check('reset-clears-handled-marker scenario 6', solve('reset-clears-handled-marker', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), False)
check('event-error-propagation scenario 1', solve('event-error-propagation', ([('outer',True),('inner',True)],'inner',[N],[N-1],False,'render')), 'boundary')
check('event-error-propagation scenario 2', solve('event-error-propagation', ([('outer',True),('inner',False)],'leaf',[],[],False,'render')), 'boundary')
check('event-error-propagation scenario 3', solve('event-error-propagation', ([], 'root',[1],[1],False,'render')), 'boundary')
check('event-error-propagation scenario 4', solve('event-error-propagation', ([('outer',True)],'leaf',[0],[False],True,'event')), 'caller')
check('event-error-propagation scenario 5', solve('event-error-propagation', ([('outer',True),('inner',True)],'leaf',[1,2],[1],True,'render')), 'boundary')
check('event-error-propagation scenario 6', solve('event-error-propagation', ([('outer',False),('inner',True)],'leaf',[],[],False,'async')), 'caller')
check('only disabled ancestor cannot intercept failure: nearest-eligible-boundary', solve('nearest-eligible-boundary', ([('outer',False)],'leaf',[],[],False,'render')), None)
check('only disabled ancestor cannot intercept failure: boundary-cannot-catch-itself', solve('boundary-cannot-catch-itself', ([('outer',False)],'leaf',[],[],False,'render')), [])
check('only disabled ancestor cannot intercept failure: reset-key-type-and-length', solve('reset-key-type-and-length', ([('outer',False)],'leaf',[],[],False,'render')), False)
check('only disabled ancestor cannot intercept failure: render-only-catch', solve('render-only-catch', ([('outer',False)],'leaf',[],[],False,'render')), True)
check('only disabled ancestor cannot intercept failure: unhandled-root-escalation', solve('unhandled-root-escalation', ([('outer',False)],'leaf',[],[],False,'render')), True)
check('only disabled ancestor cannot intercept failure: capture-path-inside-out', solve('capture-path-inside-out', ([('outer',False)],'leaf',[],[],False,'render')), [])
check('only disabled ancestor cannot intercept failure: reported-error-dedup', solve('reported-error-dedup', ([('outer',False)],'leaf',[],[],False,'render')), True)
check('only disabled ancestor cannot intercept failure: boundary-disabled-fallback', solve('boundary-disabled-fallback', ([('outer',False)],'leaf',[],[],False,'render')), ['outer'])
check('only disabled ancestor cannot intercept failure: reset-clears-handled-marker', solve('reset-clears-handled-marker', ([('outer',False)],'leaf',[],[],False,'render')), False)
check('only disabled ancestor cannot intercept failure: event-error-propagation', solve('event-error-propagation', ([('outer',False)],'leaf',[],[],False,'render')), 'boundary')
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:
Reset key type and length.

This bounded render boundary model walks ancestors inside-out, excludes a failing boundary from catching itself, and catches render failures only. Reset keys compare shape and scalar types; event and asynchronous failures propagate to their callers. Operation reset-key-type-and-length has the six explicit input/output oracles below.

split: open-access