FA-25706 / Filter interfaces / Open access
Undo is unavailable while its constraint transaction is applying · case 01
Undo is unavailable while its constraint transaction is applying is violated by the widget projection.
ROOT CAUSE
The undo-available decision uses `bool(d['history'])` instead of the stipulated filter-undo projection.
VERIFIED REPAIR
Implement the declared undo-available projection: `bool(d['history']) and not d['applying']`.
Unsuccessful approach: The attempted correction `not d['applying']` 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: Undo is unavailable while its constraint transaction is applying.
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'] if set(d['next'])==set(d['current']) else d['history']+[d['current']]), 'undo-available':(bool(d['history']))}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'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': [], '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': [], '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': ['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}), ({'history': [['a'], ['b']], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': False})], 2: [({'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': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], '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': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': False}), ({'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': [], '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': [['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': [], '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': [['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': [['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': [], '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': [['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': [], 'noop-history': [['a']], 'redo-snapshot': ['a', 'b'], 'undo-available': True, '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 1 | {'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 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'], ['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': True, '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 6 | {'branch-future': [['x']], 'noop-history': [['a'], ['a', 'b']], 'redo-snapshot': ['x'], 'undo-available': True, 'undo-snapshot': ['a'], 'undo-tail': []} | {'branch-future': [['x']], 'noop-history': [['a'], ['a', 'b']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []} | Failed |
| contract fixture 7 | {'branch-future': [], 'noop-history': [['a']], 'redo-snapshot': ['x'], 'undo-available': True, 'undo-snapshot': ['a'], 'undo-tail': []} | {'branch-future': [], 'noop-history': [['a']], 'redo-snapshot': ['x'], 'undo-available': False, 'undo-snapshot': ['a'], 'undo-tail': []} | Failed |
| contract fixture 8 | {'branch-future': [], 'noop-history': [['a'], ['b']], 'redo-snapshot': ['a', 'b'], 'undo-available': True, '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 |
| contract fixture 9 | {'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': True, 'undo-snapshot': ['b'], 'undo-tail': [['a']]} | {'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['b'], 'undo-tail': [['a']]} | Failed |
SHA-256 / 14557bf20cb034ecd94934dbe0cbe9325bf10fd5272c1ee2720b7bd9cf20160d
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 set(d['next'])==set(d['current']) else d['history']+[d['current']]), 'undo-available':(not d['applying'])}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'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': [], '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': [], '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': ['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}), ({'history': [['a'], ['b']], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': False})], 2: [({'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': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], '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': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': False}), ({'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': [], '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': [['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': [], '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': [['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': [['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': [], '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': [['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': [], '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 1 | {'branch-future': [], 'noop-history': [['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': True, '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 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'], ['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 6 | {'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 7 | {'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 8 | {'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 |
| 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'], ['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['b'], 'undo-tail': [['a']]} | Passed |
SHA-256 / dcf21658fd1b7502ddc2f5df4a870e9a2f8306bc3048aba948d73480c3654d8c
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': [['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': [], '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': [], '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': ['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}), ({'history': [['a'], ['b']], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': False})], 2: [({'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': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], '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': [['a']], 'future': [], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a'], 'undo-tail': [], 'redo-snapshot': ['a', 'b'], 'branch-future': [], 'noop-history': [['a'], ['a', 'b']], 'undo-available': False}), ({'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': [], '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': [['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': [], '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': [['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': [['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': [], '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': [['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': [], '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 1 | {'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 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'], ['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 6 | {'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 7 | {'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 8 | {'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 |
| 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'], ['a', 'b']], 'redo-snapshot': ['a', 'b'], 'undo-available': False, 'undo-snapshot': ['b'], 'undo-tail': [['a']]} | Passed |
SHA-256 / 454ff1ee0896d0dc9523004ad1926af83c0f78614cdd1693b54a8ae6fd0e4b19
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.120345+00:00.
Case digest / 5a95c92e776f36bd6b51c12b0fb3a6809c71980c2ec33fa92f9593af23d2928a