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

N = 1
observations = []
def solve(initial, events, generation, payload=None, observe=None):
    table = {('individuals-visible', 'burst-detected'): 'condensing', ('condensing', 'summary-mounted'): 'summary-visible', ('condensing', 'summary-mount-failed'): 'summary-visible', ('summary-visible', 'inspect-burst'): 'expanding-details', ('expanding-details', 'details-mounted'): 'details-visible', ('details-visible', 'collapse-details'): 'summary-visible', ('summary-visible', 'new-burst-item'): 'summary-updating', ('summary-updating', 'summary-update-mounted'): 'summary-visible', ('expanding-details', 'close-before-mount'): 'closing-details', ('closing-details', 'late-details-mounted'): 'summary-visible'}
    data = json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})) if payload is None else {**json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})), **json.loads(json.dumps(payload))}
    state = initial
    for delivery in events:
        event, event_generation = delivery[:2]
        arg = delivery[2] if len(delivery) > 2 else {}
        if event_generation == generation:
            previous = state
            if event in ('summary-mounted','details-mounted','late-details-mounted','summary-update-mounted') and arg.get('mount',data['mount']) != data['mount']: event = 'unknown-event'
            if event == 'new-burst-item' and arg.get('item','c') not in data['items']: data['items'].append(arg.get('item','c'))
            state = table.get((state, event), state)
            if state == 'summary-visible':
                data['summary_members'] = data['items'][:]
                data['detail_members'] = []
            if state == 'details-visible': data['detail_members'] = data['items'][:]
            if state == 'empty': data['summary_members'] = []; data['detail_members'] = []
    return {'phase': state, 'value': data[observe]} if observe else state
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('individuals-visible / burst-detected', solve('individuals-visible', [('burst-detected', N)], N), 'condensing')
check('condensing / summary-mounted', solve('condensing', [('summary-mounted', N)], N), 'summary-visible')
check('condensing / summary-mount-failed', solve('condensing', [('summary-mount-failed', N)], N), 'individuals-visible')
check('summary-visible / inspect-burst', solve('summary-visible', [('inspect-burst', N)], N), 'expanding-details')
check('expanding-details / details-mounted', solve('expanding-details', [('details-mounted', N)], N), 'details-visible')
check('details-visible / collapse-details', solve('details-visible', [('collapse-details', N)], N), 'summary-visible')
check('summary-visible / new-burst-item', solve('summary-visible', [('new-burst-item', N)], N), 'summary-updating')
check('summary-updating / summary-update-mounted', solve('summary-updating', [('summary-update-mounted', N)], N), 'summary-visible')
check('expanding-details / close-before-mount', solve('expanding-details', [('close-before-mount', N)], N), 'closing-details')
check('closing-details / late-details-mounted', solve('closing-details', [('late-details-mounted', N)], N), 'summary-visible')
check('older notification incarnation', solve('individuals-visible', [('burst-detected', N - 1)], N), 'individuals-visible')
check('future notification incarnation', solve('individuals-visible', [('burst-detected', N + 1)], N), 'individuals-visible')
check('unknown event is inert', solve('individuals-visible', [('unknown-event', N)], N), 'individuals-visible')
check('empty delivery batch', solve('individuals-visible', [], N), 'individuals-visible')
check('N stale deliveries before current delivery', solve('individuals-visible', [('burst-detected', N - 1)] * N + [('burst-detected', N)], N), 'condensing')
check('trace burst-detected then summary-mounted', solve('individuals-visible', [('burst-detected', N), ('summary-mounted', N)], N), 'summary-visible')
check('trace burst-detected then summary-mount-failed', solve('individuals-visible', [('burst-detected', N), ('summary-mount-failed', N)], N), 'individuals-visible')
check('trace summary-mounted then inspect-burst', solve('condensing', [('summary-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-mounted then new-burst-item', solve('condensing', [('summary-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace summary-mount-failed then burst-detected', solve('condensing', [('summary-mount-failed', N), ('burst-detected', N)], N), 'condensing')
check('trace inspect-burst then details-mounted', solve('summary-visible', [('inspect-burst', N), ('details-mounted', N)], N), 'details-visible')
check('trace inspect-burst then close-before-mount', solve('summary-visible', [('inspect-burst', N), ('close-before-mount', N)], N), 'closing-details')
check('trace details-mounted then collapse-details', solve('expanding-details', [('details-mounted', N), ('collapse-details', N)], N), 'summary-visible')
check('trace collapse-details then inspect-burst', solve('details-visible', [('collapse-details', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace collapse-details then new-burst-item', solve('details-visible', [('collapse-details', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace new-burst-item then summary-update-mounted', solve('summary-visible', [('new-burst-item', N), ('summary-update-mounted', N)], N), 'summary-visible')
check('trace summary-update-mounted then inspect-burst', solve('summary-updating', [('summary-update-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-update-mounted then new-burst-item', solve('summary-updating', [('summary-update-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace close-before-mount then late-details-mounted', solve('expanding-details', [('close-before-mount', N), ('late-details-mounted', N)], N), 'summary-visible')
check('trace late-details-mounted then inspect-burst', solve('closing-details', [('late-details-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace late-details-mounted then new-burst-item', solve('closing-details', [('late-details-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('domain state regression 1: summary_members', solve('condensing', [('summary-mounted', N, {'mount': 2})], N, {}, 'summary_members'), {'phase': 'condensing', 'value': []})
check('domain state regression 2: summary_members', solve('condensing', [('summary-mounted', N, {})], N, {}, 'summary_members'), {'phase': 'summary-visible', 'value': ['a', 'b']})
check('domain state regression 3: items', solve('summary-visible', [('new-burst-item', N, {'item': 'a'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b']})
check('domain state regression 4: items', solve('summary-visible', [('new-burst-item', N, {'item': 'c'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b', 'c']})
check('domain state regression 5: detail_members', solve('expanding-details', [('details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'details-visible', 'value': ['a', 'b']})
check('domain state regression 6: detail_members', solve('closing-details', [('late-details-mounted', N, {})], N, {'detail_members': ['a', 'b']}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
check('domain state regression 7: detail_members', solve('summary-visible', [('inspect-burst', N, {}), ('close-before-mount', N, {}), ('late-details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(initial, events, generation, payload=None, observe=None):
    table = {('individuals-visible', 'burst-detected'): 'condensing', ('condensing', 'summary-mounted'): 'summary-visible', ('condensing', 'summary-mount-failed'): 'empty', ('summary-visible', 'inspect-burst'): 'expanding-details', ('expanding-details', 'details-mounted'): 'details-visible', ('details-visible', 'collapse-details'): 'summary-visible', ('summary-visible', 'new-burst-item'): 'summary-updating', ('summary-updating', 'summary-update-mounted'): 'summary-visible', ('expanding-details', 'close-before-mount'): 'closing-details', ('closing-details', 'late-details-mounted'): 'summary-visible'}
    data = json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})) if payload is None else {**json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})), **json.loads(json.dumps(payload))}
    state = initial
    for delivery in events:
        event, event_generation = delivery[:2]
        arg = delivery[2] if len(delivery) > 2 else {}
        if event_generation == generation:
            previous = state
            if event in ('summary-mounted','details-mounted','late-details-mounted','summary-update-mounted') and arg.get('mount',data['mount']) != data['mount']: event = 'unknown-event'
            if event == 'new-burst-item' and arg.get('item','c') not in data['items']: data['items'].append(arg.get('item','c'))
            state = table.get((state, event), state)
            if state == 'summary-visible':
                data['summary_members'] = data['items'][:]
                data['detail_members'] = []
            if state == 'details-visible': data['detail_members'] = data['items'][:]
            if state == 'empty': data['summary_members'] = []; data['detail_members'] = []
    return {'phase': state, 'value': data[observe]} if observe else state
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('individuals-visible / burst-detected', solve('individuals-visible', [('burst-detected', N)], N), 'condensing')
check('condensing / summary-mounted', solve('condensing', [('summary-mounted', N)], N), 'summary-visible')
check('condensing / summary-mount-failed', solve('condensing', [('summary-mount-failed', N)], N), 'individuals-visible')
check('summary-visible / inspect-burst', solve('summary-visible', [('inspect-burst', N)], N), 'expanding-details')
check('expanding-details / details-mounted', solve('expanding-details', [('details-mounted', N)], N), 'details-visible')
check('details-visible / collapse-details', solve('details-visible', [('collapse-details', N)], N), 'summary-visible')
check('summary-visible / new-burst-item', solve('summary-visible', [('new-burst-item', N)], N), 'summary-updating')
check('summary-updating / summary-update-mounted', solve('summary-updating', [('summary-update-mounted', N)], N), 'summary-visible')
check('expanding-details / close-before-mount', solve('expanding-details', [('close-before-mount', N)], N), 'closing-details')
check('closing-details / late-details-mounted', solve('closing-details', [('late-details-mounted', N)], N), 'summary-visible')
check('older notification incarnation', solve('individuals-visible', [('burst-detected', N - 1)], N), 'individuals-visible')
check('future notification incarnation', solve('individuals-visible', [('burst-detected', N + 1)], N), 'individuals-visible')
check('unknown event is inert', solve('individuals-visible', [('unknown-event', N)], N), 'individuals-visible')
check('empty delivery batch', solve('individuals-visible', [], N), 'individuals-visible')
check('N stale deliveries before current delivery', solve('individuals-visible', [('burst-detected', N - 1)] * N + [('burst-detected', N)], N), 'condensing')
check('trace burst-detected then summary-mounted', solve('individuals-visible', [('burst-detected', N), ('summary-mounted', N)], N), 'summary-visible')
check('trace burst-detected then summary-mount-failed', solve('individuals-visible', [('burst-detected', N), ('summary-mount-failed', N)], N), 'individuals-visible')
check('trace summary-mounted then inspect-burst', solve('condensing', [('summary-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-mounted then new-burst-item', solve('condensing', [('summary-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace summary-mount-failed then burst-detected', solve('condensing', [('summary-mount-failed', N), ('burst-detected', N)], N), 'condensing')
check('trace inspect-burst then details-mounted', solve('summary-visible', [('inspect-burst', N), ('details-mounted', N)], N), 'details-visible')
check('trace inspect-burst then close-before-mount', solve('summary-visible', [('inspect-burst', N), ('close-before-mount', N)], N), 'closing-details')
check('trace details-mounted then collapse-details', solve('expanding-details', [('details-mounted', N), ('collapse-details', N)], N), 'summary-visible')
check('trace collapse-details then inspect-burst', solve('details-visible', [('collapse-details', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace collapse-details then new-burst-item', solve('details-visible', [('collapse-details', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace new-burst-item then summary-update-mounted', solve('summary-visible', [('new-burst-item', N), ('summary-update-mounted', N)], N), 'summary-visible')
check('trace summary-update-mounted then inspect-burst', solve('summary-updating', [('summary-update-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-update-mounted then new-burst-item', solve('summary-updating', [('summary-update-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace close-before-mount then late-details-mounted', solve('expanding-details', [('close-before-mount', N), ('late-details-mounted', N)], N), 'summary-visible')
check('trace late-details-mounted then inspect-burst', solve('closing-details', [('late-details-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace late-details-mounted then new-burst-item', solve('closing-details', [('late-details-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('domain state regression 1: summary_members', solve('condensing', [('summary-mounted', N, {'mount': 2})], N, {}, 'summary_members'), {'phase': 'condensing', 'value': []})
check('domain state regression 2: summary_members', solve('condensing', [('summary-mounted', N, {})], N, {}, 'summary_members'), {'phase': 'summary-visible', 'value': ['a', 'b']})
check('domain state regression 3: items', solve('summary-visible', [('new-burst-item', N, {'item': 'a'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b']})
check('domain state regression 4: items', solve('summary-visible', [('new-burst-item', N, {'item': 'c'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b', 'c']})
check('domain state regression 5: detail_members', solve('expanding-details', [('details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'details-visible', 'value': ['a', 'b']})
check('domain state regression 6: detail_members', solve('closing-details', [('late-details-mounted', N, {})], N, {'detail_members': ['a', 'b']}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
check('domain state regression 7: detail_members', solve('summary-visible', [('inspect-burst', N, {}), ('close-before-mount', N, {}), ('late-details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The summary-mount-failed event leaves a notification in summary-visible instead of individuals-visible.

Notification burst summary interaction is a bounded visual-notification workflow with mutable policy state {'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3}. Its default transition relation is {('individuals-visible', 'burst-detected'): 'condensing', ('condensing', 'summary-mounted'): 'summary-visible', ('condensing', 'summary-mount-failed'): 'individuals-visible', ('summary-visible', 'inspect-burst'): 'expanding-details', ('expanding-details', 'details-mounted'): 'details-visible', ('details-visible', 'collapse-details'): 'summary-visible', ('summary-visible', 'new-burst-item'): 'summary-updating', ('summary-updating', 'summary-update-mounted'): 'summary-visible', ('expanding-details', 'close-before-mount'): 'closing-details', ('closing-details', 'late-details-mounted'): 'summary-visible'}; domain inputs can suppress or redirect transitions and update policy fields, as specified in solve. Different-generation events are inert. Batches apply in order. Optional observe returns the selected policy field alongside the phase.

split: open-access


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

N = 1
observations = []
def solve(initial, events, generation, payload=None, observe=None):
    table = {('individuals-visible', 'burst-detected'): 'condensing', ('condensing', 'summary-mounted'): 'summary-visible', ('condensing', 'summary-mount-failed'): 'individuals-visible', ('summary-visible', 'inspect-burst'): 'details-visible', ('expanding-details', 'details-mounted'): 'details-visible', ('details-visible', 'collapse-details'): 'summary-visible', ('summary-visible', 'new-burst-item'): 'summary-updating', ('summary-updating', 'summary-update-mounted'): 'summary-visible', ('expanding-details', 'close-before-mount'): 'closing-details', ('closing-details', 'late-details-mounted'): 'summary-visible'}
    data = json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})) if payload is None else {**json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})), **json.loads(json.dumps(payload))}
    state = initial
    for delivery in events:
        event, event_generation = delivery[:2]
        arg = delivery[2] if len(delivery) > 2 else {}
        if event_generation == generation:
            previous = state
            if event in ('summary-mounted','details-mounted','late-details-mounted','summary-update-mounted') and arg.get('mount',data['mount']) != data['mount']: event = 'unknown-event'
            if event == 'new-burst-item' and arg.get('item','c') not in data['items']: data['items'].append(arg.get('item','c'))
            state = table.get((state, event), state)
            if state == 'summary-visible':
                data['summary_members'] = data['items'][:]
                data['detail_members'] = []
            if state == 'details-visible': data['detail_members'] = data['items'][:]
            if state == 'empty': data['summary_members'] = []; data['detail_members'] = []
    return {'phase': state, 'value': data[observe]} if observe else state
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('individuals-visible / burst-detected', solve('individuals-visible', [('burst-detected', N)], N), 'condensing')
check('condensing / summary-mounted', solve('condensing', [('summary-mounted', N)], N), 'summary-visible')
check('condensing / summary-mount-failed', solve('condensing', [('summary-mount-failed', N)], N), 'individuals-visible')
check('summary-visible / inspect-burst', solve('summary-visible', [('inspect-burst', N)], N), 'expanding-details')
check('expanding-details / details-mounted', solve('expanding-details', [('details-mounted', N)], N), 'details-visible')
check('details-visible / collapse-details', solve('details-visible', [('collapse-details', N)], N), 'summary-visible')
check('summary-visible / new-burst-item', solve('summary-visible', [('new-burst-item', N)], N), 'summary-updating')
check('summary-updating / summary-update-mounted', solve('summary-updating', [('summary-update-mounted', N)], N), 'summary-visible')
check('expanding-details / close-before-mount', solve('expanding-details', [('close-before-mount', N)], N), 'closing-details')
check('closing-details / late-details-mounted', solve('closing-details', [('late-details-mounted', N)], N), 'summary-visible')
check('older notification incarnation', solve('individuals-visible', [('burst-detected', N - 1)], N), 'individuals-visible')
check('future notification incarnation', solve('individuals-visible', [('burst-detected', N + 1)], N), 'individuals-visible')
check('unknown event is inert', solve('individuals-visible', [('unknown-event', N)], N), 'individuals-visible')
check('empty delivery batch', solve('individuals-visible', [], N), 'individuals-visible')
check('N stale deliveries before current delivery', solve('individuals-visible', [('burst-detected', N - 1)] * N + [('burst-detected', N)], N), 'condensing')
check('trace burst-detected then summary-mounted', solve('individuals-visible', [('burst-detected', N), ('summary-mounted', N)], N), 'summary-visible')
check('trace burst-detected then summary-mount-failed', solve('individuals-visible', [('burst-detected', N), ('summary-mount-failed', N)], N), 'individuals-visible')
check('trace summary-mounted then inspect-burst', solve('condensing', [('summary-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-mounted then new-burst-item', solve('condensing', [('summary-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace summary-mount-failed then burst-detected', solve('condensing', [('summary-mount-failed', N), ('burst-detected', N)], N), 'condensing')
check('trace inspect-burst then details-mounted', solve('summary-visible', [('inspect-burst', N), ('details-mounted', N)], N), 'details-visible')
check('trace inspect-burst then close-before-mount', solve('summary-visible', [('inspect-burst', N), ('close-before-mount', N)], N), 'closing-details')
check('trace details-mounted then collapse-details', solve('expanding-details', [('details-mounted', N), ('collapse-details', N)], N), 'summary-visible')
check('trace collapse-details then inspect-burst', solve('details-visible', [('collapse-details', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace collapse-details then new-burst-item', solve('details-visible', [('collapse-details', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace new-burst-item then summary-update-mounted', solve('summary-visible', [('new-burst-item', N), ('summary-update-mounted', N)], N), 'summary-visible')
check('trace summary-update-mounted then inspect-burst', solve('summary-updating', [('summary-update-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-update-mounted then new-burst-item', solve('summary-updating', [('summary-update-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace close-before-mount then late-details-mounted', solve('expanding-details', [('close-before-mount', N), ('late-details-mounted', N)], N), 'summary-visible')
check('trace late-details-mounted then inspect-burst', solve('closing-details', [('late-details-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace late-details-mounted then new-burst-item', solve('closing-details', [('late-details-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('domain state regression 1: summary_members', solve('condensing', [('summary-mounted', N, {'mount': 2})], N, {}, 'summary_members'), {'phase': 'condensing', 'value': []})
check('domain state regression 2: summary_members', solve('condensing', [('summary-mounted', N, {})], N, {}, 'summary_members'), {'phase': 'summary-visible', 'value': ['a', 'b']})
check('domain state regression 3: items', solve('summary-visible', [('new-burst-item', N, {'item': 'a'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b']})
check('domain state regression 4: items', solve('summary-visible', [('new-burst-item', N, {'item': 'c'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b', 'c']})
check('domain state regression 5: detail_members', solve('expanding-details', [('details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'details-visible', 'value': ['a', 'b']})
check('domain state regression 6: detail_members', solve('closing-details', [('late-details-mounted', N, {})], N, {'detail_members': ['a', 'b']}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
check('domain state regression 7: detail_members', solve('summary-visible', [('inspect-burst', N, {}), ('close-before-mount', N, {}), ('late-details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(initial, events, generation, payload=None, observe=None):
    table = {('individuals-visible', 'burst-detected'): 'condensing', ('condensing', 'summary-mounted'): 'summary-visible', ('condensing', 'summary-mount-failed'): 'individuals-visible', ('summary-visible', 'inspect-burst'): 'empty', ('expanding-details', 'details-mounted'): 'details-visible', ('details-visible', 'collapse-details'): 'summary-visible', ('summary-visible', 'new-burst-item'): 'summary-updating', ('summary-updating', 'summary-update-mounted'): 'summary-visible', ('expanding-details', 'close-before-mount'): 'closing-details', ('closing-details', 'late-details-mounted'): 'summary-visible'}
    data = json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})) if payload is None else {**json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})), **json.loads(json.dumps(payload))}
    state = initial
    for delivery in events:
        event, event_generation = delivery[:2]
        arg = delivery[2] if len(delivery) > 2 else {}
        if event_generation == generation:
            previous = state
            if event in ('summary-mounted','details-mounted','late-details-mounted','summary-update-mounted') and arg.get('mount',data['mount']) != data['mount']: event = 'unknown-event'
            if event == 'new-burst-item' and arg.get('item','c') not in data['items']: data['items'].append(arg.get('item','c'))
            state = table.get((state, event), state)
            if state == 'summary-visible':
                data['summary_members'] = data['items'][:]
                data['detail_members'] = []
            if state == 'details-visible': data['detail_members'] = data['items'][:]
            if state == 'empty': data['summary_members'] = []; data['detail_members'] = []
    return {'phase': state, 'value': data[observe]} if observe else state
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('individuals-visible / burst-detected', solve('individuals-visible', [('burst-detected', N)], N), 'condensing')
check('condensing / summary-mounted', solve('condensing', [('summary-mounted', N)], N), 'summary-visible')
check('condensing / summary-mount-failed', solve('condensing', [('summary-mount-failed', N)], N), 'individuals-visible')
check('summary-visible / inspect-burst', solve('summary-visible', [('inspect-burst', N)], N), 'expanding-details')
check('expanding-details / details-mounted', solve('expanding-details', [('details-mounted', N)], N), 'details-visible')
check('details-visible / collapse-details', solve('details-visible', [('collapse-details', N)], N), 'summary-visible')
check('summary-visible / new-burst-item', solve('summary-visible', [('new-burst-item', N)], N), 'summary-updating')
check('summary-updating / summary-update-mounted', solve('summary-updating', [('summary-update-mounted', N)], N), 'summary-visible')
check('expanding-details / close-before-mount', solve('expanding-details', [('close-before-mount', N)], N), 'closing-details')
check('closing-details / late-details-mounted', solve('closing-details', [('late-details-mounted', N)], N), 'summary-visible')
check('older notification incarnation', solve('individuals-visible', [('burst-detected', N - 1)], N), 'individuals-visible')
check('future notification incarnation', solve('individuals-visible', [('burst-detected', N + 1)], N), 'individuals-visible')
check('unknown event is inert', solve('individuals-visible', [('unknown-event', N)], N), 'individuals-visible')
check('empty delivery batch', solve('individuals-visible', [], N), 'individuals-visible')
check('N stale deliveries before current delivery', solve('individuals-visible', [('burst-detected', N - 1)] * N + [('burst-detected', N)], N), 'condensing')
check('trace burst-detected then summary-mounted', solve('individuals-visible', [('burst-detected', N), ('summary-mounted', N)], N), 'summary-visible')
check('trace burst-detected then summary-mount-failed', solve('individuals-visible', [('burst-detected', N), ('summary-mount-failed', N)], N), 'individuals-visible')
check('trace summary-mounted then inspect-burst', solve('condensing', [('summary-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-mounted then new-burst-item', solve('condensing', [('summary-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace summary-mount-failed then burst-detected', solve('condensing', [('summary-mount-failed', N), ('burst-detected', N)], N), 'condensing')
check('trace inspect-burst then details-mounted', solve('summary-visible', [('inspect-burst', N), ('details-mounted', N)], N), 'details-visible')
check('trace inspect-burst then close-before-mount', solve('summary-visible', [('inspect-burst', N), ('close-before-mount', N)], N), 'closing-details')
check('trace details-mounted then collapse-details', solve('expanding-details', [('details-mounted', N), ('collapse-details', N)], N), 'summary-visible')
check('trace collapse-details then inspect-burst', solve('details-visible', [('collapse-details', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace collapse-details then new-burst-item', solve('details-visible', [('collapse-details', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace new-burst-item then summary-update-mounted', solve('summary-visible', [('new-burst-item', N), ('summary-update-mounted', N)], N), 'summary-visible')
check('trace summary-update-mounted then inspect-burst', solve('summary-updating', [('summary-update-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-update-mounted then new-burst-item', solve('summary-updating', [('summary-update-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace close-before-mount then late-details-mounted', solve('expanding-details', [('close-before-mount', N), ('late-details-mounted', N)], N), 'summary-visible')
check('trace late-details-mounted then inspect-burst', solve('closing-details', [('late-details-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace late-details-mounted then new-burst-item', solve('closing-details', [('late-details-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('domain state regression 1: summary_members', solve('condensing', [('summary-mounted', N, {'mount': 2})], N, {}, 'summary_members'), {'phase': 'condensing', 'value': []})
check('domain state regression 2: summary_members', solve('condensing', [('summary-mounted', N, {})], N, {}, 'summary_members'), {'phase': 'summary-visible', 'value': ['a', 'b']})
check('domain state regression 3: items', solve('summary-visible', [('new-burst-item', N, {'item': 'a'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b']})
check('domain state regression 4: items', solve('summary-visible', [('new-burst-item', N, {'item': 'c'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b', 'c']})
check('domain state regression 5: detail_members', solve('expanding-details', [('details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'details-visible', 'value': ['a', 'b']})
check('domain state regression 6: detail_members', solve('closing-details', [('late-details-mounted', N, {})], N, {'detail_members': ['a', 'b']}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
check('domain state regression 7: detail_members', solve('summary-visible', [('inspect-burst', N, {}), ('close-before-mount', N, {}), ('late-details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The inspect-burst event leaves a notification in details-visible instead of expanding-details.

Notification burst summary interaction is a bounded visual-notification workflow with mutable policy state {'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3}. Its default transition relation is {('individuals-visible', 'burst-detected'): 'condensing', ('condensing', 'summary-mounted'): 'summary-visible', ('condensing', 'summary-mount-failed'): 'individuals-visible', ('summary-visible', 'inspect-burst'): 'expanding-details', ('expanding-details', 'details-mounted'): 'details-visible', ('details-visible', 'collapse-details'): 'summary-visible', ('summary-visible', 'new-burst-item'): 'summary-updating', ('summary-updating', 'summary-update-mounted'): 'summary-visible', ('expanding-details', 'close-before-mount'): 'closing-details', ('closing-details', 'late-details-mounted'): 'summary-visible'}; domain inputs can suppress or redirect transitions and update policy fields, as specified in solve. Different-generation events are inert. Batches apply in order. Optional observe returns the selected policy field alongside the phase.

split: open-access


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

N = 1
observations = []
def solve(initial, events, generation, payload=None, observe=None):
    table = {('individuals-visible', 'burst-detected'): 'condensing', ('condensing', 'summary-mounted'): 'summary-visible', ('condensing', 'summary-mount-failed'): 'individuals-visible', ('summary-visible', 'inspect-burst'): 'expanding-details', ('expanding-details', 'details-mounted'): 'summary-visible', ('details-visible', 'collapse-details'): 'summary-visible', ('summary-visible', 'new-burst-item'): 'summary-updating', ('summary-updating', 'summary-update-mounted'): 'summary-visible', ('expanding-details', 'close-before-mount'): 'closing-details', ('closing-details', 'late-details-mounted'): 'summary-visible'}
    data = json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})) if payload is None else {**json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})), **json.loads(json.dumps(payload))}
    state = initial
    for delivery in events:
        event, event_generation = delivery[:2]
        arg = delivery[2] if len(delivery) > 2 else {}
        if event_generation == generation:
            previous = state
            if event in ('summary-mounted','details-mounted','late-details-mounted','summary-update-mounted') and arg.get('mount',data['mount']) != data['mount']: event = 'unknown-event'
            if event == 'new-burst-item' and arg.get('item','c') not in data['items']: data['items'].append(arg.get('item','c'))
            state = table.get((state, event), state)
            if state == 'summary-visible':
                data['summary_members'] = data['items'][:]
                data['detail_members'] = []
            if state == 'details-visible': data['detail_members'] = data['items'][:]
            if state == 'empty': data['summary_members'] = []; data['detail_members'] = []
    return {'phase': state, 'value': data[observe]} if observe else state
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('individuals-visible / burst-detected', solve('individuals-visible', [('burst-detected', N)], N), 'condensing')
check('condensing / summary-mounted', solve('condensing', [('summary-mounted', N)], N), 'summary-visible')
check('condensing / summary-mount-failed', solve('condensing', [('summary-mount-failed', N)], N), 'individuals-visible')
check('summary-visible / inspect-burst', solve('summary-visible', [('inspect-burst', N)], N), 'expanding-details')
check('expanding-details / details-mounted', solve('expanding-details', [('details-mounted', N)], N), 'details-visible')
check('details-visible / collapse-details', solve('details-visible', [('collapse-details', N)], N), 'summary-visible')
check('summary-visible / new-burst-item', solve('summary-visible', [('new-burst-item', N)], N), 'summary-updating')
check('summary-updating / summary-update-mounted', solve('summary-updating', [('summary-update-mounted', N)], N), 'summary-visible')
check('expanding-details / close-before-mount', solve('expanding-details', [('close-before-mount', N)], N), 'closing-details')
check('closing-details / late-details-mounted', solve('closing-details', [('late-details-mounted', N)], N), 'summary-visible')
check('older notification incarnation', solve('individuals-visible', [('burst-detected', N - 1)], N), 'individuals-visible')
check('future notification incarnation', solve('individuals-visible', [('burst-detected', N + 1)], N), 'individuals-visible')
check('unknown event is inert', solve('individuals-visible', [('unknown-event', N)], N), 'individuals-visible')
check('empty delivery batch', solve('individuals-visible', [], N), 'individuals-visible')
check('N stale deliveries before current delivery', solve('individuals-visible', [('burst-detected', N - 1)] * N + [('burst-detected', N)], N), 'condensing')
check('trace burst-detected then summary-mounted', solve('individuals-visible', [('burst-detected', N), ('summary-mounted', N)], N), 'summary-visible')
check('trace burst-detected then summary-mount-failed', solve('individuals-visible', [('burst-detected', N), ('summary-mount-failed', N)], N), 'individuals-visible')
check('trace summary-mounted then inspect-burst', solve('condensing', [('summary-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-mounted then new-burst-item', solve('condensing', [('summary-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace summary-mount-failed then burst-detected', solve('condensing', [('summary-mount-failed', N), ('burst-detected', N)], N), 'condensing')
check('trace inspect-burst then details-mounted', solve('summary-visible', [('inspect-burst', N), ('details-mounted', N)], N), 'details-visible')
check('trace inspect-burst then close-before-mount', solve('summary-visible', [('inspect-burst', N), ('close-before-mount', N)], N), 'closing-details')
check('trace details-mounted then collapse-details', solve('expanding-details', [('details-mounted', N), ('collapse-details', N)], N), 'summary-visible')
check('trace collapse-details then inspect-burst', solve('details-visible', [('collapse-details', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace collapse-details then new-burst-item', solve('details-visible', [('collapse-details', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace new-burst-item then summary-update-mounted', solve('summary-visible', [('new-burst-item', N), ('summary-update-mounted', N)], N), 'summary-visible')
check('trace summary-update-mounted then inspect-burst', solve('summary-updating', [('summary-update-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-update-mounted then new-burst-item', solve('summary-updating', [('summary-update-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace close-before-mount then late-details-mounted', solve('expanding-details', [('close-before-mount', N), ('late-details-mounted', N)], N), 'summary-visible')
check('trace late-details-mounted then inspect-burst', solve('closing-details', [('late-details-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace late-details-mounted then new-burst-item', solve('closing-details', [('late-details-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('domain state regression 1: summary_members', solve('condensing', [('summary-mounted', N, {'mount': 2})], N, {}, 'summary_members'), {'phase': 'condensing', 'value': []})
check('domain state regression 2: summary_members', solve('condensing', [('summary-mounted', N, {})], N, {}, 'summary_members'), {'phase': 'summary-visible', 'value': ['a', 'b']})
check('domain state regression 3: items', solve('summary-visible', [('new-burst-item', N, {'item': 'a'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b']})
check('domain state regression 4: items', solve('summary-visible', [('new-burst-item', N, {'item': 'c'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b', 'c']})
check('domain state regression 5: detail_members', solve('expanding-details', [('details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'details-visible', 'value': ['a', 'b']})
check('domain state regression 6: detail_members', solve('closing-details', [('late-details-mounted', N, {})], N, {'detail_members': ['a', 'b']}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
check('domain state regression 7: detail_members', solve('summary-visible', [('inspect-burst', N, {}), ('close-before-mount', N, {}), ('late-details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(initial, events, generation, payload=None, observe=None):
    table = {('individuals-visible', 'burst-detected'): 'condensing', ('condensing', 'summary-mounted'): 'summary-visible', ('condensing', 'summary-mount-failed'): 'individuals-visible', ('summary-visible', 'inspect-burst'): 'expanding-details', ('expanding-details', 'details-mounted'): 'individuals-visible', ('details-visible', 'collapse-details'): 'summary-visible', ('summary-visible', 'new-burst-item'): 'summary-updating', ('summary-updating', 'summary-update-mounted'): 'summary-visible', ('expanding-details', 'close-before-mount'): 'closing-details', ('closing-details', 'late-details-mounted'): 'summary-visible'}
    data = json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})) if payload is None else {**json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})), **json.loads(json.dumps(payload))}
    state = initial
    for delivery in events:
        event, event_generation = delivery[:2]
        arg = delivery[2] if len(delivery) > 2 else {}
        if event_generation == generation:
            previous = state
            if event in ('summary-mounted','details-mounted','late-details-mounted','summary-update-mounted') and arg.get('mount',data['mount']) != data['mount']: event = 'unknown-event'
            if event == 'new-burst-item' and arg.get('item','c') not in data['items']: data['items'].append(arg.get('item','c'))
            state = table.get((state, event), state)
            if state == 'summary-visible':
                data['summary_members'] = data['items'][:]
                data['detail_members'] = []
            if state == 'details-visible': data['detail_members'] = data['items'][:]
            if state == 'empty': data['summary_members'] = []; data['detail_members'] = []
    return {'phase': state, 'value': data[observe]} if observe else state
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('individuals-visible / burst-detected', solve('individuals-visible', [('burst-detected', N)], N), 'condensing')
check('condensing / summary-mounted', solve('condensing', [('summary-mounted', N)], N), 'summary-visible')
check('condensing / summary-mount-failed', solve('condensing', [('summary-mount-failed', N)], N), 'individuals-visible')
check('summary-visible / inspect-burst', solve('summary-visible', [('inspect-burst', N)], N), 'expanding-details')
check('expanding-details / details-mounted', solve('expanding-details', [('details-mounted', N)], N), 'details-visible')
check('details-visible / collapse-details', solve('details-visible', [('collapse-details', N)], N), 'summary-visible')
check('summary-visible / new-burst-item', solve('summary-visible', [('new-burst-item', N)], N), 'summary-updating')
check('summary-updating / summary-update-mounted', solve('summary-updating', [('summary-update-mounted', N)], N), 'summary-visible')
check('expanding-details / close-before-mount', solve('expanding-details', [('close-before-mount', N)], N), 'closing-details')
check('closing-details / late-details-mounted', solve('closing-details', [('late-details-mounted', N)], N), 'summary-visible')
check('older notification incarnation', solve('individuals-visible', [('burst-detected', N - 1)], N), 'individuals-visible')
check('future notification incarnation', solve('individuals-visible', [('burst-detected', N + 1)], N), 'individuals-visible')
check('unknown event is inert', solve('individuals-visible', [('unknown-event', N)], N), 'individuals-visible')
check('empty delivery batch', solve('individuals-visible', [], N), 'individuals-visible')
check('N stale deliveries before current delivery', solve('individuals-visible', [('burst-detected', N - 1)] * N + [('burst-detected', N)], N), 'condensing')
check('trace burst-detected then summary-mounted', solve('individuals-visible', [('burst-detected', N), ('summary-mounted', N)], N), 'summary-visible')
check('trace burst-detected then summary-mount-failed', solve('individuals-visible', [('burst-detected', N), ('summary-mount-failed', N)], N), 'individuals-visible')
check('trace summary-mounted then inspect-burst', solve('condensing', [('summary-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-mounted then new-burst-item', solve('condensing', [('summary-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace summary-mount-failed then burst-detected', solve('condensing', [('summary-mount-failed', N), ('burst-detected', N)], N), 'condensing')
check('trace inspect-burst then details-mounted', solve('summary-visible', [('inspect-burst', N), ('details-mounted', N)], N), 'details-visible')
check('trace inspect-burst then close-before-mount', solve('summary-visible', [('inspect-burst', N), ('close-before-mount', N)], N), 'closing-details')
check('trace details-mounted then collapse-details', solve('expanding-details', [('details-mounted', N), ('collapse-details', N)], N), 'summary-visible')
check('trace collapse-details then inspect-burst', solve('details-visible', [('collapse-details', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace collapse-details then new-burst-item', solve('details-visible', [('collapse-details', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace new-burst-item then summary-update-mounted', solve('summary-visible', [('new-burst-item', N), ('summary-update-mounted', N)], N), 'summary-visible')
check('trace summary-update-mounted then inspect-burst', solve('summary-updating', [('summary-update-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-update-mounted then new-burst-item', solve('summary-updating', [('summary-update-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace close-before-mount then late-details-mounted', solve('expanding-details', [('close-before-mount', N), ('late-details-mounted', N)], N), 'summary-visible')
check('trace late-details-mounted then inspect-burst', solve('closing-details', [('late-details-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace late-details-mounted then new-burst-item', solve('closing-details', [('late-details-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('domain state regression 1: summary_members', solve('condensing', [('summary-mounted', N, {'mount': 2})], N, {}, 'summary_members'), {'phase': 'condensing', 'value': []})
check('domain state regression 2: summary_members', solve('condensing', [('summary-mounted', N, {})], N, {}, 'summary_members'), {'phase': 'summary-visible', 'value': ['a', 'b']})
check('domain state regression 3: items', solve('summary-visible', [('new-burst-item', N, {'item': 'a'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b']})
check('domain state regression 4: items', solve('summary-visible', [('new-burst-item', N, {'item': 'c'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b', 'c']})
check('domain state regression 5: detail_members', solve('expanding-details', [('details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'details-visible', 'value': ['a', 'b']})
check('domain state regression 6: detail_members', solve('closing-details', [('late-details-mounted', N, {})], N, {'detail_members': ['a', 'b']}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
check('domain state regression 7: detail_members', solve('summary-visible', [('inspect-burst', N, {}), ('close-before-mount', N, {}), ('late-details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The details-mounted event leaves a notification in summary-visible instead of details-visible.

Notification burst summary interaction is a bounded visual-notification workflow with mutable policy state {'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3}. Its default transition relation is {('individuals-visible', 'burst-detected'): 'condensing', ('condensing', 'summary-mounted'): 'summary-visible', ('condensing', 'summary-mount-failed'): 'individuals-visible', ('summary-visible', 'inspect-burst'): 'expanding-details', ('expanding-details', 'details-mounted'): 'details-visible', ('details-visible', 'collapse-details'): 'summary-visible', ('summary-visible', 'new-burst-item'): 'summary-updating', ('summary-updating', 'summary-update-mounted'): 'summary-visible', ('expanding-details', 'close-before-mount'): 'closing-details', ('closing-details', 'late-details-mounted'): 'summary-visible'}; domain inputs can suppress or redirect transitions and update policy fields, as specified in solve. Different-generation events are inert. Batches apply in order. Optional observe returns the selected policy field alongside the phase.

split: open-access


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

N = 1
observations = []
def solve(initial, events, generation, payload=None, observe=None):
    table = {('individuals-visible', 'burst-detected'): 'condensing', ('condensing', 'summary-mounted'): 'summary-visible', ('condensing', 'summary-mount-failed'): 'individuals-visible', ('summary-visible', 'inspect-burst'): 'expanding-details', ('expanding-details', 'details-mounted'): 'details-visible', ('details-visible', 'collapse-details'): 'empty', ('summary-visible', 'new-burst-item'): 'summary-updating', ('summary-updating', 'summary-update-mounted'): 'summary-visible', ('expanding-details', 'close-before-mount'): 'closing-details', ('closing-details', 'late-details-mounted'): 'summary-visible'}
    data = json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})) if payload is None else {**json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})), **json.loads(json.dumps(payload))}
    state = initial
    for delivery in events:
        event, event_generation = delivery[:2]
        arg = delivery[2] if len(delivery) > 2 else {}
        if event_generation == generation:
            previous = state
            if event in ('summary-mounted','details-mounted','late-details-mounted','summary-update-mounted') and arg.get('mount',data['mount']) != data['mount']: event = 'unknown-event'
            if event == 'new-burst-item' and arg.get('item','c') not in data['items']: data['items'].append(arg.get('item','c'))
            state = table.get((state, event), state)
            if state == 'summary-visible':
                data['summary_members'] = data['items'][:]
                data['detail_members'] = []
            if state == 'details-visible': data['detail_members'] = data['items'][:]
            if state == 'empty': data['summary_members'] = []; data['detail_members'] = []
    return {'phase': state, 'value': data[observe]} if observe else state
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('individuals-visible / burst-detected', solve('individuals-visible', [('burst-detected', N)], N), 'condensing')
check('condensing / summary-mounted', solve('condensing', [('summary-mounted', N)], N), 'summary-visible')
check('condensing / summary-mount-failed', solve('condensing', [('summary-mount-failed', N)], N), 'individuals-visible')
check('summary-visible / inspect-burst', solve('summary-visible', [('inspect-burst', N)], N), 'expanding-details')
check('expanding-details / details-mounted', solve('expanding-details', [('details-mounted', N)], N), 'details-visible')
check('details-visible / collapse-details', solve('details-visible', [('collapse-details', N)], N), 'summary-visible')
check('summary-visible / new-burst-item', solve('summary-visible', [('new-burst-item', N)], N), 'summary-updating')
check('summary-updating / summary-update-mounted', solve('summary-updating', [('summary-update-mounted', N)], N), 'summary-visible')
check('expanding-details / close-before-mount', solve('expanding-details', [('close-before-mount', N)], N), 'closing-details')
check('closing-details / late-details-mounted', solve('closing-details', [('late-details-mounted', N)], N), 'summary-visible')
check('older notification incarnation', solve('individuals-visible', [('burst-detected', N - 1)], N), 'individuals-visible')
check('future notification incarnation', solve('individuals-visible', [('burst-detected', N + 1)], N), 'individuals-visible')
check('unknown event is inert', solve('individuals-visible', [('unknown-event', N)], N), 'individuals-visible')
check('empty delivery batch', solve('individuals-visible', [], N), 'individuals-visible')
check('N stale deliveries before current delivery', solve('individuals-visible', [('burst-detected', N - 1)] * N + [('burst-detected', N)], N), 'condensing')
check('trace burst-detected then summary-mounted', solve('individuals-visible', [('burst-detected', N), ('summary-mounted', N)], N), 'summary-visible')
check('trace burst-detected then summary-mount-failed', solve('individuals-visible', [('burst-detected', N), ('summary-mount-failed', N)], N), 'individuals-visible')
check('trace summary-mounted then inspect-burst', solve('condensing', [('summary-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-mounted then new-burst-item', solve('condensing', [('summary-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace summary-mount-failed then burst-detected', solve('condensing', [('summary-mount-failed', N), ('burst-detected', N)], N), 'condensing')
check('trace inspect-burst then details-mounted', solve('summary-visible', [('inspect-burst', N), ('details-mounted', N)], N), 'details-visible')
check('trace inspect-burst then close-before-mount', solve('summary-visible', [('inspect-burst', N), ('close-before-mount', N)], N), 'closing-details')
check('trace details-mounted then collapse-details', solve('expanding-details', [('details-mounted', N), ('collapse-details', N)], N), 'summary-visible')
check('trace collapse-details then inspect-burst', solve('details-visible', [('collapse-details', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace collapse-details then new-burst-item', solve('details-visible', [('collapse-details', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace new-burst-item then summary-update-mounted', solve('summary-visible', [('new-burst-item', N), ('summary-update-mounted', N)], N), 'summary-visible')
check('trace summary-update-mounted then inspect-burst', solve('summary-updating', [('summary-update-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-update-mounted then new-burst-item', solve('summary-updating', [('summary-update-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace close-before-mount then late-details-mounted', solve('expanding-details', [('close-before-mount', N), ('late-details-mounted', N)], N), 'summary-visible')
check('trace late-details-mounted then inspect-burst', solve('closing-details', [('late-details-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace late-details-mounted then new-burst-item', solve('closing-details', [('late-details-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('domain state regression 1: summary_members', solve('condensing', [('summary-mounted', N, {'mount': 2})], N, {}, 'summary_members'), {'phase': 'condensing', 'value': []})
check('domain state regression 2: summary_members', solve('condensing', [('summary-mounted', N, {})], N, {}, 'summary_members'), {'phase': 'summary-visible', 'value': ['a', 'b']})
check('domain state regression 3: items', solve('summary-visible', [('new-burst-item', N, {'item': 'a'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b']})
check('domain state regression 4: items', solve('summary-visible', [('new-burst-item', N, {'item': 'c'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b', 'c']})
check('domain state regression 5: detail_members', solve('expanding-details', [('details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'details-visible', 'value': ['a', 'b']})
check('domain state regression 6: detail_members', solve('closing-details', [('late-details-mounted', N, {})], N, {'detail_members': ['a', 'b']}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
check('domain state regression 7: detail_members', solve('summary-visible', [('inspect-burst', N, {}), ('close-before-mount', N, {}), ('late-details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(initial, events, generation, payload=None, observe=None):
    table = {('individuals-visible', 'burst-detected'): 'condensing', ('condensing', 'summary-mounted'): 'summary-visible', ('condensing', 'summary-mount-failed'): 'individuals-visible', ('summary-visible', 'inspect-burst'): 'expanding-details', ('expanding-details', 'details-mounted'): 'details-visible', ('details-visible', 'collapse-details'): 'individuals-visible', ('summary-visible', 'new-burst-item'): 'summary-updating', ('summary-updating', 'summary-update-mounted'): 'summary-visible', ('expanding-details', 'close-before-mount'): 'closing-details', ('closing-details', 'late-details-mounted'): 'summary-visible'}
    data = json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})) if payload is None else {**json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})), **json.loads(json.dumps(payload))}
    state = initial
    for delivery in events:
        event, event_generation = delivery[:2]
        arg = delivery[2] if len(delivery) > 2 else {}
        if event_generation == generation:
            previous = state
            if event in ('summary-mounted','details-mounted','late-details-mounted','summary-update-mounted') and arg.get('mount',data['mount']) != data['mount']: event = 'unknown-event'
            if event == 'new-burst-item' and arg.get('item','c') not in data['items']: data['items'].append(arg.get('item','c'))
            state = table.get((state, event), state)
            if state == 'summary-visible':
                data['summary_members'] = data['items'][:]
                data['detail_members'] = []
            if state == 'details-visible': data['detail_members'] = data['items'][:]
            if state == 'empty': data['summary_members'] = []; data['detail_members'] = []
    return {'phase': state, 'value': data[observe]} if observe else state
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('individuals-visible / burst-detected', solve('individuals-visible', [('burst-detected', N)], N), 'condensing')
check('condensing / summary-mounted', solve('condensing', [('summary-mounted', N)], N), 'summary-visible')
check('condensing / summary-mount-failed', solve('condensing', [('summary-mount-failed', N)], N), 'individuals-visible')
check('summary-visible / inspect-burst', solve('summary-visible', [('inspect-burst', N)], N), 'expanding-details')
check('expanding-details / details-mounted', solve('expanding-details', [('details-mounted', N)], N), 'details-visible')
check('details-visible / collapse-details', solve('details-visible', [('collapse-details', N)], N), 'summary-visible')
check('summary-visible / new-burst-item', solve('summary-visible', [('new-burst-item', N)], N), 'summary-updating')
check('summary-updating / summary-update-mounted', solve('summary-updating', [('summary-update-mounted', N)], N), 'summary-visible')
check('expanding-details / close-before-mount', solve('expanding-details', [('close-before-mount', N)], N), 'closing-details')
check('closing-details / late-details-mounted', solve('closing-details', [('late-details-mounted', N)], N), 'summary-visible')
check('older notification incarnation', solve('individuals-visible', [('burst-detected', N - 1)], N), 'individuals-visible')
check('future notification incarnation', solve('individuals-visible', [('burst-detected', N + 1)], N), 'individuals-visible')
check('unknown event is inert', solve('individuals-visible', [('unknown-event', N)], N), 'individuals-visible')
check('empty delivery batch', solve('individuals-visible', [], N), 'individuals-visible')
check('N stale deliveries before current delivery', solve('individuals-visible', [('burst-detected', N - 1)] * N + [('burst-detected', N)], N), 'condensing')
check('trace burst-detected then summary-mounted', solve('individuals-visible', [('burst-detected', N), ('summary-mounted', N)], N), 'summary-visible')
check('trace burst-detected then summary-mount-failed', solve('individuals-visible', [('burst-detected', N), ('summary-mount-failed', N)], N), 'individuals-visible')
check('trace summary-mounted then inspect-burst', solve('condensing', [('summary-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-mounted then new-burst-item', solve('condensing', [('summary-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace summary-mount-failed then burst-detected', solve('condensing', [('summary-mount-failed', N), ('burst-detected', N)], N), 'condensing')
check('trace inspect-burst then details-mounted', solve('summary-visible', [('inspect-burst', N), ('details-mounted', N)], N), 'details-visible')
check('trace inspect-burst then close-before-mount', solve('summary-visible', [('inspect-burst', N), ('close-before-mount', N)], N), 'closing-details')
check('trace details-mounted then collapse-details', solve('expanding-details', [('details-mounted', N), ('collapse-details', N)], N), 'summary-visible')
check('trace collapse-details then inspect-burst', solve('details-visible', [('collapse-details', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace collapse-details then new-burst-item', solve('details-visible', [('collapse-details', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace new-burst-item then summary-update-mounted', solve('summary-visible', [('new-burst-item', N), ('summary-update-mounted', N)], N), 'summary-visible')
check('trace summary-update-mounted then inspect-burst', solve('summary-updating', [('summary-update-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-update-mounted then new-burst-item', solve('summary-updating', [('summary-update-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace close-before-mount then late-details-mounted', solve('expanding-details', [('close-before-mount', N), ('late-details-mounted', N)], N), 'summary-visible')
check('trace late-details-mounted then inspect-burst', solve('closing-details', [('late-details-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace late-details-mounted then new-burst-item', solve('closing-details', [('late-details-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('domain state regression 1: summary_members', solve('condensing', [('summary-mounted', N, {'mount': 2})], N, {}, 'summary_members'), {'phase': 'condensing', 'value': []})
check('domain state regression 2: summary_members', solve('condensing', [('summary-mounted', N, {})], N, {}, 'summary_members'), {'phase': 'summary-visible', 'value': ['a', 'b']})
check('domain state regression 3: items', solve('summary-visible', [('new-burst-item', N, {'item': 'a'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b']})
check('domain state regression 4: items', solve('summary-visible', [('new-burst-item', N, {'item': 'c'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b', 'c']})
check('domain state regression 5: detail_members', solve('expanding-details', [('details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'details-visible', 'value': ['a', 'b']})
check('domain state regression 6: detail_members', solve('closing-details', [('late-details-mounted', N, {})], N, {'detail_members': ['a', 'b']}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
check('domain state regression 7: detail_members', solve('summary-visible', [('inspect-burst', N, {}), ('close-before-mount', N, {}), ('late-details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The collapse-details event leaves a notification in empty instead of summary-visible.

Notification burst summary interaction is a bounded visual-notification workflow with mutable policy state {'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3}. Its default transition relation is {('individuals-visible', 'burst-detected'): 'condensing', ('condensing', 'summary-mounted'): 'summary-visible', ('condensing', 'summary-mount-failed'): 'individuals-visible', ('summary-visible', 'inspect-burst'): 'expanding-details', ('expanding-details', 'details-mounted'): 'details-visible', ('details-visible', 'collapse-details'): 'summary-visible', ('summary-visible', 'new-burst-item'): 'summary-updating', ('summary-updating', 'summary-update-mounted'): 'summary-visible', ('expanding-details', 'close-before-mount'): 'closing-details', ('closing-details', 'late-details-mounted'): 'summary-visible'}; domain inputs can suppress or redirect transitions and update policy fields, as specified in solve. Different-generation events are inert. Batches apply in order. Optional observe returns the selected policy field alongside the phase.

split: open-access


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

N = 1
observations = []
def solve(initial, events, generation, payload=None, observe=None):
    table = {('individuals-visible', 'burst-detected'): 'condensing', ('condensing', 'summary-mounted'): 'summary-visible', ('condensing', 'summary-mount-failed'): 'individuals-visible', ('summary-visible', 'inspect-burst'): 'expanding-details', ('expanding-details', 'details-mounted'): 'details-visible', ('details-visible', 'collapse-details'): 'summary-visible', ('summary-visible', 'new-burst-item'): 'individuals-visible', ('summary-updating', 'summary-update-mounted'): 'summary-visible', ('expanding-details', 'close-before-mount'): 'closing-details', ('closing-details', 'late-details-mounted'): 'summary-visible'}
    data = json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})) if payload is None else {**json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})), **json.loads(json.dumps(payload))}
    state = initial
    for delivery in events:
        event, event_generation = delivery[:2]
        arg = delivery[2] if len(delivery) > 2 else {}
        if event_generation == generation:
            previous = state
            if event in ('summary-mounted','details-mounted','late-details-mounted','summary-update-mounted') and arg.get('mount',data['mount']) != data['mount']: event = 'unknown-event'
            if event == 'new-burst-item' and arg.get('item','c') not in data['items']: data['items'].append(arg.get('item','c'))
            state = table.get((state, event), state)
            if state == 'summary-visible':
                data['summary_members'] = data['items'][:]
                data['detail_members'] = []
            if state == 'details-visible': data['detail_members'] = data['items'][:]
            if state == 'empty': data['summary_members'] = []; data['detail_members'] = []
    return {'phase': state, 'value': data[observe]} if observe else state
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('individuals-visible / burst-detected', solve('individuals-visible', [('burst-detected', N)], N), 'condensing')
check('condensing / summary-mounted', solve('condensing', [('summary-mounted', N)], N), 'summary-visible')
check('condensing / summary-mount-failed', solve('condensing', [('summary-mount-failed', N)], N), 'individuals-visible')
check('summary-visible / inspect-burst', solve('summary-visible', [('inspect-burst', N)], N), 'expanding-details')
check('expanding-details / details-mounted', solve('expanding-details', [('details-mounted', N)], N), 'details-visible')
check('details-visible / collapse-details', solve('details-visible', [('collapse-details', N)], N), 'summary-visible')
check('summary-visible / new-burst-item', solve('summary-visible', [('new-burst-item', N)], N), 'summary-updating')
check('summary-updating / summary-update-mounted', solve('summary-updating', [('summary-update-mounted', N)], N), 'summary-visible')
check('expanding-details / close-before-mount', solve('expanding-details', [('close-before-mount', N)], N), 'closing-details')
check('closing-details / late-details-mounted', solve('closing-details', [('late-details-mounted', N)], N), 'summary-visible')
check('older notification incarnation', solve('individuals-visible', [('burst-detected', N - 1)], N), 'individuals-visible')
check('future notification incarnation', solve('individuals-visible', [('burst-detected', N + 1)], N), 'individuals-visible')
check('unknown event is inert', solve('individuals-visible', [('unknown-event', N)], N), 'individuals-visible')
check('empty delivery batch', solve('individuals-visible', [], N), 'individuals-visible')
check('N stale deliveries before current delivery', solve('individuals-visible', [('burst-detected', N - 1)] * N + [('burst-detected', N)], N), 'condensing')
check('trace burst-detected then summary-mounted', solve('individuals-visible', [('burst-detected', N), ('summary-mounted', N)], N), 'summary-visible')
check('trace burst-detected then summary-mount-failed', solve('individuals-visible', [('burst-detected', N), ('summary-mount-failed', N)], N), 'individuals-visible')
check('trace summary-mounted then inspect-burst', solve('condensing', [('summary-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-mounted then new-burst-item', solve('condensing', [('summary-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace summary-mount-failed then burst-detected', solve('condensing', [('summary-mount-failed', N), ('burst-detected', N)], N), 'condensing')
check('trace inspect-burst then details-mounted', solve('summary-visible', [('inspect-burst', N), ('details-mounted', N)], N), 'details-visible')
check('trace inspect-burst then close-before-mount', solve('summary-visible', [('inspect-burst', N), ('close-before-mount', N)], N), 'closing-details')
check('trace details-mounted then collapse-details', solve('expanding-details', [('details-mounted', N), ('collapse-details', N)], N), 'summary-visible')
check('trace collapse-details then inspect-burst', solve('details-visible', [('collapse-details', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace collapse-details then new-burst-item', solve('details-visible', [('collapse-details', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace new-burst-item then summary-update-mounted', solve('summary-visible', [('new-burst-item', N), ('summary-update-mounted', N)], N), 'summary-visible')
check('trace summary-update-mounted then inspect-burst', solve('summary-updating', [('summary-update-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-update-mounted then new-burst-item', solve('summary-updating', [('summary-update-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace close-before-mount then late-details-mounted', solve('expanding-details', [('close-before-mount', N), ('late-details-mounted', N)], N), 'summary-visible')
check('trace late-details-mounted then inspect-burst', solve('closing-details', [('late-details-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace late-details-mounted then new-burst-item', solve('closing-details', [('late-details-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('domain state regression 1: summary_members', solve('condensing', [('summary-mounted', N, {'mount': 2})], N, {}, 'summary_members'), {'phase': 'condensing', 'value': []})
check('domain state regression 2: summary_members', solve('condensing', [('summary-mounted', N, {})], N, {}, 'summary_members'), {'phase': 'summary-visible', 'value': ['a', 'b']})
check('domain state regression 3: items', solve('summary-visible', [('new-burst-item', N, {'item': 'a'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b']})
check('domain state regression 4: items', solve('summary-visible', [('new-burst-item', N, {'item': 'c'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b', 'c']})
check('domain state regression 5: detail_members', solve('expanding-details', [('details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'details-visible', 'value': ['a', 'b']})
check('domain state regression 6: detail_members', solve('closing-details', [('late-details-mounted', N, {})], N, {'detail_members': ['a', 'b']}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
check('domain state regression 7: detail_members', solve('summary-visible', [('inspect-burst', N, {}), ('close-before-mount', N, {}), ('late-details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(initial, events, generation, payload=None, observe=None):
    table = {('individuals-visible', 'burst-detected'): 'condensing', ('condensing', 'summary-mounted'): 'summary-visible', ('condensing', 'summary-mount-failed'): 'individuals-visible', ('summary-visible', 'inspect-burst'): 'expanding-details', ('expanding-details', 'details-mounted'): 'details-visible', ('details-visible', 'collapse-details'): 'summary-visible', ('summary-visible', 'new-burst-item'): 'empty', ('summary-updating', 'summary-update-mounted'): 'summary-visible', ('expanding-details', 'close-before-mount'): 'closing-details', ('closing-details', 'late-details-mounted'): 'summary-visible'}
    data = json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})) if payload is None else {**json.loads(json.dumps({'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3})), **json.loads(json.dumps(payload))}
    state = initial
    for delivery in events:
        event, event_generation = delivery[:2]
        arg = delivery[2] if len(delivery) > 2 else {}
        if event_generation == generation:
            previous = state
            if event in ('summary-mounted','details-mounted','late-details-mounted','summary-update-mounted') and arg.get('mount',data['mount']) != data['mount']: event = 'unknown-event'
            if event == 'new-burst-item' and arg.get('item','c') not in data['items']: data['items'].append(arg.get('item','c'))
            state = table.get((state, event), state)
            if state == 'summary-visible':
                data['summary_members'] = data['items'][:]
                data['detail_members'] = []
            if state == 'details-visible': data['detail_members'] = data['items'][:]
            if state == 'empty': data['summary_members'] = []; data['detail_members'] = []
    return {'phase': state, 'value': data[observe]} if observe else state
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('individuals-visible / burst-detected', solve('individuals-visible', [('burst-detected', N)], N), 'condensing')
check('condensing / summary-mounted', solve('condensing', [('summary-mounted', N)], N), 'summary-visible')
check('condensing / summary-mount-failed', solve('condensing', [('summary-mount-failed', N)], N), 'individuals-visible')
check('summary-visible / inspect-burst', solve('summary-visible', [('inspect-burst', N)], N), 'expanding-details')
check('expanding-details / details-mounted', solve('expanding-details', [('details-mounted', N)], N), 'details-visible')
check('details-visible / collapse-details', solve('details-visible', [('collapse-details', N)], N), 'summary-visible')
check('summary-visible / new-burst-item', solve('summary-visible', [('new-burst-item', N)], N), 'summary-updating')
check('summary-updating / summary-update-mounted', solve('summary-updating', [('summary-update-mounted', N)], N), 'summary-visible')
check('expanding-details / close-before-mount', solve('expanding-details', [('close-before-mount', N)], N), 'closing-details')
check('closing-details / late-details-mounted', solve('closing-details', [('late-details-mounted', N)], N), 'summary-visible')
check('older notification incarnation', solve('individuals-visible', [('burst-detected', N - 1)], N), 'individuals-visible')
check('future notification incarnation', solve('individuals-visible', [('burst-detected', N + 1)], N), 'individuals-visible')
check('unknown event is inert', solve('individuals-visible', [('unknown-event', N)], N), 'individuals-visible')
check('empty delivery batch', solve('individuals-visible', [], N), 'individuals-visible')
check('N stale deliveries before current delivery', solve('individuals-visible', [('burst-detected', N - 1)] * N + [('burst-detected', N)], N), 'condensing')
check('trace burst-detected then summary-mounted', solve('individuals-visible', [('burst-detected', N), ('summary-mounted', N)], N), 'summary-visible')
check('trace burst-detected then summary-mount-failed', solve('individuals-visible', [('burst-detected', N), ('summary-mount-failed', N)], N), 'individuals-visible')
check('trace summary-mounted then inspect-burst', solve('condensing', [('summary-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-mounted then new-burst-item', solve('condensing', [('summary-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace summary-mount-failed then burst-detected', solve('condensing', [('summary-mount-failed', N), ('burst-detected', N)], N), 'condensing')
check('trace inspect-burst then details-mounted', solve('summary-visible', [('inspect-burst', N), ('details-mounted', N)], N), 'details-visible')
check('trace inspect-burst then close-before-mount', solve('summary-visible', [('inspect-burst', N), ('close-before-mount', N)], N), 'closing-details')
check('trace details-mounted then collapse-details', solve('expanding-details', [('details-mounted', N), ('collapse-details', N)], N), 'summary-visible')
check('trace collapse-details then inspect-burst', solve('details-visible', [('collapse-details', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace collapse-details then new-burst-item', solve('details-visible', [('collapse-details', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace new-burst-item then summary-update-mounted', solve('summary-visible', [('new-burst-item', N), ('summary-update-mounted', N)], N), 'summary-visible')
check('trace summary-update-mounted then inspect-burst', solve('summary-updating', [('summary-update-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace summary-update-mounted then new-burst-item', solve('summary-updating', [('summary-update-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('trace close-before-mount then late-details-mounted', solve('expanding-details', [('close-before-mount', N), ('late-details-mounted', N)], N), 'summary-visible')
check('trace late-details-mounted then inspect-burst', solve('closing-details', [('late-details-mounted', N), ('inspect-burst', N)], N), 'expanding-details')
check('trace late-details-mounted then new-burst-item', solve('closing-details', [('late-details-mounted', N), ('new-burst-item', N)], N), 'summary-updating')
check('domain state regression 1: summary_members', solve('condensing', [('summary-mounted', N, {'mount': 2})], N, {}, 'summary_members'), {'phase': 'condensing', 'value': []})
check('domain state regression 2: summary_members', solve('condensing', [('summary-mounted', N, {})], N, {}, 'summary_members'), {'phase': 'summary-visible', 'value': ['a', 'b']})
check('domain state regression 3: items', solve('summary-visible', [('new-burst-item', N, {'item': 'a'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b']})
check('domain state regression 4: items', solve('summary-visible', [('new-burst-item', N, {'item': 'c'})], N, {}, 'items'), {'phase': 'summary-updating', 'value': ['a', 'b', 'c']})
check('domain state regression 5: detail_members', solve('expanding-details', [('details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'details-visible', 'value': ['a', 'b']})
check('domain state regression 6: detail_members', solve('closing-details', [('late-details-mounted', N, {})], N, {'detail_members': ['a', 'b']}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
check('domain state regression 7: detail_members', solve('summary-visible', [('inspect-burst', N, {}), ('close-before-mount', N, {}), ('late-details-mounted', N, {})], N, {}, 'detail_members'), {'phase': 'summary-visible', 'value': []})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The new-burst-item event leaves a notification in individuals-visible instead of summary-updating.

Notification burst summary interaction is a bounded visual-notification workflow with mutable policy state {'items': ['a', 'b'], 'summary_members': [], 'detail_members': [], 'mount': 3}. Its default transition relation is {('individuals-visible', 'burst-detected'): 'condensing', ('condensing', 'summary-mounted'): 'summary-visible', ('condensing', 'summary-mount-failed'): 'individuals-visible', ('summary-visible', 'inspect-burst'): 'expanding-details', ('expanding-details', 'details-mounted'): 'details-visible', ('details-visible', 'collapse-details'): 'summary-visible', ('summary-visible', 'new-burst-item'): 'summary-updating', ('summary-updating', 'summary-update-mounted'): 'summary-visible', ('expanding-details', 'close-before-mount'): 'closing-details', ('closing-details', 'late-details-mounted'): 'summary-visible'}; domain inputs can suppress or redirect transitions and update policy fields, as specified in solve. Different-generation events are inert. Batches apply in order. Optional observe returns the selected policy field alongside the phase.

split: open-access