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 = {'offered': ['base','delta','batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}
    frames = []
    observed = []
    table = {('fresh', 'offer'): ('offered', 'advertise'), ('offered', 'subset_accept'): ('active', 'enable_subset'), ('offered', 'counteroffer'): ('countered', 'validate'), ('countered', 'compatible'): ('active', 'confirm'), ('countered', 'incompatible'): ('failed', 'reject'), ('offered', 'mandatory_missing'): ('failed', 'reject'), ('active', 'renegotiate'): ('offered', 'quiesce'), ('active', 'duplicate_accept'): ('active', 'ack_existing'), ('failed', 'payload'): ('failed', 'reject'), ('fresh', 'payload'): ('active', 'deliver')}
    for event in events:
        phase, action = table.get((phase, event), (phase, "reject"))
        if action == 'advertise':
            frames.append(['OFFER',r['offered'][:]])
        elif action == 'enable_subset':
            r['enabled']=['base','delta']
        elif action == 'enable_all':
            r['enabled']=r['offered'][:]
        elif action == 'validate':
            r['validations']+=1
        elif action == 'confirm':
            r['enabled']=['base','batch']; frames.append(['ACCEPT',['base','batch']])
        elif action == 'reject':
            frames.append(['REJECT',event])
        elif action == 'quiesce':
            r['quiesced']=True; frames.append(['OFFER',r['offered'][:]])
        elif action == 'ack_existing':
            frames.append(['ACCEPT',r['enabled'][:]])
        elif action == 'enable':
            r['enabled']=r['offered'][:]
        elif action == 'reenable':
            r['validations']+=seed; r['enabled']=r['offered'][:]
        elif action == 'buffer':
            r['queued'].extend(payload)
        elif action == 'deliver':
            r['quiesced']=False; frames.append(['DATA',payload])
        elif action == 'continue':
            frames.append(['DATA',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: [('fresh/offer', 'fresh', ['offer'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('offered/subset_accept', 'offered', ['subset_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'delta'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': []}]), ('offered/counteroffer', 'offered', ['counteroffer'], [{'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': []}]), ('countered/compatible', 'countered', ['compatible'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base', 'batch']]]}]), ('countered/incompatible', 'countered', ['incompatible'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}]), ('offered/mandatory_missing', 'offered', ['mandatory_missing'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'mandatory_missing']]}]), ('active/renegotiate', 'active', ['renegotiate'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': True, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('active/duplicate_accept', 'active', ['duplicate_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base']]]}]), ('failed/payload', 'failed', ['payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('fresh/payload', 'fresh', ['payload'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('ordered trace 0', 'fresh', ['offer', 'counteroffer', 'compatible', 'duplicate_accept'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']]]}]), ('ordered trace 3', 'countered', ['incompatible', 'payload', 'payload', 'payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}]), ('empty input', 'fresh', [], []), ('unknown event', 'fresh', ['unsupported'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'unsupported']]}])], 2: [('fresh/offer', 'fresh', ['offer'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('offered/subset_accept', 'offered', ['subset_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'delta'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': []}]), ('offered/counteroffer', 'offered', ['counteroffer'], [{'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': []}]), ('countered/compatible', 'countered', ['compatible'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base', 'batch']]]}]), ('countered/incompatible', 'countered', ['incompatible'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}]), ('offered/mandatory_missing', 'offered', ['mandatory_missing'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'mandatory_missing']]}]), ('active/renegotiate', 'active', ['renegotiate'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': True, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('active/duplicate_accept', 'active', ['duplicate_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base']]]}]), ('failed/payload', 'failed', ['payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('fresh/payload', 'fresh', ['payload'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('ordered trace 0', 'fresh', ['offer', 'counteroffer', 'compatible', 'duplicate_accept', 'renegotiate'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']]]}, {'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']]]}]), ('ordered trace 3', 'countered', ['incompatible', 'payload', 'payload', 'payload', 'payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}]), ('empty input', 'fresh', [], []), ('unknown event', 'fresh', ['unsupported'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'unsupported']]}])], 3: [('fresh/offer', 'fresh', ['offer'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('offered/subset_accept', 'offered', ['subset_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'delta'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': []}]), ('offered/counteroffer', 'offered', ['counteroffer'], [{'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': []}]), ('countered/compatible', 'countered', ['compatible'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base', 'batch']]]}]), ('countered/incompatible', 'countered', ['incompatible'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}]), ('offered/mandatory_missing', 'offered', ['mandatory_missing'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'mandatory_missing']]}]), ('active/renegotiate', 'active', ['renegotiate'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': True, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('active/duplicate_accept', 'active', ['duplicate_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base']]]}]), ('failed/payload', 'failed', ['payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('fresh/payload', 'fresh', ['payload'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('ordered trace 0', 'fresh', ['offer', 'counteroffer', 'compatible', 'duplicate_accept', 'renegotiate', 'mandatory_missing'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']]]}, {'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']], ['REJECT', 'mandatory_missing']]}]), ('ordered trace 3', 'countered', ['incompatible', 'payload', 'payload', 'payload', 'payload', 'payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}]), ('empty input', 'fresh', [], []), ('unknown event', 'fresh', ['unsupported'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'unsupported']]}])], 4: [('fresh/offer', 'fresh', ['offer'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('offered/subset_accept', 'offered', ['subset_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'delta'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': []}]), ('offered/counteroffer', 'offered', ['counteroffer'], [{'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': []}]), ('countered/compatible', 'countered', ['compatible'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base', 'batch']]]}]), ('countered/incompatible', 'countered', ['incompatible'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}]), ('offered/mandatory_missing', 'offered', ['mandatory_missing'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'mandatory_missing']]}]), ('active/renegotiate', 'active', ['renegotiate'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': True, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('active/duplicate_accept', 'active', ['duplicate_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base']]]}]), ('failed/payload', 'failed', ['payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('fresh/payload', 'fresh', ['payload'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('ordered trace 0', 'fresh', ['offer', 'counteroffer', 'compatible', 'duplicate_accept', 'renegotiate', 'mandatory_missing', 'payload'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']]]}, {'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']], ['REJECT', 'mandatory_missing']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']], ['REJECT', 'mandatory_missing'], ['REJECT', 'payload']]}]), ('ordered trace 3', 'countered', ['incompatible', 'payload', 'payload', 'payload', 'payload', 'payload', 'payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}]), ('empty input', 'fresh', [], []), ('unknown event', 'fresh', ['unsupported'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'unsupported']]}])], 5: [('fresh/offer', 'fresh', ['offer'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('offered/subset_accept', 'offered', ['subset_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'delta'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': []}]), ('offered/counteroffer', 'offered', ['counteroffer'], [{'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': []}]), ('countered/compatible', 'countered', ['compatible'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base', 'batch']]]}]), ('countered/incompatible', 'countered', ['incompatible'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}]), ('offered/mandatory_missing', 'offered', ['mandatory_missing'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'mandatory_missing']]}]), ('active/renegotiate', 'active', ['renegotiate'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': True, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('active/duplicate_accept', 'active', ['duplicate_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base']]]}]), ('failed/payload', 'failed', ['payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('fresh/payload', 'fresh', ['payload'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('ordered trace 0', 'fresh', ['offer', 'counteroffer', 'compatible', 'duplicate_accept', 'renegotiate', 'mandatory_missing', 'payload', 'payload'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']]]}, {'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']], ['REJECT', 'mandatory_missing']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']], ['REJECT', 'mandatory_missing'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']], ['REJECT', 'mandatory_missing'], ['REJECT', 'payload'], ['REJECT', 'payload']]}]), ('ordered trace 3', 'countered', ['incompatible', 'payload', 'payload', 'payload', 'payload', 'payload', 'payload', 'payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}]), ('empty input', 'fresh', [], []), ('unknown event', 'fresh', ['unsupported'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'unsupported']]}])]}
for label, phase, events, expected in cases[N]:
    check(label, solve(phase, events, N), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(phase, events, seed):
    payload = list(range(seed, seed * 2 + 2))
    r = {'offered': ['base','delta','batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}
    frames = []
    observed = []
    table = {('fresh', 'offer'): ('offered', 'advertise'), ('offered', 'subset_accept'): ('active', 'enable_subset'), ('offered', 'counteroffer'): ('countered', 'validate'), ('countered', 'compatible'): ('active', 'confirm'), ('countered', 'incompatible'): ('failed', 'reject'), ('offered', 'mandatory_missing'): ('failed', 'reject'), ('active', 'renegotiate'): ('offered', 'quiesce'), ('active', 'duplicate_accept'): ('active', 'ack_existing'), ('failed', 'payload'): ('failed', 'reject'), ('fresh', 'payload'): ('offered', 'buffer')}
    for event in events:
        phase, action = table.get((phase, event), (phase, "reject"))
        if action == 'advertise':
            frames.append(['OFFER',r['offered'][:]])
        elif action == 'enable_subset':
            r['enabled']=['base','delta']
        elif action == 'enable_all':
            r['enabled']=r['offered'][:]
        elif action == 'validate':
            r['validations']+=1
        elif action == 'confirm':
            r['enabled']=['base','batch']; frames.append(['ACCEPT',['base','batch']])
        elif action == 'reject':
            frames.append(['REJECT',event])
        elif action == 'quiesce':
            r['quiesced']=True; frames.append(['OFFER',r['offered'][:]])
        elif action == 'ack_existing':
            frames.append(['ACCEPT',r['enabled'][:]])
        elif action == 'enable':
            r['enabled']=r['offered'][:]
        elif action == 'reenable':
            r['validations']+=seed; r['enabled']=r['offered'][:]
        elif action == 'buffer':
            r['queued'].extend(payload)
        elif action == 'deliver':
            r['quiesced']=False; frames.append(['DATA',payload])
        elif action == 'continue':
            frames.append(['DATA',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: [('fresh/offer', 'fresh', ['offer'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('offered/subset_accept', 'offered', ['subset_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'delta'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': []}]), ('offered/counteroffer', 'offered', ['counteroffer'], [{'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': []}]), ('countered/compatible', 'countered', ['compatible'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base', 'batch']]]}]), ('countered/incompatible', 'countered', ['incompatible'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}]), ('offered/mandatory_missing', 'offered', ['mandatory_missing'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'mandatory_missing']]}]), ('active/renegotiate', 'active', ['renegotiate'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': True, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('active/duplicate_accept', 'active', ['duplicate_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base']]]}]), ('failed/payload', 'failed', ['payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('fresh/payload', 'fresh', ['payload'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('ordered trace 0', 'fresh', ['offer', 'counteroffer', 'compatible', 'duplicate_accept'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']]]}]), ('ordered trace 3', 'countered', ['incompatible', 'payload', 'payload', 'payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}]), ('empty input', 'fresh', [], []), ('unknown event', 'fresh', ['unsupported'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'unsupported']]}])], 2: [('fresh/offer', 'fresh', ['offer'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('offered/subset_accept', 'offered', ['subset_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'delta'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': []}]), ('offered/counteroffer', 'offered', ['counteroffer'], [{'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': []}]), ('countered/compatible', 'countered', ['compatible'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base', 'batch']]]}]), ('countered/incompatible', 'countered', ['incompatible'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}]), ('offered/mandatory_missing', 'offered', ['mandatory_missing'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'mandatory_missing']]}]), ('active/renegotiate', 'active', ['renegotiate'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': True, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('active/duplicate_accept', 'active', ['duplicate_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base']]]}]), ('failed/payload', 'failed', ['payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('fresh/payload', 'fresh', ['payload'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('ordered trace 0', 'fresh', ['offer', 'counteroffer', 'compatible', 'duplicate_accept', 'renegotiate'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']]]}, {'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']]]}]), ('ordered trace 3', 'countered', ['incompatible', 'payload', 'payload', 'payload', 'payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}]), ('empty input', 'fresh', [], []), ('unknown event', 'fresh', ['unsupported'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'unsupported']]}])], 3: [('fresh/offer', 'fresh', ['offer'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('offered/subset_accept', 'offered', ['subset_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'delta'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': []}]), ('offered/counteroffer', 'offered', ['counteroffer'], [{'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': []}]), ('countered/compatible', 'countered', ['compatible'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base', 'batch']]]}]), ('countered/incompatible', 'countered', ['incompatible'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}]), ('offered/mandatory_missing', 'offered', ['mandatory_missing'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'mandatory_missing']]}]), ('active/renegotiate', 'active', ['renegotiate'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': True, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('active/duplicate_accept', 'active', ['duplicate_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base']]]}]), ('failed/payload', 'failed', ['payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('fresh/payload', 'fresh', ['payload'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('ordered trace 0', 'fresh', ['offer', 'counteroffer', 'compatible', 'duplicate_accept', 'renegotiate', 'mandatory_missing'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']]]}, {'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']], ['REJECT', 'mandatory_missing']]}]), ('ordered trace 3', 'countered', ['incompatible', 'payload', 'payload', 'payload', 'payload', 'payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}]), ('empty input', 'fresh', [], []), ('unknown event', 'fresh', ['unsupported'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'unsupported']]}])], 4: [('fresh/offer', 'fresh', ['offer'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('offered/subset_accept', 'offered', ['subset_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'delta'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': []}]), ('offered/counteroffer', 'offered', ['counteroffer'], [{'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': []}]), ('countered/compatible', 'countered', ['compatible'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base', 'batch']]]}]), ('countered/incompatible', 'countered', ['incompatible'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}]), ('offered/mandatory_missing', 'offered', ['mandatory_missing'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'mandatory_missing']]}]), ('active/renegotiate', 'active', ['renegotiate'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': True, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('active/duplicate_accept', 'active', ['duplicate_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base']]]}]), ('failed/payload', 'failed', ['payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('fresh/payload', 'fresh', ['payload'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('ordered trace 0', 'fresh', ['offer', 'counteroffer', 'compatible', 'duplicate_accept', 'renegotiate', 'mandatory_missing', 'payload'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']]]}, {'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']], ['REJECT', 'mandatory_missing']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']], ['REJECT', 'mandatory_missing'], ['REJECT', 'payload']]}]), ('ordered trace 3', 'countered', ['incompatible', 'payload', 'payload', 'payload', 'payload', 'payload', 'payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}]), ('empty input', 'fresh', [], []), ('unknown event', 'fresh', ['unsupported'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'unsupported']]}])], 5: [('fresh/offer', 'fresh', ['offer'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('offered/subset_accept', 'offered', ['subset_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'delta'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': []}]), ('offered/counteroffer', 'offered', ['counteroffer'], [{'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': []}]), ('countered/compatible', 'countered', ['compatible'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base', 'batch']]]}]), ('countered/incompatible', 'countered', ['incompatible'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}]), ('offered/mandatory_missing', 'offered', ['mandatory_missing'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'mandatory_missing']]}]), ('active/renegotiate', 'active', ['renegotiate'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': True, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}]), ('active/duplicate_accept', 'active', ['duplicate_accept'], [{'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['ACCEPT', ['base']]]}]), ('failed/payload', 'failed', ['payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('fresh/payload', 'fresh', ['payload'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'payload']]}]), ('ordered trace 0', 'fresh', ['offer', 'counteroffer', 'compatible', 'duplicate_accept', 'renegotiate', 'mandatory_missing', 'payload', 'payload'], [{'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'countered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']]]}, {'phase': 'active', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': False, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']]]}, {'phase': 'offered', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']]]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']], ['REJECT', 'mandatory_missing']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']], ['REJECT', 'mandatory_missing'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base', 'batch'], 'quiesced': True, 'validations': 1, 'queued': []}, 'frames': [['OFFER', ['base', 'delta', 'batch']], ['ACCEPT', ['base', 'batch']], ['ACCEPT', ['base', 'batch']], ['OFFER', ['base', 'delta', 'batch']], ['REJECT', 'mandatory_missing'], ['REJECT', 'payload'], ['REJECT', 'payload']]}]), ('ordered trace 3', 'countered', ['incompatible', 'payload', 'payload', 'payload', 'payload', 'payload', 'payload', 'payload'], [{'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}, {'phase': 'failed', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'incompatible'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload'], ['REJECT', 'payload']]}]), ('empty input', 'fresh', [], []), ('unknown event', 'fresh', ['unsupported'], [{'phase': 'fresh', 'registers': {'offered': ['base', 'delta', 'batch'], 'enabled': ['base'], 'quiesced': False, 'validations': 0, 'queued': []}, 'frames': [['REJECT', 'unsupported']]}])]}
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 fresh, event payload produces active/deliver instead of fresh/reject.

For the stipulated Capability-offer negotiation 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