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

N = 1
observations = []
def solve(phase, events, seed):
    payload = list(range(seed, seed * 2 + 2))
    r = {'window': seed, 'samples': payload[:], 'other_window': [seed-1], 'delivered': phase=='published', 'sealed': phase not in ('idle','collecting')}
    frames = []
    observed = []
    table = {('idle', 'open_window'): ('collecting', 'allocate_window'), ('collecting', 'sample'): ('collecting', 'append_sample'), ('collecting', 'close_window'): ('sealed', 'seal_samples'), ('sealed', 'publish'): ('awaiting', 'send_window'), ('awaiting', 'window_ack'): ('published', 'mark_delivered'), ('awaiting', 'wrong_window_ack'): ('awaiting', 'ignore_unmatched'), ('published', 'retention_done'): ('published', 'retain'), ('sealed', 'sample'): ('sealed', 'queue_next_window'), ('awaiting', 'receiver_backpressure'): ('paused', 'retain_window'), ('paused', 'receiver_ready'): ('awaiting', 'resume_same_window')}
    for event in events:
        phase, action = table.get((phase, event), (phase, "reject"))
        if action == 'allocate_window':
            r['samples']=[]
        elif action == 'append_sample':
            r['samples'].extend(payload)
        elif action == 'seal_samples':
            r['sealed']=True
        elif action == 'send_window':
            frames.append(['WINDOW',r['window'],r['samples'][:]])
        elif action == 'mark_delivered':
            r['delivered']=True
        elif action == 'ignore_unmatched':
            frames.append(['WRONG_WINDOW',seed+1])
        elif action == 'release_window':
            r['samples']=[]
        elif action == 'queue_next_window':
            r['other_window'].extend(payload)
        elif action == 'retain_window':
            frames.append(['PAUSED_WINDOW',r['window']])
        elif action == 'resume_same_window':
            frames.append(['WINDOW',r['window'],r['samples'][:]])
        elif action == 'send_empty':
            frames.append(['WINDOW',r['window'],[]])
        elif action == 'drop_samples':
            r['samples']=[]
        elif action == 'replace_samples':
            r['samples']=payload[:]
        elif action == 'send_sample':
            frames.append(['SAMPLE',payload])
        elif action == 'send_partial':
            frames.append(['WINDOW',r['window'],r['samples'][:1]])
        elif action == 'clear_samples':
            r['samples']=[]
        elif action == 'send_latest_only':
            frames.append(['WINDOW',r['window'],r['samples'][-1:]])
        elif action == 'delete_immediately':
            r['samples']=[]
        elif action == 'mark_all_delivered':
            r['delivered']=True; r['other_window']=[]
        elif action == 'clear_all_windows':
            r['samples']=[]; r['other_window']=[]
        elif action == 'drop_window':
            r['samples']=[]
        elif action == 'truncate_window':
            r['samples']=r['samples'][:1]
        elif action == 'rebuild_window':
            r['samples']=payload[:]
        elif action == 'send_new_id':
            r['window']+=1; frames.append(['WINDOW',r['window'],r['samples'][:]])
        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: [('idle/open_window', 'idle', ['open_window'], [{'phase': 'collecting', 'registers': {'window': 1, 'samples': [], 'other_window': [0], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/sample', 'collecting', ['sample'], [{'phase': 'collecting', 'registers': {'window': 1, 'samples': [1, 2, 3, 1, 2, 3], 'other_window': [0], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/close_window', 'collecting', ['close_window'], [{'phase': 'sealed', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0], 'delivered': False, 'sealed': True}, 'frames': []}]), ('sealed/publish', 'sealed', ['publish'], [{'phase': 'awaiting', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 1, [1, 2, 3]]]}]), ('awaiting/window_ack', 'awaiting', ['window_ack'], [{'phase': 'published', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0], 'delivered': True, 'sealed': True}, 'frames': []}]), ('awaiting/wrong_window_ack', 'awaiting', ['wrong_window_ack'], [{'phase': 'awaiting', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0], 'delivered': False, 'sealed': True}, 'frames': [['WRONG_WINDOW', 2]]}]), ('published/retention_done', 'published', ['retention_done'], [{'phase': 'idle', 'registers': {'window': 1, 'samples': [], 'other_window': [0], 'delivered': True, 'sealed': True}, 'frames': []}]), ('sealed/sample', 'sealed', ['sample'], [{'phase': 'sealed', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0, 1, 2, 3], 'delivered': False, 'sealed': True}, 'frames': []}]), ('awaiting/receiver_backpressure', 'awaiting', ['receiver_backpressure'], [{'phase': 'paused', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0], 'delivered': False, 'sealed': True}, 'frames': [['PAUSED_WINDOW', 1]]}]), ('paused/receiver_ready', 'paused', ['receiver_ready'], [{'phase': 'awaiting', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 1, [1, 2, 3]]]}]), ('ordered trace 0', 'idle', ['open_window', 'close_window', 'publish', 'window_ack'], [{'phase': 'collecting', 'registers': {'window': 1, 'samples': [], 'other_window': [0], 'delivered': False, 'sealed': False}, 'frames': []}, {'phase': 'sealed', 'registers': {'window': 1, 'samples': [], 'other_window': [0], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 1, 'samples': [], 'other_window': [0], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 1, []]]}, {'phase': 'published', 'registers': {'window': 1, 'samples': [], 'other_window': [0], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 1, []]]}]), ('ordered trace 3', 'sealed', ['sample', 'publish', 'receiver_backpressure', 'receiver_ready'], [{'phase': 'sealed', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0, 1, 2, 3], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0, 1, 2, 3], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 1, [1, 2, 3]]]}, {'phase': 'paused', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0, 1, 2, 3], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 1, [1, 2, 3]], ['PAUSED_WINDOW', 1]]}, {'phase': 'awaiting', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0, 1, 2, 3], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 1, [1, 2, 3]], ['PAUSED_WINDOW', 1], ['WINDOW', 1, [1, 2, 3]]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0], 'delivered': False, 'sealed': False}, 'frames': [['reject', [1, 2, 3]]]}])], 2: [('idle/open_window', 'idle', ['open_window'], [{'phase': 'collecting', 'registers': {'window': 2, 'samples': [], 'other_window': [1], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/sample', 'collecting', ['sample'], [{'phase': 'collecting', 'registers': {'window': 2, 'samples': [2, 3, 4, 5, 2, 3, 4, 5], 'other_window': [1], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/close_window', 'collecting', ['close_window'], [{'phase': 'sealed', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1], 'delivered': False, 'sealed': True}, 'frames': []}]), ('sealed/publish', 'sealed', ['publish'], [{'phase': 'awaiting', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 2, [2, 3, 4, 5]]]}]), ('awaiting/window_ack', 'awaiting', ['window_ack'], [{'phase': 'published', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1], 'delivered': True, 'sealed': True}, 'frames': []}]), ('awaiting/wrong_window_ack', 'awaiting', ['wrong_window_ack'], [{'phase': 'awaiting', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1], 'delivered': False, 'sealed': True}, 'frames': [['WRONG_WINDOW', 3]]}]), ('published/retention_done', 'published', ['retention_done'], [{'phase': 'idle', 'registers': {'window': 2, 'samples': [], 'other_window': [1], 'delivered': True, 'sealed': True}, 'frames': []}]), ('sealed/sample', 'sealed', ['sample'], [{'phase': 'sealed', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1, 2, 3, 4, 5], 'delivered': False, 'sealed': True}, 'frames': []}]), ('awaiting/receiver_backpressure', 'awaiting', ['receiver_backpressure'], [{'phase': 'paused', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1], 'delivered': False, 'sealed': True}, 'frames': [['PAUSED_WINDOW', 2]]}]), ('paused/receiver_ready', 'paused', ['receiver_ready'], [{'phase': 'awaiting', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 2, [2, 3, 4, 5]]]}]), ('ordered trace 0', 'idle', ['open_window', 'close_window', 'publish', 'window_ack', 'retention_done'], [{'phase': 'collecting', 'registers': {'window': 2, 'samples': [], 'other_window': [1], 'delivered': False, 'sealed': False}, 'frames': []}, {'phase': 'sealed', 'registers': {'window': 2, 'samples': [], 'other_window': [1], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 2, 'samples': [], 'other_window': [1], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 2, []]]}, {'phase': 'published', 'registers': {'window': 2, 'samples': [], 'other_window': [1], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 2, []]]}, {'phase': 'idle', 'registers': {'window': 2, 'samples': [], 'other_window': [1], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 2, []]]}]), ('ordered trace 3', 'sealed', ['sample', 'publish', 'receiver_backpressure', 'receiver_ready', 'wrong_window_ack'], [{'phase': 'sealed', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1, 2, 3, 4, 5], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1, 2, 3, 4, 5], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 2, [2, 3, 4, 5]]]}, {'phase': 'paused', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1, 2, 3, 4, 5], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 2, [2, 3, 4, 5]], ['PAUSED_WINDOW', 2]]}, {'phase': 'awaiting', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1, 2, 3, 4, 5], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 2, [2, 3, 4, 5]], ['PAUSED_WINDOW', 2], ['WINDOW', 2, [2, 3, 4, 5]]]}, {'phase': 'awaiting', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1, 2, 3, 4, 5], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 2, [2, 3, 4, 5]], ['PAUSED_WINDOW', 2], ['WINDOW', 2, [2, 3, 4, 5]], ['WRONG_WINDOW', 3]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1], 'delivered': False, 'sealed': False}, 'frames': [['reject', [2, 3, 4, 5]]]}])], 3: [('idle/open_window', 'idle', ['open_window'], [{'phase': 'collecting', 'registers': {'window': 3, 'samples': [], 'other_window': [2], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/sample', 'collecting', ['sample'], [{'phase': 'collecting', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'other_window': [2], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/close_window', 'collecting', ['close_window'], [{'phase': 'sealed', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2], 'delivered': False, 'sealed': True}, 'frames': []}]), ('sealed/publish', 'sealed', ['publish'], [{'phase': 'awaiting', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 3, [3, 4, 5, 6, 7]]]}]), ('awaiting/window_ack', 'awaiting', ['window_ack'], [{'phase': 'published', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2], 'delivered': True, 'sealed': True}, 'frames': []}]), ('awaiting/wrong_window_ack', 'awaiting', ['wrong_window_ack'], [{'phase': 'awaiting', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2], 'delivered': False, 'sealed': True}, 'frames': [['WRONG_WINDOW', 4]]}]), ('published/retention_done', 'published', ['retention_done'], [{'phase': 'idle', 'registers': {'window': 3, 'samples': [], 'other_window': [2], 'delivered': True, 'sealed': True}, 'frames': []}]), ('sealed/sample', 'sealed', ['sample'], [{'phase': 'sealed', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2, 3, 4, 5, 6, 7], 'delivered': False, 'sealed': True}, 'frames': []}]), ('awaiting/receiver_backpressure', 'awaiting', ['receiver_backpressure'], [{'phase': 'paused', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2], 'delivered': False, 'sealed': True}, 'frames': [['PAUSED_WINDOW', 3]]}]), ('paused/receiver_ready', 'paused', ['receiver_ready'], [{'phase': 'awaiting', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 3, [3, 4, 5, 6, 7]]]}]), ('ordered trace 0', 'idle', ['open_window', 'close_window', 'publish', 'window_ack', 'retention_done', 'open_window'], [{'phase': 'collecting', 'registers': {'window': 3, 'samples': [], 'other_window': [2], 'delivered': False, 'sealed': False}, 'frames': []}, {'phase': 'sealed', 'registers': {'window': 3, 'samples': [], 'other_window': [2], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 3, 'samples': [], 'other_window': [2], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 3, []]]}, {'phase': 'published', 'registers': {'window': 3, 'samples': [], 'other_window': [2], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 3, []]]}, {'phase': 'idle', 'registers': {'window': 3, 'samples': [], 'other_window': [2], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 3, []]]}, {'phase': 'collecting', 'registers': {'window': 3, 'samples': [], 'other_window': [2], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 3, []]]}]), ('ordered trace 3', 'sealed', ['sample', 'publish', 'receiver_backpressure', 'receiver_ready', 'wrong_window_ack', 'receiver_backpressure'], [{'phase': 'sealed', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2, 3, 4, 5, 6, 7], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2, 3, 4, 5, 6, 7], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 3, [3, 4, 5, 6, 7]]]}, {'phase': 'paused', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2, 3, 4, 5, 6, 7], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 3, [3, 4, 5, 6, 7]], ['PAUSED_WINDOW', 3]]}, {'phase': 'awaiting', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2, 3, 4, 5, 6, 7], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 3, [3, 4, 5, 6, 7]], ['PAUSED_WINDOW', 3], ['WINDOW', 3, [3, 4, 5, 6, 7]]]}, {'phase': 'awaiting', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2, 3, 4, 5, 6, 7], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 3, [3, 4, 5, 6, 7]], ['PAUSED_WINDOW', 3], ['WINDOW', 3, [3, 4, 5, 6, 7]], ['WRONG_WINDOW', 4]]}, {'phase': 'paused', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2, 3, 4, 5, 6, 7], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 3, [3, 4, 5, 6, 7]], ['PAUSED_WINDOW', 3], ['WINDOW', 3, [3, 4, 5, 6, 7]], ['WRONG_WINDOW', 4], ['PAUSED_WINDOW', 3]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2], 'delivered': False, 'sealed': False}, 'frames': [['reject', [3, 4, 5, 6, 7]]]}])], 4: [('idle/open_window', 'idle', ['open_window'], [{'phase': 'collecting', 'registers': {'window': 4, 'samples': [], 'other_window': [3], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/sample', 'collecting', ['sample'], [{'phase': 'collecting', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'other_window': [3], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/close_window', 'collecting', ['close_window'], [{'phase': 'sealed', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3], 'delivered': False, 'sealed': True}, 'frames': []}]), ('sealed/publish', 'sealed', ['publish'], [{'phase': 'awaiting', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 4, [4, 5, 6, 7, 8, 9]]]}]), ('awaiting/window_ack', 'awaiting', ['window_ack'], [{'phase': 'published', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3], 'delivered': True, 'sealed': True}, 'frames': []}]), ('awaiting/wrong_window_ack', 'awaiting', ['wrong_window_ack'], [{'phase': 'awaiting', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3], 'delivered': False, 'sealed': True}, 'frames': [['WRONG_WINDOW', 5]]}]), ('published/retention_done', 'published', ['retention_done'], [{'phase': 'idle', 'registers': {'window': 4, 'samples': [], 'other_window': [3], 'delivered': True, 'sealed': True}, 'frames': []}]), ('sealed/sample', 'sealed', ['sample'], [{'phase': 'sealed', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3, 4, 5, 6, 7, 8, 9], 'delivered': False, 'sealed': True}, 'frames': []}]), ('awaiting/receiver_backpressure', 'awaiting', ['receiver_backpressure'], [{'phase': 'paused', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3], 'delivered': False, 'sealed': True}, 'frames': [['PAUSED_WINDOW', 4]]}]), ('paused/receiver_ready', 'paused', ['receiver_ready'], [{'phase': 'awaiting', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 4, [4, 5, 6, 7, 8, 9]]]}]), ('ordered trace 0', 'idle', ['open_window', 'close_window', 'publish', 'window_ack', 'retention_done', 'open_window', 'sample'], [{'phase': 'collecting', 'registers': {'window': 4, 'samples': [], 'other_window': [3], 'delivered': False, 'sealed': False}, 'frames': []}, {'phase': 'sealed', 'registers': {'window': 4, 'samples': [], 'other_window': [3], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 4, 'samples': [], 'other_window': [3], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 4, []]]}, {'phase': 'published', 'registers': {'window': 4, 'samples': [], 'other_window': [3], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 4, []]]}, {'phase': 'idle', 'registers': {'window': 4, 'samples': [], 'other_window': [3], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 4, []]]}, {'phase': 'collecting', 'registers': {'window': 4, 'samples': [], 'other_window': [3], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 4, []]]}, {'phase': 'collecting', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 4, []]]}]), ('ordered trace 3', 'sealed', ['sample', 'publish', 'receiver_backpressure', 'receiver_ready', 'wrong_window_ack', 'receiver_backpressure', 'receiver_ready'], [{'phase': 'sealed', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3, 4, 5, 6, 7, 8, 9], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3, 4, 5, 6, 7, 8, 9], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 4, [4, 5, 6, 7, 8, 9]]]}, {'phase': 'paused', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3, 4, 5, 6, 7, 8, 9], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 4, [4, 5, 6, 7, 8, 9]], ['PAUSED_WINDOW', 4]]}, {'phase': 'awaiting', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3, 4, 5, 6, 7, 8, 9], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 4, [4, 5, 6, 7, 8, 9]], ['PAUSED_WINDOW', 4], ['WINDOW', 4, [4, 5, 6, 7, 8, 9]]]}, {'phase': 'awaiting', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3, 4, 5, 6, 7, 8, 9], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 4, [4, 5, 6, 7, 8, 9]], ['PAUSED_WINDOW', 4], ['WINDOW', 4, [4, 5, 6, 7, 8, 9]], ['WRONG_WINDOW', 5]]}, {'phase': 'paused', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3, 4, 5, 6, 7, 8, 9], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 4, [4, 5, 6, 7, 8, 9]], ['PAUSED_WINDOW', 4], ['WINDOW', 4, [4, 5, 6, 7, 8, 9]], ['WRONG_WINDOW', 5], ['PAUSED_WINDOW', 4]]}, {'phase': 'awaiting', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3, 4, 5, 6, 7, 8, 9], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 4, [4, 5, 6, 7, 8, 9]], ['PAUSED_WINDOW', 4], ['WINDOW', 4, [4, 5, 6, 7, 8, 9]], ['WRONG_WINDOW', 5], ['PAUSED_WINDOW', 4], ['WINDOW', 4, [4, 5, 6, 7, 8, 9]]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3], 'delivered': False, 'sealed': False}, 'frames': [['reject', [4, 5, 6, 7, 8, 9]]]}])], 5: [('idle/open_window', 'idle', ['open_window'], [{'phase': 'collecting', 'registers': {'window': 5, 'samples': [], 'other_window': [4], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/sample', 'collecting', ['sample'], [{'phase': 'collecting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/close_window', 'collecting', ['close_window'], [{'phase': 'sealed', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': False, 'sealed': True}, 'frames': []}]), ('sealed/publish', 'sealed', ['publish'], [{'phase': 'awaiting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]]]}]), ('awaiting/window_ack', 'awaiting', ['window_ack'], [{'phase': 'published', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': True, 'sealed': True}, 'frames': []}]), ('awaiting/wrong_window_ack', 'awaiting', ['wrong_window_ack'], [{'phase': 'awaiting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': False, 'sealed': True}, 'frames': [['WRONG_WINDOW', 6]]}]), ('published/retention_done', 'published', ['retention_done'], [{'phase': 'idle', 'registers': {'window': 5, 'samples': [], 'other_window': [4], 'delivered': True, 'sealed': True}, 'frames': []}]), ('sealed/sample', 'sealed', ['sample'], [{'phase': 'sealed', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4, 5, 6, 7, 8, 9, 10, 11], 'delivered': False, 'sealed': True}, 'frames': []}]), ('awaiting/receiver_backpressure', 'awaiting', ['receiver_backpressure'], [{'phase': 'paused', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': False, 'sealed': True}, 'frames': [['PAUSED_WINDOW', 5]]}]), ('paused/receiver_ready', 'paused', ['receiver_ready'], [{'phase': 'awaiting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]]]}]), ('ordered trace 0', 'idle', ['open_window', 'close_window', 'publish', 'window_ack', 'retention_done', 'open_window', 'sample', 'close_window'], [{'phase': 'collecting', 'registers': {'window': 5, 'samples': [], 'other_window': [4], 'delivered': False, 'sealed': False}, 'frames': []}, {'phase': 'sealed', 'registers': {'window': 5, 'samples': [], 'other_window': [4], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 5, 'samples': [], 'other_window': [4], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, []]]}, {'phase': 'published', 'registers': {'window': 5, 'samples': [], 'other_window': [4], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 5, []]]}, {'phase': 'idle', 'registers': {'window': 5, 'samples': [], 'other_window': [4], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 5, []]]}, {'phase': 'collecting', 'registers': {'window': 5, 'samples': [], 'other_window': [4], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 5, []]]}, {'phase': 'collecting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 5, []]]}, {'phase': 'sealed', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 5, []]]}]), ('ordered trace 3', 'sealed', ['sample', 'publish', 'receiver_backpressure', 'receiver_ready', 'wrong_window_ack', 'receiver_backpressure', 'receiver_ready', 'wrong_window_ack'], [{'phase': 'sealed', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4, 5, 6, 7, 8, 9, 10, 11], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4, 5, 6, 7, 8, 9, 10, 11], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'paused', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4, 5, 6, 7, 8, 9, 10, 11], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['PAUSED_WINDOW', 5]]}, {'phase': 'awaiting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4, 5, 6, 7, 8, 9, 10, 11], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['PAUSED_WINDOW', 5], ['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'awaiting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4, 5, 6, 7, 8, 9, 10, 11], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['PAUSED_WINDOW', 5], ['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['WRONG_WINDOW', 6]]}, {'phase': 'paused', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4, 5, 6, 7, 8, 9, 10, 11], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['PAUSED_WINDOW', 5], ['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['WRONG_WINDOW', 6], ['PAUSED_WINDOW', 5]]}, {'phase': 'awaiting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4, 5, 6, 7, 8, 9, 10, 11], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['PAUSED_WINDOW', 5], ['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['WRONG_WINDOW', 6], ['PAUSED_WINDOW', 5], ['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'awaiting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4, 5, 6, 7, 8, 9, 10, 11], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['PAUSED_WINDOW', 5], ['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['WRONG_WINDOW', 6], ['PAUSED_WINDOW', 5], ['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['WRONG_WINDOW', 6]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': False, 'sealed': False}, '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)

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

N = 1
observations = []
def solve(phase, events, seed):
    payload = list(range(seed, seed * 2 + 2))
    r = {'window': seed, 'samples': payload[:], 'other_window': [seed-1], 'delivered': phase=='published', 'sealed': phase not in ('idle','collecting')}
    frames = []
    observed = []
    table = {('idle', 'open_window'): ('collecting', 'allocate_window'), ('collecting', 'sample'): ('collecting', 'append_sample'), ('collecting', 'close_window'): ('sealed', 'seal_samples'), ('sealed', 'publish'): ('awaiting', 'send_window'), ('awaiting', 'window_ack'): ('published', 'mark_delivered'), ('awaiting', 'wrong_window_ack'): ('awaiting', 'ignore_unmatched'), ('published', 'retention_done'): ('idle', 'clear_all_windows'), ('sealed', 'sample'): ('sealed', 'queue_next_window'), ('awaiting', 'receiver_backpressure'): ('paused', 'retain_window'), ('paused', 'receiver_ready'): ('awaiting', 'resume_same_window')}
    for event in events:
        phase, action = table.get((phase, event), (phase, "reject"))
        if action == 'allocate_window':
            r['samples']=[]
        elif action == 'append_sample':
            r['samples'].extend(payload)
        elif action == 'seal_samples':
            r['sealed']=True
        elif action == 'send_window':
            frames.append(['WINDOW',r['window'],r['samples'][:]])
        elif action == 'mark_delivered':
            r['delivered']=True
        elif action == 'ignore_unmatched':
            frames.append(['WRONG_WINDOW',seed+1])
        elif action == 'release_window':
            r['samples']=[]
        elif action == 'queue_next_window':
            r['other_window'].extend(payload)
        elif action == 'retain_window':
            frames.append(['PAUSED_WINDOW',r['window']])
        elif action == 'resume_same_window':
            frames.append(['WINDOW',r['window'],r['samples'][:]])
        elif action == 'send_empty':
            frames.append(['WINDOW',r['window'],[]])
        elif action == 'drop_samples':
            r['samples']=[]
        elif action == 'replace_samples':
            r['samples']=payload[:]
        elif action == 'send_sample':
            frames.append(['SAMPLE',payload])
        elif action == 'send_partial':
            frames.append(['WINDOW',r['window'],r['samples'][:1]])
        elif action == 'clear_samples':
            r['samples']=[]
        elif action == 'send_latest_only':
            frames.append(['WINDOW',r['window'],r['samples'][-1:]])
        elif action == 'delete_immediately':
            r['samples']=[]
        elif action == 'mark_all_delivered':
            r['delivered']=True; r['other_window']=[]
        elif action == 'clear_all_windows':
            r['samples']=[]; r['other_window']=[]
        elif action == 'drop_window':
            r['samples']=[]
        elif action == 'truncate_window':
            r['samples']=r['samples'][:1]
        elif action == 'rebuild_window':
            r['samples']=payload[:]
        elif action == 'send_new_id':
            r['window']+=1; frames.append(['WINDOW',r['window'],r['samples'][:]])
        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: [('idle/open_window', 'idle', ['open_window'], [{'phase': 'collecting', 'registers': {'window': 1, 'samples': [], 'other_window': [0], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/sample', 'collecting', ['sample'], [{'phase': 'collecting', 'registers': {'window': 1, 'samples': [1, 2, 3, 1, 2, 3], 'other_window': [0], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/close_window', 'collecting', ['close_window'], [{'phase': 'sealed', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0], 'delivered': False, 'sealed': True}, 'frames': []}]), ('sealed/publish', 'sealed', ['publish'], [{'phase': 'awaiting', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 1, [1, 2, 3]]]}]), ('awaiting/window_ack', 'awaiting', ['window_ack'], [{'phase': 'published', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0], 'delivered': True, 'sealed': True}, 'frames': []}]), ('awaiting/wrong_window_ack', 'awaiting', ['wrong_window_ack'], [{'phase': 'awaiting', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0], 'delivered': False, 'sealed': True}, 'frames': [['WRONG_WINDOW', 2]]}]), ('published/retention_done', 'published', ['retention_done'], [{'phase': 'idle', 'registers': {'window': 1, 'samples': [], 'other_window': [0], 'delivered': True, 'sealed': True}, 'frames': []}]), ('sealed/sample', 'sealed', ['sample'], [{'phase': 'sealed', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0, 1, 2, 3], 'delivered': False, 'sealed': True}, 'frames': []}]), ('awaiting/receiver_backpressure', 'awaiting', ['receiver_backpressure'], [{'phase': 'paused', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0], 'delivered': False, 'sealed': True}, 'frames': [['PAUSED_WINDOW', 1]]}]), ('paused/receiver_ready', 'paused', ['receiver_ready'], [{'phase': 'awaiting', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 1, [1, 2, 3]]]}]), ('ordered trace 0', 'idle', ['open_window', 'close_window', 'publish', 'window_ack'], [{'phase': 'collecting', 'registers': {'window': 1, 'samples': [], 'other_window': [0], 'delivered': False, 'sealed': False}, 'frames': []}, {'phase': 'sealed', 'registers': {'window': 1, 'samples': [], 'other_window': [0], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 1, 'samples': [], 'other_window': [0], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 1, []]]}, {'phase': 'published', 'registers': {'window': 1, 'samples': [], 'other_window': [0], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 1, []]]}]), ('ordered trace 3', 'sealed', ['sample', 'publish', 'receiver_backpressure', 'receiver_ready'], [{'phase': 'sealed', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0, 1, 2, 3], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0, 1, 2, 3], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 1, [1, 2, 3]]]}, {'phase': 'paused', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0, 1, 2, 3], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 1, [1, 2, 3]], ['PAUSED_WINDOW', 1]]}, {'phase': 'awaiting', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0, 1, 2, 3], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 1, [1, 2, 3]], ['PAUSED_WINDOW', 1], ['WINDOW', 1, [1, 2, 3]]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'window': 1, 'samples': [1, 2, 3], 'other_window': [0], 'delivered': False, 'sealed': False}, 'frames': [['reject', [1, 2, 3]]]}])], 2: [('idle/open_window', 'idle', ['open_window'], [{'phase': 'collecting', 'registers': {'window': 2, 'samples': [], 'other_window': [1], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/sample', 'collecting', ['sample'], [{'phase': 'collecting', 'registers': {'window': 2, 'samples': [2, 3, 4, 5, 2, 3, 4, 5], 'other_window': [1], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/close_window', 'collecting', ['close_window'], [{'phase': 'sealed', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1], 'delivered': False, 'sealed': True}, 'frames': []}]), ('sealed/publish', 'sealed', ['publish'], [{'phase': 'awaiting', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 2, [2, 3, 4, 5]]]}]), ('awaiting/window_ack', 'awaiting', ['window_ack'], [{'phase': 'published', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1], 'delivered': True, 'sealed': True}, 'frames': []}]), ('awaiting/wrong_window_ack', 'awaiting', ['wrong_window_ack'], [{'phase': 'awaiting', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1], 'delivered': False, 'sealed': True}, 'frames': [['WRONG_WINDOW', 3]]}]), ('published/retention_done', 'published', ['retention_done'], [{'phase': 'idle', 'registers': {'window': 2, 'samples': [], 'other_window': [1], 'delivered': True, 'sealed': True}, 'frames': []}]), ('sealed/sample', 'sealed', ['sample'], [{'phase': 'sealed', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1, 2, 3, 4, 5], 'delivered': False, 'sealed': True}, 'frames': []}]), ('awaiting/receiver_backpressure', 'awaiting', ['receiver_backpressure'], [{'phase': 'paused', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1], 'delivered': False, 'sealed': True}, 'frames': [['PAUSED_WINDOW', 2]]}]), ('paused/receiver_ready', 'paused', ['receiver_ready'], [{'phase': 'awaiting', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 2, [2, 3, 4, 5]]]}]), ('ordered trace 0', 'idle', ['open_window', 'close_window', 'publish', 'window_ack', 'retention_done'], [{'phase': 'collecting', 'registers': {'window': 2, 'samples': [], 'other_window': [1], 'delivered': False, 'sealed': False}, 'frames': []}, {'phase': 'sealed', 'registers': {'window': 2, 'samples': [], 'other_window': [1], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 2, 'samples': [], 'other_window': [1], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 2, []]]}, {'phase': 'published', 'registers': {'window': 2, 'samples': [], 'other_window': [1], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 2, []]]}, {'phase': 'idle', 'registers': {'window': 2, 'samples': [], 'other_window': [1], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 2, []]]}]), ('ordered trace 3', 'sealed', ['sample', 'publish', 'receiver_backpressure', 'receiver_ready', 'wrong_window_ack'], [{'phase': 'sealed', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1, 2, 3, 4, 5], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1, 2, 3, 4, 5], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 2, [2, 3, 4, 5]]]}, {'phase': 'paused', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1, 2, 3, 4, 5], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 2, [2, 3, 4, 5]], ['PAUSED_WINDOW', 2]]}, {'phase': 'awaiting', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1, 2, 3, 4, 5], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 2, [2, 3, 4, 5]], ['PAUSED_WINDOW', 2], ['WINDOW', 2, [2, 3, 4, 5]]]}, {'phase': 'awaiting', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1, 2, 3, 4, 5], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 2, [2, 3, 4, 5]], ['PAUSED_WINDOW', 2], ['WINDOW', 2, [2, 3, 4, 5]], ['WRONG_WINDOW', 3]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'window': 2, 'samples': [2, 3, 4, 5], 'other_window': [1], 'delivered': False, 'sealed': False}, 'frames': [['reject', [2, 3, 4, 5]]]}])], 3: [('idle/open_window', 'idle', ['open_window'], [{'phase': 'collecting', 'registers': {'window': 3, 'samples': [], 'other_window': [2], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/sample', 'collecting', ['sample'], [{'phase': 'collecting', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7, 3, 4, 5, 6, 7], 'other_window': [2], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/close_window', 'collecting', ['close_window'], [{'phase': 'sealed', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2], 'delivered': False, 'sealed': True}, 'frames': []}]), ('sealed/publish', 'sealed', ['publish'], [{'phase': 'awaiting', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 3, [3, 4, 5, 6, 7]]]}]), ('awaiting/window_ack', 'awaiting', ['window_ack'], [{'phase': 'published', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2], 'delivered': True, 'sealed': True}, 'frames': []}]), ('awaiting/wrong_window_ack', 'awaiting', ['wrong_window_ack'], [{'phase': 'awaiting', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2], 'delivered': False, 'sealed': True}, 'frames': [['WRONG_WINDOW', 4]]}]), ('published/retention_done', 'published', ['retention_done'], [{'phase': 'idle', 'registers': {'window': 3, 'samples': [], 'other_window': [2], 'delivered': True, 'sealed': True}, 'frames': []}]), ('sealed/sample', 'sealed', ['sample'], [{'phase': 'sealed', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2, 3, 4, 5, 6, 7], 'delivered': False, 'sealed': True}, 'frames': []}]), ('awaiting/receiver_backpressure', 'awaiting', ['receiver_backpressure'], [{'phase': 'paused', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2], 'delivered': False, 'sealed': True}, 'frames': [['PAUSED_WINDOW', 3]]}]), ('paused/receiver_ready', 'paused', ['receiver_ready'], [{'phase': 'awaiting', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 3, [3, 4, 5, 6, 7]]]}]), ('ordered trace 0', 'idle', ['open_window', 'close_window', 'publish', 'window_ack', 'retention_done', 'open_window'], [{'phase': 'collecting', 'registers': {'window': 3, 'samples': [], 'other_window': [2], 'delivered': False, 'sealed': False}, 'frames': []}, {'phase': 'sealed', 'registers': {'window': 3, 'samples': [], 'other_window': [2], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 3, 'samples': [], 'other_window': [2], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 3, []]]}, {'phase': 'published', 'registers': {'window': 3, 'samples': [], 'other_window': [2], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 3, []]]}, {'phase': 'idle', 'registers': {'window': 3, 'samples': [], 'other_window': [2], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 3, []]]}, {'phase': 'collecting', 'registers': {'window': 3, 'samples': [], 'other_window': [2], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 3, []]]}]), ('ordered trace 3', 'sealed', ['sample', 'publish', 'receiver_backpressure', 'receiver_ready', 'wrong_window_ack', 'receiver_backpressure'], [{'phase': 'sealed', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2, 3, 4, 5, 6, 7], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2, 3, 4, 5, 6, 7], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 3, [3, 4, 5, 6, 7]]]}, {'phase': 'paused', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2, 3, 4, 5, 6, 7], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 3, [3, 4, 5, 6, 7]], ['PAUSED_WINDOW', 3]]}, {'phase': 'awaiting', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2, 3, 4, 5, 6, 7], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 3, [3, 4, 5, 6, 7]], ['PAUSED_WINDOW', 3], ['WINDOW', 3, [3, 4, 5, 6, 7]]]}, {'phase': 'awaiting', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2, 3, 4, 5, 6, 7], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 3, [3, 4, 5, 6, 7]], ['PAUSED_WINDOW', 3], ['WINDOW', 3, [3, 4, 5, 6, 7]], ['WRONG_WINDOW', 4]]}, {'phase': 'paused', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2, 3, 4, 5, 6, 7], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 3, [3, 4, 5, 6, 7]], ['PAUSED_WINDOW', 3], ['WINDOW', 3, [3, 4, 5, 6, 7]], ['WRONG_WINDOW', 4], ['PAUSED_WINDOW', 3]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'window': 3, 'samples': [3, 4, 5, 6, 7], 'other_window': [2], 'delivered': False, 'sealed': False}, 'frames': [['reject', [3, 4, 5, 6, 7]]]}])], 4: [('idle/open_window', 'idle', ['open_window'], [{'phase': 'collecting', 'registers': {'window': 4, 'samples': [], 'other_window': [3], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/sample', 'collecting', ['sample'], [{'phase': 'collecting', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9], 'other_window': [3], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/close_window', 'collecting', ['close_window'], [{'phase': 'sealed', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3], 'delivered': False, 'sealed': True}, 'frames': []}]), ('sealed/publish', 'sealed', ['publish'], [{'phase': 'awaiting', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 4, [4, 5, 6, 7, 8, 9]]]}]), ('awaiting/window_ack', 'awaiting', ['window_ack'], [{'phase': 'published', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3], 'delivered': True, 'sealed': True}, 'frames': []}]), ('awaiting/wrong_window_ack', 'awaiting', ['wrong_window_ack'], [{'phase': 'awaiting', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3], 'delivered': False, 'sealed': True}, 'frames': [['WRONG_WINDOW', 5]]}]), ('published/retention_done', 'published', ['retention_done'], [{'phase': 'idle', 'registers': {'window': 4, 'samples': [], 'other_window': [3], 'delivered': True, 'sealed': True}, 'frames': []}]), ('sealed/sample', 'sealed', ['sample'], [{'phase': 'sealed', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3, 4, 5, 6, 7, 8, 9], 'delivered': False, 'sealed': True}, 'frames': []}]), ('awaiting/receiver_backpressure', 'awaiting', ['receiver_backpressure'], [{'phase': 'paused', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3], 'delivered': False, 'sealed': True}, 'frames': [['PAUSED_WINDOW', 4]]}]), ('paused/receiver_ready', 'paused', ['receiver_ready'], [{'phase': 'awaiting', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 4, [4, 5, 6, 7, 8, 9]]]}]), ('ordered trace 0', 'idle', ['open_window', 'close_window', 'publish', 'window_ack', 'retention_done', 'open_window', 'sample'], [{'phase': 'collecting', 'registers': {'window': 4, 'samples': [], 'other_window': [3], 'delivered': False, 'sealed': False}, 'frames': []}, {'phase': 'sealed', 'registers': {'window': 4, 'samples': [], 'other_window': [3], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 4, 'samples': [], 'other_window': [3], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 4, []]]}, {'phase': 'published', 'registers': {'window': 4, 'samples': [], 'other_window': [3], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 4, []]]}, {'phase': 'idle', 'registers': {'window': 4, 'samples': [], 'other_window': [3], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 4, []]]}, {'phase': 'collecting', 'registers': {'window': 4, 'samples': [], 'other_window': [3], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 4, []]]}, {'phase': 'collecting', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 4, []]]}]), ('ordered trace 3', 'sealed', ['sample', 'publish', 'receiver_backpressure', 'receiver_ready', 'wrong_window_ack', 'receiver_backpressure', 'receiver_ready'], [{'phase': 'sealed', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3, 4, 5, 6, 7, 8, 9], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3, 4, 5, 6, 7, 8, 9], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 4, [4, 5, 6, 7, 8, 9]]]}, {'phase': 'paused', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3, 4, 5, 6, 7, 8, 9], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 4, [4, 5, 6, 7, 8, 9]], ['PAUSED_WINDOW', 4]]}, {'phase': 'awaiting', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3, 4, 5, 6, 7, 8, 9], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 4, [4, 5, 6, 7, 8, 9]], ['PAUSED_WINDOW', 4], ['WINDOW', 4, [4, 5, 6, 7, 8, 9]]]}, {'phase': 'awaiting', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3, 4, 5, 6, 7, 8, 9], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 4, [4, 5, 6, 7, 8, 9]], ['PAUSED_WINDOW', 4], ['WINDOW', 4, [4, 5, 6, 7, 8, 9]], ['WRONG_WINDOW', 5]]}, {'phase': 'paused', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3, 4, 5, 6, 7, 8, 9], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 4, [4, 5, 6, 7, 8, 9]], ['PAUSED_WINDOW', 4], ['WINDOW', 4, [4, 5, 6, 7, 8, 9]], ['WRONG_WINDOW', 5], ['PAUSED_WINDOW', 4]]}, {'phase': 'awaiting', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3, 4, 5, 6, 7, 8, 9], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 4, [4, 5, 6, 7, 8, 9]], ['PAUSED_WINDOW', 4], ['WINDOW', 4, [4, 5, 6, 7, 8, 9]], ['WRONG_WINDOW', 5], ['PAUSED_WINDOW', 4], ['WINDOW', 4, [4, 5, 6, 7, 8, 9]]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'window': 4, 'samples': [4, 5, 6, 7, 8, 9], 'other_window': [3], 'delivered': False, 'sealed': False}, 'frames': [['reject', [4, 5, 6, 7, 8, 9]]]}])], 5: [('idle/open_window', 'idle', ['open_window'], [{'phase': 'collecting', 'registers': {'window': 5, 'samples': [], 'other_window': [4], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/sample', 'collecting', ['sample'], [{'phase': 'collecting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': False, 'sealed': False}, 'frames': []}]), ('collecting/close_window', 'collecting', ['close_window'], [{'phase': 'sealed', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': False, 'sealed': True}, 'frames': []}]), ('sealed/publish', 'sealed', ['publish'], [{'phase': 'awaiting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]]]}]), ('awaiting/window_ack', 'awaiting', ['window_ack'], [{'phase': 'published', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': True, 'sealed': True}, 'frames': []}]), ('awaiting/wrong_window_ack', 'awaiting', ['wrong_window_ack'], [{'phase': 'awaiting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': False, 'sealed': True}, 'frames': [['WRONG_WINDOW', 6]]}]), ('published/retention_done', 'published', ['retention_done'], [{'phase': 'idle', 'registers': {'window': 5, 'samples': [], 'other_window': [4], 'delivered': True, 'sealed': True}, 'frames': []}]), ('sealed/sample', 'sealed', ['sample'], [{'phase': 'sealed', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4, 5, 6, 7, 8, 9, 10, 11], 'delivered': False, 'sealed': True}, 'frames': []}]), ('awaiting/receiver_backpressure', 'awaiting', ['receiver_backpressure'], [{'phase': 'paused', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': False, 'sealed': True}, 'frames': [['PAUSED_WINDOW', 5]]}]), ('paused/receiver_ready', 'paused', ['receiver_ready'], [{'phase': 'awaiting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]]]}]), ('ordered trace 0', 'idle', ['open_window', 'close_window', 'publish', 'window_ack', 'retention_done', 'open_window', 'sample', 'close_window'], [{'phase': 'collecting', 'registers': {'window': 5, 'samples': [], 'other_window': [4], 'delivered': False, 'sealed': False}, 'frames': []}, {'phase': 'sealed', 'registers': {'window': 5, 'samples': [], 'other_window': [4], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 5, 'samples': [], 'other_window': [4], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, []]]}, {'phase': 'published', 'registers': {'window': 5, 'samples': [], 'other_window': [4], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 5, []]]}, {'phase': 'idle', 'registers': {'window': 5, 'samples': [], 'other_window': [4], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 5, []]]}, {'phase': 'collecting', 'registers': {'window': 5, 'samples': [], 'other_window': [4], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 5, []]]}, {'phase': 'collecting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 5, []]]}, {'phase': 'sealed', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': True, 'sealed': True}, 'frames': [['WINDOW', 5, []]]}]), ('ordered trace 3', 'sealed', ['sample', 'publish', 'receiver_backpressure', 'receiver_ready', 'wrong_window_ack', 'receiver_backpressure', 'receiver_ready', 'wrong_window_ack'], [{'phase': 'sealed', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4, 5, 6, 7, 8, 9, 10, 11], 'delivered': False, 'sealed': True}, 'frames': []}, {'phase': 'awaiting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4, 5, 6, 7, 8, 9, 10, 11], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'paused', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4, 5, 6, 7, 8, 9, 10, 11], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['PAUSED_WINDOW', 5]]}, {'phase': 'awaiting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4, 5, 6, 7, 8, 9, 10, 11], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['PAUSED_WINDOW', 5], ['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'awaiting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4, 5, 6, 7, 8, 9, 10, 11], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['PAUSED_WINDOW', 5], ['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['WRONG_WINDOW', 6]]}, {'phase': 'paused', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4, 5, 6, 7, 8, 9, 10, 11], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['PAUSED_WINDOW', 5], ['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['WRONG_WINDOW', 6], ['PAUSED_WINDOW', 5]]}, {'phase': 'awaiting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4, 5, 6, 7, 8, 9, 10, 11], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['PAUSED_WINDOW', 5], ['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['WRONG_WINDOW', 6], ['PAUSED_WINDOW', 5], ['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'awaiting', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4, 5, 6, 7, 8, 9, 10, 11], 'delivered': False, 'sealed': True}, 'frames': [['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['PAUSED_WINDOW', 5], ['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['WRONG_WINDOW', 6], ['PAUSED_WINDOW', 5], ['WINDOW', 5, [5, 6, 7, 8, 9, 10, 11]], ['WRONG_WINDOW', 6]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'window': 5, 'samples': [5, 6, 7, 8, 9, 10, 11], 'other_window': [4], 'delivered': False, 'sealed': False}, 'frames': [['reject', [5, 6, 7, 8, 9, 10, 11]]]}])]}
for label, phase, events, expected in cases[N]:
    check(label, solve(phase, events, N), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
While published, event retention_done produces published/retain instead of idle/release_window.

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

split: open-access