FA-25696 / Filter interfaces / Open access
A new criterion edit invalidates only the branched redo history · case 01
A new criterion edit invalidates only the branched redo history is violated by the widget projection.
ROOT CAUSE
The branch-future decision uses `d['future']` instead of the stipulated filter-undo projection.
VERIFIED REPAIR
Implement the declared branch-future projection: `[] if d['new_edit'] else d['future']`.
Unsuccessful approach: The attempted correction `[]` 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: A new criterion edit invalidates only the branched redo history.
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':(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']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], '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'], ['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}), ({'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': [], 'future': [['x']], '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': [], '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': [], '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': [['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}), ({'history': [['a'], ['b']], 'future': [['x']], '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})], 3: [({'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': [['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': [['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': ['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}), ({'history': [['a'], ['b']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': False})], 4: [({'history': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a', 'b']], 'undo-available': False}), ({'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': [], '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': ['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': ['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': [['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']], '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']], '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': []} | Failed |
| contract fixture 1 | {'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 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'], ['y']], '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': []} | Failed |
| contract fixture 4 | {'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 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': [['x'], ['y']], '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': []} | Failed |
| 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 / 6af8f365c92e9b93d5b7395d8d9b9555dd5d492d3b64cedc5bd2960eafb3cbc9
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':([]), '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']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], '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'], ['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}), ({'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': [], 'future': [['x']], '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': [], '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': [], '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': [['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}), ({'history': [['a'], ['b']], 'future': [['x']], '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})], 3: [({'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': [['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': [['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': ['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}), ({'history': [['a'], ['b']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': False})], 4: [({'history': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a', 'b']], 'undo-available': False}), ({'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': [], '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': ['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': ['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': [['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']], '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': [], '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 1 | {'branch-future': [], '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': []} | 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': [], '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 4 | {'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 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': [], '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': []} | Failed |
| 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 / 1e1660b2db2a21f02949d8c37c721f593c9f4f0a746654f2efc637eb3877870f
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']], 'current': ['a', 'b'], 'next': ['b', 'a'], 'new_edit': True, 'applying': False}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [], 'undo-available': False}), ({'history': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [['x']], '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'], ['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}), ({'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': [], 'future': [['x']], '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': [], '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': [], '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': [['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}), ({'history': [['a'], ['b']], 'future': [['x']], '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})], 3: [({'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': [['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': [['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': ['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}), ({'history': [['a'], ['b']], 'future': [['x'], ['y']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': False, 'applying': True}, {'undo-snapshot': ['b'], 'undo-tail': [['a']], 'redo-snapshot': ['x'], 'branch-future': [['x'], ['y']], 'noop-history': [['a'], ['b'], ['a', 'b']], 'undo-available': False})], 4: [({'history': [], 'future': [['x']], 'current': ['a', 'b'], 'next': ['c'], 'new_edit': True, 'applying': True}, {'undo-snapshot': ['a', 'b'], 'undo-tail': [], 'redo-snapshot': ['x'], 'branch-future': [], 'noop-history': [['a', 'b']], 'undo-available': False}), ({'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': [], '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': ['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': ['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': [['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']], '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': [], '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 1 | {'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 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': [], '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 4 | {'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 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 / 306b863157ea3dc95eb9446f4734dc9a010470b974c0abec025af15c0d1d7a26
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.072507+00:00.
Case digest / c4ef52a7207e1f3fddb58972bf8a5b256e38f2179f4c8a770de9e4ff12600a0e