FAILURE MAP
← Case archive

FA-42831 / Listener lifecycle / Open access

A callback context reset token is consumed from the wrong context · case 01

A callback context reset token is consumed from the wrong context; the returned lifecycle plan violates the stated transition contract.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The restore_disposed decision in the callback-context listener model is computed as 'reset', losing a required lifecycle condition.

VERIFIED REPAIR

Compute the restore_disposed decision from the complete contract: 'used' if s['reset_token'] in s['used_tokens'] else ('wrong-context' if s['token_context']!=s['active_context'] else 'reset').

Unsuccessful approach: The partial repair uses 'used' if s['reset_token'] in s['used_tokens'] else 'reset'; a retained regression distinguishes it from the full transition.

Case contract

Plan an observer callback context frame. The bound receiver is independent from event sender. Explicit None receiver differs from no receiver binding. Context-local values shadow inherited values, including None. An exit restores the saved outer context even after callback failure. Nested callbacks append a trace segment without rewriting the existing path. A disposed binding rejects invocation but still permits frame restoration. A forwarded sender route collapses adjacent duplicate hops only; a later revisit after another sender is meaningful and preserved. Restore only names modified by the callback. Restore their saved values or delete them if previously absent; retain all unmodified current names. Only an exit matching the active top trace span may pop the stack; out-of-order exits are ignored until their span becomes current. A reset token is single-use and context-bound: report used before wrong-context, otherwise permit reset. Restore the nearest remaining receiver frame, scanning nested frames from inner to outer while skipping completed invocation identities. Inputs are finite state snapshots, including transitional and stale states; output fields are the exact independent actions/metadata defined by the corrected expression table. Numeric fixture capacities and counts vary with N. Field definitions, each independently computed from the input snapshot: receiver = next((receiver for ident,receiver in reversed(s['receiver_frames']) if ident not in s['finished_frames']),None); bound_none = s['bound']; locals = dict(s['inherited'],**s['local']); null_shadow = s['local']['x'] if 'x' in s['local'] else s['inherited'].get('x'); restore = s['saved'] if s['exited'] else s['current']; trace = s['spans'][:-1] if s['spans'] and s['spans'][-1]==s['exiting_span'] else list(s['spans']); sender = [x for i,x in enumerate(s['sender_route']) if i==0 or x!=s['sender_route'][i-1]]; invoke = not s['disposed'] and not s['exited']; restore_disposed = 'used' if s['reset_token'] in s['used_tokens'] else ('wrong-context' if s['token_context']!=s['active_context'] else 'reset'); unwind_trace = {k:(s['saved_values'][k] if k in s['modified_names'] else s['current_values'][k]) for k in dict.fromkeys(list(s['current_values'])+list(s['saved_values'])) if (k in s['modified_names'] and k in s['saved_values']) or (k not in s['modified_names'] and k in s['current_values'])}

Why this case matters

Observer implementations need to preserve this state while subscriptions enter, execute, and leave their lifecycle.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(s):
    return {
        'receiver': next((receiver for ident,receiver in reversed(s['receiver_frames']) if ident not in s['finished_frames']),None),
        'bound_none': s['bound'],
        'locals': dict(s['inherited'],**s['local']),
        'null_shadow': s['local']['x'] if 'x' in s['local'] else s['inherited'].get('x'),
        'restore': s['saved'] if s['exited'] else s['current'],
        'trace': s['spans'][:-1] if s['spans'] and s['spans'][-1]==s['exiting_span'] else list(s['spans']),
        'sender': [x for i,x in enumerate(s['sender_route']) if i==0 or x!=s['sender_route'][i-1]],
        'invoke': not s['disposed'] and not s['exited'],
        'restore_disposed': 'reset',
        'unwind_trace': {k:(s['saved_values'][k] if k in s['modified_names'] else s['current_values'][k]) for k in dict.fromkeys(list(s['current_values'])+list(s['saved_values'])) if (k in s['modified_names'] and k in s['saved_values']) or (k not in s['modified_names'] and k in s['current_values'])},
    }
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': ['a'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 0, 'b': 2}}), ({'bound': False, 'receiver': None, 'sender': 'sender', 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 1, 'b': 2}}), ({'bound': False, 'receiver': None, 'sender': 'sender', 'local': {}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': ['a'], 'spans': [], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': 'outer-context', 'trace': [], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': None, 'path': ['root'], 'segment': 'callback', 'disposed': True, 'sender_route': [], 'current_values': {}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root'], 'sender': [], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': False, 'receiver': 'receiver', 'sender': None, 'local': {'x': None}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root', 'a'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'used', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 2: [({'bound': False, 'receiver': 'receiver', 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': 'failure', 'path': [], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {}, 'modified_names': ['a'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'b': 4}}), ({'bound': False, 'receiver': 0, 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'outer-context', 'trace': ['root', 'a'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': 'sender', 'local': {'x': None}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {}, 'modified_names': ['a'], 'spans': ['root'], 'exiting_span': 'missing', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'b': 4}}), ({'bound': True, 'receiver': None, 'sender': None, 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {'a': 0, 'c': 6}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 4}}), ({'bound': False, 'receiver': 'receiver', 'sender': None, 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 4}}), ({'bound': True, 'receiver': 0, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': True, 'error': None, 'path': [], 'segment': None, 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {'a': 0, 'c': 6}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 3: [({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': None, 'path': ['root'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 6}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 6}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'outer-context', 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'used', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': ['a'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'inner-context', 'trace': ['root', 'a'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'used', 'unwind_trace': {}}), ({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': ['a', 'b'], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': None, 'trace': ['root'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}}), ({'bound': True, 'receiver': 0, 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 0, 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 6}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': [], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': [], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 6}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 4: [({'bound': True, 'receiver': None, 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 8}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'inner-context', 'trace': ['root'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': None, 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': [], 'sender': ['a', 'b'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 8}}), ({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'outer-context', 'trace': [], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {'x': None}, 'inherited': {}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': None}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': True, 'restore_disposed': 'used', 'unwind_trace': {'a': 1, 'b': 8}}), ({'bound': False, 'receiver': 0, 'sender': None, 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 0}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 5: [({'bound': True, 'receiver': None, 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 0}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root'], 'segment': 'callback', 'disposed': False, 'sender_route': [], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': ['root', 'a'], 'sender': [], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 1, 'b': 10}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': False, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {'x': 'local'}, 'inherited': {}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'local'}, 'null_shadow': 'local', 'restore': None, 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': True, 'receiver': 0, 'sender': 'sender', 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {}, 'modified_names': ['a'], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': ['a'], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {'b': 10}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': [], 'current_values': {}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root'], 'sender': [], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})]}
for i,(state,expected) in enumerate(fixtures[N]):
    check("transition "+str(i), solve(state), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
transition 0{'bound_none': False, 'invoke': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'receiver': 'B', 'restore': None, 'restore_disposed': 'reset', 'sender': ['a', 'b', 'a'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {'a': 0, 'b': 2}}{'bound_none': False, 'invoke': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'receiver': 'B', 'restore': None, 'restore_disposed': 'wrong-context', 'sender': ['a', 'b', 'a'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {'a': 0, 'b': 2}}Failed
transition 1{'bound_none': False, 'invoke': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'receiver': None, 'restore': 'inner-context', 'restore_disposed': 'reset', 'sender': ['a', 'b', 'a'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {'a': 1, 'b': 2}}{'bound_none': False, 'invoke': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'receiver': None, 'restore': 'inner-context', 'restore_disposed': 'reset', 'sender': ['a', 'b', 'a'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {'a': 1, 'b': 2}}Passed
transition 2{'bound_none': False, 'invoke': False, 'locals': {}, 'null_shadow': None, 'receiver': 'A', 'restore': 'outer-context', 'restore_disposed': 'reset', 'sender': ['a'], 'trace': [], 'unwind_trace': {'a': 0}}{'bound_none': False, 'invoke': False, 'locals': {}, 'null_shadow': None, 'receiver': 'A', 'restore': 'outer-context', 'restore_disposed': 'reset', 'sender': ['a'], 'trace': [], 'unwind_trace': {'a': 0}}Passed
transition 3{'bound_none': True, 'invoke': False, 'locals': {}, 'null_shadow': None, 'receiver': None, 'restore': 'inner-context', 'restore_disposed': 'reset', 'sender': [], 'trace': ['root'], 'unwind_trace': {}}{'bound_none': True, 'invoke': False, 'locals': {}, 'null_shadow': None, 'receiver': None, 'restore': 'inner-context', 'restore_disposed': 'wrong-context', 'sender': [], 'trace': ['root'], 'unwind_trace': {}}Failed
transition 4{'bound_none': False, 'invoke': False, 'locals': {'x': None}, 'null_shadow': None, 'receiver': None, 'restore': 'outer-context', 'restore_disposed': 'reset', 'sender': ['a'], 'trace': ['root', 'a'], 'unwind_trace': {}}{'bound_none': False, 'invoke': False, 'locals': {'x': None}, 'null_shadow': None, 'receiver': None, 'restore': 'outer-context', 'restore_disposed': 'reset', 'sender': ['a'], 'trace': ['root', 'a'], 'unwind_trace': {}}Passed
transition 5{'bound_none': False, 'invoke': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'receiver': 'B', 'restore': 'inner-context', 'restore_disposed': 'reset', 'sender': ['a'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {}}{'bound_none': False, 'invoke': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'receiver': 'B', 'restore': 'inner-context', 'restore_disposed': 'used', 'sender': ['a'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {}}Failed
transition 6{'bound_none': False, 'invoke': True, 'locals': {}, 'null_shadow': None, 'receiver': None, 'restore': None, 'restore_disposed': 'reset', 'sender': [], 'trace': [], 'unwind_trace': {}}{'bound_none': False, 'invoke': True, 'locals': {}, 'null_shadow': None, 'receiver': None, 'restore': None, 'restore_disposed': 'reset', 'sender': [], 'trace': [], 'unwind_trace': {}}Passed
transition 7{'bound_none': True, 'invoke': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'receiver': None, 'restore': 'outer-context', 'restore_disposed': 'reset', 'sender': ['a', 'b'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {'a': 0}}{'bound_none': True, 'invoke': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'receiver': None, 'restore': 'outer-context', 'restore_disposed': 'reset', 'sender': ['a', 'b'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {'a': 0}}Passed

SHA-256 / 9cadc17dead39affe54cddd6088d11feaf2d31aaa6c5940e82e75711333ae449

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(s):
    return {
        'receiver': next((receiver for ident,receiver in reversed(s['receiver_frames']) if ident not in s['finished_frames']),None),
        'bound_none': s['bound'],
        'locals': dict(s['inherited'],**s['local']),
        'null_shadow': s['local']['x'] if 'x' in s['local'] else s['inherited'].get('x'),
        'restore': s['saved'] if s['exited'] else s['current'],
        'trace': s['spans'][:-1] if s['spans'] and s['spans'][-1]==s['exiting_span'] else list(s['spans']),
        'sender': [x for i,x in enumerate(s['sender_route']) if i==0 or x!=s['sender_route'][i-1]],
        'invoke': not s['disposed'] and not s['exited'],
        'restore_disposed': 'used' if s['reset_token'] in s['used_tokens'] else 'reset',
        'unwind_trace': {k:(s['saved_values'][k] if k in s['modified_names'] else s['current_values'][k]) for k in dict.fromkeys(list(s['current_values'])+list(s['saved_values'])) if (k in s['modified_names'] and k in s['saved_values']) or (k not in s['modified_names'] and k in s['current_values'])},
    }
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': ['a'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 0, 'b': 2}}), ({'bound': False, 'receiver': None, 'sender': 'sender', 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 1, 'b': 2}}), ({'bound': False, 'receiver': None, 'sender': 'sender', 'local': {}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': ['a'], 'spans': [], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': 'outer-context', 'trace': [], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': None, 'path': ['root'], 'segment': 'callback', 'disposed': True, 'sender_route': [], 'current_values': {}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root'], 'sender': [], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': False, 'receiver': 'receiver', 'sender': None, 'local': {'x': None}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root', 'a'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'used', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 2: [({'bound': False, 'receiver': 'receiver', 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': 'failure', 'path': [], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {}, 'modified_names': ['a'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'b': 4}}), ({'bound': False, 'receiver': 0, 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'outer-context', 'trace': ['root', 'a'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': 'sender', 'local': {'x': None}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {}, 'modified_names': ['a'], 'spans': ['root'], 'exiting_span': 'missing', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'b': 4}}), ({'bound': True, 'receiver': None, 'sender': None, 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {'a': 0, 'c': 6}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 4}}), ({'bound': False, 'receiver': 'receiver', 'sender': None, 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 4}}), ({'bound': True, 'receiver': 0, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': True, 'error': None, 'path': [], 'segment': None, 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {'a': 0, 'c': 6}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 3: [({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': None, 'path': ['root'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 6}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 6}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'outer-context', 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'used', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': ['a'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'inner-context', 'trace': ['root', 'a'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'used', 'unwind_trace': {}}), ({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': ['a', 'b'], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': None, 'trace': ['root'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}}), ({'bound': True, 'receiver': 0, 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 0, 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 6}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': [], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': [], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 6}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 4: [({'bound': True, 'receiver': None, 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 8}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'inner-context', 'trace': ['root'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': None, 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': [], 'sender': ['a', 'b'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 8}}), ({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'outer-context', 'trace': [], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {'x': None}, 'inherited': {}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': None}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': True, 'restore_disposed': 'used', 'unwind_trace': {'a': 1, 'b': 8}}), ({'bound': False, 'receiver': 0, 'sender': None, 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 0}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 5: [({'bound': True, 'receiver': None, 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 0}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root'], 'segment': 'callback', 'disposed': False, 'sender_route': [], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': ['root', 'a'], 'sender': [], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 1, 'b': 10}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': False, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {'x': 'local'}, 'inherited': {}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'local'}, 'null_shadow': 'local', 'restore': None, 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': True, 'receiver': 0, 'sender': 'sender', 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {}, 'modified_names': ['a'], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': ['a'], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {'b': 10}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': [], 'current_values': {}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root'], 'sender': [], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})]}
for i,(state,expected) in enumerate(fixtures[N]):
    check("transition "+str(i), solve(state), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
transition 0{'bound_none': False, 'invoke': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'receiver': 'B', 'restore': None, 'restore_disposed': 'reset', 'sender': ['a', 'b', 'a'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {'a': 0, 'b': 2}}{'bound_none': False, 'invoke': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'receiver': 'B', 'restore': None, 'restore_disposed': 'wrong-context', 'sender': ['a', 'b', 'a'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {'a': 0, 'b': 2}}Failed
transition 1{'bound_none': False, 'invoke': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'receiver': None, 'restore': 'inner-context', 'restore_disposed': 'reset', 'sender': ['a', 'b', 'a'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {'a': 1, 'b': 2}}{'bound_none': False, 'invoke': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'receiver': None, 'restore': 'inner-context', 'restore_disposed': 'reset', 'sender': ['a', 'b', 'a'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {'a': 1, 'b': 2}}Passed
transition 2{'bound_none': False, 'invoke': False, 'locals': {}, 'null_shadow': None, 'receiver': 'A', 'restore': 'outer-context', 'restore_disposed': 'reset', 'sender': ['a'], 'trace': [], 'unwind_trace': {'a': 0}}{'bound_none': False, 'invoke': False, 'locals': {}, 'null_shadow': None, 'receiver': 'A', 'restore': 'outer-context', 'restore_disposed': 'reset', 'sender': ['a'], 'trace': [], 'unwind_trace': {'a': 0}}Passed
transition 3{'bound_none': True, 'invoke': False, 'locals': {}, 'null_shadow': None, 'receiver': None, 'restore': 'inner-context', 'restore_disposed': 'reset', 'sender': [], 'trace': ['root'], 'unwind_trace': {}}{'bound_none': True, 'invoke': False, 'locals': {}, 'null_shadow': None, 'receiver': None, 'restore': 'inner-context', 'restore_disposed': 'wrong-context', 'sender': [], 'trace': ['root'], 'unwind_trace': {}}Failed
transition 4{'bound_none': False, 'invoke': False, 'locals': {'x': None}, 'null_shadow': None, 'receiver': None, 'restore': 'outer-context', 'restore_disposed': 'reset', 'sender': ['a'], 'trace': ['root', 'a'], 'unwind_trace': {}}{'bound_none': False, 'invoke': False, 'locals': {'x': None}, 'null_shadow': None, 'receiver': None, 'restore': 'outer-context', 'restore_disposed': 'reset', 'sender': ['a'], 'trace': ['root', 'a'], 'unwind_trace': {}}Passed
transition 5{'bound_none': False, 'invoke': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'receiver': 'B', 'restore': 'inner-context', 'restore_disposed': 'used', 'sender': ['a'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {}}{'bound_none': False, 'invoke': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'receiver': 'B', 'restore': 'inner-context', 'restore_disposed': 'used', 'sender': ['a'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {}}Passed
transition 6{'bound_none': False, 'invoke': True, 'locals': {}, 'null_shadow': None, 'receiver': None, 'restore': None, 'restore_disposed': 'reset', 'sender': [], 'trace': [], 'unwind_trace': {}}{'bound_none': False, 'invoke': True, 'locals': {}, 'null_shadow': None, 'receiver': None, 'restore': None, 'restore_disposed': 'reset', 'sender': [], 'trace': [], 'unwind_trace': {}}Passed
transition 7{'bound_none': True, 'invoke': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'receiver': None, 'restore': 'outer-context', 'restore_disposed': 'reset', 'sender': ['a', 'b'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {'a': 0}}{'bound_none': True, 'invoke': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'receiver': None, 'restore': 'outer-context', 'restore_disposed': 'reset', 'sender': ['a', 'b'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {'a': 0}}Passed

SHA-256 / 0ae5727ed2fd83d574d70eb52fd8d07d7e4eec6c7dd9459b023cdc2d83a3b461

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(s):
    return {
        'receiver': next((receiver for ident,receiver in reversed(s['receiver_frames']) if ident not in s['finished_frames']),None),
        'bound_none': s['bound'],
        'locals': dict(s['inherited'],**s['local']),
        'null_shadow': s['local']['x'] if 'x' in s['local'] else s['inherited'].get('x'),
        'restore': s['saved'] if s['exited'] else s['current'],
        'trace': s['spans'][:-1] if s['spans'] and s['spans'][-1]==s['exiting_span'] else list(s['spans']),
        'sender': [x for i,x in enumerate(s['sender_route']) if i==0 or x!=s['sender_route'][i-1]],
        'invoke': not s['disposed'] and not s['exited'],
        'restore_disposed': 'used' if s['reset_token'] in s['used_tokens'] else ('wrong-context' if s['token_context']!=s['active_context'] else 'reset'),
        'unwind_trace': {k:(s['saved_values'][k] if k in s['modified_names'] else s['current_values'][k]) for k in dict.fromkeys(list(s['current_values'])+list(s['saved_values'])) if (k in s['modified_names'] and k in s['saved_values']) or (k not in s['modified_names'] and k in s['current_values'])},
    }
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': ['a'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 0, 'b': 2}}), ({'bound': False, 'receiver': None, 'sender': 'sender', 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 1, 'b': 2}}), ({'bound': False, 'receiver': None, 'sender': 'sender', 'local': {}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': ['a'], 'spans': [], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': 'outer-context', 'trace': [], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': None, 'path': ['root'], 'segment': 'callback', 'disposed': True, 'sender_route': [], 'current_values': {}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root'], 'sender': [], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': False, 'receiver': 'receiver', 'sender': None, 'local': {'x': None}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root', 'a'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'used', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 2: [({'bound': False, 'receiver': 'receiver', 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': 'failure', 'path': [], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {}, 'modified_names': ['a'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'b': 4}}), ({'bound': False, 'receiver': 0, 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'outer-context', 'trace': ['root', 'a'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': 'sender', 'local': {'x': None}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {}, 'modified_names': ['a'], 'spans': ['root'], 'exiting_span': 'missing', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'b': 4}}), ({'bound': True, 'receiver': None, 'sender': None, 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {'a': 0, 'c': 6}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 4}}), ({'bound': False, 'receiver': 'receiver', 'sender': None, 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 4}}), ({'bound': True, 'receiver': 0, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': True, 'error': None, 'path': [], 'segment': None, 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {'a': 0, 'c': 6}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 3: [({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': None, 'path': ['root'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 6}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 6}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'outer-context', 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'used', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': ['a'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'inner-context', 'trace': ['root', 'a'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'used', 'unwind_trace': {}}), ({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': ['a', 'b'], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': None, 'trace': ['root'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}}), ({'bound': True, 'receiver': 0, 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 0, 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 6}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': [], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': [], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 6}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 4: [({'bound': True, 'receiver': None, 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 8}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'inner-context', 'trace': ['root'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': None, 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': [], 'sender': ['a', 'b'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 8}}), ({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'outer-context', 'trace': [], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {'x': None}, 'inherited': {}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': None}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': True, 'restore_disposed': 'used', 'unwind_trace': {'a': 1, 'b': 8}}), ({'bound': False, 'receiver': 0, 'sender': None, 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 0}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 5: [({'bound': True, 'receiver': None, 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 0}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root'], 'segment': 'callback', 'disposed': False, 'sender_route': [], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': ['root', 'a'], 'sender': [], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 1, 'b': 10}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': False, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {'x': 'local'}, 'inherited': {}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'local'}, 'null_shadow': 'local', 'restore': None, 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': True, 'receiver': 0, 'sender': 'sender', 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {}, 'modified_names': ['a'], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': ['a'], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {'b': 10}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': [], 'current_values': {}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root'], 'sender': [], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})]}
for i,(state,expected) in enumerate(fixtures[N]):
    check("transition "+str(i), solve(state), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
transition 0{'bound_none': False, 'invoke': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'receiver': 'B', 'restore': None, 'restore_disposed': 'wrong-context', 'sender': ['a', 'b', 'a'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {'a': 0, 'b': 2}}{'bound_none': False, 'invoke': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'receiver': 'B', 'restore': None, 'restore_disposed': 'wrong-context', 'sender': ['a', 'b', 'a'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {'a': 0, 'b': 2}}Passed
transition 1{'bound_none': False, 'invoke': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'receiver': None, 'restore': 'inner-context', 'restore_disposed': 'reset', 'sender': ['a', 'b', 'a'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {'a': 1, 'b': 2}}{'bound_none': False, 'invoke': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'receiver': None, 'restore': 'inner-context', 'restore_disposed': 'reset', 'sender': ['a', 'b', 'a'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {'a': 1, 'b': 2}}Passed
transition 2{'bound_none': False, 'invoke': False, 'locals': {}, 'null_shadow': None, 'receiver': 'A', 'restore': 'outer-context', 'restore_disposed': 'reset', 'sender': ['a'], 'trace': [], 'unwind_trace': {'a': 0}}{'bound_none': False, 'invoke': False, 'locals': {}, 'null_shadow': None, 'receiver': 'A', 'restore': 'outer-context', 'restore_disposed': 'reset', 'sender': ['a'], 'trace': [], 'unwind_trace': {'a': 0}}Passed
transition 3{'bound_none': True, 'invoke': False, 'locals': {}, 'null_shadow': None, 'receiver': None, 'restore': 'inner-context', 'restore_disposed': 'wrong-context', 'sender': [], 'trace': ['root'], 'unwind_trace': {}}{'bound_none': True, 'invoke': False, 'locals': {}, 'null_shadow': None, 'receiver': None, 'restore': 'inner-context', 'restore_disposed': 'wrong-context', 'sender': [], 'trace': ['root'], 'unwind_trace': {}}Passed
transition 4{'bound_none': False, 'invoke': False, 'locals': {'x': None}, 'null_shadow': None, 'receiver': None, 'restore': 'outer-context', 'restore_disposed': 'reset', 'sender': ['a'], 'trace': ['root', 'a'], 'unwind_trace': {}}{'bound_none': False, 'invoke': False, 'locals': {'x': None}, 'null_shadow': None, 'receiver': None, 'restore': 'outer-context', 'restore_disposed': 'reset', 'sender': ['a'], 'trace': ['root', 'a'], 'unwind_trace': {}}Passed
transition 5{'bound_none': False, 'invoke': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'receiver': 'B', 'restore': 'inner-context', 'restore_disposed': 'used', 'sender': ['a'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {}}{'bound_none': False, 'invoke': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'receiver': 'B', 'restore': 'inner-context', 'restore_disposed': 'used', 'sender': ['a'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {}}Passed
transition 6{'bound_none': False, 'invoke': True, 'locals': {}, 'null_shadow': None, 'receiver': None, 'restore': None, 'restore_disposed': 'reset', 'sender': [], 'trace': [], 'unwind_trace': {}}{'bound_none': False, 'invoke': True, 'locals': {}, 'null_shadow': None, 'receiver': None, 'restore': None, 'restore_disposed': 'reset', 'sender': [], 'trace': [], 'unwind_trace': {}}Passed
transition 7{'bound_none': True, 'invoke': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'receiver': None, 'restore': 'outer-context', 'restore_disposed': 'reset', 'sender': ['a', 'b'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {'a': 0}}{'bound_none': True, 'invoke': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'receiver': None, 'restore': 'outer-context', 'restore_disposed': 'reset', 'sender': ['a', 'b'], 'trace': ['root', 'a', 'b'], 'unwind_trace': {'a': 0}}Passed

SHA-256 / 57f0a439388a0643e1de1de15d45e02c254c17352189357b257d50c7bc52b0c7

Verification & scope

A deterministic, bounded, single-threaded transition planner. Returned plans model state changes; they do not implement a production event framework. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:43:55.830225+00:00.

Case digest / 58cba15eceaeda8f0e41455b1daa98c83839cfed77e8e20b7ab641b427a8f060