broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = [t for t in x['tabs'] if t in x['deleted']]
    r1 = [t for t in x['tabs'] if t in x['deleted'] and t in x['dirty']]
    r2 = [t for t in x['tabs'] if x['close_clean'] and t in x['deleted'] and t not in x['dirty']]
    r3 = {t:x['paths'][t] for t in x['tabs'] if t in x['deleted'] and t in x['dirty']}
    r4 = [t for t in x['tabs'] if not (x['close_clean'] and t in x['deleted'] and t not in x['dirty'])]
    r5 = {t:x['paths'][t]+' (missing)' for t in x['tabs'] if t in x['deleted']}
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c'], {}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 2: [({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0'], {}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 3: [({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0', 'background1'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0', 'background1'], {}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 4: [({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0', 'background1', 'background2'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0', 'background1', 'background2'], {}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 5: [({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0', 'background1', 'background2', 'background3'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], {}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = [t for t in x['tabs'] if t in x['deleted']]
    r1 = [t for t in x['tabs'] if t in x['deleted'] and t in x['dirty']]
    r2 = [t for t in x['tabs'] if x['close_clean'] and t in x['deleted'] and t not in x['dirty']]
    r3 = {t:'Untitled' for t in x['tabs'] if t in x['deleted'] and t in x['dirty']}
    r4 = [t for t in x['tabs'] if not (x['close_clean'] and t in x['deleted'] and t not in x['dirty'])]
    r5 = {t:x['paths'][t]+' (missing)' for t in x['tabs'] if t in x['deleted']}
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c'], {}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 2: [({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0'], {}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 3: [({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0', 'background1'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0', 'background1'], {}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 4: [({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0', 'background1', 'background2'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0', 'background1', 'background2'], {}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 5: [({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0', 'background1', 'background2', 'background3'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], {}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), 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)

prompt:
The tab workspace reports an incorrect recovery save as basename.

External deletion leaves dirty tab buffers recoverable, marks missing backing files, permits Save As, and closes clean tabs only under the explicit close-clean policy.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = [t for t in x['tabs'] if t in x['deleted']]
    r1 = [t for t in x['tabs'] if t in x['deleted'] and t in x['dirty']]
    r2 = [t for t in x['tabs'] if x['close_clean'] and t in x['deleted'] and t not in x['dirty']]
    r3 = {t:x['paths'][t].rsplit('/',1)[-1] for t in x['tabs'] if t in x['deleted'] and t in x['dirty']}
    r4 = [t for t in x['tabs'] if t not in x['deleted']]
    r5 = {t:x['paths'][t]+' (missing)' for t in x['tabs'] if t in x['deleted']}
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c'], {}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 2: [({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0'], {}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 3: [({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0', 'background1'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0', 'background1'], {}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 4: [({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0', 'background1', 'background2'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0', 'background1', 'background2'], {}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 5: [({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0', 'background1', 'background2', 'background3'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], {}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), 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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = [t for t in x['tabs'] if t in x['deleted']]
    r1 = [t for t in x['tabs'] if t in x['deleted'] and t in x['dirty']]
    r2 = [t for t in x['tabs'] if x['close_clean'] and t in x['deleted'] and t not in x['dirty']]
    r3 = {t:x['paths'][t].rsplit('/',1)[-1] for t in x['tabs'] if t in x['deleted'] and t in x['dirty']}
    r4 = x['tabs']
    r5 = {t:x['paths'][t]+' (missing)' for t in x['tabs'] if t in x['deleted']}
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c'], {}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 2: [({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0'], {}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 3: [({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0', 'background1'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0', 'background1'], {}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 4: [({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0', 'background1', 'background2'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0', 'background1', 'background2'], {}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 5: [({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0', 'background1', 'background2', 'background3'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], {}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), 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)

prompt:
The tab workspace reports an incorrect surviving open tabs.

External deletion leaves dirty tab buffers recoverable, marks missing backing files, permits Save As, and closes clean tabs only under the explicit close-clean policy.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = [t for t in x['tabs'] if t in x['deleted']]
    r1 = [t for t in x['tabs'] if t in x['deleted'] and t in x['dirty']]
    r2 = [t for t in x['tabs'] if x['close_clean'] and t in x['deleted'] and t not in x['dirty']]
    r3 = {t:x['paths'][t].rsplit('/',1)[-1] for t in x['tabs'] if t in x['deleted'] and t in x['dirty']}
    r4 = [t for t in x['tabs'] if not (x['close_clean'] and t in x['deleted'] and t not in x['dirty'])]
    r5 = {t:x['paths'][t] for t in x['tabs'] if t in x['deleted']}
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c'], {}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 2: [({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0'], {}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 3: [({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0', 'background1'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0', 'background1'], {}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 4: [({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0', 'background1', 'background2'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0', 'background1', 'background2'], {}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 5: [({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0', 'background1', 'background2', 'background3'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], {}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = [t for t in x['tabs'] if t in x['deleted']]
    r1 = [t for t in x['tabs'] if t in x['deleted'] and t in x['dirty']]
    r2 = [t for t in x['tabs'] if x['close_clean'] and t in x['deleted'] and t not in x['dirty']]
    r3 = {t:x['paths'][t].rsplit('/',1)[-1] for t in x['tabs'] if t in x['deleted'] and t in x['dirty']}
    r4 = [t for t in x['tabs'] if not (x['close_clean'] and t in x['deleted'] and t not in x['dirty'])]
    r5 = {}
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c'], {}]), ({'tabs': ['a', 'b', 'c'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 2: [({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0'], {}]), ({'tabs': ['a', 'b', 'c', 'background0'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 3: [({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0', 'background1'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0', 'background1'], {}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0', 'background1'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 4: [({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0', 'background1', 'background2'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0', 'background1', 'background2'], {}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0', 'background1', 'background2'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])], 5: [({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], ['a'], {'b': 'b.txt'}, ['b', 'c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': ['b'], 'close_clean': False, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['b'], [], {'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': ['a', 'b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], ['a', 'b'], [], {'a': 'a.txt', 'b': 'b.txt'}, ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['c'], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['c'], [], ['c'], {}, ['a', 'b', 'background0', 'background1', 'background2', 'background3'], {'c': '/project/c.txt (missing)'}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': [], 'dirty': ['b'], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [[], [], [], {}, ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], {}]), ({'tabs': ['a', 'b', 'c', 'background0', 'background1', 'background2', 'background3'], 'deleted': ['a', 'b'], 'dirty': [], 'close_clean': True, 'paths': {'a': '/project/a.txt', 'b': '/project/b.txt', 'c': '/project/c.txt'}}, [['a', 'b'], [], ['a', 'b'], {}, ['c', 'background0', 'background1', 'background2', 'background3'], {'a': '/project/a.txt (missing)', 'b': '/project/b.txt (missing)'}])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), 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)

prompt:
The tab workspace reports an incorrect missing path tooltip.

External deletion leaves dirty tab buffers recoverable, marks missing backing files, permits Save As, and closes clean tabs only under the explicit close-clean policy.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = [x['left'],x['right_rev']]
    r1 = [x['left'],x['left_rev']] if x['swapped'] else [x['right'],x['right_rev']]
    r2 = (x['right']+' → '+x['left']) if x['swapped'] else (x['left']+' → '+x['right'])
    r3 = [x['left'],x['left_rev'],x['right'],x['right_rev']]
    r4 = x['right_editable'] and not x['swapped']
    r5 = x['left']==x['right'] and x['left_rev']==x['right_rev']
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'left': 'a', 'right': 'b', 'left_rev': 2, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 2], ['b', 4], 'a \u2192 b', ['a', 2, 'b', 4], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 2, 'right_rev': 4, 'right_editable': True, 'swapped': True}, [['b', 4], ['a', 2], 'b \u2192 a', ['a', 2, 'b', 4], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 2, 'right_rev': 4, 'right_editable': False, 'swapped': False}, [['a', 2], ['b', 4], 'a \u2192 b', ['a', 2, 'b', 4], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 2, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 2], ['a', 4], 'a \u2192 a', ['a', 2, 'a', 4], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 2, 'right_editable': True, 'swapped': False}, [['a', 4], ['b', 2], 'a \u2192 b', ['a', 4, 'b', 2], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 4], 'a \u2192 b', ['a', 0, 'b', 4], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 4], ['b', 4], 'a \u2192 b', ['a', 4, 'b', 4], True, False])], 2: [({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 4], ['b', 8], 'a \u2192 b', ['a', 4, 'b', 8], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 8, 'right_editable': True, 'swapped': True}, [['b', 8], ['a', 4], 'b \u2192 a', ['a', 4, 'b', 8], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 8, 'right_editable': False, 'swapped': False}, [['a', 4], ['b', 8], 'a \u2192 b', ['a', 4, 'b', 8], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 4, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 4], ['a', 8], 'a \u2192 a', ['a', 4, 'a', 8], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 8], ['b', 4], 'a \u2192 b', ['a', 8, 'b', 4], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 8], 'a \u2192 b', ['a', 0, 'b', 8], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 8], ['b', 8], 'a \u2192 b', ['a', 8, 'b', 8], True, False])], 3: [({'left': 'a', 'right': 'b', 'left_rev': 6, 'right_rev': 12, 'right_editable': True, 'swapped': False}, [['a', 6], ['b', 12], 'a \u2192 b', ['a', 6, 'b', 12], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 6, 'right_rev': 12, 'right_editable': True, 'swapped': True}, [['b', 12], ['a', 6], 'b \u2192 a', ['a', 6, 'b', 12], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 6, 'right_rev': 12, 'right_editable': False, 'swapped': False}, [['a', 6], ['b', 12], 'a \u2192 b', ['a', 6, 'b', 12], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 6, 'right_rev': 12, 'right_editable': True, 'swapped': False}, [['a', 6], ['a', 12], 'a \u2192 a', ['a', 6, 'a', 12], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 12, 'right_rev': 6, 'right_editable': True, 'swapped': False}, [['a', 12], ['b', 6], 'a \u2192 b', ['a', 12, 'b', 6], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 12, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 12], 'a \u2192 b', ['a', 0, 'b', 12], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 12, 'right_rev': 12, 'right_editable': True, 'swapped': False}, [['a', 12], ['b', 12], 'a \u2192 b', ['a', 12, 'b', 12], True, False])], 4: [({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 16, 'right_editable': True, 'swapped': False}, [['a', 8], ['b', 16], 'a \u2192 b', ['a', 8, 'b', 16], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 16, 'right_editable': True, 'swapped': True}, [['b', 16], ['a', 8], 'b \u2192 a', ['a', 8, 'b', 16], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 16, 'right_editable': False, 'swapped': False}, [['a', 8], ['b', 16], 'a \u2192 b', ['a', 8, 'b', 16], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 8, 'right_rev': 16, 'right_editable': True, 'swapped': False}, [['a', 8], ['a', 16], 'a \u2192 a', ['a', 8, 'a', 16], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 16, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 16], ['b', 8], 'a \u2192 b', ['a', 16, 'b', 8], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 16, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 16], 'a \u2192 b', ['a', 0, 'b', 16], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 16, 'right_rev': 16, 'right_editable': True, 'swapped': False}, [['a', 16], ['b', 16], 'a \u2192 b', ['a', 16, 'b', 16], True, False])], 5: [({'left': 'a', 'right': 'b', 'left_rev': 10, 'right_rev': 20, 'right_editable': True, 'swapped': False}, [['a', 10], ['b', 20], 'a \u2192 b', ['a', 10, 'b', 20], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 10, 'right_rev': 20, 'right_editable': True, 'swapped': True}, [['b', 20], ['a', 10], 'b \u2192 a', ['a', 10, 'b', 20], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 10, 'right_rev': 20, 'right_editable': False, 'swapped': False}, [['a', 10], ['b', 20], 'a \u2192 b', ['a', 10, 'b', 20], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 10, 'right_rev': 20, 'right_editable': True, 'swapped': False}, [['a', 10], ['a', 20], 'a \u2192 a', ['a', 10, 'a', 20], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 20, 'right_rev': 10, 'right_editable': True, 'swapped': False}, [['a', 20], ['b', 10], 'a \u2192 b', ['a', 20, 'b', 10], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 20, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 20], 'a \u2192 b', ['a', 0, 'b', 20], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 20, 'right_rev': 20, 'right_editable': True, 'swapped': False}, [['a', 20], ['b', 20], 'a \u2192 b', ['a', 20, 'b', 20], True, False])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = [x['left'],x['left_rev']]
    r1 = [x['left'],x['left_rev']] if x['swapped'] else [x['right'],x['right_rev']]
    r2 = (x['right']+' → '+x['left']) if x['swapped'] else (x['left']+' → '+x['right'])
    r3 = [x['left'],x['left_rev'],x['right'],x['right_rev']]
    r4 = x['right_editable'] and not x['swapped']
    r5 = x['left']==x['right'] and x['left_rev']==x['right_rev']
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'left': 'a', 'right': 'b', 'left_rev': 2, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 2], ['b', 4], 'a \u2192 b', ['a', 2, 'b', 4], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 2, 'right_rev': 4, 'right_editable': True, 'swapped': True}, [['b', 4], ['a', 2], 'b \u2192 a', ['a', 2, 'b', 4], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 2, 'right_rev': 4, 'right_editable': False, 'swapped': False}, [['a', 2], ['b', 4], 'a \u2192 b', ['a', 2, 'b', 4], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 2, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 2], ['a', 4], 'a \u2192 a', ['a', 2, 'a', 4], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 2, 'right_editable': True, 'swapped': False}, [['a', 4], ['b', 2], 'a \u2192 b', ['a', 4, 'b', 2], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 4], 'a \u2192 b', ['a', 0, 'b', 4], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 4], ['b', 4], 'a \u2192 b', ['a', 4, 'b', 4], True, False])], 2: [({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 4], ['b', 8], 'a \u2192 b', ['a', 4, 'b', 8], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 8, 'right_editable': True, 'swapped': True}, [['b', 8], ['a', 4], 'b \u2192 a', ['a', 4, 'b', 8], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 8, 'right_editable': False, 'swapped': False}, [['a', 4], ['b', 8], 'a \u2192 b', ['a', 4, 'b', 8], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 4, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 4], ['a', 8], 'a \u2192 a', ['a', 4, 'a', 8], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 8], ['b', 4], 'a \u2192 b', ['a', 8, 'b', 4], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 8], 'a \u2192 b', ['a', 0, 'b', 8], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 8], ['b', 8], 'a \u2192 b', ['a', 8, 'b', 8], True, False])], 3: [({'left': 'a', 'right': 'b', 'left_rev': 6, 'right_rev': 12, 'right_editable': True, 'swapped': False}, [['a', 6], ['b', 12], 'a \u2192 b', ['a', 6, 'b', 12], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 6, 'right_rev': 12, 'right_editable': True, 'swapped': True}, [['b', 12], ['a', 6], 'b \u2192 a', ['a', 6, 'b', 12], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 6, 'right_rev': 12, 'right_editable': False, 'swapped': False}, [['a', 6], ['b', 12], 'a \u2192 b', ['a', 6, 'b', 12], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 6, 'right_rev': 12, 'right_editable': True, 'swapped': False}, [['a', 6], ['a', 12], 'a \u2192 a', ['a', 6, 'a', 12], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 12, 'right_rev': 6, 'right_editable': True, 'swapped': False}, [['a', 12], ['b', 6], 'a \u2192 b', ['a', 12, 'b', 6], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 12, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 12], 'a \u2192 b', ['a', 0, 'b', 12], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 12, 'right_rev': 12, 'right_editable': True, 'swapped': False}, [['a', 12], ['b', 12], 'a \u2192 b', ['a', 12, 'b', 12], True, False])], 4: [({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 16, 'right_editable': True, 'swapped': False}, [['a', 8], ['b', 16], 'a \u2192 b', ['a', 8, 'b', 16], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 16, 'right_editable': True, 'swapped': True}, [['b', 16], ['a', 8], 'b \u2192 a', ['a', 8, 'b', 16], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 16, 'right_editable': False, 'swapped': False}, [['a', 8], ['b', 16], 'a \u2192 b', ['a', 8, 'b', 16], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 8, 'right_rev': 16, 'right_editable': True, 'swapped': False}, [['a', 8], ['a', 16], 'a \u2192 a', ['a', 8, 'a', 16], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 16, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 16], ['b', 8], 'a \u2192 b', ['a', 16, 'b', 8], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 16, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 16], 'a \u2192 b', ['a', 0, 'b', 16], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 16, 'right_rev': 16, 'right_editable': True, 'swapped': False}, [['a', 16], ['b', 16], 'a \u2192 b', ['a', 16, 'b', 16], True, False])], 5: [({'left': 'a', 'right': 'b', 'left_rev': 10, 'right_rev': 20, 'right_editable': True, 'swapped': False}, [['a', 10], ['b', 20], 'a \u2192 b', ['a', 10, 'b', 20], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 10, 'right_rev': 20, 'right_editable': True, 'swapped': True}, [['b', 20], ['a', 10], 'b \u2192 a', ['a', 10, 'b', 20], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 10, 'right_rev': 20, 'right_editable': False, 'swapped': False}, [['a', 10], ['b', 20], 'a \u2192 b', ['a', 10, 'b', 20], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 10, 'right_rev': 20, 'right_editable': True, 'swapped': False}, [['a', 10], ['a', 20], 'a \u2192 a', ['a', 10, 'a', 20], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 20, 'right_rev': 10, 'right_editable': True, 'swapped': False}, [['a', 20], ['b', 10], 'a \u2192 b', ['a', 20, 'b', 10], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 20, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 20], 'a \u2192 b', ['a', 0, 'b', 20], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 20, 'right_rev': 20, 'right_editable': True, 'swapped': False}, [['a', 20], ['b', 20], 'a \u2192 b', ['a', 20, 'b', 20], True, False])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), 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)

prompt:
The tab workspace reports an incorrect left comparison binding.

A comparison tab binds ordered left/right document revisions, labels the direction, permits edits only on editable right side and handles same-document different-revision comparisons.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = [x['right'],x['right_rev']] if x['swapped'] else [x['left'],x['left_rev']]
    r1 = [x['right'],x['left_rev']]
    r2 = (x['right']+' → '+x['left']) if x['swapped'] else (x['left']+' → '+x['right'])
    r3 = [x['left'],x['left_rev'],x['right'],x['right_rev']]
    r4 = x['right_editable'] and not x['swapped']
    r5 = x['left']==x['right'] and x['left_rev']==x['right_rev']
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'left': 'a', 'right': 'b', 'left_rev': 2, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 2], ['b', 4], 'a \u2192 b', ['a', 2, 'b', 4], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 2, 'right_rev': 4, 'right_editable': True, 'swapped': True}, [['b', 4], ['a', 2], 'b \u2192 a', ['a', 2, 'b', 4], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 2, 'right_rev': 4, 'right_editable': False, 'swapped': False}, [['a', 2], ['b', 4], 'a \u2192 b', ['a', 2, 'b', 4], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 2, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 2], ['a', 4], 'a \u2192 a', ['a', 2, 'a', 4], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 2, 'right_editable': True, 'swapped': False}, [['a', 4], ['b', 2], 'a \u2192 b', ['a', 4, 'b', 2], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 4], 'a \u2192 b', ['a', 0, 'b', 4], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 4], ['b', 4], 'a \u2192 b', ['a', 4, 'b', 4], True, False])], 2: [({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 4], ['b', 8], 'a \u2192 b', ['a', 4, 'b', 8], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 8, 'right_editable': True, 'swapped': True}, [['b', 8], ['a', 4], 'b \u2192 a', ['a', 4, 'b', 8], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 8, 'right_editable': False, 'swapped': False}, [['a', 4], ['b', 8], 'a \u2192 b', ['a', 4, 'b', 8], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 4, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 4], ['a', 8], 'a \u2192 a', ['a', 4, 'a', 8], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 8], ['b', 4], 'a \u2192 b', ['a', 8, 'b', 4], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 8], 'a \u2192 b', ['a', 0, 'b', 8], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 8], ['b', 8], 'a \u2192 b', ['a', 8, 'b', 8], True, False])], 3: [({'left': 'a', 'right': 'b', 'left_rev': 6, 'right_rev': 12, 'right_editable': True, 'swapped': False}, [['a', 6], ['b', 12], 'a \u2192 b', ['a', 6, 'b', 12], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 6, 'right_rev': 12, 'right_editable': True, 'swapped': True}, [['b', 12], ['a', 6], 'b \u2192 a', ['a', 6, 'b', 12], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 6, 'right_rev': 12, 'right_editable': False, 'swapped': False}, [['a', 6], ['b', 12], 'a \u2192 b', ['a', 6, 'b', 12], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 6, 'right_rev': 12, 'right_editable': True, 'swapped': False}, [['a', 6], ['a', 12], 'a \u2192 a', ['a', 6, 'a', 12], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 12, 'right_rev': 6, 'right_editable': True, 'swapped': False}, [['a', 12], ['b', 6], 'a \u2192 b', ['a', 12, 'b', 6], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 12, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 12], 'a \u2192 b', ['a', 0, 'b', 12], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 12, 'right_rev': 12, 'right_editable': True, 'swapped': False}, [['a', 12], ['b', 12], 'a \u2192 b', ['a', 12, 'b', 12], True, False])], 4: [({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 16, 'right_editable': True, 'swapped': False}, [['a', 8], ['b', 16], 'a \u2192 b', ['a', 8, 'b', 16], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 16, 'right_editable': True, 'swapped': True}, [['b', 16], ['a', 8], 'b \u2192 a', ['a', 8, 'b', 16], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 16, 'right_editable': False, 'swapped': False}, [['a', 8], ['b', 16], 'a \u2192 b', ['a', 8, 'b', 16], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 8, 'right_rev': 16, 'right_editable': True, 'swapped': False}, [['a', 8], ['a', 16], 'a \u2192 a', ['a', 8, 'a', 16], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 16, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 16], ['b', 8], 'a \u2192 b', ['a', 16, 'b', 8], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 16, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 16], 'a \u2192 b', ['a', 0, 'b', 16], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 16, 'right_rev': 16, 'right_editable': True, 'swapped': False}, [['a', 16], ['b', 16], 'a \u2192 b', ['a', 16, 'b', 16], True, False])], 5: [({'left': 'a', 'right': 'b', 'left_rev': 10, 'right_rev': 20, 'right_editable': True, 'swapped': False}, [['a', 10], ['b', 20], 'a \u2192 b', ['a', 10, 'b', 20], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 10, 'right_rev': 20, 'right_editable': True, 'swapped': True}, [['b', 20], ['a', 10], 'b \u2192 a', ['a', 10, 'b', 20], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 10, 'right_rev': 20, 'right_editable': False, 'swapped': False}, [['a', 10], ['b', 20], 'a \u2192 b', ['a', 10, 'b', 20], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 10, 'right_rev': 20, 'right_editable': True, 'swapped': False}, [['a', 10], ['a', 20], 'a \u2192 a', ['a', 10, 'a', 20], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 20, 'right_rev': 10, 'right_editable': True, 'swapped': False}, [['a', 20], ['b', 10], 'a \u2192 b', ['a', 20, 'b', 10], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 20, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 20], 'a \u2192 b', ['a', 0, 'b', 20], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 20, 'right_rev': 20, 'right_editable': True, 'swapped': False}, [['a', 20], ['b', 20], 'a \u2192 b', ['a', 20, 'b', 20], True, False])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = [x['right'],x['right_rev']] if x['swapped'] else [x['left'],x['left_rev']]
    r1 = [x['right'],x['right_rev']]
    r2 = (x['right']+' → '+x['left']) if x['swapped'] else (x['left']+' → '+x['right'])
    r3 = [x['left'],x['left_rev'],x['right'],x['right_rev']]
    r4 = x['right_editable'] and not x['swapped']
    r5 = x['left']==x['right'] and x['left_rev']==x['right_rev']
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'left': 'a', 'right': 'b', 'left_rev': 2, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 2], ['b', 4], 'a \u2192 b', ['a', 2, 'b', 4], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 2, 'right_rev': 4, 'right_editable': True, 'swapped': True}, [['b', 4], ['a', 2], 'b \u2192 a', ['a', 2, 'b', 4], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 2, 'right_rev': 4, 'right_editable': False, 'swapped': False}, [['a', 2], ['b', 4], 'a \u2192 b', ['a', 2, 'b', 4], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 2, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 2], ['a', 4], 'a \u2192 a', ['a', 2, 'a', 4], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 2, 'right_editable': True, 'swapped': False}, [['a', 4], ['b', 2], 'a \u2192 b', ['a', 4, 'b', 2], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 4], 'a \u2192 b', ['a', 0, 'b', 4], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 4], ['b', 4], 'a \u2192 b', ['a', 4, 'b', 4], True, False])], 2: [({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 4], ['b', 8], 'a \u2192 b', ['a', 4, 'b', 8], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 8, 'right_editable': True, 'swapped': True}, [['b', 8], ['a', 4], 'b \u2192 a', ['a', 4, 'b', 8], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 4, 'right_rev': 8, 'right_editable': False, 'swapped': False}, [['a', 4], ['b', 8], 'a \u2192 b', ['a', 4, 'b', 8], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 4, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 4], ['a', 8], 'a \u2192 a', ['a', 4, 'a', 8], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 4, 'right_editable': True, 'swapped': False}, [['a', 8], ['b', 4], 'a \u2192 b', ['a', 8, 'b', 4], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 8], 'a \u2192 b', ['a', 0, 'b', 8], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 8], ['b', 8], 'a \u2192 b', ['a', 8, 'b', 8], True, False])], 3: [({'left': 'a', 'right': 'b', 'left_rev': 6, 'right_rev': 12, 'right_editable': True, 'swapped': False}, [['a', 6], ['b', 12], 'a \u2192 b', ['a', 6, 'b', 12], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 6, 'right_rev': 12, 'right_editable': True, 'swapped': True}, [['b', 12], ['a', 6], 'b \u2192 a', ['a', 6, 'b', 12], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 6, 'right_rev': 12, 'right_editable': False, 'swapped': False}, [['a', 6], ['b', 12], 'a \u2192 b', ['a', 6, 'b', 12], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 6, 'right_rev': 12, 'right_editable': True, 'swapped': False}, [['a', 6], ['a', 12], 'a \u2192 a', ['a', 6, 'a', 12], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 12, 'right_rev': 6, 'right_editable': True, 'swapped': False}, [['a', 12], ['b', 6], 'a \u2192 b', ['a', 12, 'b', 6], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 12, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 12], 'a \u2192 b', ['a', 0, 'b', 12], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 12, 'right_rev': 12, 'right_editable': True, 'swapped': False}, [['a', 12], ['b', 12], 'a \u2192 b', ['a', 12, 'b', 12], True, False])], 4: [({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 16, 'right_editable': True, 'swapped': False}, [['a', 8], ['b', 16], 'a \u2192 b', ['a', 8, 'b', 16], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 16, 'right_editable': True, 'swapped': True}, [['b', 16], ['a', 8], 'b \u2192 a', ['a', 8, 'b', 16], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 8, 'right_rev': 16, 'right_editable': False, 'swapped': False}, [['a', 8], ['b', 16], 'a \u2192 b', ['a', 8, 'b', 16], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 8, 'right_rev': 16, 'right_editable': True, 'swapped': False}, [['a', 8], ['a', 16], 'a \u2192 a', ['a', 8, 'a', 16], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 16, 'right_rev': 8, 'right_editable': True, 'swapped': False}, [['a', 16], ['b', 8], 'a \u2192 b', ['a', 16, 'b', 8], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 16, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 16], 'a \u2192 b', ['a', 0, 'b', 16], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 16, 'right_rev': 16, 'right_editable': True, 'swapped': False}, [['a', 16], ['b', 16], 'a \u2192 b', ['a', 16, 'b', 16], True, False])], 5: [({'left': 'a', 'right': 'b', 'left_rev': 10, 'right_rev': 20, 'right_editable': True, 'swapped': False}, [['a', 10], ['b', 20], 'a \u2192 b', ['a', 10, 'b', 20], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 10, 'right_rev': 20, 'right_editable': True, 'swapped': True}, [['b', 20], ['a', 10], 'b \u2192 a', ['a', 10, 'b', 20], False, False]), ({'left': 'a', 'right': 'b', 'left_rev': 10, 'right_rev': 20, 'right_editable': False, 'swapped': False}, [['a', 10], ['b', 20], 'a \u2192 b', ['a', 10, 'b', 20], False, False]), ({'left': 'a', 'right': 'a', 'left_rev': 10, 'right_rev': 20, 'right_editable': True, 'swapped': False}, [['a', 10], ['a', 20], 'a \u2192 a', ['a', 10, 'a', 20], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 20, 'right_rev': 10, 'right_editable': True, 'swapped': False}, [['a', 20], ['b', 10], 'a \u2192 b', ['a', 20, 'b', 10], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 0, 'right_rev': 20, 'right_editable': True, 'swapped': False}, [['a', 0], ['b', 20], 'a \u2192 b', ['a', 0, 'b', 20], True, False]), ({'left': 'a', 'right': 'b', 'left_rev': 20, 'right_rev': 20, 'right_editable': True, 'swapped': False}, [['a', 20], ['b', 20], 'a \u2192 b', ['a', 20, 'b', 20], True, False])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), 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)

prompt:
The tab workspace reports an incorrect right comparison binding.

A comparison tab binds ordered left/right document revisions, labels the direction, permits edits only on editable right side and handles same-document different-revision comparisons.

split: open-access