FAILURE MAP
← Case archive

FA-19881 / Protocols / Open access

Application stream endpoint migration controller: home / unsolicited boundary ack · case 01

While home, event unsolicited_boundary_ack produces away/switch_target instead of home/reject_unoffered.

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

ROOT CAUSE

In home, the unsolicited boundary ack handler runs switch target and enters away; it must instead run reject unoffered and enter home.

VERIFIED REPAIR

In phase home, classify unsolicited_boundary_ack as transition to home and emit reject_unoffered.

Unsuccessful approach: The partial repair chooses switching/send_boundary, which still violates this phase-specific event contract.

Case contract

For the stipulated Application stream endpoint migration 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.

Why this case matters

Incorrect event admission now changes concrete queued data, resource ownership, or emitted protocol frames and subsequent trace behavior.

1 / The failure

Exit 1
"""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 = {'endpoint': 'target' if phase=='away' else 'home', 'home_open': phase not in ('away','suspended'), 'sequence': seed+3, 'boundary': None, 'target_checked': False, 'queue': payload[:], 'delivered': []}
    frames = []
    observed = []
    table = {('home', 'move_offer'): ('probing', 'probe_target'), ('probing', 'target_ready'): ('draining', 'freeze_home_sequence'), ('probing', 'target_rejected'): ('home', 'discard_target'), ('draining', 'home_flushed'): ('switching', 'send_boundary'), ('switching', 'boundary_ack'): ('away', 'switch_target'), ('switching', 'old_endpoint_data'): ('switching', 'accept_before_boundary'), ('away', 'old_endpoint_data'): ('away', 'reject_old_endpoint'), ('away', 'target_lost'): ('suspended', 'report_unavailable'), ('home', 'unsolicited_boundary_ack'): ('away', 'switch_target'), ('draining', 'new_application_data'): ('draining', 'queue_after_boundary')}
    for event in events:
        phase, action = table.get((phase, event), (phase, "reject"))
        if action == 'probe_target':
            r['target_checked']=True; frames.append(['PROBE_TARGET',seed])
        elif action == 'freeze_home_sequence':
            r['boundary']=r['sequence']
        elif action == 'discard_target':
            r['target_checked']=False
        elif action == 'send_boundary':
            frames.append(['BOUNDARY',r['sequence']])
        elif action == 'switch_target':
            r['endpoint']='target'; r['home_open']=False
        elif action == 'accept_before_boundary':
            r['delivered'].extend([x for x in payload if x<r['sequence']])
        elif action == 'reject_old_endpoint':
            frames.append(['OLD_ENDPOINT',seed])
        elif action == 'report_unavailable':
            frames.append(['UNAVAILABLE',seed])
        elif action == 'reject_unoffered':
            frames.append(['NO_MIGRATION',seed])
        elif action == 'queue_after_boundary':
            r['queue'].extend(payload)
        elif action == 'stop_home':
            r['home_open']=False
        elif action == 'reset_sequence':
            r['sequence']=0
        elif action == 'send_zero_boundary':
            frames.append(['BOUNDARY',0])
        elif action == 'resume_home':
            r['endpoint']='home'; r['home_open']=True
        elif action == 'send_on_both':
            frames.extend([['HOME',payload],['TARGET',payload]])
        elif action == 'drop_all':
            r['delivered']=[]
        elif action == 'accept_all':
            r['delivered'].extend(payload)
        elif action == 'deliver':
            r['delivered'].extend(payload)
        elif action == 'silent_drop':
            r['queue']=[]
        elif action == 'send_home':
            frames.append(['HOME',payload])
        elif action == 'send_target':
            frames.append(['TARGET',payload])
        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: [('home/move_offer', 'home', ['move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': True, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['PROBE_TARGET', 1]]}]), ('probing/target_ready', 'probing', ['target_ready'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': 4, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': []}]), ('probing/target_rejected', 'probing', ['target_rejected'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': []}]), ('draining/home_flushed', 'draining', ['home_flushed'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['BOUNDARY', 4]]}]), ('switching/boundary_ack', 'switching', ['boundary_ack'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': []}]), ('switching/old_endpoint_data', 'switching', ['old_endpoint_data'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': [1, 2, 3]}, 'frames': []}]), ('away/old_endpoint_data', 'away', ['old_endpoint_data'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['OLD_ENDPOINT', 1]]}]), ('away/target_lost', 'away', ['target_lost'], [{'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['UNAVAILABLE', 1]]}]), ('home/unsolicited_boundary_ack', 'home', ['unsolicited_boundary_ack'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['NO_MIGRATION', 1]]}]), ('draining/new_application_data', 'draining', ['new_application_data'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3, 1, 2, 3], 'delivered': []}, 'frames': []}]), ('ordered trace 0', 'home', ['move_offer', 'target_rejected', 'move_offer', 'target_rejected'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': True, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['PROBE_TARGET', 1]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['PROBE_TARGET', 1]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': True, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['PROBE_TARGET', 1], ['PROBE_TARGET', 1]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['PROBE_TARGET', 1], ['PROBE_TARGET', 1]]}]), ('ordered trace 3', 'draining', ['new_application_data', 'home_flushed', 'old_endpoint_data', 'boundary_ack'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3, 1, 2, 3], 'delivered': []}, 'frames': []}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3, 1, 2, 3], 'delivered': []}, 'frames': [['BOUNDARY', 4]]}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3, 1, 2, 3], 'delivered': [1, 2, 3]}, 'frames': [['BOUNDARY', 4]]}, {'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3, 1, 2, 3], 'delivered': [1, 2, 3]}, 'frames': [['BOUNDARY', 4]]}]), ('empty input', 'home', [], []), ('unknown event', 'home', ['unsupported'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['reject', [1, 2, 3]]]}])], 2: [('home/move_offer', 'home', ['move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': True, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['PROBE_TARGET', 2]]}]), ('probing/target_ready', 'probing', ['target_ready'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': 5, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': []}]), ('probing/target_rejected', 'probing', ['target_rejected'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': []}]), ('draining/home_flushed', 'draining', ['home_flushed'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['BOUNDARY', 5]]}]), ('switching/boundary_ack', 'switching', ['boundary_ack'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': []}]), ('switching/old_endpoint_data', 'switching', ['old_endpoint_data'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': [2, 3, 4]}, 'frames': []}]), ('away/old_endpoint_data', 'away', ['old_endpoint_data'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['OLD_ENDPOINT', 2]]}]), ('away/target_lost', 'away', ['target_lost'], [{'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['UNAVAILABLE', 2]]}]), ('home/unsolicited_boundary_ack', 'home', ['unsolicited_boundary_ack'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['NO_MIGRATION', 2]]}]), ('draining/new_application_data', 'draining', ['new_application_data'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5, 2, 3, 4, 5], 'delivered': []}, 'frames': []}]), ('ordered trace 0', 'home', ['move_offer', 'target_rejected', 'move_offer', 'target_rejected', 'move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': True, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['PROBE_TARGET', 2]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['PROBE_TARGET', 2]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': True, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['PROBE_TARGET', 2], ['PROBE_TARGET', 2]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['PROBE_TARGET', 2], ['PROBE_TARGET', 2]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': True, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['PROBE_TARGET', 2], ['PROBE_TARGET', 2], ['PROBE_TARGET', 2]]}]), ('ordered trace 3', 'draining', ['new_application_data', 'home_flushed', 'old_endpoint_data', 'boundary_ack', 'target_lost'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5, 2, 3, 4, 5], 'delivered': []}, 'frames': []}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5, 2, 3, 4, 5], 'delivered': []}, 'frames': [['BOUNDARY', 5]]}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5, 2, 3, 4, 5], 'delivered': [2, 3, 4]}, 'frames': [['BOUNDARY', 5]]}, {'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5, 2, 3, 4, 5], 'delivered': [2, 3, 4]}, 'frames': [['BOUNDARY', 5]]}, {'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5, 2, 3, 4, 5], 'delivered': [2, 3, 4]}, 'frames': [['BOUNDARY', 5], ['UNAVAILABLE', 2]]}]), ('empty input', 'home', [], []), ('unknown event', 'home', ['unsupported'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['reject', [2, 3, 4, 5]]]}])], 3: [('home/move_offer', 'home', ['move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': True, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3]]}]), ('probing/target_ready', 'probing', ['target_ready'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': 6, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': []}]), ('probing/target_rejected', 'probing', ['target_rejected'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': []}]), ('draining/home_flushed', 'draining', ['home_flushed'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['BOUNDARY', 6]]}]), ('switching/boundary_ack', 'switching', ['boundary_ack'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': []}]), ('switching/old_endpoint_data', 'switching', ['old_endpoint_data'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': [3, 4, 5]}, 'frames': []}]), ('away/old_endpoint_data', 'away', ['old_endpoint_data'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['OLD_ENDPOINT', 3]]}]), ('away/target_lost', 'away', ['target_lost'], [{'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['UNAVAILABLE', 3]]}]), ('home/unsolicited_boundary_ack', 'home', ['unsolicited_boundary_ack'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['NO_MIGRATION', 3]]}]), ('draining/new_application_data', 'draining', ['new_application_data'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'delivered': []}, 'frames': []}]), ('ordered trace 0', 'home', ['move_offer', 'target_rejected', 'move_offer', 'target_rejected', 'move_offer', 'target_rejected'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': True, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': True, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3], ['PROBE_TARGET', 3]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3], ['PROBE_TARGET', 3]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': True, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3], ['PROBE_TARGET', 3], ['PROBE_TARGET', 3]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3], ['PROBE_TARGET', 3], ['PROBE_TARGET', 3]]}]), ('ordered trace 3', 'draining', ['new_application_data', 'home_flushed', 'old_endpoint_data', 'boundary_ack', 'target_lost'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'delivered': []}, 'frames': []}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['BOUNDARY', 6]]}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'delivered': [3, 4, 5]}, 'frames': [['BOUNDARY', 6]]}, {'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'delivered': [3, 4, 5]}, 'frames': [['BOUNDARY', 6]]}, {'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'delivered': [3, 4, 5]}, 'frames': [['BOUNDARY', 6], ['UNAVAILABLE', 3]]}]), ('empty input', 'home', [], []), ('unknown event', 'home', ['unsupported'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['reject', [3, 4, 5, 6, 7]]]}])], 4: [('home/move_offer', 'home', ['move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': True, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4]]}]), ('probing/target_ready', 'probing', ['target_ready'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': 7, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': []}]), ('probing/target_rejected', 'probing', ['target_rejected'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': []}]), ('draining/home_flushed', 'draining', ['home_flushed'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['BOUNDARY', 7]]}]), ('switching/boundary_ack', 'switching', ['boundary_ack'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': []}]), ('switching/old_endpoint_data', 'switching', ['old_endpoint_data'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': [4, 5, 6]}, 'frames': []}]), ('away/old_endpoint_data', 'away', ['old_endpoint_data'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['OLD_ENDPOINT', 4]]}]), ('away/target_lost', 'away', ['target_lost'], [{'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['UNAVAILABLE', 4]]}]), ('home/unsolicited_boundary_ack', 'home', ['unsolicited_boundary_ack'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['NO_MIGRATION', 4]]}]), ('draining/new_application_data', 'draining', ['new_application_data'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': []}]), ('ordered trace 0', 'home', ['move_offer', 'target_rejected', 'move_offer', 'target_rejected', 'move_offer', 'target_rejected', 'move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': True, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': True, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4], ['PROBE_TARGET', 4]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4], ['PROBE_TARGET', 4]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': True, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4], ['PROBE_TARGET', 4], ['PROBE_TARGET', 4]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4], ['PROBE_TARGET', 4], ['PROBE_TARGET', 4]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': True, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4], ['PROBE_TARGET', 4], ['PROBE_TARGET', 4], ['PROBE_TARGET', 4]]}]), ('ordered trace 3', 'draining', ['new_application_data', 'home_flushed', 'old_endpoint_data', 'boundary_ack', 'target_lost'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': []}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['BOUNDARY', 7]]}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'delivered': [4, 5, 6]}, 'frames': [['BOUNDARY', 7]]}, {'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'delivered': [4, 5, 6]}, 'frames': [['BOUNDARY', 7]]}, {'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'delivered': [4, 5, 6]}, 'frames': [['BOUNDARY', 7], ['UNAVAILABLE', 4]]}]), ('empty input', 'home', [], []), ('unknown event', 'home', ['unsupported'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['reject', [4, 5, 6, 7, 8, 9]]]}])], 5: [('home/move_offer', 'home', ['move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': True, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5]]}]), ('probing/target_ready', 'probing', ['target_ready'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': 8, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': []}]), ('probing/target_rejected', 'probing', ['target_rejected'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': []}]), ('draining/home_flushed', 'draining', ['home_flushed'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['BOUNDARY', 8]]}]), ('switching/boundary_ack', 'switching', ['boundary_ack'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': []}]), ('switching/old_endpoint_data', 'switching', ['old_endpoint_data'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': [5, 6, 7]}, 'frames': []}]), ('away/old_endpoint_data', 'away', ['old_endpoint_data'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['OLD_ENDPOINT', 5]]}]), ('away/target_lost', 'away', ['target_lost'], [{'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['UNAVAILABLE', 5]]}]), ('home/unsolicited_boundary_ack', 'home', ['unsolicited_boundary_ack'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['NO_MIGRATION', 5]]}]), ('draining/new_application_data', 'draining', ['new_application_data'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': []}]), ('ordered trace 0', 'home', ['move_offer', 'target_rejected', 'move_offer', 'target_rejected', 'move_offer', 'target_rejected', 'move_offer', 'target_rejected'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': True, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': True, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5], ['PROBE_TARGET', 5]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5], ['PROBE_TARGET', 5]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': True, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5], ['PROBE_TARGET', 5], ['PROBE_TARGET', 5]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5], ['PROBE_TARGET', 5], ['PROBE_TARGET', 5]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': True, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5], ['PROBE_TARGET', 5], ['PROBE_TARGET', 5], ['PROBE_TARGET', 5]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5], ['PROBE_TARGET', 5], ['PROBE_TARGET', 5], ['PROBE_TARGET', 5]]}]), ('ordered trace 3', 'draining', ['new_application_data', 'home_flushed', 'old_endpoint_data', 'boundary_ack', 'target_lost'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': []}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['BOUNDARY', 8]]}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'delivered': [5, 6, 7]}, 'frames': [['BOUNDARY', 8]]}, {'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'delivered': [5, 6, 7]}, 'frames': [['BOUNDARY', 8]]}, {'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'delivered': [5, 6, 7]}, 'frames': [['BOUNDARY', 8], ['UNAVAILABLE', 5]]}]), ('empty input', 'home', [], []), ('unknown event', 'home', ['unsupported'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, '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)
Boundary fixtureActualExpectedOutcome
home/move_offer[{'frames': [['PROBE_TARGET', 1]], 'phase': 'probing', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': True}}][{'frames': [['PROBE_TARGET', 1]], 'phase': 'probing', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': True}}]Passed
probing/target_ready[{'frames': [], 'phase': 'draining', 'registers': {'boundary': 4, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [], 'phase': 'draining', 'registers': {'boundary': 4, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
probing/target_rejected[{'frames': [], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
draining/home_flushed[{'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
switching/boundary_ack[{'frames': [], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
switching/old_endpoint_data[{'frames': [], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [1, 2, 3], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [1, 2, 3], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
away/old_endpoint_data[{'frames': [['OLD_ENDPOINT', 1]], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [['OLD_ENDPOINT', 1]], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
away/target_lost[{'frames': [['UNAVAILABLE', 1]], 'phase': 'suspended', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [['UNAVAILABLE', 1]], 'phase': 'suspended', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
home/unsolicited_boundary_ack[{'frames': [], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [['NO_MIGRATION', 1]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Failed
draining/new_application_data[{'frames': [], 'phase': 'draining', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [], 'phase': 'draining', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
ordered trace 0[{'frames': [['PROBE_TARGET', 1]], 'phase': 'probing', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': True}}, {'frames': [['PROBE_TARGET', 1]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['PROBE_TARGET', 1], ['PROBE_TARGET', 1]], 'phase': 'probing', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': True}}, {'frames': [['PROBE_TARGET', 1], ['PROBE_TARGET', 1]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [['PROBE_TARGET', 1]], 'phase': 'probing', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': True}}, {'frames': [['PROBE_TARGET', 1]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['PROBE_TARGET', 1], ['PROBE_TARGET', 1]], 'phase': 'probing', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': True}}, {'frames': [['PROBE_TARGET', 1], ['PROBE_TARGET', 1]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
ordered trace 3[{'frames': [], 'phase': 'draining', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [1, 2, 3], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['BOUNDARY', 4]], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [1, 2, 3], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [], 'phase': 'draining', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [1, 2, 3], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['BOUNDARY', 4]], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [1, 2, 3], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
empty input[][]Passed
unknown event[{'frames': [['reject', [1, 2, 3]]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [['reject', [1, 2, 3]]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed

SHA-256 / c59a6fc3cd3bec98cb555423e66ebb0565a5e2ed25224cd43989779eb9de280b

2 / The unsuccessful fix

Exit 1
"""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 = {'endpoint': 'target' if phase=='away' else 'home', 'home_open': phase not in ('away','suspended'), 'sequence': seed+3, 'boundary': None, 'target_checked': False, 'queue': payload[:], 'delivered': []}
    frames = []
    observed = []
    table = {('home', 'move_offer'): ('probing', 'probe_target'), ('probing', 'target_ready'): ('draining', 'freeze_home_sequence'), ('probing', 'target_rejected'): ('home', 'discard_target'), ('draining', 'home_flushed'): ('switching', 'send_boundary'), ('switching', 'boundary_ack'): ('away', 'switch_target'), ('switching', 'old_endpoint_data'): ('switching', 'accept_before_boundary'), ('away', 'old_endpoint_data'): ('away', 'reject_old_endpoint'), ('away', 'target_lost'): ('suspended', 'report_unavailable'), ('home', 'unsolicited_boundary_ack'): ('switching', 'send_boundary'), ('draining', 'new_application_data'): ('draining', 'queue_after_boundary')}
    for event in events:
        phase, action = table.get((phase, event), (phase, "reject"))
        if action == 'probe_target':
            r['target_checked']=True; frames.append(['PROBE_TARGET',seed])
        elif action == 'freeze_home_sequence':
            r['boundary']=r['sequence']
        elif action == 'discard_target':
            r['target_checked']=False
        elif action == 'send_boundary':
            frames.append(['BOUNDARY',r['sequence']])
        elif action == 'switch_target':
            r['endpoint']='target'; r['home_open']=False
        elif action == 'accept_before_boundary':
            r['delivered'].extend([x for x in payload if x<r['sequence']])
        elif action == 'reject_old_endpoint':
            frames.append(['OLD_ENDPOINT',seed])
        elif action == 'report_unavailable':
            frames.append(['UNAVAILABLE',seed])
        elif action == 'reject_unoffered':
            frames.append(['NO_MIGRATION',seed])
        elif action == 'queue_after_boundary':
            r['queue'].extend(payload)
        elif action == 'stop_home':
            r['home_open']=False
        elif action == 'reset_sequence':
            r['sequence']=0
        elif action == 'send_zero_boundary':
            frames.append(['BOUNDARY',0])
        elif action == 'resume_home':
            r['endpoint']='home'; r['home_open']=True
        elif action == 'send_on_both':
            frames.extend([['HOME',payload],['TARGET',payload]])
        elif action == 'drop_all':
            r['delivered']=[]
        elif action == 'accept_all':
            r['delivered'].extend(payload)
        elif action == 'deliver':
            r['delivered'].extend(payload)
        elif action == 'silent_drop':
            r['queue']=[]
        elif action == 'send_home':
            frames.append(['HOME',payload])
        elif action == 'send_target':
            frames.append(['TARGET',payload])
        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: [('home/move_offer', 'home', ['move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': True, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['PROBE_TARGET', 1]]}]), ('probing/target_ready', 'probing', ['target_ready'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': 4, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': []}]), ('probing/target_rejected', 'probing', ['target_rejected'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': []}]), ('draining/home_flushed', 'draining', ['home_flushed'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['BOUNDARY', 4]]}]), ('switching/boundary_ack', 'switching', ['boundary_ack'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': []}]), ('switching/old_endpoint_data', 'switching', ['old_endpoint_data'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': [1, 2, 3]}, 'frames': []}]), ('away/old_endpoint_data', 'away', ['old_endpoint_data'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['OLD_ENDPOINT', 1]]}]), ('away/target_lost', 'away', ['target_lost'], [{'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['UNAVAILABLE', 1]]}]), ('home/unsolicited_boundary_ack', 'home', ['unsolicited_boundary_ack'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['NO_MIGRATION', 1]]}]), ('draining/new_application_data', 'draining', ['new_application_data'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3, 1, 2, 3], 'delivered': []}, 'frames': []}]), ('ordered trace 0', 'home', ['move_offer', 'target_rejected', 'move_offer', 'target_rejected'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': True, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['PROBE_TARGET', 1]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['PROBE_TARGET', 1]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': True, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['PROBE_TARGET', 1], ['PROBE_TARGET', 1]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['PROBE_TARGET', 1], ['PROBE_TARGET', 1]]}]), ('ordered trace 3', 'draining', ['new_application_data', 'home_flushed', 'old_endpoint_data', 'boundary_ack'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3, 1, 2, 3], 'delivered': []}, 'frames': []}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3, 1, 2, 3], 'delivered': []}, 'frames': [['BOUNDARY', 4]]}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3, 1, 2, 3], 'delivered': [1, 2, 3]}, 'frames': [['BOUNDARY', 4]]}, {'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3, 1, 2, 3], 'delivered': [1, 2, 3]}, 'frames': [['BOUNDARY', 4]]}]), ('empty input', 'home', [], []), ('unknown event', 'home', ['unsupported'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['reject', [1, 2, 3]]]}])], 2: [('home/move_offer', 'home', ['move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': True, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['PROBE_TARGET', 2]]}]), ('probing/target_ready', 'probing', ['target_ready'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': 5, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': []}]), ('probing/target_rejected', 'probing', ['target_rejected'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': []}]), ('draining/home_flushed', 'draining', ['home_flushed'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['BOUNDARY', 5]]}]), ('switching/boundary_ack', 'switching', ['boundary_ack'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': []}]), ('switching/old_endpoint_data', 'switching', ['old_endpoint_data'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': [2, 3, 4]}, 'frames': []}]), ('away/old_endpoint_data', 'away', ['old_endpoint_data'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['OLD_ENDPOINT', 2]]}]), ('away/target_lost', 'away', ['target_lost'], [{'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['UNAVAILABLE', 2]]}]), ('home/unsolicited_boundary_ack', 'home', ['unsolicited_boundary_ack'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['NO_MIGRATION', 2]]}]), ('draining/new_application_data', 'draining', ['new_application_data'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5, 2, 3, 4, 5], 'delivered': []}, 'frames': []}]), ('ordered trace 0', 'home', ['move_offer', 'target_rejected', 'move_offer', 'target_rejected', 'move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': True, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['PROBE_TARGET', 2]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['PROBE_TARGET', 2]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': True, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['PROBE_TARGET', 2], ['PROBE_TARGET', 2]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['PROBE_TARGET', 2], ['PROBE_TARGET', 2]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': True, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['PROBE_TARGET', 2], ['PROBE_TARGET', 2], ['PROBE_TARGET', 2]]}]), ('ordered trace 3', 'draining', ['new_application_data', 'home_flushed', 'old_endpoint_data', 'boundary_ack', 'target_lost'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5, 2, 3, 4, 5], 'delivered': []}, 'frames': []}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5, 2, 3, 4, 5], 'delivered': []}, 'frames': [['BOUNDARY', 5]]}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5, 2, 3, 4, 5], 'delivered': [2, 3, 4]}, 'frames': [['BOUNDARY', 5]]}, {'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5, 2, 3, 4, 5], 'delivered': [2, 3, 4]}, 'frames': [['BOUNDARY', 5]]}, {'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5, 2, 3, 4, 5], 'delivered': [2, 3, 4]}, 'frames': [['BOUNDARY', 5], ['UNAVAILABLE', 2]]}]), ('empty input', 'home', [], []), ('unknown event', 'home', ['unsupported'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['reject', [2, 3, 4, 5]]]}])], 3: [('home/move_offer', 'home', ['move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': True, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3]]}]), ('probing/target_ready', 'probing', ['target_ready'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': 6, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': []}]), ('probing/target_rejected', 'probing', ['target_rejected'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': []}]), ('draining/home_flushed', 'draining', ['home_flushed'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['BOUNDARY', 6]]}]), ('switching/boundary_ack', 'switching', ['boundary_ack'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': []}]), ('switching/old_endpoint_data', 'switching', ['old_endpoint_data'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': [3, 4, 5]}, 'frames': []}]), ('away/old_endpoint_data', 'away', ['old_endpoint_data'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['OLD_ENDPOINT', 3]]}]), ('away/target_lost', 'away', ['target_lost'], [{'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['UNAVAILABLE', 3]]}]), ('home/unsolicited_boundary_ack', 'home', ['unsolicited_boundary_ack'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['NO_MIGRATION', 3]]}]), ('draining/new_application_data', 'draining', ['new_application_data'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'delivered': []}, 'frames': []}]), ('ordered trace 0', 'home', ['move_offer', 'target_rejected', 'move_offer', 'target_rejected', 'move_offer', 'target_rejected'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': True, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': True, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3], ['PROBE_TARGET', 3]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3], ['PROBE_TARGET', 3]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': True, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3], ['PROBE_TARGET', 3], ['PROBE_TARGET', 3]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3], ['PROBE_TARGET', 3], ['PROBE_TARGET', 3]]}]), ('ordered trace 3', 'draining', ['new_application_data', 'home_flushed', 'old_endpoint_data', 'boundary_ack', 'target_lost'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'delivered': []}, 'frames': []}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['BOUNDARY', 6]]}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'delivered': [3, 4, 5]}, 'frames': [['BOUNDARY', 6]]}, {'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'delivered': [3, 4, 5]}, 'frames': [['BOUNDARY', 6]]}, {'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'delivered': [3, 4, 5]}, 'frames': [['BOUNDARY', 6], ['UNAVAILABLE', 3]]}]), ('empty input', 'home', [], []), ('unknown event', 'home', ['unsupported'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['reject', [3, 4, 5, 6, 7]]]}])], 4: [('home/move_offer', 'home', ['move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': True, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4]]}]), ('probing/target_ready', 'probing', ['target_ready'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': 7, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': []}]), ('probing/target_rejected', 'probing', ['target_rejected'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': []}]), ('draining/home_flushed', 'draining', ['home_flushed'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['BOUNDARY', 7]]}]), ('switching/boundary_ack', 'switching', ['boundary_ack'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': []}]), ('switching/old_endpoint_data', 'switching', ['old_endpoint_data'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': [4, 5, 6]}, 'frames': []}]), ('away/old_endpoint_data', 'away', ['old_endpoint_data'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['OLD_ENDPOINT', 4]]}]), ('away/target_lost', 'away', ['target_lost'], [{'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['UNAVAILABLE', 4]]}]), ('home/unsolicited_boundary_ack', 'home', ['unsolicited_boundary_ack'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['NO_MIGRATION', 4]]}]), ('draining/new_application_data', 'draining', ['new_application_data'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': []}]), ('ordered trace 0', 'home', ['move_offer', 'target_rejected', 'move_offer', 'target_rejected', 'move_offer', 'target_rejected', 'move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': True, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': True, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4], ['PROBE_TARGET', 4]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4], ['PROBE_TARGET', 4]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': True, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4], ['PROBE_TARGET', 4], ['PROBE_TARGET', 4]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4], ['PROBE_TARGET', 4], ['PROBE_TARGET', 4]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': True, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4], ['PROBE_TARGET', 4], ['PROBE_TARGET', 4], ['PROBE_TARGET', 4]]}]), ('ordered trace 3', 'draining', ['new_application_data', 'home_flushed', 'old_endpoint_data', 'boundary_ack', 'target_lost'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': []}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['BOUNDARY', 7]]}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'delivered': [4, 5, 6]}, 'frames': [['BOUNDARY', 7]]}, {'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'delivered': [4, 5, 6]}, 'frames': [['BOUNDARY', 7]]}, {'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'delivered': [4, 5, 6]}, 'frames': [['BOUNDARY', 7], ['UNAVAILABLE', 4]]}]), ('empty input', 'home', [], []), ('unknown event', 'home', ['unsupported'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['reject', [4, 5, 6, 7, 8, 9]]]}])], 5: [('home/move_offer', 'home', ['move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': True, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5]]}]), ('probing/target_ready', 'probing', ['target_ready'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': 8, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': []}]), ('probing/target_rejected', 'probing', ['target_rejected'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': []}]), ('draining/home_flushed', 'draining', ['home_flushed'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['BOUNDARY', 8]]}]), ('switching/boundary_ack', 'switching', ['boundary_ack'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': []}]), ('switching/old_endpoint_data', 'switching', ['old_endpoint_data'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': [5, 6, 7]}, 'frames': []}]), ('away/old_endpoint_data', 'away', ['old_endpoint_data'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['OLD_ENDPOINT', 5]]}]), ('away/target_lost', 'away', ['target_lost'], [{'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['UNAVAILABLE', 5]]}]), ('home/unsolicited_boundary_ack', 'home', ['unsolicited_boundary_ack'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['NO_MIGRATION', 5]]}]), ('draining/new_application_data', 'draining', ['new_application_data'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': []}]), ('ordered trace 0', 'home', ['move_offer', 'target_rejected', 'move_offer', 'target_rejected', 'move_offer', 'target_rejected', 'move_offer', 'target_rejected'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': True, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': True, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5], ['PROBE_TARGET', 5]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5], ['PROBE_TARGET', 5]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': True, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5], ['PROBE_TARGET', 5], ['PROBE_TARGET', 5]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5], ['PROBE_TARGET', 5], ['PROBE_TARGET', 5]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': True, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5], ['PROBE_TARGET', 5], ['PROBE_TARGET', 5], ['PROBE_TARGET', 5]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5], ['PROBE_TARGET', 5], ['PROBE_TARGET', 5], ['PROBE_TARGET', 5]]}]), ('ordered trace 3', 'draining', ['new_application_data', 'home_flushed', 'old_endpoint_data', 'boundary_ack', 'target_lost'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': []}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['BOUNDARY', 8]]}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'delivered': [5, 6, 7]}, 'frames': [['BOUNDARY', 8]]}, {'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'delivered': [5, 6, 7]}, 'frames': [['BOUNDARY', 8]]}, {'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'delivered': [5, 6, 7]}, 'frames': [['BOUNDARY', 8], ['UNAVAILABLE', 5]]}]), ('empty input', 'home', [], []), ('unknown event', 'home', ['unsupported'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, '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)
Boundary fixtureActualExpectedOutcome
home/move_offer[{'frames': [['PROBE_TARGET', 1]], 'phase': 'probing', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': True}}][{'frames': [['PROBE_TARGET', 1]], 'phase': 'probing', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': True}}]Passed
probing/target_ready[{'frames': [], 'phase': 'draining', 'registers': {'boundary': 4, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [], 'phase': 'draining', 'registers': {'boundary': 4, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
probing/target_rejected[{'frames': [], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
draining/home_flushed[{'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
switching/boundary_ack[{'frames': [], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
switching/old_endpoint_data[{'frames': [], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [1, 2, 3], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [1, 2, 3], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
away/old_endpoint_data[{'frames': [['OLD_ENDPOINT', 1]], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [['OLD_ENDPOINT', 1]], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
away/target_lost[{'frames': [['UNAVAILABLE', 1]], 'phase': 'suspended', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [['UNAVAILABLE', 1]], 'phase': 'suspended', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
home/unsolicited_boundary_ack[{'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [['NO_MIGRATION', 1]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Failed
draining/new_application_data[{'frames': [], 'phase': 'draining', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [], 'phase': 'draining', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
ordered trace 0[{'frames': [['PROBE_TARGET', 1]], 'phase': 'probing', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': True}}, {'frames': [['PROBE_TARGET', 1]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['PROBE_TARGET', 1], ['PROBE_TARGET', 1]], 'phase': 'probing', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': True}}, {'frames': [['PROBE_TARGET', 1], ['PROBE_TARGET', 1]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [['PROBE_TARGET', 1]], 'phase': 'probing', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': True}}, {'frames': [['PROBE_TARGET', 1]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['PROBE_TARGET', 1], ['PROBE_TARGET', 1]], 'phase': 'probing', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': True}}, {'frames': [['PROBE_TARGET', 1], ['PROBE_TARGET', 1]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
ordered trace 3[{'frames': [], 'phase': 'draining', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [1, 2, 3], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['BOUNDARY', 4]], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [1, 2, 3], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [], 'phase': 'draining', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [1, 2, 3], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['BOUNDARY', 4]], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [1, 2, 3], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
empty input[][]Passed
unknown event[{'frames': [['reject', [1, 2, 3]]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [['reject', [1, 2, 3]]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed

SHA-256 / dddffc2385f360abae5e5ec3b7816918387f74c8f6e5d4c044137eb4c451855a

3 / The verified repair

Exit 0
"""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 = {'endpoint': 'target' if phase=='away' else 'home', 'home_open': phase not in ('away','suspended'), 'sequence': seed+3, 'boundary': None, 'target_checked': False, 'queue': payload[:], 'delivered': []}
    frames = []
    observed = []
    table = {('home', 'move_offer'): ('probing', 'probe_target'), ('probing', 'target_ready'): ('draining', 'freeze_home_sequence'), ('probing', 'target_rejected'): ('home', 'discard_target'), ('draining', 'home_flushed'): ('switching', 'send_boundary'), ('switching', 'boundary_ack'): ('away', 'switch_target'), ('switching', 'old_endpoint_data'): ('switching', 'accept_before_boundary'), ('away', 'old_endpoint_data'): ('away', 'reject_old_endpoint'), ('away', 'target_lost'): ('suspended', 'report_unavailable'), ('home', 'unsolicited_boundary_ack'): ('home', 'reject_unoffered'), ('draining', 'new_application_data'): ('draining', 'queue_after_boundary')}
    for event in events:
        phase, action = table.get((phase, event), (phase, "reject"))
        if action == 'probe_target':
            r['target_checked']=True; frames.append(['PROBE_TARGET',seed])
        elif action == 'freeze_home_sequence':
            r['boundary']=r['sequence']
        elif action == 'discard_target':
            r['target_checked']=False
        elif action == 'send_boundary':
            frames.append(['BOUNDARY',r['sequence']])
        elif action == 'switch_target':
            r['endpoint']='target'; r['home_open']=False
        elif action == 'accept_before_boundary':
            r['delivered'].extend([x for x in payload if x<r['sequence']])
        elif action == 'reject_old_endpoint':
            frames.append(['OLD_ENDPOINT',seed])
        elif action == 'report_unavailable':
            frames.append(['UNAVAILABLE',seed])
        elif action == 'reject_unoffered':
            frames.append(['NO_MIGRATION',seed])
        elif action == 'queue_after_boundary':
            r['queue'].extend(payload)
        elif action == 'stop_home':
            r['home_open']=False
        elif action == 'reset_sequence':
            r['sequence']=0
        elif action == 'send_zero_boundary':
            frames.append(['BOUNDARY',0])
        elif action == 'resume_home':
            r['endpoint']='home'; r['home_open']=True
        elif action == 'send_on_both':
            frames.extend([['HOME',payload],['TARGET',payload]])
        elif action == 'drop_all':
            r['delivered']=[]
        elif action == 'accept_all':
            r['delivered'].extend(payload)
        elif action == 'deliver':
            r['delivered'].extend(payload)
        elif action == 'silent_drop':
            r['queue']=[]
        elif action == 'send_home':
            frames.append(['HOME',payload])
        elif action == 'send_target':
            frames.append(['TARGET',payload])
        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: [('home/move_offer', 'home', ['move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': True, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['PROBE_TARGET', 1]]}]), ('probing/target_ready', 'probing', ['target_ready'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': 4, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': []}]), ('probing/target_rejected', 'probing', ['target_rejected'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': []}]), ('draining/home_flushed', 'draining', ['home_flushed'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['BOUNDARY', 4]]}]), ('switching/boundary_ack', 'switching', ['boundary_ack'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': []}]), ('switching/old_endpoint_data', 'switching', ['old_endpoint_data'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': [1, 2, 3]}, 'frames': []}]), ('away/old_endpoint_data', 'away', ['old_endpoint_data'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['OLD_ENDPOINT', 1]]}]), ('away/target_lost', 'away', ['target_lost'], [{'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['UNAVAILABLE', 1]]}]), ('home/unsolicited_boundary_ack', 'home', ['unsolicited_boundary_ack'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['NO_MIGRATION', 1]]}]), ('draining/new_application_data', 'draining', ['new_application_data'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3, 1, 2, 3], 'delivered': []}, 'frames': []}]), ('ordered trace 0', 'home', ['move_offer', 'target_rejected', 'move_offer', 'target_rejected'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': True, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['PROBE_TARGET', 1]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['PROBE_TARGET', 1]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': True, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['PROBE_TARGET', 1], ['PROBE_TARGET', 1]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['PROBE_TARGET', 1], ['PROBE_TARGET', 1]]}]), ('ordered trace 3', 'draining', ['new_application_data', 'home_flushed', 'old_endpoint_data', 'boundary_ack'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3, 1, 2, 3], 'delivered': []}, 'frames': []}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3, 1, 2, 3], 'delivered': []}, 'frames': [['BOUNDARY', 4]]}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3, 1, 2, 3], 'delivered': [1, 2, 3]}, 'frames': [['BOUNDARY', 4]]}, {'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3, 1, 2, 3], 'delivered': [1, 2, 3]}, 'frames': [['BOUNDARY', 4]]}]), ('empty input', 'home', [], []), ('unknown event', 'home', ['unsupported'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 4, 'boundary': None, 'target_checked': False, 'queue': [1, 2, 3], 'delivered': []}, 'frames': [['reject', [1, 2, 3]]]}])], 2: [('home/move_offer', 'home', ['move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': True, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['PROBE_TARGET', 2]]}]), ('probing/target_ready', 'probing', ['target_ready'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': 5, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': []}]), ('probing/target_rejected', 'probing', ['target_rejected'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': []}]), ('draining/home_flushed', 'draining', ['home_flushed'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['BOUNDARY', 5]]}]), ('switching/boundary_ack', 'switching', ['boundary_ack'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': []}]), ('switching/old_endpoint_data', 'switching', ['old_endpoint_data'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': [2, 3, 4]}, 'frames': []}]), ('away/old_endpoint_data', 'away', ['old_endpoint_data'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['OLD_ENDPOINT', 2]]}]), ('away/target_lost', 'away', ['target_lost'], [{'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['UNAVAILABLE', 2]]}]), ('home/unsolicited_boundary_ack', 'home', ['unsolicited_boundary_ack'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['NO_MIGRATION', 2]]}]), ('draining/new_application_data', 'draining', ['new_application_data'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5, 2, 3, 4, 5], 'delivered': []}, 'frames': []}]), ('ordered trace 0', 'home', ['move_offer', 'target_rejected', 'move_offer', 'target_rejected', 'move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': True, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['PROBE_TARGET', 2]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['PROBE_TARGET', 2]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': True, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['PROBE_TARGET', 2], ['PROBE_TARGET', 2]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['PROBE_TARGET', 2], ['PROBE_TARGET', 2]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': True, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['PROBE_TARGET', 2], ['PROBE_TARGET', 2], ['PROBE_TARGET', 2]]}]), ('ordered trace 3', 'draining', ['new_application_data', 'home_flushed', 'old_endpoint_data', 'boundary_ack', 'target_lost'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5, 2, 3, 4, 5], 'delivered': []}, 'frames': []}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5, 2, 3, 4, 5], 'delivered': []}, 'frames': [['BOUNDARY', 5]]}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5, 2, 3, 4, 5], 'delivered': [2, 3, 4]}, 'frames': [['BOUNDARY', 5]]}, {'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5, 2, 3, 4, 5], 'delivered': [2, 3, 4]}, 'frames': [['BOUNDARY', 5]]}, {'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5, 2, 3, 4, 5], 'delivered': [2, 3, 4]}, 'frames': [['BOUNDARY', 5], ['UNAVAILABLE', 2]]}]), ('empty input', 'home', [], []), ('unknown event', 'home', ['unsupported'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 5, 'boundary': None, 'target_checked': False, 'queue': [2, 3, 4, 5], 'delivered': []}, 'frames': [['reject', [2, 3, 4, 5]]]}])], 3: [('home/move_offer', 'home', ['move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': True, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3]]}]), ('probing/target_ready', 'probing', ['target_ready'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': 6, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': []}]), ('probing/target_rejected', 'probing', ['target_rejected'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': []}]), ('draining/home_flushed', 'draining', ['home_flushed'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['BOUNDARY', 6]]}]), ('switching/boundary_ack', 'switching', ['boundary_ack'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': []}]), ('switching/old_endpoint_data', 'switching', ['old_endpoint_data'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': [3, 4, 5]}, 'frames': []}]), ('away/old_endpoint_data', 'away', ['old_endpoint_data'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['OLD_ENDPOINT', 3]]}]), ('away/target_lost', 'away', ['target_lost'], [{'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['UNAVAILABLE', 3]]}]), ('home/unsolicited_boundary_ack', 'home', ['unsolicited_boundary_ack'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['NO_MIGRATION', 3]]}]), ('draining/new_application_data', 'draining', ['new_application_data'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'delivered': []}, 'frames': []}]), ('ordered trace 0', 'home', ['move_offer', 'target_rejected', 'move_offer', 'target_rejected', 'move_offer', 'target_rejected'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': True, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': True, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3], ['PROBE_TARGET', 3]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3], ['PROBE_TARGET', 3]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': True, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3], ['PROBE_TARGET', 3], ['PROBE_TARGET', 3]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['PROBE_TARGET', 3], ['PROBE_TARGET', 3], ['PROBE_TARGET', 3]]}]), ('ordered trace 3', 'draining', ['new_application_data', 'home_flushed', 'old_endpoint_data', 'boundary_ack', 'target_lost'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'delivered': []}, 'frames': []}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['BOUNDARY', 6]]}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'delivered': [3, 4, 5]}, 'frames': [['BOUNDARY', 6]]}, {'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'delivered': [3, 4, 5]}, 'frames': [['BOUNDARY', 6]]}, {'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'delivered': [3, 4, 5]}, 'frames': [['BOUNDARY', 6], ['UNAVAILABLE', 3]]}]), ('empty input', 'home', [], []), ('unknown event', 'home', ['unsupported'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 6, 'boundary': None, 'target_checked': False, 'queue': [3, 4, 5, 6, 7], 'delivered': []}, 'frames': [['reject', [3, 4, 5, 6, 7]]]}])], 4: [('home/move_offer', 'home', ['move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': True, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4]]}]), ('probing/target_ready', 'probing', ['target_ready'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': 7, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': []}]), ('probing/target_rejected', 'probing', ['target_rejected'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': []}]), ('draining/home_flushed', 'draining', ['home_flushed'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['BOUNDARY', 7]]}]), ('switching/boundary_ack', 'switching', ['boundary_ack'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': []}]), ('switching/old_endpoint_data', 'switching', ['old_endpoint_data'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': [4, 5, 6]}, 'frames': []}]), ('away/old_endpoint_data', 'away', ['old_endpoint_data'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['OLD_ENDPOINT', 4]]}]), ('away/target_lost', 'away', ['target_lost'], [{'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['UNAVAILABLE', 4]]}]), ('home/unsolicited_boundary_ack', 'home', ['unsolicited_boundary_ack'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['NO_MIGRATION', 4]]}]), ('draining/new_application_data', 'draining', ['new_application_data'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': []}]), ('ordered trace 0', 'home', ['move_offer', 'target_rejected', 'move_offer', 'target_rejected', 'move_offer', 'target_rejected', 'move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': True, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': True, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4], ['PROBE_TARGET', 4]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4], ['PROBE_TARGET', 4]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': True, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4], ['PROBE_TARGET', 4], ['PROBE_TARGET', 4]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4], ['PROBE_TARGET', 4], ['PROBE_TARGET', 4]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': True, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['PROBE_TARGET', 4], ['PROBE_TARGET', 4], ['PROBE_TARGET', 4], ['PROBE_TARGET', 4]]}]), ('ordered trace 3', 'draining', ['new_application_data', 'home_flushed', 'old_endpoint_data', 'boundary_ack', 'target_lost'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': []}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['BOUNDARY', 7]]}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'delivered': [4, 5, 6]}, 'frames': [['BOUNDARY', 7]]}, {'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'delivered': [4, 5, 6]}, 'frames': [['BOUNDARY', 7]]}, {'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'delivered': [4, 5, 6]}, 'frames': [['BOUNDARY', 7], ['UNAVAILABLE', 4]]}]), ('empty input', 'home', [], []), ('unknown event', 'home', ['unsupported'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 7, 'boundary': None, 'target_checked': False, 'queue': [4, 5, 6, 7, 8, 9], 'delivered': []}, 'frames': [['reject', [4, 5, 6, 7, 8, 9]]]}])], 5: [('home/move_offer', 'home', ['move_offer'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': True, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5]]}]), ('probing/target_ready', 'probing', ['target_ready'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': 8, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': []}]), ('probing/target_rejected', 'probing', ['target_rejected'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': []}]), ('draining/home_flushed', 'draining', ['home_flushed'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['BOUNDARY', 8]]}]), ('switching/boundary_ack', 'switching', ['boundary_ack'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': []}]), ('switching/old_endpoint_data', 'switching', ['old_endpoint_data'], [{'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': [5, 6, 7]}, 'frames': []}]), ('away/old_endpoint_data', 'away', ['old_endpoint_data'], [{'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['OLD_ENDPOINT', 5]]}]), ('away/target_lost', 'away', ['target_lost'], [{'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['UNAVAILABLE', 5]]}]), ('home/unsolicited_boundary_ack', 'home', ['unsolicited_boundary_ack'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['NO_MIGRATION', 5]]}]), ('draining/new_application_data', 'draining', ['new_application_data'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': []}]), ('ordered trace 0', 'home', ['move_offer', 'target_rejected', 'move_offer', 'target_rejected', 'move_offer', 'target_rejected', 'move_offer', 'target_rejected'], [{'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': True, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': True, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5], ['PROBE_TARGET', 5]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5], ['PROBE_TARGET', 5]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': True, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5], ['PROBE_TARGET', 5], ['PROBE_TARGET', 5]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5], ['PROBE_TARGET', 5], ['PROBE_TARGET', 5]]}, {'phase': 'probing', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': True, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5], ['PROBE_TARGET', 5], ['PROBE_TARGET', 5], ['PROBE_TARGET', 5]]}, {'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['PROBE_TARGET', 5], ['PROBE_TARGET', 5], ['PROBE_TARGET', 5], ['PROBE_TARGET', 5]]}]), ('ordered trace 3', 'draining', ['new_application_data', 'home_flushed', 'old_endpoint_data', 'boundary_ack', 'target_lost'], [{'phase': 'draining', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': []}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'delivered': []}, 'frames': [['BOUNDARY', 8]]}, {'phase': 'switching', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'delivered': [5, 6, 7]}, 'frames': [['BOUNDARY', 8]]}, {'phase': 'away', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'delivered': [5, 6, 7]}, 'frames': [['BOUNDARY', 8]]}, {'phase': 'suspended', 'registers': {'endpoint': 'target', 'home_open': False, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'delivered': [5, 6, 7]}, 'frames': [['BOUNDARY', 8], ['UNAVAILABLE', 5]]}]), ('empty input', 'home', [], []), ('unknown event', 'home', ['unsupported'], [{'phase': 'home', 'registers': {'endpoint': 'home', 'home_open': True, 'sequence': 8, 'boundary': None, 'target_checked': False, 'queue': [5, 6, 7, 8, 9, 10, 11], 'delivered': []}, '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)
Boundary fixtureActualExpectedOutcome
home/move_offer[{'frames': [['PROBE_TARGET', 1]], 'phase': 'probing', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': True}}][{'frames': [['PROBE_TARGET', 1]], 'phase': 'probing', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': True}}]Passed
probing/target_ready[{'frames': [], 'phase': 'draining', 'registers': {'boundary': 4, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [], 'phase': 'draining', 'registers': {'boundary': 4, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
probing/target_rejected[{'frames': [], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
draining/home_flushed[{'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
switching/boundary_ack[{'frames': [], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
switching/old_endpoint_data[{'frames': [], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [1, 2, 3], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [1, 2, 3], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
away/old_endpoint_data[{'frames': [['OLD_ENDPOINT', 1]], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [['OLD_ENDPOINT', 1]], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
away/target_lost[{'frames': [['UNAVAILABLE', 1]], 'phase': 'suspended', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [['UNAVAILABLE', 1]], 'phase': 'suspended', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
home/unsolicited_boundary_ack[{'frames': [['NO_MIGRATION', 1]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [['NO_MIGRATION', 1]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
draining/new_application_data[{'frames': [], 'phase': 'draining', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [], 'phase': 'draining', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
ordered trace 0[{'frames': [['PROBE_TARGET', 1]], 'phase': 'probing', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': True}}, {'frames': [['PROBE_TARGET', 1]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['PROBE_TARGET', 1], ['PROBE_TARGET', 1]], 'phase': 'probing', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': True}}, {'frames': [['PROBE_TARGET', 1], ['PROBE_TARGET', 1]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [['PROBE_TARGET', 1]], 'phase': 'probing', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': True}}, {'frames': [['PROBE_TARGET', 1]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['PROBE_TARGET', 1], ['PROBE_TARGET', 1]], 'phase': 'probing', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': True}}, {'frames': [['PROBE_TARGET', 1], ['PROBE_TARGET', 1]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
ordered trace 3[{'frames': [], 'phase': 'draining', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [1, 2, 3], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['BOUNDARY', 4]], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [1, 2, 3], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [], 'phase': 'draining', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['BOUNDARY', 4]], 'phase': 'switching', 'registers': {'boundary': None, 'delivered': [1, 2, 3], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}, {'frames': [['BOUNDARY', 4]], 'phase': 'away', 'registers': {'boundary': None, 'delivered': [1, 2, 3], 'endpoint': 'target', 'home_open': False, 'queue': [1, 2, 3, 1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed
empty input[][]Passed
unknown event[{'frames': [['reject', [1, 2, 3]]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}][{'frames': [['reject', [1, 2, 3]]], 'phase': 'home', 'registers': {'boundary': None, 'delivered': [], 'endpoint': 'home', 'home_open': True, 'queue': [1, 2, 3], 'sequence': 4, 'target_checked': False}}]Passed

SHA-256 / f526d2a5ec1fb917fccc9c15de528aa60feb36094306551324730835cb357eed

Verification & scope

Bounded offline control-plane abstraction with prescribed initial registers and classified events. Not a named protocol implementation or conformance test; excludes wire parsing, transport retries, physical execution, authentication, crash persistence, and timing. Related event faults share the full corrected controller and evaluation group. 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:40:12.984701+00:00.

Case digest / e7235ac4c41c4ca738db6040474faee2757c0e094478d720f9adb6f662b50dd0