FAILURE MAP
← Case archive

FA-42491 / Listener lifecycle / Open access

Zip emits an unmatched value when either input buffer is ready · case 01

Zip emits an unmatched value when either input buffer is ready; the returned lifecycle plan violates the stated transition contract.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The ready decision in the zip-observer listener model is computed as bool(s['left']) or bool(s['right']), losing a required lifecycle condition.

VERIFIED REPAIR

Compute the ready decision from the complete contract: bool(s['left']) and bool(s['right']) and s['credit']>0.

Unsuccessful approach: The partial repair uses bool(s['left']) and bool(s['right']); a retained regression distinguishes it from the full transition.

Case contract

Plan a two-source zip observer with arrival-order input buffers. Emit one pair only when both buffers are nonempty and downstream credit is positive. Consume one head from each. Complete as soon as a completed source has an empty buffer, since no future pair is possible. Error disposes both input subscriptions, and cancellation releases both buffered tails. Consume the paired left head before invoking the output callback, then append left values produced reentrantly by that callback to the remaining tail. Inputs are finite state snapshots, including transitional and stale states; output fields are the exact independent actions/metadata defined by the corrected expression table. Numeric fixture capacities and counts vary with N. Field definitions, each independently computed from the input snapshot: ready = bool(s['left']) and bool(s['right']) and s['credit']>0; pair = [s['left'][0],s['right'][0]] if s['left'] and s['right'] else None; left_tail = s['left'][1:] if s['left'] and s['right'] and s['credit']>0 else list(s['left']); right_tail = s['right'][1:] if s['left'] and s['right'] and s['credit']>0 else list(s['right']); complete = (s['left_done'] and not s['left']) or (s['right_done'] and not s['right']); credit = max(0,s['credit']-int(bool(s['left']) and bool(s['right']))); left_dispose = s['left_owned'] and (s['error'] is not None or s['cancel']); right_dispose = s['right_owned'] and (s['error'] is not None or s['cancel']); clear_left = s['left'][1:]+list(s['reentrant_left']) if s['left'] and s['right'] else list(s['left'])+list(s['reentrant_left']); clear_right = [] if s['error'] is not None else list(s['right'])

Why this case matters

Observer implementations need to preserve this state while subscriptions enter, execute, and leave their lifecycle.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(s):
    return {
        'ready': bool(s['left']) or bool(s['right']),
        'pair': [s['left'][0],s['right'][0]] if s['left'] and s['right'] else None,
        'left_tail': s['left'][1:] if s['left'] and s['right'] and s['credit']>0 else list(s['left']),
        'right_tail': s['right'][1:] if s['left'] and s['right'] and s['credit']>0 else list(s['right']),
        'complete': (s['left_done'] and not s['left']) or (s['right_done'] and not s['right']),
        'credit': max(0,s['credit']-int(bool(s['left']) and bool(s['right']))),
        'left_dispose': s['left_owned'] and (s['error'] is not None or s['cancel']),
        'right_dispose': s['right_owned'] and (s['error'] is not None or s['cancel']),
        'clear_left': s['left'][1:]+list(s['reentrant_left']) if s['left'] and s['right'] else list(s['left'])+list(s['reentrant_left']),
        'clear_right': [] if s['error'] is not None else list(s['right']),
    }
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new']}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['b', 'c', 'new'], 'clear_right': []}), ({'left': [], 'right': ['x', 'y'], 'credit': 3, 'left_done': True, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x', 'y'], 'complete': True, 'credit': 3, 'left_dispose': True, 'right_dispose': True, 'clear_left': [], 'clear_right': ['x', 'y']}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': False, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['b', 'c', 'new'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': [], 'credit': 1, 'left_done': False, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': ['a', 'b', 'c'], 'right_tail': [], 'complete': False, 'credit': 1, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['a', 'b', 'c', 'new'], 'clear_right': []}), ({'left': ['a'], 'right': ['x'], 'credit': 1, 'left_done': False, 'right_done': True, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['new'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x'], 'credit': 3, 'left_done': False, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': [], 'complete': False, 'credit': 2, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['b', 'c'], 'clear_right': ['x']}), ({'left': [], 'right': [], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': [], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 3, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': ['y'], 'complete': False, 'credit': 2, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []})], 2: [({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': True, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new']}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['b', 'c', 'new'], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 6, 'left_done': False, 'right_done': True, 'error': None, 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': True, 'credit': 6, 'left_dispose': True, 'right_dispose': True, 'clear_left': [], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': [], 'credit': 6, 'left_done': True, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': True, 'right_owned': False, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': ['a', 'b', 'c'], 'right_tail': [], 'complete': False, 'credit': 6, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['a', 'b', 'c', 'new'], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 6, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': True, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 6, 'left_dispose': False, 'right_dispose': False, 'clear_left': [], 'clear_right': []}), ({'left': [], 'right': ['x', 'y'], 'credit': 6, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x', 'y'], 'complete': True, 'credit': 6, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['new'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': [], 'credit': 6, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': True, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': ['a', 'b', 'c'], 'right_tail': [], 'complete': False, 'credit': 6, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['a', 'b', 'c'], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': [], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 6, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': ['y'], 'complete': False, 'credit': 5, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []})], 3: [({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []}), ({'left': [], 'right': ['x', 'y'], 'credit': 1, 'left_done': True, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x', 'y'], 'complete': True, 'credit': 1, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['new'], 'clear_right': ['x', 'y']}), ({'left': ['a', 'b', 'c'], 'right': [], 'credit': 1, 'left_done': True, 'right_done': True, 'error': None, 'cancel': False, 'left_owned': True, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': ['a', 'b', 'c'], 'right_tail': [], 'complete': True, 'credit': 1, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['a', 'b', 'c'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': [], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': None, 'left_tail': ['a', 'b', 'c'], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['a', 'b', 'c', 'new', 'newer'], 'clear_right': []}), ({'left': [], 'right': ['x', 'y'], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['new'], 'clear_right': ['x', 'y']}), ({'left': [], 'right': ['x', 'y'], 'credit': 1, 'left_done': False, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 1, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['new', 'newer'], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': [], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 9, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': ['y'], 'complete': False, 'credit': 8, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []})], 4: [({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []}), ({'left': ['a'], 'right': [], 'credit': 12, 'left_done': False, 'right_done': True, 'error': None, 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': ['a'], 'right_tail': [], 'complete': True, 'credit': 12, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['a'], 'clear_right': []}), ({'left': [], 'right': ['x', 'y'], 'credit': 12, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x', 'y'], 'complete': True, 'credit': 12, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['new'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 12, 'left_done': False, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': ['y'], 'complete': False, 'credit': 11, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': ['x', 'y']}), ({'left': ['a', 'b', 'c'], 'right': ['x'], 'credit': 1, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 12, 'left_done': False, 'right_done': True, 'error': 'bad', 'cancel': False, 'left_owned': True, 'right_owned': True, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': True, 'credit': 12, 'left_dispose': True, 'right_dispose': True, 'clear_left': [], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': [], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 12, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': ['y'], 'complete': False, 'credit': 11, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []})], 5: [({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []}), ({'left': ['a'], 'right': [], 'credit': 1, 'left_done': True, 'right_done': True, 'error': None, 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': None, 'left_tail': ['a'], 'right_tail': [], 'complete': True, 'credit': 1, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['a', 'new', 'newer'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': True, 'left_owned': False, 'right_owned': True, 'reentrant_left': []}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['b', 'c'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': [], 'credit': 15, 'left_done': True, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': True, 'right_owned': False, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': None, 'left_tail': ['a', 'b', 'c'], 'right_tail': [], 'complete': False, 'credit': 15, 'left_dispose': True, 'right_dispose': False, 'clear_left': ['a', 'b', 'c', 'new', 'newer'], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 1, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': True, 'credit': 1, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['new'], 'clear_right': []}), ({'left': [], 'right': ['x'], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['new'], 'clear_right': ['x']}), ({'left': [], 'right': [], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': [], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 15, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': ['y'], 'complete': False, 'credit': 14, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []})]}
for i,(state,expected) in enumerate(fixtures[N]):
    check("transition "+str(i), solve(state), 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 fixtureActualExpectedOutcome
transition 0{'clear_left': ['b', 'c', 'new'], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': ['a', 'b', 'c'], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': False, 'right_tail': ['x', 'y']}{'clear_left': ['b', 'c', 'new'], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': ['a', 'b', 'c'], 'pair': ['a', 'x'], 'ready': False, 'right_dispose': False, 'right_tail': ['x', 'y']}Failed
transition 1{'clear_left': [], 'clear_right': ['x', 'y'], 'complete': True, 'credit': 3, 'left_dispose': True, 'left_tail': [], 'pair': None, 'ready': True, 'right_dispose': True, 'right_tail': ['x', 'y']}{'clear_left': [], 'clear_right': ['x', 'y'], 'complete': True, 'credit': 3, 'left_dispose': True, 'left_tail': [], 'pair': None, 'ready': False, 'right_dispose': True, 'right_tail': ['x', 'y']}Failed
transition 2{'clear_left': ['b', 'c', 'new'], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': ['a', 'b', 'c'], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': True, 'right_tail': ['x', 'y']}{'clear_left': ['b', 'c', 'new'], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': ['a', 'b', 'c'], 'pair': ['a', 'x'], 'ready': False, 'right_dispose': True, 'right_tail': ['x', 'y']}Failed
transition 3{'clear_left': ['a', 'b', 'c', 'new'], 'clear_right': [], 'complete': False, 'credit': 1, 'left_dispose': False, 'left_tail': ['a', 'b', 'c'], 'pair': None, 'ready': True, 'right_dispose': True, 'right_tail': []}{'clear_left': ['a', 'b', 'c', 'new'], 'clear_right': [], 'complete': False, 'credit': 1, 'left_dispose': False, 'left_tail': ['a', 'b', 'c'], 'pair': None, 'ready': False, 'right_dispose': True, 'right_tail': []}Failed
transition 4{'clear_left': ['new'], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': [], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': False, 'right_tail': []}{'clear_left': ['new'], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': [], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': False, 'right_tail': []}Passed
transition 5{'clear_left': ['b', 'c'], 'clear_right': ['x'], 'complete': False, 'credit': 2, 'left_dispose': False, 'left_tail': ['b', 'c'], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': False, 'right_tail': []}{'clear_left': ['b', 'c'], 'clear_right': ['x'], 'complete': False, 'credit': 2, 'left_dispose': False, 'left_tail': ['b', 'c'], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': False, 'right_tail': []}Passed
transition 6{'clear_left': [], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': [], 'pair': None, 'ready': False, 'right_dispose': False, 'right_tail': []}{'clear_left': [], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': [], 'pair': None, 'ready': False, 'right_dispose': False, 'right_tail': []}Passed
transition 7{'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': [], 'complete': False, 'credit': 2, 'left_dispose': True, 'left_tail': ['b', 'c'], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': True, 'right_tail': ['y']}{'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': [], 'complete': False, 'credit': 2, 'left_dispose': True, 'left_tail': ['b', 'c'], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': True, 'right_tail': ['y']}Passed

SHA-256 / 94c8c35df4a270f4ba6379408bf426ef908678b43f25a0efbd1acdd0f2454112

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(s):
    return {
        'ready': bool(s['left']) and bool(s['right']),
        'pair': [s['left'][0],s['right'][0]] if s['left'] and s['right'] else None,
        'left_tail': s['left'][1:] if s['left'] and s['right'] and s['credit']>0 else list(s['left']),
        'right_tail': s['right'][1:] if s['left'] and s['right'] and s['credit']>0 else list(s['right']),
        'complete': (s['left_done'] and not s['left']) or (s['right_done'] and not s['right']),
        'credit': max(0,s['credit']-int(bool(s['left']) and bool(s['right']))),
        'left_dispose': s['left_owned'] and (s['error'] is not None or s['cancel']),
        'right_dispose': s['right_owned'] and (s['error'] is not None or s['cancel']),
        'clear_left': s['left'][1:]+list(s['reentrant_left']) if s['left'] and s['right'] else list(s['left'])+list(s['reentrant_left']),
        'clear_right': [] if s['error'] is not None else list(s['right']),
    }
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new']}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['b', 'c', 'new'], 'clear_right': []}), ({'left': [], 'right': ['x', 'y'], 'credit': 3, 'left_done': True, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x', 'y'], 'complete': True, 'credit': 3, 'left_dispose': True, 'right_dispose': True, 'clear_left': [], 'clear_right': ['x', 'y']}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': False, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['b', 'c', 'new'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': [], 'credit': 1, 'left_done': False, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': ['a', 'b', 'c'], 'right_tail': [], 'complete': False, 'credit': 1, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['a', 'b', 'c', 'new'], 'clear_right': []}), ({'left': ['a'], 'right': ['x'], 'credit': 1, 'left_done': False, 'right_done': True, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['new'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x'], 'credit': 3, 'left_done': False, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': [], 'complete': False, 'credit': 2, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['b', 'c'], 'clear_right': ['x']}), ({'left': [], 'right': [], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': [], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 3, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': ['y'], 'complete': False, 'credit': 2, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []})], 2: [({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': True, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new']}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['b', 'c', 'new'], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 6, 'left_done': False, 'right_done': True, 'error': None, 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': True, 'credit': 6, 'left_dispose': True, 'right_dispose': True, 'clear_left': [], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': [], 'credit': 6, 'left_done': True, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': True, 'right_owned': False, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': ['a', 'b', 'c'], 'right_tail': [], 'complete': False, 'credit': 6, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['a', 'b', 'c', 'new'], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 6, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': True, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 6, 'left_dispose': False, 'right_dispose': False, 'clear_left': [], 'clear_right': []}), ({'left': [], 'right': ['x', 'y'], 'credit': 6, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x', 'y'], 'complete': True, 'credit': 6, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['new'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': [], 'credit': 6, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': True, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': ['a', 'b', 'c'], 'right_tail': [], 'complete': False, 'credit': 6, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['a', 'b', 'c'], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': [], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 6, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': ['y'], 'complete': False, 'credit': 5, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []})], 3: [({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []}), ({'left': [], 'right': ['x', 'y'], 'credit': 1, 'left_done': True, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x', 'y'], 'complete': True, 'credit': 1, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['new'], 'clear_right': ['x', 'y']}), ({'left': ['a', 'b', 'c'], 'right': [], 'credit': 1, 'left_done': True, 'right_done': True, 'error': None, 'cancel': False, 'left_owned': True, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': ['a', 'b', 'c'], 'right_tail': [], 'complete': True, 'credit': 1, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['a', 'b', 'c'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': [], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': None, 'left_tail': ['a', 'b', 'c'], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['a', 'b', 'c', 'new', 'newer'], 'clear_right': []}), ({'left': [], 'right': ['x', 'y'], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['new'], 'clear_right': ['x', 'y']}), ({'left': [], 'right': ['x', 'y'], 'credit': 1, 'left_done': False, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 1, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['new', 'newer'], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': [], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 9, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': ['y'], 'complete': False, 'credit': 8, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []})], 4: [({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []}), ({'left': ['a'], 'right': [], 'credit': 12, 'left_done': False, 'right_done': True, 'error': None, 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': ['a'], 'right_tail': [], 'complete': True, 'credit': 12, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['a'], 'clear_right': []}), ({'left': [], 'right': ['x', 'y'], 'credit': 12, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x', 'y'], 'complete': True, 'credit': 12, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['new'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 12, 'left_done': False, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': ['y'], 'complete': False, 'credit': 11, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': ['x', 'y']}), ({'left': ['a', 'b', 'c'], 'right': ['x'], 'credit': 1, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 12, 'left_done': False, 'right_done': True, 'error': 'bad', 'cancel': False, 'left_owned': True, 'right_owned': True, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': True, 'credit': 12, 'left_dispose': True, 'right_dispose': True, 'clear_left': [], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': [], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 12, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': ['y'], 'complete': False, 'credit': 11, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []})], 5: [({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []}), ({'left': ['a'], 'right': [], 'credit': 1, 'left_done': True, 'right_done': True, 'error': None, 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': None, 'left_tail': ['a'], 'right_tail': [], 'complete': True, 'credit': 1, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['a', 'new', 'newer'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': True, 'left_owned': False, 'right_owned': True, 'reentrant_left': []}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['b', 'c'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': [], 'credit': 15, 'left_done': True, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': True, 'right_owned': False, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': None, 'left_tail': ['a', 'b', 'c'], 'right_tail': [], 'complete': False, 'credit': 15, 'left_dispose': True, 'right_dispose': False, 'clear_left': ['a', 'b', 'c', 'new', 'newer'], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 1, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': True, 'credit': 1, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['new'], 'clear_right': []}), ({'left': [], 'right': ['x'], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['new'], 'clear_right': ['x']}), ({'left': [], 'right': [], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': [], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 15, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': ['y'], 'complete': False, 'credit': 14, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []})]}
for i,(state,expected) in enumerate(fixtures[N]):
    check("transition "+str(i), solve(state), 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 fixtureActualExpectedOutcome
transition 0{'clear_left': ['b', 'c', 'new'], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': ['a', 'b', 'c'], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': False, 'right_tail': ['x', 'y']}{'clear_left': ['b', 'c', 'new'], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': ['a', 'b', 'c'], 'pair': ['a', 'x'], 'ready': False, 'right_dispose': False, 'right_tail': ['x', 'y']}Failed
transition 1{'clear_left': [], 'clear_right': ['x', 'y'], 'complete': True, 'credit': 3, 'left_dispose': True, 'left_tail': [], 'pair': None, 'ready': False, 'right_dispose': True, 'right_tail': ['x', 'y']}{'clear_left': [], 'clear_right': ['x', 'y'], 'complete': True, 'credit': 3, 'left_dispose': True, 'left_tail': [], 'pair': None, 'ready': False, 'right_dispose': True, 'right_tail': ['x', 'y']}Passed
transition 2{'clear_left': ['b', 'c', 'new'], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': ['a', 'b', 'c'], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': True, 'right_tail': ['x', 'y']}{'clear_left': ['b', 'c', 'new'], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': ['a', 'b', 'c'], 'pair': ['a', 'x'], 'ready': False, 'right_dispose': True, 'right_tail': ['x', 'y']}Failed
transition 3{'clear_left': ['a', 'b', 'c', 'new'], 'clear_right': [], 'complete': False, 'credit': 1, 'left_dispose': False, 'left_tail': ['a', 'b', 'c'], 'pair': None, 'ready': False, 'right_dispose': True, 'right_tail': []}{'clear_left': ['a', 'b', 'c', 'new'], 'clear_right': [], 'complete': False, 'credit': 1, 'left_dispose': False, 'left_tail': ['a', 'b', 'c'], 'pair': None, 'ready': False, 'right_dispose': True, 'right_tail': []}Passed
transition 4{'clear_left': ['new'], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': [], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': False, 'right_tail': []}{'clear_left': ['new'], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': [], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': False, 'right_tail': []}Passed
transition 5{'clear_left': ['b', 'c'], 'clear_right': ['x'], 'complete': False, 'credit': 2, 'left_dispose': False, 'left_tail': ['b', 'c'], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': False, 'right_tail': []}{'clear_left': ['b', 'c'], 'clear_right': ['x'], 'complete': False, 'credit': 2, 'left_dispose': False, 'left_tail': ['b', 'c'], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': False, 'right_tail': []}Passed
transition 6{'clear_left': [], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': [], 'pair': None, 'ready': False, 'right_dispose': False, 'right_tail': []}{'clear_left': [], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': [], 'pair': None, 'ready': False, 'right_dispose': False, 'right_tail': []}Passed
transition 7{'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': [], 'complete': False, 'credit': 2, 'left_dispose': True, 'left_tail': ['b', 'c'], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': True, 'right_tail': ['y']}{'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': [], 'complete': False, 'credit': 2, 'left_dispose': True, 'left_tail': ['b', 'c'], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': True, 'right_tail': ['y']}Passed

SHA-256 / 9371b3b3d4d855a940c366e88f6a59c660460da70b0dfd61e472af9dbae333be

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(s):
    return {
        'ready': bool(s['left']) and bool(s['right']) and s['credit']>0,
        'pair': [s['left'][0],s['right'][0]] if s['left'] and s['right'] else None,
        'left_tail': s['left'][1:] if s['left'] and s['right'] and s['credit']>0 else list(s['left']),
        'right_tail': s['right'][1:] if s['left'] and s['right'] and s['credit']>0 else list(s['right']),
        'complete': (s['left_done'] and not s['left']) or (s['right_done'] and not s['right']),
        'credit': max(0,s['credit']-int(bool(s['left']) and bool(s['right']))),
        'left_dispose': s['left_owned'] and (s['error'] is not None or s['cancel']),
        'right_dispose': s['right_owned'] and (s['error'] is not None or s['cancel']),
        'clear_left': s['left'][1:]+list(s['reentrant_left']) if s['left'] and s['right'] else list(s['left'])+list(s['reentrant_left']),
        'clear_right': [] if s['error'] is not None else list(s['right']),
    }
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new']}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['b', 'c', 'new'], 'clear_right': []}), ({'left': [], 'right': ['x', 'y'], 'credit': 3, 'left_done': True, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x', 'y'], 'complete': True, 'credit': 3, 'left_dispose': True, 'right_dispose': True, 'clear_left': [], 'clear_right': ['x', 'y']}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': False, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['b', 'c', 'new'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': [], 'credit': 1, 'left_done': False, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': ['a', 'b', 'c'], 'right_tail': [], 'complete': False, 'credit': 1, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['a', 'b', 'c', 'new'], 'clear_right': []}), ({'left': ['a'], 'right': ['x'], 'credit': 1, 'left_done': False, 'right_done': True, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['new'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x'], 'credit': 3, 'left_done': False, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': [], 'complete': False, 'credit': 2, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['b', 'c'], 'clear_right': ['x']}), ({'left': [], 'right': [], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': [], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 3, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': ['y'], 'complete': False, 'credit': 2, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []})], 2: [({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': True, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new']}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['b', 'c', 'new'], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 6, 'left_done': False, 'right_done': True, 'error': None, 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': True, 'credit': 6, 'left_dispose': True, 'right_dispose': True, 'clear_left': [], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': [], 'credit': 6, 'left_done': True, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': True, 'right_owned': False, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': ['a', 'b', 'c'], 'right_tail': [], 'complete': False, 'credit': 6, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['a', 'b', 'c', 'new'], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 6, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': True, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 6, 'left_dispose': False, 'right_dispose': False, 'clear_left': [], 'clear_right': []}), ({'left': [], 'right': ['x', 'y'], 'credit': 6, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x', 'y'], 'complete': True, 'credit': 6, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['new'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': [], 'credit': 6, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': True, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': ['a', 'b', 'c'], 'right_tail': [], 'complete': False, 'credit': 6, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['a', 'b', 'c'], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': [], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 6, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': ['y'], 'complete': False, 'credit': 5, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []})], 3: [({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []}), ({'left': [], 'right': ['x', 'y'], 'credit': 1, 'left_done': True, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x', 'y'], 'complete': True, 'credit': 1, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['new'], 'clear_right': ['x', 'y']}), ({'left': ['a', 'b', 'c'], 'right': [], 'credit': 1, 'left_done': True, 'right_done': True, 'error': None, 'cancel': False, 'left_owned': True, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': ['a', 'b', 'c'], 'right_tail': [], 'complete': True, 'credit': 1, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['a', 'b', 'c'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': [], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': None, 'left_tail': ['a', 'b', 'c'], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['a', 'b', 'c', 'new', 'newer'], 'clear_right': []}), ({'left': [], 'right': ['x', 'y'], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['new'], 'clear_right': ['x', 'y']}), ({'left': [], 'right': ['x', 'y'], 'credit': 1, 'left_done': False, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 1, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['new', 'newer'], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': [], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 9, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': ['y'], 'complete': False, 'credit': 8, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []})], 4: [({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []}), ({'left': ['a'], 'right': [], 'credit': 12, 'left_done': False, 'right_done': True, 'error': None, 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': ['a'], 'right_tail': [], 'complete': True, 'credit': 12, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['a'], 'clear_right': []}), ({'left': [], 'right': ['x', 'y'], 'credit': 12, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x', 'y'], 'complete': True, 'credit': 12, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['new'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 12, 'left_done': False, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': ['y'], 'complete': False, 'credit': 11, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': ['x', 'y']}), ({'left': ['a', 'b', 'c'], 'right': ['x'], 'credit': 1, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 12, 'left_done': False, 'right_done': True, 'error': 'bad', 'cancel': False, 'left_owned': True, 'right_owned': True, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': True, 'credit': 12, 'left_dispose': True, 'right_dispose': True, 'clear_left': [], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': [], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 12, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': ['y'], 'complete': False, 'credit': 11, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []})], 5: [({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []}), ({'left': ['a'], 'right': [], 'credit': 1, 'left_done': True, 'right_done': True, 'error': None, 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': None, 'left_tail': ['a'], 'right_tail': [], 'complete': True, 'credit': 1, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['a', 'new', 'newer'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 0, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': True, 'left_owned': False, 'right_owned': True, 'reentrant_left': []}, {'ready': False, 'pair': ['a', 'x'], 'left_tail': ['a', 'b', 'c'], 'right_tail': ['x', 'y'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['b', 'c'], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': [], 'credit': 15, 'left_done': True, 'right_done': False, 'error': None, 'cancel': True, 'left_owned': True, 'right_owned': False, 'reentrant_left': ['new', 'newer']}, {'ready': False, 'pair': None, 'left_tail': ['a', 'b', 'c'], 'right_tail': [], 'complete': False, 'credit': 15, 'left_dispose': True, 'right_dispose': False, 'clear_left': ['a', 'b', 'c', 'new', 'newer'], 'clear_right': []}), ({'left': [], 'right': [], 'credit': 1, 'left_done': True, 'right_done': False, 'error': 'bad', 'cancel': False, 'left_owned': False, 'right_owned': True, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': True, 'credit': 1, 'left_dispose': False, 'right_dispose': True, 'clear_left': ['new'], 'clear_right': []}), ({'left': [], 'right': ['x'], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': ['new']}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': ['x'], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': ['new'], 'clear_right': ['x']}), ({'left': [], 'right': [], 'credit': 0, 'left_done': False, 'right_done': False, 'error': None, 'cancel': False, 'left_owned': False, 'right_owned': False, 'reentrant_left': []}, {'ready': False, 'pair': None, 'left_tail': [], 'right_tail': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'right_dispose': False, 'clear_left': [], 'clear_right': []}), ({'left': ['a', 'b', 'c'], 'right': ['x', 'y'], 'credit': 15, 'left_done': True, 'right_done': True, 'error': 'bad', 'cancel': True, 'left_owned': True, 'right_owned': True, 'reentrant_left': ['new', 'newer']}, {'ready': True, 'pair': ['a', 'x'], 'left_tail': ['b', 'c'], 'right_tail': ['y'], 'complete': False, 'credit': 14, 'left_dispose': True, 'right_dispose': True, 'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': []})]}
for i,(state,expected) in enumerate(fixtures[N]):
    check("transition "+str(i), solve(state), 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 fixtureActualExpectedOutcome
transition 0{'clear_left': ['b', 'c', 'new'], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': ['a', 'b', 'c'], 'pair': ['a', 'x'], 'ready': False, 'right_dispose': False, 'right_tail': ['x', 'y']}{'clear_left': ['b', 'c', 'new'], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': ['a', 'b', 'c'], 'pair': ['a', 'x'], 'ready': False, 'right_dispose': False, 'right_tail': ['x', 'y']}Passed
transition 1{'clear_left': [], 'clear_right': ['x', 'y'], 'complete': True, 'credit': 3, 'left_dispose': True, 'left_tail': [], 'pair': None, 'ready': False, 'right_dispose': True, 'right_tail': ['x', 'y']}{'clear_left': [], 'clear_right': ['x', 'y'], 'complete': True, 'credit': 3, 'left_dispose': True, 'left_tail': [], 'pair': None, 'ready': False, 'right_dispose': True, 'right_tail': ['x', 'y']}Passed
transition 2{'clear_left': ['b', 'c', 'new'], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': ['a', 'b', 'c'], 'pair': ['a', 'x'], 'ready': False, 'right_dispose': True, 'right_tail': ['x', 'y']}{'clear_left': ['b', 'c', 'new'], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': ['a', 'b', 'c'], 'pair': ['a', 'x'], 'ready': False, 'right_dispose': True, 'right_tail': ['x', 'y']}Passed
transition 3{'clear_left': ['a', 'b', 'c', 'new'], 'clear_right': [], 'complete': False, 'credit': 1, 'left_dispose': False, 'left_tail': ['a', 'b', 'c'], 'pair': None, 'ready': False, 'right_dispose': True, 'right_tail': []}{'clear_left': ['a', 'b', 'c', 'new'], 'clear_right': [], 'complete': False, 'credit': 1, 'left_dispose': False, 'left_tail': ['a', 'b', 'c'], 'pair': None, 'ready': False, 'right_dispose': True, 'right_tail': []}Passed
transition 4{'clear_left': ['new'], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': [], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': False, 'right_tail': []}{'clear_left': ['new'], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': [], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': False, 'right_tail': []}Passed
transition 5{'clear_left': ['b', 'c'], 'clear_right': ['x'], 'complete': False, 'credit': 2, 'left_dispose': False, 'left_tail': ['b', 'c'], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': False, 'right_tail': []}{'clear_left': ['b', 'c'], 'clear_right': ['x'], 'complete': False, 'credit': 2, 'left_dispose': False, 'left_tail': ['b', 'c'], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': False, 'right_tail': []}Passed
transition 6{'clear_left': [], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': [], 'pair': None, 'ready': False, 'right_dispose': False, 'right_tail': []}{'clear_left': [], 'clear_right': [], 'complete': False, 'credit': 0, 'left_dispose': False, 'left_tail': [], 'pair': None, 'ready': False, 'right_dispose': False, 'right_tail': []}Passed
transition 7{'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': [], 'complete': False, 'credit': 2, 'left_dispose': True, 'left_tail': ['b', 'c'], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': True, 'right_tail': ['y']}{'clear_left': ['b', 'c', 'new', 'newer'], 'clear_right': [], 'complete': False, 'credit': 2, 'left_dispose': True, 'left_tail': ['b', 'c'], 'pair': ['a', 'x'], 'ready': True, 'right_dispose': True, 'right_tail': ['y']}Passed

SHA-256 / 67b5422c12754f6afcff3ca93a9d0f65ccdde340ed5d3f968f6d517a1c01237b

Verification & scope

A deterministic, bounded, single-threaded transition planner. Returned plans model state changes; they do not implement a production event framework. 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:43:52.301312+00:00.

Case digest / 8950009362d6b8f251ef821430b99e92d60a3454e27b566ac776e8943a82633e