FAILURE MAP
← Case archive

FA-25701 / Filter interfaces / Open access

Order-only filter changes do not create undo transactions · case 01

Order-only filter changes do not create undo transactions is violated by the widget projection.

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

ROOT CAUSE

The noop-history decision uses `d['history']+[d['current']]` instead of the stipulated filter-undo projection.

VERIFIED REPAIR

Implement the declared noop-history projection: `d['history'] if set(d['next'])==set(d['current']) else d['history']+[d['current']]`.

Unsuccessful approach: The attempted correction `d['history'] if d['next']==d['current'] else d['history']+[d['current']]` still violates the explicit contract fixtures.

Case contract

Each filter edit transaction records before and after snapshots. Undo/redo moves whole constraint snapshots and does not resurrect history after a new branch edit. This example checks: Order-only filter changes do not create undo transactions.

Why this case matters

Filter-widget state and serialization must preserve user constraints while the view changes.

1 / The failure

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

N = 1
observations = []
def solve(d):
    return {'undo-snapshot':(d['history'][-1] if d['history'] else d['current']), 'undo-tail':(d['history'][:-1]), 'redo-snapshot':(d['future'][0] if d['future'] else d['current']), 'branch-future':([] if d['new_edit'] else d['future']), 'noop-history':(d['history']+[d['current']]), 'undo-available':(bool(d['history']) and not d['applying'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a', 'b']], 'undo-available': False}), ({'history': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [['a', 'b']], 'undo-available': False}), ({'history': [], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': False}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [['a'], ['a', 'b']], 'undo-available': False}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['b']], 'undo-available': False})], 2: [({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a', 'b']], 'undo-available': False}), ({'history': [], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a', 'b']], 'undo-available': False}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': True}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [['a']], 'undo-available': True}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': True}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a'], ['a', 'b']], 'undo-available': True}), ({'history': [['a'], ['b']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['b']], 'undo-available': True}), ({'history': [['a'], ['b']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [['a'], ['b']], 'undo-available': True})], 3: [({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a', 'b']], 'undo-available': False}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': False}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a'], ['a', 'b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [['a'], ['b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': False})], 4: [({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': True}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': True}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': True}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a']], 'undo-available': True}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': True}), ({'history': [['a'], ['b']], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': True}), ({'history': [['a'], ['b']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['b']], 'undo-available': True}), ({'history': [['a'], ['b']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a'], ['b']], 'undo-available': True}), ({'history': [['a'], ['b']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': True})], 5: [({'history': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [], 'undo-available': False}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a'], ['b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': False}), ({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a', 'b']], 'undo-available': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), 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
contract fixture 0{'branch-future': [], 'noop-history': [['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}{'branch-future': [], 'noop-history': [], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}Failed
contract fixture 1{'branch-future': [], 'noop-history': [['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}{'branch-future': [], 'noop-history': [], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}Failed
contract fixture 2{'branch-future': [], 'noop-history': [['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}{'branch-future': [], 'noop-history': [['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}Passed
contract fixture 3{'branch-future': [['x']], 'noop-history': [['a', 'b']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}{'branch-future': [['x']], 'noop-history': [['a', 'b']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}Passed
contract fixture 4{'branch-future': [], 'noop-history': [['a', 'b']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}{'branch-future': [], 'noop-history': [], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}Failed
contract fixture 5{'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}{'branch-future': [], 'noop-history': [['a']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}Failed
contract fixture 6{'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}{'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}Passed
contract fixture 7{'branch-future': [['x']], 'noop-history': [['a'], ['a', 'b']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}{'branch-future': [['x']], 'noop-history': [['a'], ['a', 'b']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}Passed
contract fixture 8{'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}{'branch-future': [], 'noop-history': [['a']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}Failed
contract fixture 9{'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['b'], 'undo-tail': [['a']]}{'branch-future': [], 'noop-history': [['a'], ['b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['b'], 'undo-tail': [['a']]}Failed

SHA-256 / 014a5cd13a3fa477bc259d3bd80f80d60a3d153b8a58f447d78e0341e514f468

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(d):
    return {'undo-snapshot':(d['history'][-1] if d['history'] else d['current']), 'undo-tail':(d['history'][:-1]), 'redo-snapshot':(d['future'][0] if d['future'] else d['current']), 'branch-future':([] if d['new_edit'] else d['future']), 'noop-history':(d['history'] if d['next']==d['current'] else d['history']+[d['current']]), 'undo-available':(bool(d['history']) and not d['applying'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a', 'b']], 'undo-available': False}), ({'history': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [['a', 'b']], 'undo-available': False}), ({'history': [], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': False}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [['a'], ['a', 'b']], 'undo-available': False}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['b']], 'undo-available': False})], 2: [({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a', 'b']], 'undo-available': False}), ({'history': [], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a', 'b']], 'undo-available': False}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': True}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [['a']], 'undo-available': True}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': True}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a'], ['a', 'b']], 'undo-available': True}), ({'history': [['a'], ['b']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['b']], 'undo-available': True}), ({'history': [['a'], ['b']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [['a'], ['b']], 'undo-available': True})], 3: [({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a', 'b']], 'undo-available': False}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': False}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a'], ['a', 'b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [['a'], ['b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': False})], 4: [({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': True}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': True}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': True}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a']], 'undo-available': True}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': True}), ({'history': [['a'], ['b']], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': True}), ({'history': [['a'], ['b']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['b']], 'undo-available': True}), ({'history': [['a'], ['b']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a'], ['b']], 'undo-available': True}), ({'history': [['a'], ['b']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': True})], 5: [({'history': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [], 'undo-available': False}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a'], ['b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': False}), ({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a', 'b']], 'undo-available': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), 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
contract fixture 0{'branch-future': [], 'noop-history': [['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}{'branch-future': [], 'noop-history': [], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}Failed
contract fixture 1{'branch-future': [], 'noop-history': [['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}{'branch-future': [], 'noop-history': [], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}Failed
contract fixture 2{'branch-future': [], 'noop-history': [['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}{'branch-future': [], 'noop-history': [['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}Passed
contract fixture 3{'branch-future': [['x']], 'noop-history': [['a', 'b']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}{'branch-future': [['x']], 'noop-history': [['a', 'b']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}Passed
contract fixture 4{'branch-future': [], 'noop-history': [['a', 'b']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}{'branch-future': [], 'noop-history': [], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}Failed
contract fixture 5{'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}{'branch-future': [], 'noop-history': [['a']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}Failed
contract fixture 6{'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}{'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}Passed
contract fixture 7{'branch-future': [['x']], 'noop-history': [['a'], ['a', 'b']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}{'branch-future': [['x']], 'noop-history': [['a'], ['a', 'b']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}Passed
contract fixture 8{'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}{'branch-future': [], 'noop-history': [['a']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}Failed
contract fixture 9{'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['b'], 'undo-tail': [['a']]}{'branch-future': [], 'noop-history': [['a'], ['b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['b'], 'undo-tail': [['a']]}Failed

SHA-256 / 35aaf72fb726600f5f3f14b4a94fc1b570b4ffd805202fad0286971c88c94800

3 / The verified repair

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

N = 1
observations = []
def solve(d):
    return {'undo-snapshot':(d['history'][-1] if d['history'] else d['current']), 'undo-tail':(d['history'][:-1]), 'redo-snapshot':(d['future'][0] if d['future'] else d['current']), 'branch-future':([] if d['new_edit'] else d['future']), 'noop-history':(d['history'] if set(d['next'])==set(d['current']) else d['history']+[d['current']]), 'undo-available':(bool(d['history']) and not d['applying'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a', 'b']], 'undo-available': False}), ({'history': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [['a', 'b']], 'undo-available': False}), ({'history': [], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': False}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [['a'], ['a', 'b']], 'undo-available': False}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['b']], 'undo-available': False})], 2: [({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a', 'b']], 'undo-available': False}), ({'history': [], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a', 'b']], 'undo-available': False}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': True}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [['a']], 'undo-available': True}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': True}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a'], ['a', 'b']], 'undo-available': True}), ({'history': [['a'], ['b']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['b']], 'undo-available': True}), ({'history': [['a'], ['b']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [['a'], ['b']], 'undo-available': True})], 3: [({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a', 'b']], 'undo-available': False}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': False}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a'], ['a', 'b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [['a'], ['b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': False})], 4: [({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': True}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': True}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': True}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a']], 'undo-available': True}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': True}), ({'history': [['a'], ['b']], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': True}), ({'history': [['a'], ['b']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['b']], 'undo-available': True}), ({'history': [['a'], ['b']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a'], ['b']], 'undo-available': True}), ({'history': [['a'], ['b']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': True})], 5: [({'history': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], 'noop-history': [], 'undo-available': False}), ({'history': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a']], 'undo-available': False}), ({'history': [['a']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [['x']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a'], ['b']], 'undo-available': False}), ({'history': [['a'], ['b']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': False}), ({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a', 'b']], 'undo-available': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), 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
contract fixture 0{'branch-future': [], 'noop-history': [], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}{'branch-future': [], 'noop-history': [], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}Passed
contract fixture 1{'branch-future': [], 'noop-history': [], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}{'branch-future': [], 'noop-history': [], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}Passed
contract fixture 2{'branch-future': [], 'noop-history': [['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}{'branch-future': [], 'noop-history': [['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}Passed
contract fixture 3{'branch-future': [['x']], 'noop-history': [['a', 'b']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}{'branch-future': [['x']], 'noop-history': [['a', 'b']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}Passed
contract fixture 4{'branch-future': [], 'noop-history': [], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}{'branch-future': [], 'noop-history': [], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []}Passed
contract fixture 5{'branch-future': [], 'noop-history': [['a']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}{'branch-future': [], 'noop-history': [['a']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}Passed
contract fixture 6{'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}{'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}Passed
contract fixture 7{'branch-future': [['x']], 'noop-history': [['a'], ['a', 'b']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}{'branch-future': [['x']], 'noop-history': [['a'], ['a', 'b']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}Passed
contract fixture 8{'branch-future': [], 'noop-history': [['a']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}{'branch-future': [], 'noop-history': [['a']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []}Passed
contract fixture 9{'branch-future': [], 'noop-history': [['a'], ['b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['b'], 'undo-tail': [['a']]}{'branch-future': [], 'noop-history': [['a'], ['b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['b'], 'undo-tail': [['a']]}Passed

SHA-256 / 4d836988157742ae07845fc11e8780852f84d83c4dc5d88f45b9b2e4c3081aed

Verification & scope

Deterministic bounded UI-state model only; no browser, query engine, network, or production-standard conformance is claimed. 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:41:09.084236+00:00.

Case digest / 298b2ad8d01bb55f90e79447e3684f6dc37695bd0f0da3ca2f843ffb8ce9433a