FA-25691 / Filter interfaces / Open access
Redo restores the first future filter snapshot · case 01
Redo restores the first future filter snapshot is violated by the widget projection.
ROOT CAUSE
The redo-snapshot decision uses `d['future'][-1] if d['future'] else d['current']` instead of the stipulated filter-undo projection.
VERIFIED REPAIR
Implement the declared redo-snapshot projection: `d['future'][0] if d['future'] else d['current']`.
Unsuccessful approach: The attempted correction `[] if not d['future'] else d['future'][0]` 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: Redo restores the first future filter snapshot.
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'][-1] 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': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], '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': [['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': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': False}, {'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': 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': [['x'], ['y']], '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': [['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': [], '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': [['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': ['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}), ({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a', 'b']], 'undo-available': False})], 5: [({'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': ['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': ['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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'branch-future': [['x'], ['y']], 'noop-history': [], 'redo-snapshot': ['y'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []} | {'branch-future': [['x'], ['y']], 'noop-history': [], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []} | Failed |
| 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': ['y'], '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']], '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': ['y'], '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']], '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 / 10f9f11cc21d54d43ab39b4b878ba7f0d661814a0461c9e67a1979964db12082
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':([] if not d['future'] else d['future'][0]), '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': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], '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': [['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': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': False}, {'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': 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': [['x'], ['y']], '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': [['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': [], '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': [['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': ['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}), ({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a', 'b']], 'undo-available': False})], 5: [({'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': ['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': ['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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'branch-future': [['x'], ['y']], 'noop-history': [], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []} | {'branch-future': [['x'], ['y']], 'noop-history': [], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []} | Passed |
| contract fixture 1 | {'branch-future': [], 'noop-history': [], 'redo-snapshot': [], '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': [], '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': []} | Failed |
| 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': [], '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': [], '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': []} | Failed |
| 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': [], '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 / 377a661fd2be74c46c7fe50dddf821cdc7084694288782476f8aac18cf3ef1a0
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': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], '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': [['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': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': False}, {'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': 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': [['x'], ['y']], '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': [['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': [], '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': [['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': ['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}), ({'history': [], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a', 'b']], 'undo-available': False})], 5: [({'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': ['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': ['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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'branch-future': [['x'], ['y']], 'noop-history': [], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a', 'b'], 'undo-tail': []} | {'branch-future': [['x'], ['y']], 'noop-history': [], 'redo-snapshot': ['x'], '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 / 667768b791d5f786974219cc34c1be2a7c3071cb0e87e270f660e44afd49ea26
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.029740+00:00.
Case digest / 1ac7001652fec42568163a33d89ef52bbe8594e246b66c191146745545ec229b