FA-20041 / Protocols / Open access
Service-discovery watch lifecycle controller: idle / start watch · case 01
While idle, event start_watch produces live/publish_ready instead of snapshotting/request_listing.
ROOT CAUSE
In idle, the start watch handler runs publish ready and enters live; it must instead run request listing and enter snapshotting.
VERIFIED REPAIR
In phase idle, classify start_watch as transition to snapshotting and emit request_listing.
Unsuccessful approach: The partial repair chooses idle/request_delta, which still violates this phase-specific event contract.
Case contract
For the stipulated Service-discovery watch 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 = {'listing': ['stale'] if phase=='live' else [], 'staged': ['first'] if phase=='snapshotting' else [], 'tombstones': [], 'notifications': [], 'watch_owned': phase!='closed'}
frames = []
observed = []
table = {('idle', 'start_watch'): ('live', 'publish_ready'), ('snapshotting', 'listed_service'): ('snapshotting', 'stage_service'), ('snapshotting', 'listing_end'): ('live', 'publish_listing'), ('live', 'service_added'): ('live', 'insert_notify'), ('live', 'service_removed'): ('live', 'remove_notify'), ('live', 'watch_gap'): ('snapshotting', 'clear_request_listing'), ('live', 'lease_expired'): ('live', 'expire_notify'), ('live', 'stop_watch'): ('closed', 'release_watch'), ('closed', 'service_added'): ('closed', 'ignore_closed'), ('snapshotting', 'service_removed'): ('snapshotting', 'record_tombstone')}
for event in events:
phase, action = table.get((phase, event), (phase, "reject"))
if action == 'request_listing':
frames.append(['LIST',seed])
elif action == 'stage_service':
r['staged'].append('svc'+str(seed))
elif action == 'publish_listing':
r['listing']=[x for x in r['staged'] if x not in r['tombstones']]; r['notifications'].append(r['listing'][:])
elif action == 'insert_notify':
r['listing'].append('svc'+str(seed)); r['notifications'].append(['add','svc'+str(seed)])
elif action == 'remove_notify':
r['listing']=[]; r['notifications'].append(['remove','stale'])
elif action == 'clear_request_listing':
r['listing']=[]; r['staged']=[]; frames.append(['LIST',seed])
elif action == 'expire_notify':
r['listing']=[]; r['notifications'].append(['expired','stale'])
elif action == 'release_watch':
r['watch_owned']=False
elif action == 'ignore_closed':
frames.append(['IGNORED_CLOSED',seed])
elif action == 'record_tombstone':
r['tombstones'].append('svc'+str(seed))
elif action == 'publish_ready':
r['notifications'].append('ready')
elif action == 'request_delta':
frames.append(['DELTA',seed])
elif action == 'publish_service':
r['notifications'].append('svc'+str(seed))
elif action == 'replace_listing':
r['staged']=['svc'+str(seed)]
elif action == 'publish_last_only':
r['listing']=r['staged'][-1:]
elif action == 'replace_all':
r['listing']=['svc'+str(seed)]
elif action == 'insert_silent':
r['listing'].append('svc'+str(seed))
elif action == 'notify_without_remove':
r['notifications'].append(['remove','stale'])
elif action == 'merge_listing':
r['listing'].extend(r['staged'])
elif action == 'refresh_lease':
frames.append(['REFRESH','stale'])
elif action == 'expire_silent':
r['listing']=[]
elif action == 'publish_remove':
r['notifications'].append(['remove','svc'+str(seed)])
elif action == 'continue':
r['notifications'].append(['add','svc'+str(seed)])
else:
if action not in ("wait", "ignore", "keep", "retain", "keep_peer", "keep_offer", "keep_hold", "keep_batch", "retain_staging", "keep_staging", "keep_local_owner", "keep_old_session", "keep_address", "keep_old_expiry", "ignore_conflict", "keep_service", "keep_subscription", "retain_shadow", "keep_live", "keep_suspicion", "keep_roles", "keep_staged"):
frames.append([action, payload[:]])
observed.append(json.loads(json.dumps({"phase": phase, "registers": r, "frames": frames})))
return observed
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('idle/start_watch', 'idle', ['start_watch'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 1]]}]), ('snapshotting/listed_service', 'snapshotting', ['listed_service'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first', 'svc1'], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('snapshotting/listing_end', 'snapshotting', ['listing_end'], [{'phase': 'live', 'registers': {'listing': ['first'], 'staged': ['first'], 'tombstones': [], 'notifications': [['first']], 'watch_owned': True}, 'frames': []}]), ('live/service_added', 'live', ['service_added'], [{'phase': 'live', 'registers': {'listing': ['stale', 'svc1'], 'staged': [], 'tombstones': [], 'notifications': [['add', 'svc1']], 'watch_owned': True}, 'frames': []}]), ('live/service_removed', 'live', ['service_removed'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['remove', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/watch_gap', 'live', ['watch_gap'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 1]]}]), ('live/lease_expired', 'live', ['lease_expired'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/stop_watch', 'live', ['stop_watch'], [{'phase': 'closed', 'registers': {'listing': ['stale'], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': []}]), ('closed/service_added', 'closed', ['service_added'], [{'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 1]]}]), ('snapshotting/service_removed', 'snapshotting', ['service_removed'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first'], 'tombstones': ['svc1'], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('ordered trace 0', 'idle', ['start_watch', 'listing_end', 'watch_gap', 'listed_service'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 1]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 1]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 1], ['LIST', 1]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['svc1'], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 1], ['LIST', 1]]}]), ('ordered trace 3', 'live', ['lease_expired', 'stop_watch', 'service_added', 'service_added'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 1]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 1], ['IGNORED_CLOSED', 1]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['reject', [1, 2, 3]]]}])], 2: [('idle/start_watch', 'idle', ['start_watch'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 2]]}]), ('snapshotting/listed_service', 'snapshotting', ['listed_service'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first', 'svc2'], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('snapshotting/listing_end', 'snapshotting', ['listing_end'], [{'phase': 'live', 'registers': {'listing': ['first'], 'staged': ['first'], 'tombstones': [], 'notifications': [['first']], 'watch_owned': True}, 'frames': []}]), ('live/service_added', 'live', ['service_added'], [{'phase': 'live', 'registers': {'listing': ['stale', 'svc2'], 'staged': [], 'tombstones': [], 'notifications': [['add', 'svc2']], 'watch_owned': True}, 'frames': []}]), ('live/service_removed', 'live', ['service_removed'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['remove', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/watch_gap', 'live', ['watch_gap'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 2]]}]), ('live/lease_expired', 'live', ['lease_expired'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/stop_watch', 'live', ['stop_watch'], [{'phase': 'closed', 'registers': {'listing': ['stale'], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': []}]), ('closed/service_added', 'closed', ['service_added'], [{'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 2]]}]), ('snapshotting/service_removed', 'snapshotting', ['service_removed'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first'], 'tombstones': ['svc2'], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('ordered trace 0', 'idle', ['start_watch', 'listing_end', 'watch_gap', 'listed_service', 'listing_end'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 2]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 2]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 2], ['LIST', 2]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['svc2'], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 2], ['LIST', 2]]}, {'phase': 'live', 'registers': {'listing': ['svc2'], 'staged': ['svc2'], 'tombstones': [], 'notifications': [[], ['svc2']], 'watch_owned': True}, 'frames': [['LIST', 2], ['LIST', 2]]}]), ('ordered trace 3', 'live', ['lease_expired', 'stop_watch', 'service_added', 'service_added', 'service_added'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 2]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 2], ['IGNORED_CLOSED', 2]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 2], ['IGNORED_CLOSED', 2], ['IGNORED_CLOSED', 2]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['reject', [2, 3, 4, 5]]]}])], 3: [('idle/start_watch', 'idle', ['start_watch'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 3]]}]), ('snapshotting/listed_service', 'snapshotting', ['listed_service'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first', 'svc3'], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('snapshotting/listing_end', 'snapshotting', ['listing_end'], [{'phase': 'live', 'registers': {'listing': ['first'], 'staged': ['first'], 'tombstones': [], 'notifications': [['first']], 'watch_owned': True}, 'frames': []}]), ('live/service_added', 'live', ['service_added'], [{'phase': 'live', 'registers': {'listing': ['stale', 'svc3'], 'staged': [], 'tombstones': [], 'notifications': [['add', 'svc3']], 'watch_owned': True}, 'frames': []}]), ('live/service_removed', 'live', ['service_removed'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['remove', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/watch_gap', 'live', ['watch_gap'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 3]]}]), ('live/lease_expired', 'live', ['lease_expired'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/stop_watch', 'live', ['stop_watch'], [{'phase': 'closed', 'registers': {'listing': ['stale'], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': []}]), ('closed/service_added', 'closed', ['service_added'], [{'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 3]]}]), ('snapshotting/service_removed', 'snapshotting', ['service_removed'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first'], 'tombstones': ['svc3'], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('ordered trace 0', 'idle', ['start_watch', 'listing_end', 'watch_gap', 'listed_service', 'listing_end', 'service_added'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 3]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 3]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 3], ['LIST', 3]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['svc3'], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 3], ['LIST', 3]]}, {'phase': 'live', 'registers': {'listing': ['svc3'], 'staged': ['svc3'], 'tombstones': [], 'notifications': [[], ['svc3']], 'watch_owned': True}, 'frames': [['LIST', 3], ['LIST', 3]]}, {'phase': 'live', 'registers': {'listing': ['svc3', 'svc3'], 'staged': ['svc3'], 'tombstones': [], 'notifications': [[], ['svc3'], ['add', 'svc3']], 'watch_owned': True}, 'frames': [['LIST', 3], ['LIST', 3]]}]), ('ordered trace 3', 'live', ['lease_expired', 'stop_watch', 'service_added', 'service_added', 'service_added', 'service_added'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 3]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 3], ['IGNORED_CLOSED', 3]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 3], ['IGNORED_CLOSED', 3], ['IGNORED_CLOSED', 3]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 3], ['IGNORED_CLOSED', 3], ['IGNORED_CLOSED', 3], ['IGNORED_CLOSED', 3]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['reject', [3, 4, 5, 6, 7]]]}])], 4: [('idle/start_watch', 'idle', ['start_watch'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 4]]}]), ('snapshotting/listed_service', 'snapshotting', ['listed_service'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first', 'svc4'], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('snapshotting/listing_end', 'snapshotting', ['listing_end'], [{'phase': 'live', 'registers': {'listing': ['first'], 'staged': ['first'], 'tombstones': [], 'notifications': [['first']], 'watch_owned': True}, 'frames': []}]), ('live/service_added', 'live', ['service_added'], [{'phase': 'live', 'registers': {'listing': ['stale', 'svc4'], 'staged': [], 'tombstones': [], 'notifications': [['add', 'svc4']], 'watch_owned': True}, 'frames': []}]), ('live/service_removed', 'live', ['service_removed'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['remove', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/watch_gap', 'live', ['watch_gap'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 4]]}]), ('live/lease_expired', 'live', ['lease_expired'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/stop_watch', 'live', ['stop_watch'], [{'phase': 'closed', 'registers': {'listing': ['stale'], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': []}]), ('closed/service_added', 'closed', ['service_added'], [{'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 4]]}]), ('snapshotting/service_removed', 'snapshotting', ['service_removed'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first'], 'tombstones': ['svc4'], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('ordered trace 0', 'idle', ['start_watch', 'listing_end', 'watch_gap', 'listed_service', 'listing_end', 'service_added', 'service_removed'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 4]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 4]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 4], ['LIST', 4]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['svc4'], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 4], ['LIST', 4]]}, {'phase': 'live', 'registers': {'listing': ['svc4'], 'staged': ['svc4'], 'tombstones': [], 'notifications': [[], ['svc4']], 'watch_owned': True}, 'frames': [['LIST', 4], ['LIST', 4]]}, {'phase': 'live', 'registers': {'listing': ['svc4', 'svc4'], 'staged': ['svc4'], 'tombstones': [], 'notifications': [[], ['svc4'], ['add', 'svc4']], 'watch_owned': True}, 'frames': [['LIST', 4], ['LIST', 4]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': ['svc4'], 'tombstones': [], 'notifications': [[], ['svc4'], ['add', 'svc4'], ['remove', 'stale']], 'watch_owned': True}, 'frames': [['LIST', 4], ['LIST', 4]]}]), ('ordered trace 3', 'live', ['lease_expired', 'stop_watch', 'service_added', 'service_added', 'service_added', 'service_added', 'service_added'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 4]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['reject', [4, 5, 6, 7, 8, 9]]]}])], 5: [('idle/start_watch', 'idle', ['start_watch'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 5]]}]), ('snapshotting/listed_service', 'snapshotting', ['listed_service'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first', 'svc5'], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('snapshotting/listing_end', 'snapshotting', ['listing_end'], [{'phase': 'live', 'registers': {'listing': ['first'], 'staged': ['first'], 'tombstones': [], 'notifications': [['first']], 'watch_owned': True}, 'frames': []}]), ('live/service_added', 'live', ['service_added'], [{'phase': 'live', 'registers': {'listing': ['stale', 'svc5'], 'staged': [], 'tombstones': [], 'notifications': [['add', 'svc5']], 'watch_owned': True}, 'frames': []}]), ('live/service_removed', 'live', ['service_removed'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['remove', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/watch_gap', 'live', ['watch_gap'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 5]]}]), ('live/lease_expired', 'live', ['lease_expired'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/stop_watch', 'live', ['stop_watch'], [{'phase': 'closed', 'registers': {'listing': ['stale'], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': []}]), ('closed/service_added', 'closed', ['service_added'], [{'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5]]}]), ('snapshotting/service_removed', 'snapshotting', ['service_removed'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first'], 'tombstones': ['svc5'], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('ordered trace 0', 'idle', ['start_watch', 'listing_end', 'watch_gap', 'listed_service', 'listing_end', 'service_added', 'service_removed', 'watch_gap'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 5]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 5]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 5], ['LIST', 5]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['svc5'], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 5], ['LIST', 5]]}, {'phase': 'live', 'registers': {'listing': ['svc5'], 'staged': ['svc5'], 'tombstones': [], 'notifications': [[], ['svc5']], 'watch_owned': True}, 'frames': [['LIST', 5], ['LIST', 5]]}, {'phase': 'live', 'registers': {'listing': ['svc5', 'svc5'], 'staged': ['svc5'], 'tombstones': [], 'notifications': [[], ['svc5'], ['add', 'svc5']], 'watch_owned': True}, 'frames': [['LIST', 5], ['LIST', 5]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': ['svc5'], 'tombstones': [], 'notifications': [[], ['svc5'], ['add', 'svc5'], ['remove', 'stale']], 'watch_owned': True}, 'frames': [['LIST', 5], ['LIST', 5]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[], ['svc5'], ['add', 'svc5'], ['remove', 'stale']], 'watch_owned': True}, 'frames': [['LIST', 5], ['LIST', 5], ['LIST', 5]]}]), ('ordered trace 3', 'live', ['lease_expired', 'stop_watch', 'service_added', 'service_added', 'service_added', 'service_added', 'service_added', 'service_added'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, '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 |
|---|---|---|---|
| idle/start_watch | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': ['ready'], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | Failed |
| snapshotting/listed_service | [{'frames': [], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': ['first', 'svc1'], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': ['first', 'svc1'], 'tombstones': [], 'watch_owned': True}}] | Passed |
| snapshotting/listing_end | [{'frames': [], 'phase': 'live', 'registers': {'listing': ['first'], 'notifications': [['first']], 'staged': ['first'], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [], 'phase': 'live', 'registers': {'listing': ['first'], 'notifications': [['first']], 'staged': ['first'], 'tombstones': [], 'watch_owned': True}}] | Passed |
| live/service_added | [{'frames': [], 'phase': 'live', 'registers': {'listing': ['stale', 'svc1'], 'notifications': [['add', 'svc1']], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [], 'phase': 'live', 'registers': {'listing': ['stale', 'svc1'], 'notifications': [['add', 'svc1']], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | Passed |
| live/service_removed | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': [['remove', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': [['remove', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | Passed |
| live/watch_gap | [{'frames': [['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | Passed |
| live/lease_expired | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | Passed |
| live/stop_watch | [{'frames': [], 'phase': 'closed', 'registers': {'listing': ['stale'], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': False}}] | [{'frames': [], 'phase': 'closed', 'registers': {'listing': ['stale'], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': False}}] | Passed |
| closed/service_added | [{'frames': [['IGNORED_CLOSED', 1]], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': False}}] | [{'frames': [['IGNORED_CLOSED', 1]], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': False}}] | Passed |
| snapshotting/service_removed | [{'frames': [], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': ['first'], 'tombstones': ['svc1'], 'watch_owned': True}}] | [{'frames': [], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': ['first'], 'tombstones': ['svc1'], 'watch_owned': True}}] | Passed |
| ordered trace 0 | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': ['ready'], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [['reject', [1, 2, 3]]], 'phase': 'live', 'registers': {'listing': [], 'notifications': ['ready'], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [['reject', [1, 2, 3]], ['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': ['ready'], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [['reject', [1, 2, 3]], ['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': ['ready'], 'staged': ['svc1'], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [['LIST', 1]], 'phase': 'live', 'registers': {'listing': [], 'notifications': [[]], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [['LIST', 1], ['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [[]], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [['LIST', 1], ['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [[]], 'staged': ['svc1'], 'tombstones': [], 'watch_owned': True}}] | Failed |
| ordered trace 3 | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': False}}, {'frames': [['IGNORED_CLOSED', 1]], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': False}}, {'frames': [['IGNORED_CLOSED', 1], ['IGNORED_CLOSED', 1]], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': False}}] | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': False}}, {'frames': [['IGNORED_CLOSED', 1]], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': False}}, {'frames': [['IGNORED_CLOSED', 1], ['IGNORED_CLOSED', 1]], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': False}}] | Passed |
| empty input | [] | [] | Passed |
| unknown event | [{'frames': [['reject', [1, 2, 3]]], 'phase': 'idle', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [['reject', [1, 2, 3]]], 'phase': 'idle', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | Passed |
SHA-256 / fd7e5dd12fd26e8517f30fec5acf38e2ee72292fddf3fa976b9f947161478c17
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 = {'listing': ['stale'] if phase=='live' else [], 'staged': ['first'] if phase=='snapshotting' else [], 'tombstones': [], 'notifications': [], 'watch_owned': phase!='closed'}
frames = []
observed = []
table = {('idle', 'start_watch'): ('idle', 'request_delta'), ('snapshotting', 'listed_service'): ('snapshotting', 'stage_service'), ('snapshotting', 'listing_end'): ('live', 'publish_listing'), ('live', 'service_added'): ('live', 'insert_notify'), ('live', 'service_removed'): ('live', 'remove_notify'), ('live', 'watch_gap'): ('snapshotting', 'clear_request_listing'), ('live', 'lease_expired'): ('live', 'expire_notify'), ('live', 'stop_watch'): ('closed', 'release_watch'), ('closed', 'service_added'): ('closed', 'ignore_closed'), ('snapshotting', 'service_removed'): ('snapshotting', 'record_tombstone')}
for event in events:
phase, action = table.get((phase, event), (phase, "reject"))
if action == 'request_listing':
frames.append(['LIST',seed])
elif action == 'stage_service':
r['staged'].append('svc'+str(seed))
elif action == 'publish_listing':
r['listing']=[x for x in r['staged'] if x not in r['tombstones']]; r['notifications'].append(r['listing'][:])
elif action == 'insert_notify':
r['listing'].append('svc'+str(seed)); r['notifications'].append(['add','svc'+str(seed)])
elif action == 'remove_notify':
r['listing']=[]; r['notifications'].append(['remove','stale'])
elif action == 'clear_request_listing':
r['listing']=[]; r['staged']=[]; frames.append(['LIST',seed])
elif action == 'expire_notify':
r['listing']=[]; r['notifications'].append(['expired','stale'])
elif action == 'release_watch':
r['watch_owned']=False
elif action == 'ignore_closed':
frames.append(['IGNORED_CLOSED',seed])
elif action == 'record_tombstone':
r['tombstones'].append('svc'+str(seed))
elif action == 'publish_ready':
r['notifications'].append('ready')
elif action == 'request_delta':
frames.append(['DELTA',seed])
elif action == 'publish_service':
r['notifications'].append('svc'+str(seed))
elif action == 'replace_listing':
r['staged']=['svc'+str(seed)]
elif action == 'publish_last_only':
r['listing']=r['staged'][-1:]
elif action == 'replace_all':
r['listing']=['svc'+str(seed)]
elif action == 'insert_silent':
r['listing'].append('svc'+str(seed))
elif action == 'notify_without_remove':
r['notifications'].append(['remove','stale'])
elif action == 'merge_listing':
r['listing'].extend(r['staged'])
elif action == 'refresh_lease':
frames.append(['REFRESH','stale'])
elif action == 'expire_silent':
r['listing']=[]
elif action == 'publish_remove':
r['notifications'].append(['remove','svc'+str(seed)])
elif action == 'continue':
r['notifications'].append(['add','svc'+str(seed)])
else:
if action not in ("wait", "ignore", "keep", "retain", "keep_peer", "keep_offer", "keep_hold", "keep_batch", "retain_staging", "keep_staging", "keep_local_owner", "keep_old_session", "keep_address", "keep_old_expiry", "ignore_conflict", "keep_service", "keep_subscription", "retain_shadow", "keep_live", "keep_suspicion", "keep_roles", "keep_staged"):
frames.append([action, payload[:]])
observed.append(json.loads(json.dumps({"phase": phase, "registers": r, "frames": frames})))
return observed
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('idle/start_watch', 'idle', ['start_watch'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 1]]}]), ('snapshotting/listed_service', 'snapshotting', ['listed_service'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first', 'svc1'], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('snapshotting/listing_end', 'snapshotting', ['listing_end'], [{'phase': 'live', 'registers': {'listing': ['first'], 'staged': ['first'], 'tombstones': [], 'notifications': [['first']], 'watch_owned': True}, 'frames': []}]), ('live/service_added', 'live', ['service_added'], [{'phase': 'live', 'registers': {'listing': ['stale', 'svc1'], 'staged': [], 'tombstones': [], 'notifications': [['add', 'svc1']], 'watch_owned': True}, 'frames': []}]), ('live/service_removed', 'live', ['service_removed'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['remove', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/watch_gap', 'live', ['watch_gap'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 1]]}]), ('live/lease_expired', 'live', ['lease_expired'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/stop_watch', 'live', ['stop_watch'], [{'phase': 'closed', 'registers': {'listing': ['stale'], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': []}]), ('closed/service_added', 'closed', ['service_added'], [{'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 1]]}]), ('snapshotting/service_removed', 'snapshotting', ['service_removed'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first'], 'tombstones': ['svc1'], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('ordered trace 0', 'idle', ['start_watch', 'listing_end', 'watch_gap', 'listed_service'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 1]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 1]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 1], ['LIST', 1]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['svc1'], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 1], ['LIST', 1]]}]), ('ordered trace 3', 'live', ['lease_expired', 'stop_watch', 'service_added', 'service_added'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 1]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 1], ['IGNORED_CLOSED', 1]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['reject', [1, 2, 3]]]}])], 2: [('idle/start_watch', 'idle', ['start_watch'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 2]]}]), ('snapshotting/listed_service', 'snapshotting', ['listed_service'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first', 'svc2'], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('snapshotting/listing_end', 'snapshotting', ['listing_end'], [{'phase': 'live', 'registers': {'listing': ['first'], 'staged': ['first'], 'tombstones': [], 'notifications': [['first']], 'watch_owned': True}, 'frames': []}]), ('live/service_added', 'live', ['service_added'], [{'phase': 'live', 'registers': {'listing': ['stale', 'svc2'], 'staged': [], 'tombstones': [], 'notifications': [['add', 'svc2']], 'watch_owned': True}, 'frames': []}]), ('live/service_removed', 'live', ['service_removed'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['remove', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/watch_gap', 'live', ['watch_gap'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 2]]}]), ('live/lease_expired', 'live', ['lease_expired'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/stop_watch', 'live', ['stop_watch'], [{'phase': 'closed', 'registers': {'listing': ['stale'], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': []}]), ('closed/service_added', 'closed', ['service_added'], [{'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 2]]}]), ('snapshotting/service_removed', 'snapshotting', ['service_removed'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first'], 'tombstones': ['svc2'], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('ordered trace 0', 'idle', ['start_watch', 'listing_end', 'watch_gap', 'listed_service', 'listing_end'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 2]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 2]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 2], ['LIST', 2]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['svc2'], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 2], ['LIST', 2]]}, {'phase': 'live', 'registers': {'listing': ['svc2'], 'staged': ['svc2'], 'tombstones': [], 'notifications': [[], ['svc2']], 'watch_owned': True}, 'frames': [['LIST', 2], ['LIST', 2]]}]), ('ordered trace 3', 'live', ['lease_expired', 'stop_watch', 'service_added', 'service_added', 'service_added'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 2]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 2], ['IGNORED_CLOSED', 2]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 2], ['IGNORED_CLOSED', 2], ['IGNORED_CLOSED', 2]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['reject', [2, 3, 4, 5]]]}])], 3: [('idle/start_watch', 'idle', ['start_watch'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 3]]}]), ('snapshotting/listed_service', 'snapshotting', ['listed_service'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first', 'svc3'], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('snapshotting/listing_end', 'snapshotting', ['listing_end'], [{'phase': 'live', 'registers': {'listing': ['first'], 'staged': ['first'], 'tombstones': [], 'notifications': [['first']], 'watch_owned': True}, 'frames': []}]), ('live/service_added', 'live', ['service_added'], [{'phase': 'live', 'registers': {'listing': ['stale', 'svc3'], 'staged': [], 'tombstones': [], 'notifications': [['add', 'svc3']], 'watch_owned': True}, 'frames': []}]), ('live/service_removed', 'live', ['service_removed'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['remove', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/watch_gap', 'live', ['watch_gap'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 3]]}]), ('live/lease_expired', 'live', ['lease_expired'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/stop_watch', 'live', ['stop_watch'], [{'phase': 'closed', 'registers': {'listing': ['stale'], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': []}]), ('closed/service_added', 'closed', ['service_added'], [{'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 3]]}]), ('snapshotting/service_removed', 'snapshotting', ['service_removed'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first'], 'tombstones': ['svc3'], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('ordered trace 0', 'idle', ['start_watch', 'listing_end', 'watch_gap', 'listed_service', 'listing_end', 'service_added'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 3]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 3]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 3], ['LIST', 3]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['svc3'], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 3], ['LIST', 3]]}, {'phase': 'live', 'registers': {'listing': ['svc3'], 'staged': ['svc3'], 'tombstones': [], 'notifications': [[], ['svc3']], 'watch_owned': True}, 'frames': [['LIST', 3], ['LIST', 3]]}, {'phase': 'live', 'registers': {'listing': ['svc3', 'svc3'], 'staged': ['svc3'], 'tombstones': [], 'notifications': [[], ['svc3'], ['add', 'svc3']], 'watch_owned': True}, 'frames': [['LIST', 3], ['LIST', 3]]}]), ('ordered trace 3', 'live', ['lease_expired', 'stop_watch', 'service_added', 'service_added', 'service_added', 'service_added'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 3]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 3], ['IGNORED_CLOSED', 3]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 3], ['IGNORED_CLOSED', 3], ['IGNORED_CLOSED', 3]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 3], ['IGNORED_CLOSED', 3], ['IGNORED_CLOSED', 3], ['IGNORED_CLOSED', 3]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['reject', [3, 4, 5, 6, 7]]]}])], 4: [('idle/start_watch', 'idle', ['start_watch'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 4]]}]), ('snapshotting/listed_service', 'snapshotting', ['listed_service'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first', 'svc4'], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('snapshotting/listing_end', 'snapshotting', ['listing_end'], [{'phase': 'live', 'registers': {'listing': ['first'], 'staged': ['first'], 'tombstones': [], 'notifications': [['first']], 'watch_owned': True}, 'frames': []}]), ('live/service_added', 'live', ['service_added'], [{'phase': 'live', 'registers': {'listing': ['stale', 'svc4'], 'staged': [], 'tombstones': [], 'notifications': [['add', 'svc4']], 'watch_owned': True}, 'frames': []}]), ('live/service_removed', 'live', ['service_removed'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['remove', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/watch_gap', 'live', ['watch_gap'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 4]]}]), ('live/lease_expired', 'live', ['lease_expired'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/stop_watch', 'live', ['stop_watch'], [{'phase': 'closed', 'registers': {'listing': ['stale'], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': []}]), ('closed/service_added', 'closed', ['service_added'], [{'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 4]]}]), ('snapshotting/service_removed', 'snapshotting', ['service_removed'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first'], 'tombstones': ['svc4'], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('ordered trace 0', 'idle', ['start_watch', 'listing_end', 'watch_gap', 'listed_service', 'listing_end', 'service_added', 'service_removed'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 4]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 4]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 4], ['LIST', 4]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['svc4'], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 4], ['LIST', 4]]}, {'phase': 'live', 'registers': {'listing': ['svc4'], 'staged': ['svc4'], 'tombstones': [], 'notifications': [[], ['svc4']], 'watch_owned': True}, 'frames': [['LIST', 4], ['LIST', 4]]}, {'phase': 'live', 'registers': {'listing': ['svc4', 'svc4'], 'staged': ['svc4'], 'tombstones': [], 'notifications': [[], ['svc4'], ['add', 'svc4']], 'watch_owned': True}, 'frames': [['LIST', 4], ['LIST', 4]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': ['svc4'], 'tombstones': [], 'notifications': [[], ['svc4'], ['add', 'svc4'], ['remove', 'stale']], 'watch_owned': True}, 'frames': [['LIST', 4], ['LIST', 4]]}]), ('ordered trace 3', 'live', ['lease_expired', 'stop_watch', 'service_added', 'service_added', 'service_added', 'service_added', 'service_added'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 4]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['reject', [4, 5, 6, 7, 8, 9]]]}])], 5: [('idle/start_watch', 'idle', ['start_watch'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 5]]}]), ('snapshotting/listed_service', 'snapshotting', ['listed_service'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first', 'svc5'], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('snapshotting/listing_end', 'snapshotting', ['listing_end'], [{'phase': 'live', 'registers': {'listing': ['first'], 'staged': ['first'], 'tombstones': [], 'notifications': [['first']], 'watch_owned': True}, 'frames': []}]), ('live/service_added', 'live', ['service_added'], [{'phase': 'live', 'registers': {'listing': ['stale', 'svc5'], 'staged': [], 'tombstones': [], 'notifications': [['add', 'svc5']], 'watch_owned': True}, 'frames': []}]), ('live/service_removed', 'live', ['service_removed'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['remove', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/watch_gap', 'live', ['watch_gap'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 5]]}]), ('live/lease_expired', 'live', ['lease_expired'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/stop_watch', 'live', ['stop_watch'], [{'phase': 'closed', 'registers': {'listing': ['stale'], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': []}]), ('closed/service_added', 'closed', ['service_added'], [{'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5]]}]), ('snapshotting/service_removed', 'snapshotting', ['service_removed'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first'], 'tombstones': ['svc5'], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('ordered trace 0', 'idle', ['start_watch', 'listing_end', 'watch_gap', 'listed_service', 'listing_end', 'service_added', 'service_removed', 'watch_gap'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 5]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 5]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 5], ['LIST', 5]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['svc5'], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 5], ['LIST', 5]]}, {'phase': 'live', 'registers': {'listing': ['svc5'], 'staged': ['svc5'], 'tombstones': [], 'notifications': [[], ['svc5']], 'watch_owned': True}, 'frames': [['LIST', 5], ['LIST', 5]]}, {'phase': 'live', 'registers': {'listing': ['svc5', 'svc5'], 'staged': ['svc5'], 'tombstones': [], 'notifications': [[], ['svc5'], ['add', 'svc5']], 'watch_owned': True}, 'frames': [['LIST', 5], ['LIST', 5]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': ['svc5'], 'tombstones': [], 'notifications': [[], ['svc5'], ['add', 'svc5'], ['remove', 'stale']], 'watch_owned': True}, 'frames': [['LIST', 5], ['LIST', 5]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[], ['svc5'], ['add', 'svc5'], ['remove', 'stale']], 'watch_owned': True}, 'frames': [['LIST', 5], ['LIST', 5], ['LIST', 5]]}]), ('ordered trace 3', 'live', ['lease_expired', 'stop_watch', 'service_added', 'service_added', 'service_added', 'service_added', 'service_added', 'service_added'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, '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 |
|---|---|---|---|
| idle/start_watch | [{'frames': [['DELTA', 1]], 'phase': 'idle', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | Failed |
| snapshotting/listed_service | [{'frames': [], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': ['first', 'svc1'], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': ['first', 'svc1'], 'tombstones': [], 'watch_owned': True}}] | Passed |
| snapshotting/listing_end | [{'frames': [], 'phase': 'live', 'registers': {'listing': ['first'], 'notifications': [['first']], 'staged': ['first'], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [], 'phase': 'live', 'registers': {'listing': ['first'], 'notifications': [['first']], 'staged': ['first'], 'tombstones': [], 'watch_owned': True}}] | Passed |
| live/service_added | [{'frames': [], 'phase': 'live', 'registers': {'listing': ['stale', 'svc1'], 'notifications': [['add', 'svc1']], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [], 'phase': 'live', 'registers': {'listing': ['stale', 'svc1'], 'notifications': [['add', 'svc1']], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | Passed |
| live/service_removed | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': [['remove', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': [['remove', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | Passed |
| live/watch_gap | [{'frames': [['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | Passed |
| live/lease_expired | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | Passed |
| live/stop_watch | [{'frames': [], 'phase': 'closed', 'registers': {'listing': ['stale'], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': False}}] | [{'frames': [], 'phase': 'closed', 'registers': {'listing': ['stale'], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': False}}] | Passed |
| closed/service_added | [{'frames': [['IGNORED_CLOSED', 1]], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': False}}] | [{'frames': [['IGNORED_CLOSED', 1]], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': False}}] | Passed |
| snapshotting/service_removed | [{'frames': [], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': ['first'], 'tombstones': ['svc1'], 'watch_owned': True}}] | [{'frames': [], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': ['first'], 'tombstones': ['svc1'], 'watch_owned': True}}] | Passed |
| ordered trace 0 | [{'frames': [['DELTA', 1]], 'phase': 'idle', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [['DELTA', 1], ['reject', [1, 2, 3]]], 'phase': 'idle', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [['DELTA', 1], ['reject', [1, 2, 3]], ['reject', [1, 2, 3]]], 'phase': 'idle', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [['DELTA', 1], ['reject', [1, 2, 3]], ['reject', [1, 2, 3]], ['reject', [1, 2, 3]]], 'phase': 'idle', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [['LIST', 1]], 'phase': 'live', 'registers': {'listing': [], 'notifications': [[]], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [['LIST', 1], ['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [[]], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [['LIST', 1], ['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [[]], 'staged': ['svc1'], 'tombstones': [], 'watch_owned': True}}] | Failed |
| ordered trace 3 | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': False}}, {'frames': [['IGNORED_CLOSED', 1]], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': False}}, {'frames': [['IGNORED_CLOSED', 1], ['IGNORED_CLOSED', 1]], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': False}}] | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': False}}, {'frames': [['IGNORED_CLOSED', 1]], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': False}}, {'frames': [['IGNORED_CLOSED', 1], ['IGNORED_CLOSED', 1]], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': False}}] | Passed |
| empty input | [] | [] | Passed |
| unknown event | [{'frames': [['reject', [1, 2, 3]]], 'phase': 'idle', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [['reject', [1, 2, 3]]], 'phase': 'idle', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | Passed |
SHA-256 / 1c9542fc3d1e8c7625a3c58edb4083afe5c87c44f807f96a10169650e7d26988
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 = {'listing': ['stale'] if phase=='live' else [], 'staged': ['first'] if phase=='snapshotting' else [], 'tombstones': [], 'notifications': [], 'watch_owned': phase!='closed'}
frames = []
observed = []
table = {('idle', 'start_watch'): ('snapshotting', 'request_listing'), ('snapshotting', 'listed_service'): ('snapshotting', 'stage_service'), ('snapshotting', 'listing_end'): ('live', 'publish_listing'), ('live', 'service_added'): ('live', 'insert_notify'), ('live', 'service_removed'): ('live', 'remove_notify'), ('live', 'watch_gap'): ('snapshotting', 'clear_request_listing'), ('live', 'lease_expired'): ('live', 'expire_notify'), ('live', 'stop_watch'): ('closed', 'release_watch'), ('closed', 'service_added'): ('closed', 'ignore_closed'), ('snapshotting', 'service_removed'): ('snapshotting', 'record_tombstone')}
for event in events:
phase, action = table.get((phase, event), (phase, "reject"))
if action == 'request_listing':
frames.append(['LIST',seed])
elif action == 'stage_service':
r['staged'].append('svc'+str(seed))
elif action == 'publish_listing':
r['listing']=[x for x in r['staged'] if x not in r['tombstones']]; r['notifications'].append(r['listing'][:])
elif action == 'insert_notify':
r['listing'].append('svc'+str(seed)); r['notifications'].append(['add','svc'+str(seed)])
elif action == 'remove_notify':
r['listing']=[]; r['notifications'].append(['remove','stale'])
elif action == 'clear_request_listing':
r['listing']=[]; r['staged']=[]; frames.append(['LIST',seed])
elif action == 'expire_notify':
r['listing']=[]; r['notifications'].append(['expired','stale'])
elif action == 'release_watch':
r['watch_owned']=False
elif action == 'ignore_closed':
frames.append(['IGNORED_CLOSED',seed])
elif action == 'record_tombstone':
r['tombstones'].append('svc'+str(seed))
elif action == 'publish_ready':
r['notifications'].append('ready')
elif action == 'request_delta':
frames.append(['DELTA',seed])
elif action == 'publish_service':
r['notifications'].append('svc'+str(seed))
elif action == 'replace_listing':
r['staged']=['svc'+str(seed)]
elif action == 'publish_last_only':
r['listing']=r['staged'][-1:]
elif action == 'replace_all':
r['listing']=['svc'+str(seed)]
elif action == 'insert_silent':
r['listing'].append('svc'+str(seed))
elif action == 'notify_without_remove':
r['notifications'].append(['remove','stale'])
elif action == 'merge_listing':
r['listing'].extend(r['staged'])
elif action == 'refresh_lease':
frames.append(['REFRESH','stale'])
elif action == 'expire_silent':
r['listing']=[]
elif action == 'publish_remove':
r['notifications'].append(['remove','svc'+str(seed)])
elif action == 'continue':
r['notifications'].append(['add','svc'+str(seed)])
else:
if action not in ("wait", "ignore", "keep", "retain", "keep_peer", "keep_offer", "keep_hold", "keep_batch", "retain_staging", "keep_staging", "keep_local_owner", "keep_old_session", "keep_address", "keep_old_expiry", "ignore_conflict", "keep_service", "keep_subscription", "retain_shadow", "keep_live", "keep_suspicion", "keep_roles", "keep_staged"):
frames.append([action, payload[:]])
observed.append(json.loads(json.dumps({"phase": phase, "registers": r, "frames": frames})))
return observed
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('idle/start_watch', 'idle', ['start_watch'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 1]]}]), ('snapshotting/listed_service', 'snapshotting', ['listed_service'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first', 'svc1'], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('snapshotting/listing_end', 'snapshotting', ['listing_end'], [{'phase': 'live', 'registers': {'listing': ['first'], 'staged': ['first'], 'tombstones': [], 'notifications': [['first']], 'watch_owned': True}, 'frames': []}]), ('live/service_added', 'live', ['service_added'], [{'phase': 'live', 'registers': {'listing': ['stale', 'svc1'], 'staged': [], 'tombstones': [], 'notifications': [['add', 'svc1']], 'watch_owned': True}, 'frames': []}]), ('live/service_removed', 'live', ['service_removed'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['remove', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/watch_gap', 'live', ['watch_gap'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 1]]}]), ('live/lease_expired', 'live', ['lease_expired'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/stop_watch', 'live', ['stop_watch'], [{'phase': 'closed', 'registers': {'listing': ['stale'], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': []}]), ('closed/service_added', 'closed', ['service_added'], [{'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 1]]}]), ('snapshotting/service_removed', 'snapshotting', ['service_removed'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first'], 'tombstones': ['svc1'], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('ordered trace 0', 'idle', ['start_watch', 'listing_end', 'watch_gap', 'listed_service'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 1]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 1]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 1], ['LIST', 1]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['svc1'], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 1], ['LIST', 1]]}]), ('ordered trace 3', 'live', ['lease_expired', 'stop_watch', 'service_added', 'service_added'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 1]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 1], ['IGNORED_CLOSED', 1]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['reject', [1, 2, 3]]]}])], 2: [('idle/start_watch', 'idle', ['start_watch'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 2]]}]), ('snapshotting/listed_service', 'snapshotting', ['listed_service'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first', 'svc2'], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('snapshotting/listing_end', 'snapshotting', ['listing_end'], [{'phase': 'live', 'registers': {'listing': ['first'], 'staged': ['first'], 'tombstones': [], 'notifications': [['first']], 'watch_owned': True}, 'frames': []}]), ('live/service_added', 'live', ['service_added'], [{'phase': 'live', 'registers': {'listing': ['stale', 'svc2'], 'staged': [], 'tombstones': [], 'notifications': [['add', 'svc2']], 'watch_owned': True}, 'frames': []}]), ('live/service_removed', 'live', ['service_removed'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['remove', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/watch_gap', 'live', ['watch_gap'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 2]]}]), ('live/lease_expired', 'live', ['lease_expired'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/stop_watch', 'live', ['stop_watch'], [{'phase': 'closed', 'registers': {'listing': ['stale'], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': []}]), ('closed/service_added', 'closed', ['service_added'], [{'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 2]]}]), ('snapshotting/service_removed', 'snapshotting', ['service_removed'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first'], 'tombstones': ['svc2'], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('ordered trace 0', 'idle', ['start_watch', 'listing_end', 'watch_gap', 'listed_service', 'listing_end'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 2]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 2]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 2], ['LIST', 2]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['svc2'], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 2], ['LIST', 2]]}, {'phase': 'live', 'registers': {'listing': ['svc2'], 'staged': ['svc2'], 'tombstones': [], 'notifications': [[], ['svc2']], 'watch_owned': True}, 'frames': [['LIST', 2], ['LIST', 2]]}]), ('ordered trace 3', 'live', ['lease_expired', 'stop_watch', 'service_added', 'service_added', 'service_added'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 2]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 2], ['IGNORED_CLOSED', 2]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 2], ['IGNORED_CLOSED', 2], ['IGNORED_CLOSED', 2]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['reject', [2, 3, 4, 5]]]}])], 3: [('idle/start_watch', 'idle', ['start_watch'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 3]]}]), ('snapshotting/listed_service', 'snapshotting', ['listed_service'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first', 'svc3'], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('snapshotting/listing_end', 'snapshotting', ['listing_end'], [{'phase': 'live', 'registers': {'listing': ['first'], 'staged': ['first'], 'tombstones': [], 'notifications': [['first']], 'watch_owned': True}, 'frames': []}]), ('live/service_added', 'live', ['service_added'], [{'phase': 'live', 'registers': {'listing': ['stale', 'svc3'], 'staged': [], 'tombstones': [], 'notifications': [['add', 'svc3']], 'watch_owned': True}, 'frames': []}]), ('live/service_removed', 'live', ['service_removed'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['remove', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/watch_gap', 'live', ['watch_gap'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 3]]}]), ('live/lease_expired', 'live', ['lease_expired'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/stop_watch', 'live', ['stop_watch'], [{'phase': 'closed', 'registers': {'listing': ['stale'], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': []}]), ('closed/service_added', 'closed', ['service_added'], [{'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 3]]}]), ('snapshotting/service_removed', 'snapshotting', ['service_removed'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first'], 'tombstones': ['svc3'], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('ordered trace 0', 'idle', ['start_watch', 'listing_end', 'watch_gap', 'listed_service', 'listing_end', 'service_added'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 3]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 3]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 3], ['LIST', 3]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['svc3'], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 3], ['LIST', 3]]}, {'phase': 'live', 'registers': {'listing': ['svc3'], 'staged': ['svc3'], 'tombstones': [], 'notifications': [[], ['svc3']], 'watch_owned': True}, 'frames': [['LIST', 3], ['LIST', 3]]}, {'phase': 'live', 'registers': {'listing': ['svc3', 'svc3'], 'staged': ['svc3'], 'tombstones': [], 'notifications': [[], ['svc3'], ['add', 'svc3']], 'watch_owned': True}, 'frames': [['LIST', 3], ['LIST', 3]]}]), ('ordered trace 3', 'live', ['lease_expired', 'stop_watch', 'service_added', 'service_added', 'service_added', 'service_added'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 3]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 3], ['IGNORED_CLOSED', 3]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 3], ['IGNORED_CLOSED', 3], ['IGNORED_CLOSED', 3]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 3], ['IGNORED_CLOSED', 3], ['IGNORED_CLOSED', 3], ['IGNORED_CLOSED', 3]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['reject', [3, 4, 5, 6, 7]]]}])], 4: [('idle/start_watch', 'idle', ['start_watch'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 4]]}]), ('snapshotting/listed_service', 'snapshotting', ['listed_service'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first', 'svc4'], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('snapshotting/listing_end', 'snapshotting', ['listing_end'], [{'phase': 'live', 'registers': {'listing': ['first'], 'staged': ['first'], 'tombstones': [], 'notifications': [['first']], 'watch_owned': True}, 'frames': []}]), ('live/service_added', 'live', ['service_added'], [{'phase': 'live', 'registers': {'listing': ['stale', 'svc4'], 'staged': [], 'tombstones': [], 'notifications': [['add', 'svc4']], 'watch_owned': True}, 'frames': []}]), ('live/service_removed', 'live', ['service_removed'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['remove', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/watch_gap', 'live', ['watch_gap'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 4]]}]), ('live/lease_expired', 'live', ['lease_expired'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/stop_watch', 'live', ['stop_watch'], [{'phase': 'closed', 'registers': {'listing': ['stale'], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': []}]), ('closed/service_added', 'closed', ['service_added'], [{'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 4]]}]), ('snapshotting/service_removed', 'snapshotting', ['service_removed'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first'], 'tombstones': ['svc4'], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('ordered trace 0', 'idle', ['start_watch', 'listing_end', 'watch_gap', 'listed_service', 'listing_end', 'service_added', 'service_removed'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 4]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 4]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 4], ['LIST', 4]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['svc4'], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 4], ['LIST', 4]]}, {'phase': 'live', 'registers': {'listing': ['svc4'], 'staged': ['svc4'], 'tombstones': [], 'notifications': [[], ['svc4']], 'watch_owned': True}, 'frames': [['LIST', 4], ['LIST', 4]]}, {'phase': 'live', 'registers': {'listing': ['svc4', 'svc4'], 'staged': ['svc4'], 'tombstones': [], 'notifications': [[], ['svc4'], ['add', 'svc4']], 'watch_owned': True}, 'frames': [['LIST', 4], ['LIST', 4]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': ['svc4'], 'tombstones': [], 'notifications': [[], ['svc4'], ['add', 'svc4'], ['remove', 'stale']], 'watch_owned': True}, 'frames': [['LIST', 4], ['LIST', 4]]}]), ('ordered trace 3', 'live', ['lease_expired', 'stop_watch', 'service_added', 'service_added', 'service_added', 'service_added', 'service_added'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 4]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4], ['IGNORED_CLOSED', 4]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['reject', [4, 5, 6, 7, 8, 9]]]}])], 5: [('idle/start_watch', 'idle', ['start_watch'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 5]]}]), ('snapshotting/listed_service', 'snapshotting', ['listed_service'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first', 'svc5'], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('snapshotting/listing_end', 'snapshotting', ['listing_end'], [{'phase': 'live', 'registers': {'listing': ['first'], 'staged': ['first'], 'tombstones': [], 'notifications': [['first']], 'watch_owned': True}, 'frames': []}]), ('live/service_added', 'live', ['service_added'], [{'phase': 'live', 'registers': {'listing': ['stale', 'svc5'], 'staged': [], 'tombstones': [], 'notifications': [['add', 'svc5']], 'watch_owned': True}, 'frames': []}]), ('live/service_removed', 'live', ['service_removed'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['remove', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/watch_gap', 'live', ['watch_gap'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 5]]}]), ('live/lease_expired', 'live', ['lease_expired'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}]), ('live/stop_watch', 'live', ['stop_watch'], [{'phase': 'closed', 'registers': {'listing': ['stale'], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': []}]), ('closed/service_added', 'closed', ['service_added'], [{'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5]]}]), ('snapshotting/service_removed', 'snapshotting', ['service_removed'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['first'], 'tombstones': ['svc5'], 'notifications': [], 'watch_owned': True}, 'frames': []}]), ('ordered trace 0', 'idle', ['start_watch', 'listing_end', 'watch_gap', 'listed_service', 'listing_end', 'service_added', 'service_removed', 'watch_gap'], [{'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, 'frames': [['LIST', 5]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 5]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 5], ['LIST', 5]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': ['svc5'], 'tombstones': [], 'notifications': [[]], 'watch_owned': True}, 'frames': [['LIST', 5], ['LIST', 5]]}, {'phase': 'live', 'registers': {'listing': ['svc5'], 'staged': ['svc5'], 'tombstones': [], 'notifications': [[], ['svc5']], 'watch_owned': True}, 'frames': [['LIST', 5], ['LIST', 5]]}, {'phase': 'live', 'registers': {'listing': ['svc5', 'svc5'], 'staged': ['svc5'], 'tombstones': [], 'notifications': [[], ['svc5'], ['add', 'svc5']], 'watch_owned': True}, 'frames': [['LIST', 5], ['LIST', 5]]}, {'phase': 'live', 'registers': {'listing': [], 'staged': ['svc5'], 'tombstones': [], 'notifications': [[], ['svc5'], ['add', 'svc5'], ['remove', 'stale']], 'watch_owned': True}, 'frames': [['LIST', 5], ['LIST', 5]]}, {'phase': 'snapshotting', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [[], ['svc5'], ['add', 'svc5'], ['remove', 'stale']], 'watch_owned': True}, 'frames': [['LIST', 5], ['LIST', 5], ['LIST', 5]]}]), ('ordered trace 3', 'live', ['lease_expired', 'stop_watch', 'service_added', 'service_added', 'service_added', 'service_added', 'service_added', 'service_added'], [{'phase': 'live', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': True}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': []}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5]]}, {'phase': 'closed', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [['expired', 'stale']], 'watch_owned': False}, 'frames': [['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5], ['IGNORED_CLOSED', 5]]}]), ('empty input', 'idle', [], []), ('unknown event', 'idle', ['unsupported'], [{'phase': 'idle', 'registers': {'listing': [], 'staged': [], 'tombstones': [], 'notifications': [], 'watch_owned': True}, '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 |
|---|---|---|---|
| idle/start_watch | [{'frames': [['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | Passed |
| snapshotting/listed_service | [{'frames': [], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': ['first', 'svc1'], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': ['first', 'svc1'], 'tombstones': [], 'watch_owned': True}}] | Passed |
| snapshotting/listing_end | [{'frames': [], 'phase': 'live', 'registers': {'listing': ['first'], 'notifications': [['first']], 'staged': ['first'], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [], 'phase': 'live', 'registers': {'listing': ['first'], 'notifications': [['first']], 'staged': ['first'], 'tombstones': [], 'watch_owned': True}}] | Passed |
| live/service_added | [{'frames': [], 'phase': 'live', 'registers': {'listing': ['stale', 'svc1'], 'notifications': [['add', 'svc1']], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [], 'phase': 'live', 'registers': {'listing': ['stale', 'svc1'], 'notifications': [['add', 'svc1']], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | Passed |
| live/service_removed | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': [['remove', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': [['remove', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | Passed |
| live/watch_gap | [{'frames': [['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | Passed |
| live/lease_expired | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | Passed |
| live/stop_watch | [{'frames': [], 'phase': 'closed', 'registers': {'listing': ['stale'], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': False}}] | [{'frames': [], 'phase': 'closed', 'registers': {'listing': ['stale'], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': False}}] | Passed |
| closed/service_added | [{'frames': [['IGNORED_CLOSED', 1]], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': False}}] | [{'frames': [['IGNORED_CLOSED', 1]], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': False}}] | Passed |
| snapshotting/service_removed | [{'frames': [], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': ['first'], 'tombstones': ['svc1'], 'watch_owned': True}}] | [{'frames': [], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': ['first'], 'tombstones': ['svc1'], 'watch_owned': True}}] | Passed |
| ordered trace 0 | [{'frames': [['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [['LIST', 1]], 'phase': 'live', 'registers': {'listing': [], 'notifications': [[]], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [['LIST', 1], ['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [[]], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [['LIST', 1], ['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [[]], 'staged': ['svc1'], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [['LIST', 1]], 'phase': 'live', 'registers': {'listing': [], 'notifications': [[]], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [['LIST', 1], ['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [[]], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [['LIST', 1], ['LIST', 1]], 'phase': 'snapshotting', 'registers': {'listing': [], 'notifications': [[]], 'staged': ['svc1'], 'tombstones': [], 'watch_owned': True}}] | Passed |
| ordered trace 3 | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': False}}, {'frames': [['IGNORED_CLOSED', 1]], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': False}}, {'frames': [['IGNORED_CLOSED', 1], ['IGNORED_CLOSED', 1]], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': False}}] | [{'frames': [], 'phase': 'live', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': True}}, {'frames': [], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': False}}, {'frames': [['IGNORED_CLOSED', 1]], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': False}}, {'frames': [['IGNORED_CLOSED', 1], ['IGNORED_CLOSED', 1]], 'phase': 'closed', 'registers': {'listing': [], 'notifications': [['expired', 'stale']], 'staged': [], 'tombstones': [], 'watch_owned': False}}] | Passed |
| empty input | [] | [] | Passed |
| unknown event | [{'frames': [['reject', [1, 2, 3]]], 'phase': 'idle', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | [{'frames': [['reject', [1, 2, 3]]], 'phase': 'idle', 'registers': {'listing': [], 'notifications': [], 'staged': [], 'tombstones': [], 'watch_owned': True}}] | Passed |
SHA-256 / 73709e39133d8608e3f2143b00a9df5246b7da7f42e49a4d28b73cbddbbd60bd
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:14.706438+00:00.
Case digest / 0f7c056c38621ea939cd95c2743d783052e3b7c2cf2193ee87d8bf1c066e27c7