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

N = 1
observations = []
def solve(phase, events, seed):
    payload = list(range(seed, seed * 2 + 2))
    r = {'challenge': seed, 'roundtrip': seed+2, 'suspected': phase=='suspect', 'peer_owned': phase!='dead', 'activity': 0, 'sent_at': seed}
    frames = []
    observed = []
    table = {('quiet', 'probe_due'): ('awaiting', 'send_challenge'), ('awaiting', 'matching_response'): ('healthy', 'record_roundtrip'), ('awaiting', 'wrong_response'): ('awaiting', 'ignore_unmatched'), ('awaiting', 'deadline'): ('dead', 'release_peer'), ('suspect', 'operator_confirm_dead'): ('dead', 'release_peer'), ('suspect', 'matching_response'): ('healthy', 'clear_suspicion'), ('healthy', 'probe_due'): ('awaiting', 'send_challenge'), ('dead', 'matching_response'): ('dead', 'reject_old_session'), ('quiet', 'unsolicited_response'): ('quiet', 'ignore_unmatched'), ('healthy', 'traffic_received'): ('healthy', 'record_activity')}
    for event in events:
        phase, action = table.get((phase, event), (phase, "reject"))
        if action == 'send_challenge':
            frames.append(['CHALLENGE',r['challenge']]); r['sent_at']=seed
        elif action == 'record_roundtrip':
            r['roundtrip']=len(payload)
        elif action == 'ignore_unmatched':
            frames.append(['UNMATCHED',seed+1])
        elif action == 'report_suspect':
            r['suspected']=True; frames.append(['SUSPECT',seed])
        elif action == 'release_peer':
            r['peer_owned']=False
        elif action == 'clear_suspicion':
            r['suspected']=False; r['roundtrip']=len(payload)
        elif action == 'reject_old_session':
            frames.append(['OLD_SESSION',seed])
        elif action == 'record_activity':
            r['activity']+=len(payload)
        elif action == 'report_alive':
            frames.append(['ALIVE',seed])
        elif action == 'send_data':
            frames.append(['DATA',payload])
        elif action == 'record_send_time':
            r['roundtrip']=r['sent_at']
        elif action == 'cancel_probe':
            r['challenge']=None
        elif action == 'keep_suspicion':
            r['suspected']=True; r['roundtrip']=len(payload)
        elif action == 'retain_peer':
            r['peer_owned']=True
        elif action == 'reuse_result':
            frames.append(['ALIVE',seed])
        elif action == 'restart_session':
            r['peer_owned']=True; r['challenge']=seed+1
        elif action == 'start_deadline':
            r['challenge']=seed+1
        elif action == 'erase_roundtrip':
            r['activity']+=len(payload); r['roundtrip']=None
        else:
            if action not in ("wait", "ignore", "keep", "retain", "keep_peer", "keep_offer", "keep_hold", "keep_batch", "retain_staging", "keep_staging", "keep_local_owner", "keep_old_session", "keep_address", "keep_old_expiry", "ignore_conflict", "keep_service", "keep_subscription", "retain_shadow", "keep_live", "keep_suspicion", "keep_roles", "keep_staged"):
                frames.append([action, payload[:]])
        observed.append(json.loads(json.dumps({"phase": phase, "registers": r, "frames": frames})))
    return observed
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('quiet/probe_due', 'quiet', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['CHALLENGE', 1]]}]), ('awaiting/matching_response', 'awaiting', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': []}]), ('awaiting/wrong_response', 'awaiting', ['wrong_response'], [{'phase': 'awaiting', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['UNMATCHED', 2]]}]), ('awaiting/deadline', 'awaiting', ['deadline'], [{'phase': 'suspect', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['SUSPECT', 1]]}]), ('suspect/operator_confirm_dead', 'suspect', ['operator_confirm_dead'], [{'phase': 'dead', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 1}, 'frames': []}]), ('suspect/matching_response', 'suspect', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': []}]), ('healthy/probe_due', 'healthy', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['CHALLENGE', 1]]}]), ('dead/matching_response', 'dead', ['matching_response'], [{'phase': 'dead', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': False, 'activity': 0, 'sent_at': 1}, 'frames': [['OLD_SESSION', 1]]}]), ('quiet/unsolicited_response', 'quiet', ['unsolicited_response'], [{'phase': 'quiet', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['UNMATCHED', 2]]}]), ('healthy/traffic_received', 'healthy', ['traffic_received'], [{'phase': 'healthy', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 3, 'sent_at': 1}, 'frames': []}]), ('ordered trace 0', 'quiet', ['probe_due', 'wrong_response', 'deadline', 'matching_response'], [{'phase': 'awaiting', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['CHALLENGE', 1]]}, {'phase': 'awaiting', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['CHALLENGE', 1], ['UNMATCHED', 2]]}, {'phase': 'suspect', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['CHALLENGE', 1], ['UNMATCHED', 2], ['SUSPECT', 1]]}, {'phase': 'healthy', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['CHALLENGE', 1], ['UNMATCHED', 2], ['SUSPECT', 1]]}]), ('ordered trace 3', 'awaiting', ['matching_response', 'probe_due', 'deadline', 'operator_confirm_dead'], [{'phase': 'healthy', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': []}, {'phase': 'awaiting', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['CHALLENGE', 1]]}, {'phase': 'suspect', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['CHALLENGE', 1], ['SUSPECT', 1]]}, {'phase': 'dead', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 1}, 'frames': [['CHALLENGE', 1], ['SUSPECT', 1]]}]), ('empty input', 'quiet', [], []), ('unknown event', 'quiet', ['unsupported'], [{'phase': 'quiet', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['reject', [1, 2, 3]]]}])], 2: [('quiet/probe_due', 'quiet', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2]]}]), ('awaiting/matching_response', 'awaiting', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': []}]), ('awaiting/wrong_response', 'awaiting', ['wrong_response'], [{'phase': 'awaiting', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['UNMATCHED', 3]]}]), ('awaiting/deadline', 'awaiting', ['deadline'], [{'phase': 'suspect', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['SUSPECT', 2]]}]), ('suspect/operator_confirm_dead', 'suspect', ['operator_confirm_dead'], [{'phase': 'dead', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 2}, 'frames': []}]), ('suspect/matching_response', 'suspect', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': []}]), ('healthy/probe_due', 'healthy', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2]]}]), ('dead/matching_response', 'dead', ['matching_response'], [{'phase': 'dead', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': False, 'activity': 0, 'sent_at': 2}, 'frames': [['OLD_SESSION', 2]]}]), ('quiet/unsolicited_response', 'quiet', ['unsolicited_response'], [{'phase': 'quiet', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['UNMATCHED', 3]]}]), ('healthy/traffic_received', 'healthy', ['traffic_received'], [{'phase': 'healthy', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 4, 'sent_at': 2}, 'frames': []}]), ('ordered trace 0', 'quiet', ['probe_due', 'wrong_response', 'deadline', 'matching_response', 'probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2]]}, {'phase': 'awaiting', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2], ['UNMATCHED', 3]]}, {'phase': 'suspect', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2], ['UNMATCHED', 3], ['SUSPECT', 2]]}, {'phase': 'healthy', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2], ['UNMATCHED', 3], ['SUSPECT', 2]]}, {'phase': 'awaiting', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2], ['UNMATCHED', 3], ['SUSPECT', 2], ['CHALLENGE', 2]]}]), ('ordered trace 3', 'awaiting', ['matching_response', 'probe_due', 'deadline', 'operator_confirm_dead', 'matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': []}, {'phase': 'awaiting', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2]]}, {'phase': 'suspect', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2], ['SUSPECT', 2]]}, {'phase': 'dead', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2], ['SUSPECT', 2]]}, {'phase': 'dead', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2], ['SUSPECT', 2], ['OLD_SESSION', 2]]}]), ('empty input', 'quiet', [], []), ('unknown event', 'quiet', ['unsupported'], [{'phase': 'quiet', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['reject', [2, 3, 4, 5]]]}])], 3: [('quiet/probe_due', 'quiet', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3]]}]), ('awaiting/matching_response', 'awaiting', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': []}]), ('awaiting/wrong_response', 'awaiting', ['wrong_response'], [{'phase': 'awaiting', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['UNMATCHED', 4]]}]), ('awaiting/deadline', 'awaiting', ['deadline'], [{'phase': 'suspect', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['SUSPECT', 3]]}]), ('suspect/operator_confirm_dead', 'suspect', ['operator_confirm_dead'], [{'phase': 'dead', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 3}, 'frames': []}]), ('suspect/matching_response', 'suspect', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': []}]), ('healthy/probe_due', 'healthy', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3]]}]), ('dead/matching_response', 'dead', ['matching_response'], [{'phase': 'dead', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': False, 'activity': 0, 'sent_at': 3}, 'frames': [['OLD_SESSION', 3]]}]), ('quiet/unsolicited_response', 'quiet', ['unsolicited_response'], [{'phase': 'quiet', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['UNMATCHED', 4]]}]), ('healthy/traffic_received', 'healthy', ['traffic_received'], [{'phase': 'healthy', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 5, 'sent_at': 3}, 'frames': []}]), ('ordered trace 0', 'quiet', ['probe_due', 'wrong_response', 'deadline', 'matching_response', 'probe_due', 'deadline'], [{'phase': 'awaiting', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3]]}, {'phase': 'awaiting', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3], ['UNMATCHED', 4]]}, {'phase': 'suspect', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3], ['UNMATCHED', 4], ['SUSPECT', 3]]}, {'phase': 'healthy', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3], ['UNMATCHED', 4], ['SUSPECT', 3]]}, {'phase': 'awaiting', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3], ['UNMATCHED', 4], ['SUSPECT', 3], ['CHALLENGE', 3]]}, {'phase': 'suspect', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3], ['UNMATCHED', 4], ['SUSPECT', 3], ['CHALLENGE', 3], ['SUSPECT', 3]]}]), ('ordered trace 3', 'awaiting', ['matching_response', 'probe_due', 'deadline', 'operator_confirm_dead', 'matching_response', 'matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': []}, {'phase': 'awaiting', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3]]}, {'phase': 'suspect', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3], ['SUSPECT', 3]]}, {'phase': 'dead', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3], ['SUSPECT', 3]]}, {'phase': 'dead', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3], ['SUSPECT', 3], ['OLD_SESSION', 3]]}, {'phase': 'dead', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3], ['SUSPECT', 3], ['OLD_SESSION', 3], ['OLD_SESSION', 3]]}]), ('empty input', 'quiet', [], []), ('unknown event', 'quiet', ['unsupported'], [{'phase': 'quiet', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['reject', [3, 4, 5, 6, 7]]]}])], 4: [('quiet/probe_due', 'quiet', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4]]}]), ('awaiting/matching_response', 'awaiting', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': []}]), ('awaiting/wrong_response', 'awaiting', ['wrong_response'], [{'phase': 'awaiting', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['UNMATCHED', 5]]}]), ('awaiting/deadline', 'awaiting', ['deadline'], [{'phase': 'suspect', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['SUSPECT', 4]]}]), ('suspect/operator_confirm_dead', 'suspect', ['operator_confirm_dead'], [{'phase': 'dead', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 4}, 'frames': []}]), ('suspect/matching_response', 'suspect', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': []}]), ('healthy/probe_due', 'healthy', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4]]}]), ('dead/matching_response', 'dead', ['matching_response'], [{'phase': 'dead', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': False, 'activity': 0, 'sent_at': 4}, 'frames': [['OLD_SESSION', 4]]}]), ('quiet/unsolicited_response', 'quiet', ['unsolicited_response'], [{'phase': 'quiet', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['UNMATCHED', 5]]}]), ('healthy/traffic_received', 'healthy', ['traffic_received'], [{'phase': 'healthy', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 6, 'sent_at': 4}, 'frames': []}]), ('ordered trace 0', 'quiet', ['probe_due', 'wrong_response', 'deadline', 'matching_response', 'probe_due', 'deadline', 'operator_confirm_dead'], [{'phase': 'awaiting', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4]]}, {'phase': 'awaiting', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['UNMATCHED', 5]]}, {'phase': 'suspect', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['UNMATCHED', 5], ['SUSPECT', 4]]}, {'phase': 'healthy', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['UNMATCHED', 5], ['SUSPECT', 4]]}, {'phase': 'awaiting', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['UNMATCHED', 5], ['SUSPECT', 4], ['CHALLENGE', 4]]}, {'phase': 'suspect', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['UNMATCHED', 5], ['SUSPECT', 4], ['CHALLENGE', 4], ['SUSPECT', 4]]}, {'phase': 'dead', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['UNMATCHED', 5], ['SUSPECT', 4], ['CHALLENGE', 4], ['SUSPECT', 4]]}]), ('ordered trace 3', 'awaiting', ['matching_response', 'probe_due', 'deadline', 'operator_confirm_dead', 'matching_response', 'matching_response', 'matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': []}, {'phase': 'awaiting', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4]]}, {'phase': 'suspect', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['SUSPECT', 4]]}, {'phase': 'dead', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['SUSPECT', 4]]}, {'phase': 'dead', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['SUSPECT', 4], ['OLD_SESSION', 4]]}, {'phase': 'dead', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['SUSPECT', 4], ['OLD_SESSION', 4], ['OLD_SESSION', 4]]}, {'phase': 'dead', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['SUSPECT', 4], ['OLD_SESSION', 4], ['OLD_SESSION', 4], ['OLD_SESSION', 4]]}]), ('empty input', 'quiet', [], []), ('unknown event', 'quiet', ['unsupported'], [{'phase': 'quiet', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['reject', [4, 5, 6, 7, 8, 9]]]}])], 5: [('quiet/probe_due', 'quiet', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5]]}]), ('awaiting/matching_response', 'awaiting', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': []}]), ('awaiting/wrong_response', 'awaiting', ['wrong_response'], [{'phase': 'awaiting', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['UNMATCHED', 6]]}]), ('awaiting/deadline', 'awaiting', ['deadline'], [{'phase': 'suspect', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['SUSPECT', 5]]}]), ('suspect/operator_confirm_dead', 'suspect', ['operator_confirm_dead'], [{'phase': 'dead', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 5}, 'frames': []}]), ('suspect/matching_response', 'suspect', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': []}]), ('healthy/probe_due', 'healthy', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5]]}]), ('dead/matching_response', 'dead', ['matching_response'], [{'phase': 'dead', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': False, 'activity': 0, 'sent_at': 5}, 'frames': [['OLD_SESSION', 5]]}]), ('quiet/unsolicited_response', 'quiet', ['unsolicited_response'], [{'phase': 'quiet', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['UNMATCHED', 6]]}]), ('healthy/traffic_received', 'healthy', ['traffic_received'], [{'phase': 'healthy', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 7, 'sent_at': 5}, 'frames': []}]), ('ordered trace 0', 'quiet', ['probe_due', 'wrong_response', 'deadline', 'matching_response', 'probe_due', 'deadline', 'operator_confirm_dead', 'matching_response'], [{'phase': 'awaiting', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5]]}, {'phase': 'awaiting', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['UNMATCHED', 6]]}, {'phase': 'suspect', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['UNMATCHED', 6], ['SUSPECT', 5]]}, {'phase': 'healthy', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['UNMATCHED', 6], ['SUSPECT', 5]]}, {'phase': 'awaiting', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['UNMATCHED', 6], ['SUSPECT', 5], ['CHALLENGE', 5]]}, {'phase': 'suspect', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['UNMATCHED', 6], ['SUSPECT', 5], ['CHALLENGE', 5], ['SUSPECT', 5]]}, {'phase': 'dead', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['UNMATCHED', 6], ['SUSPECT', 5], ['CHALLENGE', 5], ['SUSPECT', 5]]}, {'phase': 'dead', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['UNMATCHED', 6], ['SUSPECT', 5], ['CHALLENGE', 5], ['SUSPECT', 5], ['OLD_SESSION', 5]]}]), ('ordered trace 3', 'awaiting', ['matching_response', 'probe_due', 'deadline', 'operator_confirm_dead', 'matching_response', 'matching_response', 'matching_response', 'matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': []}, {'phase': 'awaiting', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5]]}, {'phase': 'suspect', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['SUSPECT', 5]]}, {'phase': 'dead', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['SUSPECT', 5]]}, {'phase': 'dead', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['SUSPECT', 5], ['OLD_SESSION', 5]]}, {'phase': 'dead', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['SUSPECT', 5], ['OLD_SESSION', 5], ['OLD_SESSION', 5]]}, {'phase': 'dead', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['SUSPECT', 5], ['OLD_SESSION', 5], ['OLD_SESSION', 5], ['OLD_SESSION', 5]]}, {'phase': 'dead', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['SUSPECT', 5], ['OLD_SESSION', 5], ['OLD_SESSION', 5], ['OLD_SESSION', 5], ['OLD_SESSION', 5]]}]), ('empty input', 'quiet', [], []), ('unknown event', 'quiet', ['unsupported'], [{'phase': 'quiet', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['reject', [5, 6, 7, 8, 9, 10, 11]]]}])]}
for label, phase, events, expected in cases[N]:
    check(label, solve(phase, events, N), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(phase, events, seed):
    payload = list(range(seed, seed * 2 + 2))
    r = {'challenge': seed, 'roundtrip': seed+2, 'suspected': phase=='suspect', 'peer_owned': phase!='dead', 'activity': 0, 'sent_at': seed}
    frames = []
    observed = []
    table = {('quiet', 'probe_due'): ('awaiting', 'send_challenge'), ('awaiting', 'matching_response'): ('healthy', 'record_roundtrip'), ('awaiting', 'wrong_response'): ('awaiting', 'ignore_unmatched'), ('awaiting', 'deadline'): ('healthy', 'record_roundtrip'), ('suspect', 'operator_confirm_dead'): ('dead', 'release_peer'), ('suspect', 'matching_response'): ('healthy', 'clear_suspicion'), ('healthy', 'probe_due'): ('awaiting', 'send_challenge'), ('dead', 'matching_response'): ('dead', 'reject_old_session'), ('quiet', 'unsolicited_response'): ('quiet', 'ignore_unmatched'), ('healthy', 'traffic_received'): ('healthy', 'record_activity')}
    for event in events:
        phase, action = table.get((phase, event), (phase, "reject"))
        if action == 'send_challenge':
            frames.append(['CHALLENGE',r['challenge']]); r['sent_at']=seed
        elif action == 'record_roundtrip':
            r['roundtrip']=len(payload)
        elif action == 'ignore_unmatched':
            frames.append(['UNMATCHED',seed+1])
        elif action == 'report_suspect':
            r['suspected']=True; frames.append(['SUSPECT',seed])
        elif action == 'release_peer':
            r['peer_owned']=False
        elif action == 'clear_suspicion':
            r['suspected']=False; r['roundtrip']=len(payload)
        elif action == 'reject_old_session':
            frames.append(['OLD_SESSION',seed])
        elif action == 'record_activity':
            r['activity']+=len(payload)
        elif action == 'report_alive':
            frames.append(['ALIVE',seed])
        elif action == 'send_data':
            frames.append(['DATA',payload])
        elif action == 'record_send_time':
            r['roundtrip']=r['sent_at']
        elif action == 'cancel_probe':
            r['challenge']=None
        elif action == 'keep_suspicion':
            r['suspected']=True; r['roundtrip']=len(payload)
        elif action == 'retain_peer':
            r['peer_owned']=True
        elif action == 'reuse_result':
            frames.append(['ALIVE',seed])
        elif action == 'restart_session':
            r['peer_owned']=True; r['challenge']=seed+1
        elif action == 'start_deadline':
            r['challenge']=seed+1
        elif action == 'erase_roundtrip':
            r['activity']+=len(payload); r['roundtrip']=None
        else:
            if action not in ("wait", "ignore", "keep", "retain", "keep_peer", "keep_offer", "keep_hold", "keep_batch", "retain_staging", "keep_staging", "keep_local_owner", "keep_old_session", "keep_address", "keep_old_expiry", "ignore_conflict", "keep_service", "keep_subscription", "retain_shadow", "keep_live", "keep_suspicion", "keep_roles", "keep_staged"):
                frames.append([action, payload[:]])
        observed.append(json.loads(json.dumps({"phase": phase, "registers": r, "frames": frames})))
    return observed
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('quiet/probe_due', 'quiet', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['CHALLENGE', 1]]}]), ('awaiting/matching_response', 'awaiting', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': []}]), ('awaiting/wrong_response', 'awaiting', ['wrong_response'], [{'phase': 'awaiting', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['UNMATCHED', 2]]}]), ('awaiting/deadline', 'awaiting', ['deadline'], [{'phase': 'suspect', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['SUSPECT', 1]]}]), ('suspect/operator_confirm_dead', 'suspect', ['operator_confirm_dead'], [{'phase': 'dead', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 1}, 'frames': []}]), ('suspect/matching_response', 'suspect', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': []}]), ('healthy/probe_due', 'healthy', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['CHALLENGE', 1]]}]), ('dead/matching_response', 'dead', ['matching_response'], [{'phase': 'dead', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': False, 'activity': 0, 'sent_at': 1}, 'frames': [['OLD_SESSION', 1]]}]), ('quiet/unsolicited_response', 'quiet', ['unsolicited_response'], [{'phase': 'quiet', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['UNMATCHED', 2]]}]), ('healthy/traffic_received', 'healthy', ['traffic_received'], [{'phase': 'healthy', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 3, 'sent_at': 1}, 'frames': []}]), ('ordered trace 0', 'quiet', ['probe_due', 'wrong_response', 'deadline', 'matching_response'], [{'phase': 'awaiting', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['CHALLENGE', 1]]}, {'phase': 'awaiting', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['CHALLENGE', 1], ['UNMATCHED', 2]]}, {'phase': 'suspect', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['CHALLENGE', 1], ['UNMATCHED', 2], ['SUSPECT', 1]]}, {'phase': 'healthy', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['CHALLENGE', 1], ['UNMATCHED', 2], ['SUSPECT', 1]]}]), ('ordered trace 3', 'awaiting', ['matching_response', 'probe_due', 'deadline', 'operator_confirm_dead'], [{'phase': 'healthy', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': []}, {'phase': 'awaiting', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['CHALLENGE', 1]]}, {'phase': 'suspect', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['CHALLENGE', 1], ['SUSPECT', 1]]}, {'phase': 'dead', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 1}, 'frames': [['CHALLENGE', 1], ['SUSPECT', 1]]}]), ('empty input', 'quiet', [], []), ('unknown event', 'quiet', ['unsupported'], [{'phase': 'quiet', 'registers': {'challenge': 1, 'roundtrip': 3, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 1}, 'frames': [['reject', [1, 2, 3]]]}])], 2: [('quiet/probe_due', 'quiet', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2]]}]), ('awaiting/matching_response', 'awaiting', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': []}]), ('awaiting/wrong_response', 'awaiting', ['wrong_response'], [{'phase': 'awaiting', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['UNMATCHED', 3]]}]), ('awaiting/deadline', 'awaiting', ['deadline'], [{'phase': 'suspect', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['SUSPECT', 2]]}]), ('suspect/operator_confirm_dead', 'suspect', ['operator_confirm_dead'], [{'phase': 'dead', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 2}, 'frames': []}]), ('suspect/matching_response', 'suspect', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': []}]), ('healthy/probe_due', 'healthy', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2]]}]), ('dead/matching_response', 'dead', ['matching_response'], [{'phase': 'dead', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': False, 'activity': 0, 'sent_at': 2}, 'frames': [['OLD_SESSION', 2]]}]), ('quiet/unsolicited_response', 'quiet', ['unsolicited_response'], [{'phase': 'quiet', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['UNMATCHED', 3]]}]), ('healthy/traffic_received', 'healthy', ['traffic_received'], [{'phase': 'healthy', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 4, 'sent_at': 2}, 'frames': []}]), ('ordered trace 0', 'quiet', ['probe_due', 'wrong_response', 'deadline', 'matching_response', 'probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2]]}, {'phase': 'awaiting', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2], ['UNMATCHED', 3]]}, {'phase': 'suspect', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2], ['UNMATCHED', 3], ['SUSPECT', 2]]}, {'phase': 'healthy', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2], ['UNMATCHED', 3], ['SUSPECT', 2]]}, {'phase': 'awaiting', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2], ['UNMATCHED', 3], ['SUSPECT', 2], ['CHALLENGE', 2]]}]), ('ordered trace 3', 'awaiting', ['matching_response', 'probe_due', 'deadline', 'operator_confirm_dead', 'matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': []}, {'phase': 'awaiting', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2]]}, {'phase': 'suspect', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2], ['SUSPECT', 2]]}, {'phase': 'dead', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2], ['SUSPECT', 2]]}, {'phase': 'dead', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 2}, 'frames': [['CHALLENGE', 2], ['SUSPECT', 2], ['OLD_SESSION', 2]]}]), ('empty input', 'quiet', [], []), ('unknown event', 'quiet', ['unsupported'], [{'phase': 'quiet', 'registers': {'challenge': 2, 'roundtrip': 4, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 2}, 'frames': [['reject', [2, 3, 4, 5]]]}])], 3: [('quiet/probe_due', 'quiet', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3]]}]), ('awaiting/matching_response', 'awaiting', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': []}]), ('awaiting/wrong_response', 'awaiting', ['wrong_response'], [{'phase': 'awaiting', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['UNMATCHED', 4]]}]), ('awaiting/deadline', 'awaiting', ['deadline'], [{'phase': 'suspect', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['SUSPECT', 3]]}]), ('suspect/operator_confirm_dead', 'suspect', ['operator_confirm_dead'], [{'phase': 'dead', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 3}, 'frames': []}]), ('suspect/matching_response', 'suspect', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': []}]), ('healthy/probe_due', 'healthy', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3]]}]), ('dead/matching_response', 'dead', ['matching_response'], [{'phase': 'dead', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': False, 'activity': 0, 'sent_at': 3}, 'frames': [['OLD_SESSION', 3]]}]), ('quiet/unsolicited_response', 'quiet', ['unsolicited_response'], [{'phase': 'quiet', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['UNMATCHED', 4]]}]), ('healthy/traffic_received', 'healthy', ['traffic_received'], [{'phase': 'healthy', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 5, 'sent_at': 3}, 'frames': []}]), ('ordered trace 0', 'quiet', ['probe_due', 'wrong_response', 'deadline', 'matching_response', 'probe_due', 'deadline'], [{'phase': 'awaiting', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3]]}, {'phase': 'awaiting', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3], ['UNMATCHED', 4]]}, {'phase': 'suspect', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3], ['UNMATCHED', 4], ['SUSPECT', 3]]}, {'phase': 'healthy', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3], ['UNMATCHED', 4], ['SUSPECT', 3]]}, {'phase': 'awaiting', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3], ['UNMATCHED', 4], ['SUSPECT', 3], ['CHALLENGE', 3]]}, {'phase': 'suspect', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3], ['UNMATCHED', 4], ['SUSPECT', 3], ['CHALLENGE', 3], ['SUSPECT', 3]]}]), ('ordered trace 3', 'awaiting', ['matching_response', 'probe_due', 'deadline', 'operator_confirm_dead', 'matching_response', 'matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': []}, {'phase': 'awaiting', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3]]}, {'phase': 'suspect', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3], ['SUSPECT', 3]]}, {'phase': 'dead', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3], ['SUSPECT', 3]]}, {'phase': 'dead', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3], ['SUSPECT', 3], ['OLD_SESSION', 3]]}, {'phase': 'dead', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 3}, 'frames': [['CHALLENGE', 3], ['SUSPECT', 3], ['OLD_SESSION', 3], ['OLD_SESSION', 3]]}]), ('empty input', 'quiet', [], []), ('unknown event', 'quiet', ['unsupported'], [{'phase': 'quiet', 'registers': {'challenge': 3, 'roundtrip': 5, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 3}, 'frames': [['reject', [3, 4, 5, 6, 7]]]}])], 4: [('quiet/probe_due', 'quiet', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4]]}]), ('awaiting/matching_response', 'awaiting', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': []}]), ('awaiting/wrong_response', 'awaiting', ['wrong_response'], [{'phase': 'awaiting', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['UNMATCHED', 5]]}]), ('awaiting/deadline', 'awaiting', ['deadline'], [{'phase': 'suspect', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['SUSPECT', 4]]}]), ('suspect/operator_confirm_dead', 'suspect', ['operator_confirm_dead'], [{'phase': 'dead', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 4}, 'frames': []}]), ('suspect/matching_response', 'suspect', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': []}]), ('healthy/probe_due', 'healthy', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4]]}]), ('dead/matching_response', 'dead', ['matching_response'], [{'phase': 'dead', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': False, 'activity': 0, 'sent_at': 4}, 'frames': [['OLD_SESSION', 4]]}]), ('quiet/unsolicited_response', 'quiet', ['unsolicited_response'], [{'phase': 'quiet', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['UNMATCHED', 5]]}]), ('healthy/traffic_received', 'healthy', ['traffic_received'], [{'phase': 'healthy', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 6, 'sent_at': 4}, 'frames': []}]), ('ordered trace 0', 'quiet', ['probe_due', 'wrong_response', 'deadline', 'matching_response', 'probe_due', 'deadline', 'operator_confirm_dead'], [{'phase': 'awaiting', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4]]}, {'phase': 'awaiting', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['UNMATCHED', 5]]}, {'phase': 'suspect', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['UNMATCHED', 5], ['SUSPECT', 4]]}, {'phase': 'healthy', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['UNMATCHED', 5], ['SUSPECT', 4]]}, {'phase': 'awaiting', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['UNMATCHED', 5], ['SUSPECT', 4], ['CHALLENGE', 4]]}, {'phase': 'suspect', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['UNMATCHED', 5], ['SUSPECT', 4], ['CHALLENGE', 4], ['SUSPECT', 4]]}, {'phase': 'dead', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['UNMATCHED', 5], ['SUSPECT', 4], ['CHALLENGE', 4], ['SUSPECT', 4]]}]), ('ordered trace 3', 'awaiting', ['matching_response', 'probe_due', 'deadline', 'operator_confirm_dead', 'matching_response', 'matching_response', 'matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': []}, {'phase': 'awaiting', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4]]}, {'phase': 'suspect', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['SUSPECT', 4]]}, {'phase': 'dead', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['SUSPECT', 4]]}, {'phase': 'dead', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['SUSPECT', 4], ['OLD_SESSION', 4]]}, {'phase': 'dead', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['SUSPECT', 4], ['OLD_SESSION', 4], ['OLD_SESSION', 4]]}, {'phase': 'dead', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 4}, 'frames': [['CHALLENGE', 4], ['SUSPECT', 4], ['OLD_SESSION', 4], ['OLD_SESSION', 4], ['OLD_SESSION', 4]]}]), ('empty input', 'quiet', [], []), ('unknown event', 'quiet', ['unsupported'], [{'phase': 'quiet', 'registers': {'challenge': 4, 'roundtrip': 6, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 4}, 'frames': [['reject', [4, 5, 6, 7, 8, 9]]]}])], 5: [('quiet/probe_due', 'quiet', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5]]}]), ('awaiting/matching_response', 'awaiting', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': []}]), ('awaiting/wrong_response', 'awaiting', ['wrong_response'], [{'phase': 'awaiting', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['UNMATCHED', 6]]}]), ('awaiting/deadline', 'awaiting', ['deadline'], [{'phase': 'suspect', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['SUSPECT', 5]]}]), ('suspect/operator_confirm_dead', 'suspect', ['operator_confirm_dead'], [{'phase': 'dead', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 5}, 'frames': []}]), ('suspect/matching_response', 'suspect', ['matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': []}]), ('healthy/probe_due', 'healthy', ['probe_due'], [{'phase': 'awaiting', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5]]}]), ('dead/matching_response', 'dead', ['matching_response'], [{'phase': 'dead', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': False, 'activity': 0, 'sent_at': 5}, 'frames': [['OLD_SESSION', 5]]}]), ('quiet/unsolicited_response', 'quiet', ['unsolicited_response'], [{'phase': 'quiet', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['UNMATCHED', 6]]}]), ('healthy/traffic_received', 'healthy', ['traffic_received'], [{'phase': 'healthy', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 7, 'sent_at': 5}, 'frames': []}]), ('ordered trace 0', 'quiet', ['probe_due', 'wrong_response', 'deadline', 'matching_response', 'probe_due', 'deadline', 'operator_confirm_dead', 'matching_response'], [{'phase': 'awaiting', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5]]}, {'phase': 'awaiting', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['UNMATCHED', 6]]}, {'phase': 'suspect', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['UNMATCHED', 6], ['SUSPECT', 5]]}, {'phase': 'healthy', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['UNMATCHED', 6], ['SUSPECT', 5]]}, {'phase': 'awaiting', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['UNMATCHED', 6], ['SUSPECT', 5], ['CHALLENGE', 5]]}, {'phase': 'suspect', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['UNMATCHED', 6], ['SUSPECT', 5], ['CHALLENGE', 5], ['SUSPECT', 5]]}, {'phase': 'dead', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['UNMATCHED', 6], ['SUSPECT', 5], ['CHALLENGE', 5], ['SUSPECT', 5]]}, {'phase': 'dead', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['UNMATCHED', 6], ['SUSPECT', 5], ['CHALLENGE', 5], ['SUSPECT', 5], ['OLD_SESSION', 5]]}]), ('ordered trace 3', 'awaiting', ['matching_response', 'probe_due', 'deadline', 'operator_confirm_dead', 'matching_response', 'matching_response', 'matching_response', 'matching_response'], [{'phase': 'healthy', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': []}, {'phase': 'awaiting', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5]]}, {'phase': 'suspect', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['SUSPECT', 5]]}, {'phase': 'dead', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['SUSPECT', 5]]}, {'phase': 'dead', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['SUSPECT', 5], ['OLD_SESSION', 5]]}, {'phase': 'dead', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['SUSPECT', 5], ['OLD_SESSION', 5], ['OLD_SESSION', 5]]}, {'phase': 'dead', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['SUSPECT', 5], ['OLD_SESSION', 5], ['OLD_SESSION', 5], ['OLD_SESSION', 5]]}, {'phase': 'dead', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': True, 'peer_owned': False, 'activity': 0, 'sent_at': 5}, 'frames': [['CHALLENGE', 5], ['SUSPECT', 5], ['OLD_SESSION', 5], ['OLD_SESSION', 5], ['OLD_SESSION', 5], ['OLD_SESSION', 5]]}]), ('empty input', 'quiet', [], []), ('unknown event', 'quiet', ['unsupported'], [{'phase': 'quiet', 'registers': {'challenge': 5, 'roundtrip': 7, 'suspected': False, 'peer_owned': True, 'activity': 0, 'sent_at': 5}, 'frames': [['reject', [5, 6, 7, 8, 9, 10, 11]]]}])]}
for label, phase, events, expected in cases[N]:
    check(label, solve(phase, events, N), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
While awaiting, event deadline produces dead/release_peer instead of suspect/report_suspect.

For the stipulated Application liveness challenge controller, initialize the explicitly shown resource registers from seed (1..5), then consume classified events sequentially. After each event return a deep snapshot of phase, resource registers, and cumulative emitted control frames. The explicit ten phase/event rules and their resource effects define admission and response semantics. Unlisted events preserve phase and emit rejection. Payload is the consecutive integers seed through 2*seed+1. Empty event input returns no observations.

split: open-access