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

N = 1
observations = []
def solve(x):
    r0 = x['target'] not in x['locked']
    r1 = [] if x['target'] in x['locked'] else [x['target']]
    r2 = x['target']
    r3 = x['view'] in x['locked']
    r4 = x['duplicate']
    r5 = [t for t in x['locked'] if t!=x['duplicate']]
    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: [({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'b'], 'b', True, 'd', ['a', 'c']]), ({'locked': [], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a'], 'a', False, 'd', []]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c'], 'a', False, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']])], 2: [({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'b'], 'b', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'a'], 'a', False, 'd', ['extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', False, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']])], 3: [({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'a'], 'a', False, 'd', ['extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']])], 4: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']])], 5: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'extra3', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']])]}
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['target'] not in x['locked']
    r1 = [x['target']]
    r2 = x['target']
    r3 = x['view'] in x['locked']
    r4 = x['duplicate']
    r5 = [t for t in x['locked'] if t!=x['duplicate']]
    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: [({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'b'], 'b', True, 'd', ['a', 'c']]), ({'locked': [], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a'], 'a', False, 'd', []]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c'], 'a', False, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']])], 2: [({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'b'], 'b', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'a'], 'a', False, 'd', ['extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', False, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']])], 3: [({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'a'], 'a', False, 'd', ['extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']])], 4: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']])], 5: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'extra3', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']])]}
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 lock toggle preserves other locks.

Locked tabs forbid replacement and close commands but permit selection, scrolling and explicit duplication. Lock badges and command predicates are attached to view identity.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['target'] not in x['locked']
    r1 = [t for t in x['locked'] if t!=x['target']] if x['target'] in x['locked'] else x['locked']+[x['target']]
    r2 = x['selected'] if x['target'] in x['locked'] else x['target']
    r3 = x['view'] in x['locked']
    r4 = x['duplicate']
    r5 = [t for t in x['locked'] if t!=x['duplicate']]
    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: [({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'b'], 'b', True, 'd', ['a', 'c']]), ({'locked': [], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a'], 'a', False, 'd', []]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c'], 'a', False, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']])], 2: [({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'b'], 'b', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'a'], 'a', False, 'd', ['extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', False, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']])], 3: [({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'a'], 'a', False, 'd', ['extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']])], 4: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']])], 5: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'extra3', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']])]}
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 = x['target'] not in x['locked']
    r1 = [t for t in x['locked'] if t!=x['target']] if x['target'] in x['locked'] else x['locked']+[x['target']]
    r2 = x['selected']
    r3 = x['view'] in x['locked']
    r4 = x['duplicate']
    r5 = [t for t in x['locked'] if t!=x['duplicate']]
    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: [({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'b'], 'b', True, 'd', ['a', 'c']]), ({'locked': [], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a'], 'a', False, 'd', []]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c'], 'a', False, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']])], 2: [({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'b'], 'b', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'a'], 'a', False, 'd', ['extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', False, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']])], 3: [({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'a'], 'a', False, 'd', ['extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']])], 4: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']])], 5: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'extra3', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']])]}
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 selection allowed under lock.

Locked tabs forbid replacement and close commands but permit selection, scrolling and explicit duplication. Lock badges and command predicates are attached to view identity.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['target'] not in x['locked']
    r1 = [t for t in x['locked'] if t!=x['target']] if x['target'] in x['locked'] else x['locked']+[x['target']]
    r2 = x['target']
    r3 = x['selected'] in x['locked']
    r4 = x['duplicate']
    r5 = [t for t in x['locked'] if t!=x['duplicate']]
    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: [({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'b'], 'b', True, 'd', ['a', 'c']]), ({'locked': [], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a'], 'a', False, 'd', []]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c'], 'a', False, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']])], 2: [({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'b'], 'b', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'a'], 'a', False, 'd', ['extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', False, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']])], 3: [({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'a'], 'a', False, 'd', ['extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']])], 4: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']])], 5: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'extra3', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']])]}
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['target'] not in x['locked']
    r1 = [t for t in x['locked'] if t!=x['target']] if x['target'] in x['locked'] else x['locked']+[x['target']]
    r2 = x['target']
    r3 = bool(x['locked'])
    r4 = x['duplicate']
    r5 = [t for t in x['locked'] if t!=x['duplicate']]
    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: [({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'b'], 'b', True, 'd', ['a', 'c']]), ({'locked': [], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a'], 'a', False, 'd', []]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c'], 'a', False, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']])], 2: [({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'b'], 'b', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'a'], 'a', False, 'd', ['extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', False, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']])], 3: [({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'a'], 'a', False, 'd', ['extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']])], 4: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']])], 5: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'extra3', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']])]}
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 view lock badge.

Locked tabs forbid replacement and close commands but permit selection, scrolling and explicit duplication. Lock badges and command predicates are attached to view identity.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['target'] not in x['locked']
    r1 = [t for t in x['locked'] if t!=x['target']] if x['target'] in x['locked'] else x['locked']+[x['target']]
    r2 = x['target']
    r3 = x['view'] in x['locked']
    r4 = x['target']
    r5 = [t for t in x['locked'] if t!=x['duplicate']]
    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: [({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'b'], 'b', True, 'd', ['a', 'c']]), ({'locked': [], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a'], 'a', False, 'd', []]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c'], 'a', False, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']])], 2: [({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'b'], 'b', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'a'], 'a', False, 'd', ['extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', False, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']])], 3: [({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'a'], 'a', False, 'd', ['extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']])], 4: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']])], 5: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'extra3', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']])]}
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['target'] not in x['locked']
    r1 = [t for t in x['locked'] if t!=x['target']] if x['target'] in x['locked'] else x['locked']+[x['target']]
    r2 = x['target']
    r3 = x['view'] in x['locked']
    r4 = x['view']
    r5 = [t for t in x['locked'] if t!=x['duplicate']]
    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: [({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'b'], 'b', True, 'd', ['a', 'c']]), ({'locked': [], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a'], 'a', False, 'd', []]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c'], 'a', False, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']])], 2: [({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'b'], 'b', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'a'], 'a', False, 'd', ['extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', False, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']])], 3: [({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'a'], 'a', False, 'd', ['extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']])], 4: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']])], 5: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'extra3', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']])]}
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 duplicate new view identity.

Locked tabs forbid replacement and close commands but permit selection, scrolling and explicit duplication. Lock badges and command predicates are attached to view identity.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['target'] not in x['locked']
    r1 = [t for t in x['locked'] if t!=x['target']] if x['target'] in x['locked'] else x['locked']+[x['target']]
    r2 = x['target']
    r3 = x['view'] in x['locked']
    r4 = x['duplicate']
    r5 = x['locked']+[x['duplicate']]
    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: [({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'b'], 'b', True, 'd', ['a', 'c']]), ({'locked': [], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a'], 'a', False, 'd', []]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c'], 'a', False, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']])], 2: [({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'b'], 'b', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'a'], 'a', False, 'd', ['extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', False, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']])], 3: [({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'a'], 'a', False, 'd', ['extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']])], 4: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']])], 5: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'extra3', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']])]}
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['target'] not in x['locked']
    r1 = [t for t in x['locked'] if t!=x['target']] if x['target'] in x['locked'] else x['locked']+[x['target']]
    r2 = x['target']
    r3 = x['view'] in x['locked']
    r4 = x['duplicate']
    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: [({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'b'], 'b', True, 'd', ['a', 'c']]), ({'locked': [], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a'], 'a', False, 'd', []]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c'], 'a', False, 'd', ['a', 'c']]), ({'locked': ['a', 'c'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c'], 'a', True, 'd', ['a', 'c']])], 2: [({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'b'], 'b', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'a'], 'a', False, 'd', ['extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', False, 'd', ['a', 'c', 'extra0']]), ({'locked': ['a', 'c', 'extra0'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0'], 'a', True, 'd', ['a', 'c', 'extra0']])], 3: [({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'a'], 'a', False, 'd', ['extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1']]), ({'locked': ['a', 'c', 'extra0', 'extra1'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1']])], 4: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2']])], 5: [({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'b', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3', 'b'], 'b', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [True, ['extra0', 'extra1', 'extra2', 'extra3', 'a'], 'a', False, 'd', ['extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': [], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'b', 'dirty': ['a'], 'view': 'b', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', False, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'locked': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'target': 'a', 'selected': 'a', 'dirty': ['a'], 'view': 'a', 'duplicate': 'd'}, [False, ['c', 'extra0', 'extra1', 'extra2', 'extra3'], 'a', True, 'd', ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3']])]}
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 duplicate starts unlocked.

Locked tabs forbid replacement and close commands but permit selection, scrolling and explicit duplication. Lock badges and command predicates are attached to view identity.

split: open-access


prompt:
The tab workspace reports an incorrect direct child recognition.

An opener path lists ancestor tab IDs from root to direct opener. Related tabs are inserted after the opener subtree in strip order; closing an opener reparents descendants by removing that identity from their paths.

split: open-access


prompt:
The tab workspace reports an incorrect transitive opener subtree.

An opener path lists ancestor tab IDs from root to direct opener. Related tabs are inserted after the opener subtree in strip order; closing an opener reparents descendants by removing that identity from their paths.

split: open-access


prompt:
The tab workspace reports an incorrect related insertion boundary.

An opener path lists ancestor tab IDs from root to direct opener. Related tabs are inserted after the opener subtree in strip order; closing an opener reparents descendants by removing that identity from their paths.

split: open-access


prompt:
The tab workspace reports an incorrect child ancestry extension.

An opener path lists ancestor tab IDs from root to direct opener. Related tabs are inserted after the opener subtree in strip order; closing an opener reparents descendants by removing that identity from their paths.

split: open-access


prompt:
The tab workspace reports an incorrect closed opener path splice.

An opener path lists ancestor tab IDs from root to direct opener. Related tabs are inserted after the opener subtree in strip order; closing an opener reparents descendants by removing that identity from their paths.

split: open-access


prompt:
The tab workspace reports an incorrect opener root association.

An opener path lists ancestor tab IDs from root to direct opener. Related tabs are inserted after the opener subtree in strip order; closing an opener reparents descendants by removing that identity from their paths.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
def pack(widths, available):
    rows = [[]]
    occupied = 0
    for index, width in enumerate(widths):
        if rows[-1] and occupied + width > available:
            rows.append([])
            occupied = 0
        rows[-1].append(index)
        occupied += width
    return rows

N = 1
observations = []
def solve(x):
    r0 = pack(x['widths'],x['available']-1)
    r1 = sum(x['widths'][j] for j in next(row for row in pack(x['widths'],x['available']) if x['active_index'] in row) if j<x['active_index'])
    r2 = next(i for i,row in enumerate(pack(x['widths'],x['available'])) if x['active_index'] in row)
    r3 = [row for row in pack(x['widths'],x['available']) if x['active_index'] not in row]+[row for row in pack(x['widths'],x['available']) if x['active_index'] in row]
    r4 = (len(pack(x['widths'],x['available']))-1)*x['row_height']
    r5 = [t for row in ([row for row in pack(x['widths'],x['available']) if x['active_index'] not in row]+[row for row in pack(x['widths'],x['available']) if x['active_index'] in row]) for t in row]
    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: [({'widths': [80, 70, 90, 30], 'available': 160, 'active_index': 2, 'row_height': 24}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 24, [0, 1, 2, 3]]), ({'widths': [80, 80, 50, 100], 'available': 160, 'active_index': 2, 'row_height': 24}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 24, [0, 1, 2, 3]]), ({'widths': [80, 70, 90, 30], 'available': 160, 'active_index': 0, 'row_height': 24}, [[[0, 1], [2, 3]], 0, 0, [[2, 3], [0, 1]], 24, [2, 3, 0, 1]]), ({'widths': [80, 70, 90, 30], 'available': 160, 'active_index': 3, 'row_height': 24}, [[[0, 1], [2, 3]], 90, 1, [[0, 1], [2, 3]], 24, [0, 1, 2, 3]]), ({'widths': [80, 70, 90, 30], 'available': 300, 'active_index': 2, 'row_height': 24}, [[[0, 1, 2, 3]], 150, 0, [[0, 1, 2, 3]], 0, [0, 1, 2, 3]]), ({'widths': [100, 70, 70, 90], 'available': 160, 'active_index': 2, 'row_height': 24}, [[[0], [1, 2], [3]], 70, 1, [[0], [3], [1, 2]], 48, [0, 3, 1, 2]])], 2: [({'widths': [160, 140, 180, 60], 'available': 320, 'active_index': 2, 'row_height': 48}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 48, [0, 1, 2, 3]]), ({'widths': [160, 160, 100, 200], 'available': 320, 'active_index': 2, 'row_height': 48}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 48, [0, 1, 2, 3]]), ({'widths': [160, 140, 180, 60], 'available': 320, 'active_index': 0, 'row_height': 48}, [[[0, 1], [2, 3]], 0, 0, [[2, 3], [0, 1]], 48, [2, 3, 0, 1]]), ({'widths': [160, 140, 180, 60], 'available': 320, 'active_index': 3, 'row_height': 48}, [[[0, 1], [2, 3]], 180, 1, [[0, 1], [2, 3]], 48, [0, 1, 2, 3]]), ({'widths': [160, 140, 180, 60], 'available': 600, 'active_index': 2, 'row_height': 48}, [[[0, 1, 2, 3]], 300, 0, [[0, 1, 2, 3]], 0, [0, 1, 2, 3]]), ({'widths': [200, 140, 140, 180], 'available': 320, 'active_index': 2, 'row_height': 48}, [[[0], [1, 2], [3]], 140, 1, [[0], [3], [1, 2]], 96, [0, 3, 1, 2]])], 3: [({'widths': [240, 210, 270, 90], 'available': 480, 'active_index': 2, 'row_height': 72}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 72, [0, 1, 2, 3]]), ({'widths': [240, 240, 150, 300], 'available': 480, 'active_index': 2, 'row_height': 72}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 72, [0, 1, 2, 3]]), ({'widths': [240, 210, 270, 90], 'available': 480, 'active_index': 0, 'row_height': 72}, [[[0, 1], [2, 3]], 0, 0, [[2, 3], [0, 1]], 72, [2, 3, 0, 1]]), ({'widths': [240, 210, 270, 90], 'available': 480, 'active_index': 3, 'row_height': 72}, [[[0, 1], [2, 3]], 270, 1, [[0, 1], [2, 3]], 72, [0, 1, 2, 3]]), ({'widths': [240, 210, 270, 90], 'available': 900, 'active_index': 2, 'row_height': 72}, [[[0, 1, 2, 3]], 450, 0, [[0, 1, 2, 3]], 0, [0, 1, 2, 3]]), ({'widths': [300, 210, 210, 270], 'available': 480, 'active_index': 2, 'row_height': 72}, [[[0], [1, 2], [3]], 210, 1, [[0], [3], [1, 2]], 144, [0, 3, 1, 2]])], 4: [({'widths': [320, 280, 360, 120], 'available': 640, 'active_index': 2, 'row_height': 96}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 96, [0, 1, 2, 3]]), ({'widths': [320, 320, 200, 400], 'available': 640, 'active_index': 2, 'row_height': 96}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 96, [0, 1, 2, 3]]), ({'widths': [320, 280, 360, 120], 'available': 640, 'active_index': 0, 'row_height': 96}, [[[0, 1], [2, 3]], 0, 0, [[2, 3], [0, 1]], 96, [2, 3, 0, 1]]), ({'widths': [320, 280, 360, 120], 'available': 640, 'active_index': 3, 'row_height': 96}, [[[0, 1], [2, 3]], 360, 1, [[0, 1], [2, 3]], 96, [0, 1, 2, 3]]), ({'widths': [320, 280, 360, 120], 'available': 1200, 'active_index': 2, 'row_height': 96}, [[[0, 1, 2, 3]], 600, 0, [[0, 1, 2, 3]], 0, [0, 1, 2, 3]]), ({'widths': [400, 280, 280, 360], 'available': 640, 'active_index': 2, 'row_height': 96}, [[[0], [1, 2], [3]], 280, 1, [[0], [3], [1, 2]], 192, [0, 3, 1, 2]])], 5: [({'widths': [400, 350, 450, 150], 'available': 800, 'active_index': 2, 'row_height': 120}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 120, [0, 1, 2, 3]]), ({'widths': [400, 400, 250, 500], 'available': 800, 'active_index': 2, 'row_height': 120}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 120, [0, 1, 2, 3]]), ({'widths': [400, 350, 450, 150], 'available': 800, 'active_index': 0, 'row_height': 120}, [[[0, 1], [2, 3]], 0, 0, [[2, 3], [0, 1]], 120, [2, 3, 0, 1]]), ({'widths': [400, 350, 450, 150], 'available': 800, 'active_index': 3, 'row_height': 120}, [[[0, 1], [2, 3]], 450, 1, [[0, 1], [2, 3]], 120, [0, 1, 2, 3]]), ({'widths': [400, 350, 450, 150], 'available': 1500, 'active_index': 2, 'row_height': 120}, [[[0, 1, 2, 3]], 750, 0, [[0, 1, 2, 3]], 0, [0, 1, 2, 3]]), ({'widths': [500, 350, 350, 450], 'available': 800, 'active_index': 2, 'row_height': 120}, [[[0], [1, 2], [3]], 350, 1, [[0], [3], [1, 2]], 240, [0, 3, 1, 2]])]}
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
def pack(widths, available):
    rows = [[]]
    occupied = 0
    for index, width in enumerate(widths):
        if rows[-1] and occupied + width > available:
            rows.append([])
            occupied = 0
        rows[-1].append(index)
        occupied += width
    return rows

N = 1
observations = []
def solve(x):
    r0 = pack(x['widths'],x['available']+min(x['widths']))
    r1 = sum(x['widths'][j] for j in next(row for row in pack(x['widths'],x['available']) if x['active_index'] in row) if j<x['active_index'])
    r2 = next(i for i,row in enumerate(pack(x['widths'],x['available'])) if x['active_index'] in row)
    r3 = [row for row in pack(x['widths'],x['available']) if x['active_index'] not in row]+[row for row in pack(x['widths'],x['available']) if x['active_index'] in row]
    r4 = (len(pack(x['widths'],x['available']))-1)*x['row_height']
    r5 = [t for row in ([row for row in pack(x['widths'],x['available']) if x['active_index'] not in row]+[row for row in pack(x['widths'],x['available']) if x['active_index'] in row]) for t in row]
    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: [({'widths': [80, 70, 90, 30], 'available': 160, 'active_index': 2, 'row_height': 24}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 24, [0, 1, 2, 3]]), ({'widths': [80, 80, 50, 100], 'available': 160, 'active_index': 2, 'row_height': 24}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 24, [0, 1, 2, 3]]), ({'widths': [80, 70, 90, 30], 'available': 160, 'active_index': 0, 'row_height': 24}, [[[0, 1], [2, 3]], 0, 0, [[2, 3], [0, 1]], 24, [2, 3, 0, 1]]), ({'widths': [80, 70, 90, 30], 'available': 160, 'active_index': 3, 'row_height': 24}, [[[0, 1], [2, 3]], 90, 1, [[0, 1], [2, 3]], 24, [0, 1, 2, 3]]), ({'widths': [80, 70, 90, 30], 'available': 300, 'active_index': 2, 'row_height': 24}, [[[0, 1, 2, 3]], 150, 0, [[0, 1, 2, 3]], 0, [0, 1, 2, 3]]), ({'widths': [100, 70, 70, 90], 'available': 160, 'active_index': 2, 'row_height': 24}, [[[0], [1, 2], [3]], 70, 1, [[0], [3], [1, 2]], 48, [0, 3, 1, 2]])], 2: [({'widths': [160, 140, 180, 60], 'available': 320, 'active_index': 2, 'row_height': 48}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 48, [0, 1, 2, 3]]), ({'widths': [160, 160, 100, 200], 'available': 320, 'active_index': 2, 'row_height': 48}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 48, [0, 1, 2, 3]]), ({'widths': [160, 140, 180, 60], 'available': 320, 'active_index': 0, 'row_height': 48}, [[[0, 1], [2, 3]], 0, 0, [[2, 3], [0, 1]], 48, [2, 3, 0, 1]]), ({'widths': [160, 140, 180, 60], 'available': 320, 'active_index': 3, 'row_height': 48}, [[[0, 1], [2, 3]], 180, 1, [[0, 1], [2, 3]], 48, [0, 1, 2, 3]]), ({'widths': [160, 140, 180, 60], 'available': 600, 'active_index': 2, 'row_height': 48}, [[[0, 1, 2, 3]], 300, 0, [[0, 1, 2, 3]], 0, [0, 1, 2, 3]]), ({'widths': [200, 140, 140, 180], 'available': 320, 'active_index': 2, 'row_height': 48}, [[[0], [1, 2], [3]], 140, 1, [[0], [3], [1, 2]], 96, [0, 3, 1, 2]])], 3: [({'widths': [240, 210, 270, 90], 'available': 480, 'active_index': 2, 'row_height': 72}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 72, [0, 1, 2, 3]]), ({'widths': [240, 240, 150, 300], 'available': 480, 'active_index': 2, 'row_height': 72}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 72, [0, 1, 2, 3]]), ({'widths': [240, 210, 270, 90], 'available': 480, 'active_index': 0, 'row_height': 72}, [[[0, 1], [2, 3]], 0, 0, [[2, 3], [0, 1]], 72, [2, 3, 0, 1]]), ({'widths': [240, 210, 270, 90], 'available': 480, 'active_index': 3, 'row_height': 72}, [[[0, 1], [2, 3]], 270, 1, [[0, 1], [2, 3]], 72, [0, 1, 2, 3]]), ({'widths': [240, 210, 270, 90], 'available': 900, 'active_index': 2, 'row_height': 72}, [[[0, 1, 2, 3]], 450, 0, [[0, 1, 2, 3]], 0, [0, 1, 2, 3]]), ({'widths': [300, 210, 210, 270], 'available': 480, 'active_index': 2, 'row_height': 72}, [[[0], [1, 2], [3]], 210, 1, [[0], [3], [1, 2]], 144, [0, 3, 1, 2]])], 4: [({'widths': [320, 280, 360, 120], 'available': 640, 'active_index': 2, 'row_height': 96}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 96, [0, 1, 2, 3]]), ({'widths': [320, 320, 200, 400], 'available': 640, 'active_index': 2, 'row_height': 96}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 96, [0, 1, 2, 3]]), ({'widths': [320, 280, 360, 120], 'available': 640, 'active_index': 0, 'row_height': 96}, [[[0, 1], [2, 3]], 0, 0, [[2, 3], [0, 1]], 96, [2, 3, 0, 1]]), ({'widths': [320, 280, 360, 120], 'available': 640, 'active_index': 3, 'row_height': 96}, [[[0, 1], [2, 3]], 360, 1, [[0, 1], [2, 3]], 96, [0, 1, 2, 3]]), ({'widths': [320, 280, 360, 120], 'available': 1200, 'active_index': 2, 'row_height': 96}, [[[0, 1, 2, 3]], 600, 0, [[0, 1, 2, 3]], 0, [0, 1, 2, 3]]), ({'widths': [400, 280, 280, 360], 'available': 640, 'active_index': 2, 'row_height': 96}, [[[0], [1, 2], [3]], 280, 1, [[0], [3], [1, 2]], 192, [0, 3, 1, 2]])], 5: [({'widths': [400, 350, 450, 150], 'available': 800, 'active_index': 2, 'row_height': 120}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 120, [0, 1, 2, 3]]), ({'widths': [400, 400, 250, 500], 'available': 800, 'active_index': 2, 'row_height': 120}, [[[0, 1], [2, 3]], 0, 1, [[0, 1], [2, 3]], 120, [0, 1, 2, 3]]), ({'widths': [400, 350, 450, 150], 'available': 800, 'active_index': 0, 'row_height': 120}, [[[0, 1], [2, 3]], 0, 0, [[2, 3], [0, 1]], 120, [2, 3, 0, 1]]), ({'widths': [400, 350, 450, 150], 'available': 800, 'active_index': 3, 'row_height': 120}, [[[0, 1], [2, 3]], 450, 1, [[0, 1], [2, 3]], 120, [0, 1, 2, 3]]), ({'widths': [400, 350, 450, 150], 'available': 1500, 'active_index': 2, 'row_height': 120}, [[[0, 1, 2, 3]], 750, 0, [[0, 1, 2, 3]], 0, [0, 1, 2, 3]]), ({'widths': [500, 350, 350, 450], 'available': 800, 'active_index': 2, 'row_height': 120}, [[[0], [1, 2], [3]], 350, 1, [[0], [3], [1, 2]], 240, [0, 3, 1, 2]])]}
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 exact fit row packing.

A multirow strip greedily packs indivisible tab widths with exact fits allowed. The active tab row is painted adjacent to content after other rows; tab identity and within-row coordinates follow this row permutation.

split: open-access