FA-19211 / Protocols / Open access
Route advertisement lifecycle controller: withdrawn / stale announce · case 01
While withdrawn, event stale_announce produces usable/install instead of withdrawn/suppress.
ROOT CAUSE
In withdrawn, the stale announce handler runs install and enters usable; it must instead run suppress and enter withdrawn.
VERIFIED REPAIR
In phase withdrawn, classify stale_announce as transition to withdrawn and emit suppress.
Unsuccessful approach: The partial repair chooses candidate/check_path, which still violates this phase-specific event contract.
Case contract
For the stipulated Route advertisement lifecycle controller, initialize the explicitly shown resource registers from seed (1..5), then consume classified events sequentially. After each event return a deep snapshot of phase, resource registers, and cumulative emitted control frames. The explicit ten phase/event rules and their resource effects define admission and response semantics. Unlisted events preserve phase and emit rejection. Payload is the consecutive integers seed through 2*seed+1. Empty event input returns no observations.
Why this case matters
Incorrect event admission now changes concrete queued data, resource ownership, or emitted protocol frames and subsequent trace behavior.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(phase, events, seed):
payload = list(range(seed, seed * 2 + 2))
r = {'forwarding': ['old'] if phase=='usable' else [], 'advertised': ['old'] if phase=='usable' else [], 'checks': 0, 'liveness': seed, 'withdrawals': 0}
frames = []
observed = []
table = {('unknown', 'announce'): ('candidate', 'check_path'), ('candidate', 'loop_free'): ('usable', 'install'), ('candidate', 'loop_detected'): ('rejected', 'suppress'), ('usable', 'withdraw'): ('withdrawn', 'remove_and_propagate'), ('withdrawn', 'stale_announce'): ('usable', 'install'), ('usable', 'newer_announce'): ('candidate', 'hold_validate'), ('usable', 'neighbor_down'): ('unreachable', 'invalidate'), ('unreachable', 'neighbor_up'): ('unknown', 'request_refresh'), ('rejected', 'corrected_announce'): ('candidate', 'check_path'), ('usable', 'duplicate_announce'): ('usable', 'refresh_liveness')}
for event in events:
phase, action = table.get((phase, event), (phase, "reject"))
if action == 'check_path':
r['checks']+=1
elif action == 'install':
r['forwarding']=['candidate']
elif action == 'suppress':
frames.append(['REJECT_PATH',payload])
elif action == 'remove_and_propagate':
r['forwarding']=[]; r['advertised']=[]; r['withdrawals']+=1
elif action == 'hold_validate':
r['checks']+=1
elif action == 'invalidate':
r['forwarding']=[]; r['advertised']=[]
elif action == 'request_refresh':
frames.append(['REQUEST_ROUTES',seed])
elif action == 'refresh_liveness':
r['liveness']=seed+len(payload)
elif action == 'advertise_only':
r['advertised']=['candidate']
elif action == 'advertise':
r['advertised']=['candidate']
elif action == 'remove_only':
r['forwarding']=[]
elif action == 'remove_immediately':
r['forwarding']=[]; r['checks']+=1
elif action == 'install_cached':
r['forwarding']=['old']
elif action == 'reinstall':
r['forwarding']=['candidate']; r['withdrawals']+=1
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: [('unknown/announce', 'unknown', ['announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 1, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_free', 'candidate', ['loop_free'], [{'phase': 'usable', 'registers': {'forwarding': ['candidate'], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_detected', 'candidate', ['loop_detected'], [{'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [1, 2, 3]]]}]), ('usable/withdraw', 'usable', ['withdraw'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 1}, 'frames': []}]), ('withdrawn/stale_announce', 'withdrawn', ['stale_announce'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [1, 2, 3]]]}]), ('usable/newer_announce', 'usable', ['newer_announce'], [{'phase': 'candidate', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 1, 'liveness': 1, 'withdrawals': 0}, 'frames': []}]), ('usable/neighbor_down', 'usable', ['neighbor_down'], [{'phase': 'unreachable', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 0}, 'frames': []}]), ('unreachable/neighbor_up', 'unreachable', ['neighbor_up'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 0}, 'frames': [['REQUEST_ROUTES', 1]]}]), ('rejected/corrected_announce', 'rejected', ['corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 1, 'withdrawals': 0}, 'frames': []}]), ('usable/duplicate_announce', 'usable', ['duplicate_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': []}]), ('ordered trace 0', 'unknown', ['announce', 'loop_detected', 'corrected_announce', 'loop_detected'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 1, 'withdrawals': 0}, 'frames': []}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 1, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [1, 2, 3]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 1, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [1, 2, 3]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 1, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [1, 2, 3]], ['REJECT_PATH', [1, 2, 3]]]}]), ('ordered trace 3', 'usable', ['duplicate_announce', 'withdraw', 'stale_announce', 'stale_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 1}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [1, 2, 3]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [1, 2, 3]], ['REJECT_PATH', [1, 2, 3]]]}]), ('empty input', 'unknown', [], []), ('unknown event', 'unknown', ['unsupported'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 0}, 'frames': [['reject', [1, 2, 3]]]}])], 2: [('unknown/announce', 'unknown', ['announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 2, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_free', 'candidate', ['loop_free'], [{'phase': 'usable', 'registers': {'forwarding': ['candidate'], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_detected', 'candidate', ['loop_detected'], [{'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]]]}]), ('usable/withdraw', 'usable', ['withdraw'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 1}, 'frames': []}]), ('withdrawn/stale_announce', 'withdrawn', ['stale_announce'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]]]}]), ('usable/newer_announce', 'usable', ['newer_announce'], [{'phase': 'candidate', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 1, 'liveness': 2, 'withdrawals': 0}, 'frames': []}]), ('usable/neighbor_down', 'usable', ['neighbor_down'], [{'phase': 'unreachable', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 0}, 'frames': []}]), ('unreachable/neighbor_up', 'unreachable', ['neighbor_up'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REQUEST_ROUTES', 2]]}]), ('rejected/corrected_announce', 'rejected', ['corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 2, 'withdrawals': 0}, 'frames': []}]), ('usable/duplicate_announce', 'usable', ['duplicate_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 6, 'withdrawals': 0}, 'frames': []}]), ('ordered trace 0', 'unknown', ['announce', 'loop_detected', 'corrected_announce', 'loop_detected', 'corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 2, 'withdrawals': 0}, 'frames': []}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]], ['REJECT_PATH', [2, 3, 4, 5]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]], ['REJECT_PATH', [2, 3, 4, 5]]]}]), ('ordered trace 3', 'usable', ['duplicate_announce', 'withdraw', 'stale_announce', 'stale_announce', 'stale_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 6, 'withdrawals': 0}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 6, 'withdrawals': 1}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 6, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 6, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]], ['REJECT_PATH', [2, 3, 4, 5]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 6, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]], ['REJECT_PATH', [2, 3, 4, 5]], ['REJECT_PATH', [2, 3, 4, 5]]]}]), ('empty input', 'unknown', [], []), ('unknown event', 'unknown', ['unsupported'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 0}, 'frames': [['reject', [2, 3, 4, 5]]]}])], 3: [('unknown/announce', 'unknown', ['announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 3, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_free', 'candidate', ['loop_free'], [{'phase': 'usable', 'registers': {'forwarding': ['candidate'], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_detected', 'candidate', ['loop_detected'], [{'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]]]}]), ('usable/withdraw', 'usable', ['withdraw'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 1}, 'frames': []}]), ('withdrawn/stale_announce', 'withdrawn', ['stale_announce'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]]]}]), ('usable/newer_announce', 'usable', ['newer_announce'], [{'phase': 'candidate', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 1, 'liveness': 3, 'withdrawals': 0}, 'frames': []}]), ('usable/neighbor_down', 'usable', ['neighbor_down'], [{'phase': 'unreachable', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 0}, 'frames': []}]), ('unreachable/neighbor_up', 'unreachable', ['neighbor_up'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REQUEST_ROUTES', 3]]}]), ('rejected/corrected_announce', 'rejected', ['corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 3, 'withdrawals': 0}, 'frames': []}]), ('usable/duplicate_announce', 'usable', ['duplicate_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 8, 'withdrawals': 0}, 'frames': []}]), ('ordered trace 0', 'unknown', ['announce', 'loop_detected', 'corrected_announce', 'loop_detected', 'corrected_announce', 'loop_detected'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 3, 'withdrawals': 0}, 'frames': []}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]]]}]), ('ordered trace 3', 'usable', ['duplicate_announce', 'withdraw', 'stale_announce', 'stale_announce', 'stale_announce', 'stale_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 8, 'withdrawals': 0}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 8, 'withdrawals': 1}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 8, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 8, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 8, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 8, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]]]}]), ('empty input', 'unknown', [], []), ('unknown event', 'unknown', ['unsupported'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 0}, 'frames': [['reject', [3, 4, 5, 6, 7]]]}])], 4: [('unknown/announce', 'unknown', ['announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 4, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_free', 'candidate', ['loop_free'], [{'phase': 'usable', 'registers': {'forwarding': ['candidate'], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_detected', 'candidate', ['loop_detected'], [{'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}]), ('usable/withdraw', 'usable', ['withdraw'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 1}, 'frames': []}]), ('withdrawn/stale_announce', 'withdrawn', ['stale_announce'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}]), ('usable/newer_announce', 'usable', ['newer_announce'], [{'phase': 'candidate', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 1, 'liveness': 4, 'withdrawals': 0}, 'frames': []}]), ('usable/neighbor_down', 'usable', ['neighbor_down'], [{'phase': 'unreachable', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': []}]), ('unreachable/neighbor_up', 'unreachable', ['neighbor_up'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REQUEST_ROUTES', 4]]}]), ('rejected/corrected_announce', 'rejected', ['corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 4, 'withdrawals': 0}, 'frames': []}]), ('usable/duplicate_announce', 'usable', ['duplicate_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 10, 'withdrawals': 0}, 'frames': []}]), ('ordered trace 0', 'unknown', ['announce', 'loop_detected', 'corrected_announce', 'loop_detected', 'corrected_announce', 'loop_detected', 'corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 4, 'withdrawals': 0}, 'frames': []}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 4, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}]), ('ordered trace 3', 'usable', ['duplicate_announce', 'withdraw', 'stale_announce', 'stale_announce', 'stale_announce', 'stale_announce', 'stale_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 10, 'withdrawals': 0}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 10, 'withdrawals': 1}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 10, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 10, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 10, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 10, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 10, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}]), ('empty input', 'unknown', [], []), ('unknown event', 'unknown', ['unsupported'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': [['reject', [4, 5, 6, 7, 8, 9]]]}])], 5: [('unknown/announce', 'unknown', ['announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 5, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_free', 'candidate', ['loop_free'], [{'phase': 'usable', 'registers': {'forwarding': ['candidate'], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_detected', 'candidate', ['loop_detected'], [{'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}]), ('usable/withdraw', 'usable', ['withdraw'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 1}, 'frames': []}]), ('withdrawn/stale_announce', 'withdrawn', ['stale_announce'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}]), ('usable/newer_announce', 'usable', ['newer_announce'], [{'phase': 'candidate', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 1, 'liveness': 5, 'withdrawals': 0}, 'frames': []}]), ('usable/neighbor_down', 'usable', ['neighbor_down'], [{'phase': 'unreachable', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 0}, 'frames': []}]), ('unreachable/neighbor_up', 'unreachable', ['neighbor_up'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REQUEST_ROUTES', 5]]}]), ('rejected/corrected_announce', 'rejected', ['corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 5, 'withdrawals': 0}, 'frames': []}]), ('usable/duplicate_announce', 'usable', ['duplicate_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 12, 'withdrawals': 0}, 'frames': []}]), ('ordered trace 0', 'unknown', ['announce', 'loop_detected', 'corrected_announce', 'loop_detected', 'corrected_announce', 'loop_detected', 'corrected_announce', 'loop_detected'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 5, 'withdrawals': 0}, 'frames': []}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 4, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 4, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}]), ('ordered trace 3', 'usable', ['duplicate_announce', 'withdraw', 'stale_announce', 'stale_announce', 'stale_announce', 'stale_announce', 'stale_announce', 'stale_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 12, 'withdrawals': 0}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}]), ('empty input', 'unknown', [], []), ('unknown event', 'unknown', ['unsupported'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 0}, 'frames': [['reject', [5, 6, 7, 8, 9, 10, 11]]]}])]}
for label, phase, events, expected in cases[N]:
check(label, solve(phase, events, N), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| unknown/announce | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| candidate/loop_free | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': [], 'checks': 0, 'forwarding': ['candidate'], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': [], 'checks': 0, 'forwarding': ['candidate'], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| candidate/loop_detected | [{'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'rejected', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'rejected', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| usable/withdraw | [{'frames': [], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 1}}] | [{'frames': [], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 1}}] | Passed |
| withdrawn/stale_announce | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': [], 'checks': 0, 'forwarding': ['candidate'], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Failed |
| usable/newer_announce | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': ['old'], 'checks': 1, 'forwarding': ['old'], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': ['old'], 'checks': 1, 'forwarding': ['old'], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| usable/neighbor_down | [{'frames': [], 'phase': 'unreachable', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'unreachable', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| unreachable/neighbor_up | [{'frames': [['REQUEST_ROUTES', 1]], 'phase': 'unknown', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [['REQUEST_ROUTES', 1]], 'phase': 'unknown', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| rejected/corrected_announce | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| usable/duplicate_announce | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': ['old'], 'checks': 0, 'forwarding': ['old'], 'liveness': 4, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': ['old'], 'checks': 0, 'forwarding': ['old'], 'liveness': 4, 'withdrawals': 0}}] | Passed |
| ordered trace 0 | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}, {'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'rejected', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}, {'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 2, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}, {'frames': [['REJECT_PATH', [1, 2, 3]], ['REJECT_PATH', [1, 2, 3]]], 'phase': 'rejected', 'registers': {'advertised': [], 'checks': 2, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}, {'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'rejected', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}, {'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 2, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}, {'frames': [['REJECT_PATH', [1, 2, 3]], ['REJECT_PATH', [1, 2, 3]]], 'phase': 'rejected', 'registers': {'advertised': [], 'checks': 2, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| ordered trace 3 | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': ['old'], 'checks': 0, 'forwarding': ['old'], 'liveness': 4, 'withdrawals': 0}}, {'frames': [], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 4, 'withdrawals': 1}}, {'frames': [], 'phase': 'usable', 'registers': {'advertised': [], 'checks': 0, 'forwarding': ['candidate'], 'liveness': 4, 'withdrawals': 1}}, {'frames': [['reject', [1, 2, 3]]], 'phase': 'usable', 'registers': {'advertised': [], 'checks': 0, 'forwarding': ['candidate'], 'liveness': 4, 'withdrawals': 1}}] | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': ['old'], 'checks': 0, 'forwarding': ['old'], 'liveness': 4, 'withdrawals': 0}}, {'frames': [], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 4, 'withdrawals': 1}}, {'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 4, 'withdrawals': 1}}, {'frames': [['REJECT_PATH', [1, 2, 3]], ['REJECT_PATH', [1, 2, 3]]], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 4, 'withdrawals': 1}}] | Failed |
| empty input | [] | [] | Passed |
| unknown event | [{'frames': [['reject', [1, 2, 3]]], 'phase': 'unknown', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [['reject', [1, 2, 3]]], 'phase': 'unknown', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
SHA-256 / 661d3f85bb54cc72fafdb6d273cc809fecf92d0dc0e82be2ecc31e089d167ca1
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(phase, events, seed):
payload = list(range(seed, seed * 2 + 2))
r = {'forwarding': ['old'] if phase=='usable' else [], 'advertised': ['old'] if phase=='usable' else [], 'checks': 0, 'liveness': seed, 'withdrawals': 0}
frames = []
observed = []
table = {('unknown', 'announce'): ('candidate', 'check_path'), ('candidate', 'loop_free'): ('usable', 'install'), ('candidate', 'loop_detected'): ('rejected', 'suppress'), ('usable', 'withdraw'): ('withdrawn', 'remove_and_propagate'), ('withdrawn', 'stale_announce'): ('candidate', 'check_path'), ('usable', 'newer_announce'): ('candidate', 'hold_validate'), ('usable', 'neighbor_down'): ('unreachable', 'invalidate'), ('unreachable', 'neighbor_up'): ('unknown', 'request_refresh'), ('rejected', 'corrected_announce'): ('candidate', 'check_path'), ('usable', 'duplicate_announce'): ('usable', 'refresh_liveness')}
for event in events:
phase, action = table.get((phase, event), (phase, "reject"))
if action == 'check_path':
r['checks']+=1
elif action == 'install':
r['forwarding']=['candidate']
elif action == 'suppress':
frames.append(['REJECT_PATH',payload])
elif action == 'remove_and_propagate':
r['forwarding']=[]; r['advertised']=[]; r['withdrawals']+=1
elif action == 'hold_validate':
r['checks']+=1
elif action == 'invalidate':
r['forwarding']=[]; r['advertised']=[]
elif action == 'request_refresh':
frames.append(['REQUEST_ROUTES',seed])
elif action == 'refresh_liveness':
r['liveness']=seed+len(payload)
elif action == 'advertise_only':
r['advertised']=['candidate']
elif action == 'advertise':
r['advertised']=['candidate']
elif action == 'remove_only':
r['forwarding']=[]
elif action == 'remove_immediately':
r['forwarding']=[]; r['checks']+=1
elif action == 'install_cached':
r['forwarding']=['old']
elif action == 'reinstall':
r['forwarding']=['candidate']; r['withdrawals']+=1
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: [('unknown/announce', 'unknown', ['announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 1, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_free', 'candidate', ['loop_free'], [{'phase': 'usable', 'registers': {'forwarding': ['candidate'], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_detected', 'candidate', ['loop_detected'], [{'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [1, 2, 3]]]}]), ('usable/withdraw', 'usable', ['withdraw'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 1}, 'frames': []}]), ('withdrawn/stale_announce', 'withdrawn', ['stale_announce'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [1, 2, 3]]]}]), ('usable/newer_announce', 'usable', ['newer_announce'], [{'phase': 'candidate', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 1, 'liveness': 1, 'withdrawals': 0}, 'frames': []}]), ('usable/neighbor_down', 'usable', ['neighbor_down'], [{'phase': 'unreachable', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 0}, 'frames': []}]), ('unreachable/neighbor_up', 'unreachable', ['neighbor_up'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 0}, 'frames': [['REQUEST_ROUTES', 1]]}]), ('rejected/corrected_announce', 'rejected', ['corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 1, 'withdrawals': 0}, 'frames': []}]), ('usable/duplicate_announce', 'usable', ['duplicate_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': []}]), ('ordered trace 0', 'unknown', ['announce', 'loop_detected', 'corrected_announce', 'loop_detected'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 1, 'withdrawals': 0}, 'frames': []}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 1, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [1, 2, 3]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 1, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [1, 2, 3]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 1, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [1, 2, 3]], ['REJECT_PATH', [1, 2, 3]]]}]), ('ordered trace 3', 'usable', ['duplicate_announce', 'withdraw', 'stale_announce', 'stale_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 1}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [1, 2, 3]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [1, 2, 3]], ['REJECT_PATH', [1, 2, 3]]]}]), ('empty input', 'unknown', [], []), ('unknown event', 'unknown', ['unsupported'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 0}, 'frames': [['reject', [1, 2, 3]]]}])], 2: [('unknown/announce', 'unknown', ['announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 2, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_free', 'candidate', ['loop_free'], [{'phase': 'usable', 'registers': {'forwarding': ['candidate'], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_detected', 'candidate', ['loop_detected'], [{'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]]]}]), ('usable/withdraw', 'usable', ['withdraw'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 1}, 'frames': []}]), ('withdrawn/stale_announce', 'withdrawn', ['stale_announce'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]]]}]), ('usable/newer_announce', 'usable', ['newer_announce'], [{'phase': 'candidate', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 1, 'liveness': 2, 'withdrawals': 0}, 'frames': []}]), ('usable/neighbor_down', 'usable', ['neighbor_down'], [{'phase': 'unreachable', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 0}, 'frames': []}]), ('unreachable/neighbor_up', 'unreachable', ['neighbor_up'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REQUEST_ROUTES', 2]]}]), ('rejected/corrected_announce', 'rejected', ['corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 2, 'withdrawals': 0}, 'frames': []}]), ('usable/duplicate_announce', 'usable', ['duplicate_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 6, 'withdrawals': 0}, 'frames': []}]), ('ordered trace 0', 'unknown', ['announce', 'loop_detected', 'corrected_announce', 'loop_detected', 'corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 2, 'withdrawals': 0}, 'frames': []}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]], ['REJECT_PATH', [2, 3, 4, 5]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]], ['REJECT_PATH', [2, 3, 4, 5]]]}]), ('ordered trace 3', 'usable', ['duplicate_announce', 'withdraw', 'stale_announce', 'stale_announce', 'stale_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 6, 'withdrawals': 0}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 6, 'withdrawals': 1}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 6, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 6, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]], ['REJECT_PATH', [2, 3, 4, 5]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 6, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]], ['REJECT_PATH', [2, 3, 4, 5]], ['REJECT_PATH', [2, 3, 4, 5]]]}]), ('empty input', 'unknown', [], []), ('unknown event', 'unknown', ['unsupported'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 0}, 'frames': [['reject', [2, 3, 4, 5]]]}])], 3: [('unknown/announce', 'unknown', ['announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 3, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_free', 'candidate', ['loop_free'], [{'phase': 'usable', 'registers': {'forwarding': ['candidate'], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_detected', 'candidate', ['loop_detected'], [{'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]]]}]), ('usable/withdraw', 'usable', ['withdraw'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 1}, 'frames': []}]), ('withdrawn/stale_announce', 'withdrawn', ['stale_announce'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]]]}]), ('usable/newer_announce', 'usable', ['newer_announce'], [{'phase': 'candidate', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 1, 'liveness': 3, 'withdrawals': 0}, 'frames': []}]), ('usable/neighbor_down', 'usable', ['neighbor_down'], [{'phase': 'unreachable', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 0}, 'frames': []}]), ('unreachable/neighbor_up', 'unreachable', ['neighbor_up'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REQUEST_ROUTES', 3]]}]), ('rejected/corrected_announce', 'rejected', ['corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 3, 'withdrawals': 0}, 'frames': []}]), ('usable/duplicate_announce', 'usable', ['duplicate_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 8, 'withdrawals': 0}, 'frames': []}]), ('ordered trace 0', 'unknown', ['announce', 'loop_detected', 'corrected_announce', 'loop_detected', 'corrected_announce', 'loop_detected'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 3, 'withdrawals': 0}, 'frames': []}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]]]}]), ('ordered trace 3', 'usable', ['duplicate_announce', 'withdraw', 'stale_announce', 'stale_announce', 'stale_announce', 'stale_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 8, 'withdrawals': 0}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 8, 'withdrawals': 1}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 8, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 8, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 8, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 8, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]]]}]), ('empty input', 'unknown', [], []), ('unknown event', 'unknown', ['unsupported'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 0}, 'frames': [['reject', [3, 4, 5, 6, 7]]]}])], 4: [('unknown/announce', 'unknown', ['announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 4, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_free', 'candidate', ['loop_free'], [{'phase': 'usable', 'registers': {'forwarding': ['candidate'], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_detected', 'candidate', ['loop_detected'], [{'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}]), ('usable/withdraw', 'usable', ['withdraw'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 1}, 'frames': []}]), ('withdrawn/stale_announce', 'withdrawn', ['stale_announce'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}]), ('usable/newer_announce', 'usable', ['newer_announce'], [{'phase': 'candidate', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 1, 'liveness': 4, 'withdrawals': 0}, 'frames': []}]), ('usable/neighbor_down', 'usable', ['neighbor_down'], [{'phase': 'unreachable', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': []}]), ('unreachable/neighbor_up', 'unreachable', ['neighbor_up'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REQUEST_ROUTES', 4]]}]), ('rejected/corrected_announce', 'rejected', ['corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 4, 'withdrawals': 0}, 'frames': []}]), ('usable/duplicate_announce', 'usable', ['duplicate_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 10, 'withdrawals': 0}, 'frames': []}]), ('ordered trace 0', 'unknown', ['announce', 'loop_detected', 'corrected_announce', 'loop_detected', 'corrected_announce', 'loop_detected', 'corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 4, 'withdrawals': 0}, 'frames': []}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 4, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}]), ('ordered trace 3', 'usable', ['duplicate_announce', 'withdraw', 'stale_announce', 'stale_announce', 'stale_announce', 'stale_announce', 'stale_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 10, 'withdrawals': 0}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 10, 'withdrawals': 1}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 10, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 10, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 10, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 10, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 10, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}]), ('empty input', 'unknown', [], []), ('unknown event', 'unknown', ['unsupported'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': [['reject', [4, 5, 6, 7, 8, 9]]]}])], 5: [('unknown/announce', 'unknown', ['announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 5, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_free', 'candidate', ['loop_free'], [{'phase': 'usable', 'registers': {'forwarding': ['candidate'], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_detected', 'candidate', ['loop_detected'], [{'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}]), ('usable/withdraw', 'usable', ['withdraw'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 1}, 'frames': []}]), ('withdrawn/stale_announce', 'withdrawn', ['stale_announce'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}]), ('usable/newer_announce', 'usable', ['newer_announce'], [{'phase': 'candidate', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 1, 'liveness': 5, 'withdrawals': 0}, 'frames': []}]), ('usable/neighbor_down', 'usable', ['neighbor_down'], [{'phase': 'unreachable', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 0}, 'frames': []}]), ('unreachable/neighbor_up', 'unreachable', ['neighbor_up'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REQUEST_ROUTES', 5]]}]), ('rejected/corrected_announce', 'rejected', ['corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 5, 'withdrawals': 0}, 'frames': []}]), ('usable/duplicate_announce', 'usable', ['duplicate_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 12, 'withdrawals': 0}, 'frames': []}]), ('ordered trace 0', 'unknown', ['announce', 'loop_detected', 'corrected_announce', 'loop_detected', 'corrected_announce', 'loop_detected', 'corrected_announce', 'loop_detected'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 5, 'withdrawals': 0}, 'frames': []}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 4, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 4, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}]), ('ordered trace 3', 'usable', ['duplicate_announce', 'withdraw', 'stale_announce', 'stale_announce', 'stale_announce', 'stale_announce', 'stale_announce', 'stale_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 12, 'withdrawals': 0}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}]), ('empty input', 'unknown', [], []), ('unknown event', 'unknown', ['unsupported'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 0}, 'frames': [['reject', [5, 6, 7, 8, 9, 10, 11]]]}])]}
for label, phase, events, expected in cases[N]:
check(label, solve(phase, events, N), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| unknown/announce | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| candidate/loop_free | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': [], 'checks': 0, 'forwarding': ['candidate'], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': [], 'checks': 0, 'forwarding': ['candidate'], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| candidate/loop_detected | [{'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'rejected', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'rejected', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| usable/withdraw | [{'frames': [], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 1}}] | [{'frames': [], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 1}}] | Passed |
| withdrawn/stale_announce | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Failed |
| usable/newer_announce | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': ['old'], 'checks': 1, 'forwarding': ['old'], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': ['old'], 'checks': 1, 'forwarding': ['old'], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| usable/neighbor_down | [{'frames': [], 'phase': 'unreachable', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'unreachable', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| unreachable/neighbor_up | [{'frames': [['REQUEST_ROUTES', 1]], 'phase': 'unknown', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [['REQUEST_ROUTES', 1]], 'phase': 'unknown', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| rejected/corrected_announce | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| usable/duplicate_announce | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': ['old'], 'checks': 0, 'forwarding': ['old'], 'liveness': 4, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': ['old'], 'checks': 0, 'forwarding': ['old'], 'liveness': 4, 'withdrawals': 0}}] | Passed |
| ordered trace 0 | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}, {'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'rejected', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}, {'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 2, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}, {'frames': [['REJECT_PATH', [1, 2, 3]], ['REJECT_PATH', [1, 2, 3]]], 'phase': 'rejected', 'registers': {'advertised': [], 'checks': 2, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}, {'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'rejected', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}, {'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 2, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}, {'frames': [['REJECT_PATH', [1, 2, 3]], ['REJECT_PATH', [1, 2, 3]]], 'phase': 'rejected', 'registers': {'advertised': [], 'checks': 2, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| ordered trace 3 | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': ['old'], 'checks': 0, 'forwarding': ['old'], 'liveness': 4, 'withdrawals': 0}}, {'frames': [], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 4, 'withdrawals': 1}}, {'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 4, 'withdrawals': 1}}, {'frames': [['reject', [1, 2, 3]]], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 4, 'withdrawals': 1}}] | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': ['old'], 'checks': 0, 'forwarding': ['old'], 'liveness': 4, 'withdrawals': 0}}, {'frames': [], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 4, 'withdrawals': 1}}, {'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 4, 'withdrawals': 1}}, {'frames': [['REJECT_PATH', [1, 2, 3]], ['REJECT_PATH', [1, 2, 3]]], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 4, 'withdrawals': 1}}] | Failed |
| empty input | [] | [] | Passed |
| unknown event | [{'frames': [['reject', [1, 2, 3]]], 'phase': 'unknown', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [['reject', [1, 2, 3]]], 'phase': 'unknown', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
SHA-256 / b58a8510f11090ffc397b59018dbd0daee84a79d3993d62fe9548ff6d4c9c7b8
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(phase, events, seed):
payload = list(range(seed, seed * 2 + 2))
r = {'forwarding': ['old'] if phase=='usable' else [], 'advertised': ['old'] if phase=='usable' else [], 'checks': 0, 'liveness': seed, 'withdrawals': 0}
frames = []
observed = []
table = {('unknown', 'announce'): ('candidate', 'check_path'), ('candidate', 'loop_free'): ('usable', 'install'), ('candidate', 'loop_detected'): ('rejected', 'suppress'), ('usable', 'withdraw'): ('withdrawn', 'remove_and_propagate'), ('withdrawn', 'stale_announce'): ('withdrawn', 'suppress'), ('usable', 'newer_announce'): ('candidate', 'hold_validate'), ('usable', 'neighbor_down'): ('unreachable', 'invalidate'), ('unreachable', 'neighbor_up'): ('unknown', 'request_refresh'), ('rejected', 'corrected_announce'): ('candidate', 'check_path'), ('usable', 'duplicate_announce'): ('usable', 'refresh_liveness')}
for event in events:
phase, action = table.get((phase, event), (phase, "reject"))
if action == 'check_path':
r['checks']+=1
elif action == 'install':
r['forwarding']=['candidate']
elif action == 'suppress':
frames.append(['REJECT_PATH',payload])
elif action == 'remove_and_propagate':
r['forwarding']=[]; r['advertised']=[]; r['withdrawals']+=1
elif action == 'hold_validate':
r['checks']+=1
elif action == 'invalidate':
r['forwarding']=[]; r['advertised']=[]
elif action == 'request_refresh':
frames.append(['REQUEST_ROUTES',seed])
elif action == 'refresh_liveness':
r['liveness']=seed+len(payload)
elif action == 'advertise_only':
r['advertised']=['candidate']
elif action == 'advertise':
r['advertised']=['candidate']
elif action == 'remove_only':
r['forwarding']=[]
elif action == 'remove_immediately':
r['forwarding']=[]; r['checks']+=1
elif action == 'install_cached':
r['forwarding']=['old']
elif action == 'reinstall':
r['forwarding']=['candidate']; r['withdrawals']+=1
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: [('unknown/announce', 'unknown', ['announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 1, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_free', 'candidate', ['loop_free'], [{'phase': 'usable', 'registers': {'forwarding': ['candidate'], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_detected', 'candidate', ['loop_detected'], [{'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [1, 2, 3]]]}]), ('usable/withdraw', 'usable', ['withdraw'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 1}, 'frames': []}]), ('withdrawn/stale_announce', 'withdrawn', ['stale_announce'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [1, 2, 3]]]}]), ('usable/newer_announce', 'usable', ['newer_announce'], [{'phase': 'candidate', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 1, 'liveness': 1, 'withdrawals': 0}, 'frames': []}]), ('usable/neighbor_down', 'usable', ['neighbor_down'], [{'phase': 'unreachable', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 0}, 'frames': []}]), ('unreachable/neighbor_up', 'unreachable', ['neighbor_up'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 0}, 'frames': [['REQUEST_ROUTES', 1]]}]), ('rejected/corrected_announce', 'rejected', ['corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 1, 'withdrawals': 0}, 'frames': []}]), ('usable/duplicate_announce', 'usable', ['duplicate_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': []}]), ('ordered trace 0', 'unknown', ['announce', 'loop_detected', 'corrected_announce', 'loop_detected'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 1, 'withdrawals': 0}, 'frames': []}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 1, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [1, 2, 3]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 1, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [1, 2, 3]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 1, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [1, 2, 3]], ['REJECT_PATH', [1, 2, 3]]]}]), ('ordered trace 3', 'usable', ['duplicate_announce', 'withdraw', 'stale_announce', 'stale_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 1}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [1, 2, 3]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [1, 2, 3]], ['REJECT_PATH', [1, 2, 3]]]}]), ('empty input', 'unknown', [], []), ('unknown event', 'unknown', ['unsupported'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 1, 'withdrawals': 0}, 'frames': [['reject', [1, 2, 3]]]}])], 2: [('unknown/announce', 'unknown', ['announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 2, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_free', 'candidate', ['loop_free'], [{'phase': 'usable', 'registers': {'forwarding': ['candidate'], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_detected', 'candidate', ['loop_detected'], [{'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]]]}]), ('usable/withdraw', 'usable', ['withdraw'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 1}, 'frames': []}]), ('withdrawn/stale_announce', 'withdrawn', ['stale_announce'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]]]}]), ('usable/newer_announce', 'usable', ['newer_announce'], [{'phase': 'candidate', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 1, 'liveness': 2, 'withdrawals': 0}, 'frames': []}]), ('usable/neighbor_down', 'usable', ['neighbor_down'], [{'phase': 'unreachable', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 0}, 'frames': []}]), ('unreachable/neighbor_up', 'unreachable', ['neighbor_up'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REQUEST_ROUTES', 2]]}]), ('rejected/corrected_announce', 'rejected', ['corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 2, 'withdrawals': 0}, 'frames': []}]), ('usable/duplicate_announce', 'usable', ['duplicate_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 6, 'withdrawals': 0}, 'frames': []}]), ('ordered trace 0', 'unknown', ['announce', 'loop_detected', 'corrected_announce', 'loop_detected', 'corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 2, 'withdrawals': 0}, 'frames': []}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]], ['REJECT_PATH', [2, 3, 4, 5]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 2, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]], ['REJECT_PATH', [2, 3, 4, 5]]]}]), ('ordered trace 3', 'usable', ['duplicate_announce', 'withdraw', 'stale_announce', 'stale_announce', 'stale_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 6, 'withdrawals': 0}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 6, 'withdrawals': 1}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 6, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 6, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]], ['REJECT_PATH', [2, 3, 4, 5]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 6, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [2, 3, 4, 5]], ['REJECT_PATH', [2, 3, 4, 5]], ['REJECT_PATH', [2, 3, 4, 5]]]}]), ('empty input', 'unknown', [], []), ('unknown event', 'unknown', ['unsupported'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 2, 'withdrawals': 0}, 'frames': [['reject', [2, 3, 4, 5]]]}])], 3: [('unknown/announce', 'unknown', ['announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 3, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_free', 'candidate', ['loop_free'], [{'phase': 'usable', 'registers': {'forwarding': ['candidate'], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_detected', 'candidate', ['loop_detected'], [{'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]]]}]), ('usable/withdraw', 'usable', ['withdraw'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 1}, 'frames': []}]), ('withdrawn/stale_announce', 'withdrawn', ['stale_announce'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]]]}]), ('usable/newer_announce', 'usable', ['newer_announce'], [{'phase': 'candidate', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 1, 'liveness': 3, 'withdrawals': 0}, 'frames': []}]), ('usable/neighbor_down', 'usable', ['neighbor_down'], [{'phase': 'unreachable', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 0}, 'frames': []}]), ('unreachable/neighbor_up', 'unreachable', ['neighbor_up'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REQUEST_ROUTES', 3]]}]), ('rejected/corrected_announce', 'rejected', ['corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 3, 'withdrawals': 0}, 'frames': []}]), ('usable/duplicate_announce', 'usable', ['duplicate_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 8, 'withdrawals': 0}, 'frames': []}]), ('ordered trace 0', 'unknown', ['announce', 'loop_detected', 'corrected_announce', 'loop_detected', 'corrected_announce', 'loop_detected'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 3, 'withdrawals': 0}, 'frames': []}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 3, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]]]}]), ('ordered trace 3', 'usable', ['duplicate_announce', 'withdraw', 'stale_announce', 'stale_announce', 'stale_announce', 'stale_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 8, 'withdrawals': 0}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 8, 'withdrawals': 1}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 8, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 8, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 8, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 8, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]], ['REJECT_PATH', [3, 4, 5, 6, 7]]]}]), ('empty input', 'unknown', [], []), ('unknown event', 'unknown', ['unsupported'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 3, 'withdrawals': 0}, 'frames': [['reject', [3, 4, 5, 6, 7]]]}])], 4: [('unknown/announce', 'unknown', ['announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 4, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_free', 'candidate', ['loop_free'], [{'phase': 'usable', 'registers': {'forwarding': ['candidate'], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_detected', 'candidate', ['loop_detected'], [{'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}]), ('usable/withdraw', 'usable', ['withdraw'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 1}, 'frames': []}]), ('withdrawn/stale_announce', 'withdrawn', ['stale_announce'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}]), ('usable/newer_announce', 'usable', ['newer_announce'], [{'phase': 'candidate', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 1, 'liveness': 4, 'withdrawals': 0}, 'frames': []}]), ('usable/neighbor_down', 'usable', ['neighbor_down'], [{'phase': 'unreachable', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': []}]), ('unreachable/neighbor_up', 'unreachable', ['neighbor_up'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REQUEST_ROUTES', 4]]}]), ('rejected/corrected_announce', 'rejected', ['corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 4, 'withdrawals': 0}, 'frames': []}]), ('usable/duplicate_announce', 'usable', ['duplicate_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 10, 'withdrawals': 0}, 'frames': []}]), ('ordered trace 0', 'unknown', ['announce', 'loop_detected', 'corrected_announce', 'loop_detected', 'corrected_announce', 'loop_detected', 'corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 4, 'withdrawals': 0}, 'frames': []}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 4, 'liveness': 4, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}]), ('ordered trace 3', 'usable', ['duplicate_announce', 'withdraw', 'stale_announce', 'stale_announce', 'stale_announce', 'stale_announce', 'stale_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 10, 'withdrawals': 0}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 10, 'withdrawals': 1}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 10, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 10, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 10, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 10, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 10, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]], ['REJECT_PATH', [4, 5, 6, 7, 8, 9]]]}]), ('empty input', 'unknown', [], []), ('unknown event', 'unknown', ['unsupported'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 4, 'withdrawals': 0}, 'frames': [['reject', [4, 5, 6, 7, 8, 9]]]}])], 5: [('unknown/announce', 'unknown', ['announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 5, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_free', 'candidate', ['loop_free'], [{'phase': 'usable', 'registers': {'forwarding': ['candidate'], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 0}, 'frames': []}]), ('candidate/loop_detected', 'candidate', ['loop_detected'], [{'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}]), ('usable/withdraw', 'usable', ['withdraw'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 1}, 'frames': []}]), ('withdrawn/stale_announce', 'withdrawn', ['stale_announce'], [{'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}]), ('usable/newer_announce', 'usable', ['newer_announce'], [{'phase': 'candidate', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 1, 'liveness': 5, 'withdrawals': 0}, 'frames': []}]), ('usable/neighbor_down', 'usable', ['neighbor_down'], [{'phase': 'unreachable', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 0}, 'frames': []}]), ('unreachable/neighbor_up', 'unreachable', ['neighbor_up'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REQUEST_ROUTES', 5]]}]), ('rejected/corrected_announce', 'rejected', ['corrected_announce'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 5, 'withdrawals': 0}, 'frames': []}]), ('usable/duplicate_announce', 'usable', ['duplicate_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 12, 'withdrawals': 0}, 'frames': []}]), ('ordered trace 0', 'unknown', ['announce', 'loop_detected', 'corrected_announce', 'loop_detected', 'corrected_announce', 'loop_detected', 'corrected_announce', 'loop_detected'], [{'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 5, 'withdrawals': 0}, 'frames': []}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 1, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 2, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 3, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'candidate', 'registers': {'forwarding': [], 'advertised': [], 'checks': 4, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'rejected', 'registers': {'forwarding': [], 'advertised': [], 'checks': 4, 'liveness': 5, 'withdrawals': 0}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}]), ('ordered trace 3', 'usable', ['duplicate_announce', 'withdraw', 'stale_announce', 'stale_announce', 'stale_announce', 'stale_announce', 'stale_announce', 'stale_announce'], [{'phase': 'usable', 'registers': {'forwarding': ['old'], 'advertised': ['old'], 'checks': 0, 'liveness': 12, 'withdrawals': 0}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': []}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'withdrawn', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 12, 'withdrawals': 1}, 'frames': [['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]], ['REJECT_PATH', [5, 6, 7, 8, 9, 10, 11]]]}]), ('empty input', 'unknown', [], []), ('unknown event', 'unknown', ['unsupported'], [{'phase': 'unknown', 'registers': {'forwarding': [], 'advertised': [], 'checks': 0, 'liveness': 5, 'withdrawals': 0}, 'frames': [['reject', [5, 6, 7, 8, 9, 10, 11]]]}])]}
for label, phase, events, expected in cases[N]:
check(label, solve(phase, events, N), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| unknown/announce | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| candidate/loop_free | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': [], 'checks': 0, 'forwarding': ['candidate'], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': [], 'checks': 0, 'forwarding': ['candidate'], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| candidate/loop_detected | [{'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'rejected', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'rejected', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| usable/withdraw | [{'frames': [], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 1}}] | [{'frames': [], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 1}}] | Passed |
| withdrawn/stale_announce | [{'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| usable/newer_announce | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': ['old'], 'checks': 1, 'forwarding': ['old'], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': ['old'], 'checks': 1, 'forwarding': ['old'], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| usable/neighbor_down | [{'frames': [], 'phase': 'unreachable', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'unreachable', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| unreachable/neighbor_up | [{'frames': [['REQUEST_ROUTES', 1]], 'phase': 'unknown', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [['REQUEST_ROUTES', 1]], 'phase': 'unknown', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| rejected/corrected_announce | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| usable/duplicate_announce | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': ['old'], 'checks': 0, 'forwarding': ['old'], 'liveness': 4, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': ['old'], 'checks': 0, 'forwarding': ['old'], 'liveness': 4, 'withdrawals': 0}}] | Passed |
| ordered trace 0 | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}, {'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'rejected', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}, {'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 2, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}, {'frames': [['REJECT_PATH', [1, 2, 3]], ['REJECT_PATH', [1, 2, 3]]], 'phase': 'rejected', 'registers': {'advertised': [], 'checks': 2, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}, {'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'rejected', 'registers': {'advertised': [], 'checks': 1, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}, {'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'candidate', 'registers': {'advertised': [], 'checks': 2, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}, {'frames': [['REJECT_PATH', [1, 2, 3]], ['REJECT_PATH', [1, 2, 3]]], 'phase': 'rejected', 'registers': {'advertised': [], 'checks': 2, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
| ordered trace 3 | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': ['old'], 'checks': 0, 'forwarding': ['old'], 'liveness': 4, 'withdrawals': 0}}, {'frames': [], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 4, 'withdrawals': 1}}, {'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 4, 'withdrawals': 1}}, {'frames': [['REJECT_PATH', [1, 2, 3]], ['REJECT_PATH', [1, 2, 3]]], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 4, 'withdrawals': 1}}] | [{'frames': [], 'phase': 'usable', 'registers': {'advertised': ['old'], 'checks': 0, 'forwarding': ['old'], 'liveness': 4, 'withdrawals': 0}}, {'frames': [], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 4, 'withdrawals': 1}}, {'frames': [['REJECT_PATH', [1, 2, 3]]], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 4, 'withdrawals': 1}}, {'frames': [['REJECT_PATH', [1, 2, 3]], ['REJECT_PATH', [1, 2, 3]]], 'phase': 'withdrawn', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 4, 'withdrawals': 1}}] | Passed |
| empty input | [] | [] | Passed |
| unknown event | [{'frames': [['reject', [1, 2, 3]]], 'phase': 'unknown', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | [{'frames': [['reject', [1, 2, 3]]], 'phase': 'unknown', 'registers': {'advertised': [], 'checks': 0, 'forwarding': [], 'liveness': 1, 'withdrawals': 0}}] | Passed |
SHA-256 / 1e07c7d18c0ebf08e8691086828dcba469e173a6155ccd80d0aad32a64831f6b
Verification & scope
Bounded offline control-plane abstraction with prescribed initial registers and classified events. Not a named protocol implementation or conformance test; excludes wire parsing, transport retries, physical execution, authentication, crash persistence, and timing. Related event faults share the full corrected controller and evaluation group. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:40:05.659430+00:00.
Case digest / ca346ca9fd9d887ae340bf88bb7b8eff7efa5a41174b5cd4a156019c9a8d9be4