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

N = 1
observations = []
def solve(x):
    r0 = ([x['active']] if x['active'] in x['members'] else []) if x['collapsed'] else x['members']
    r1 = len(x['members'])
    r2 = sum(t in x['dirty'] for t in x['members'])
    r3 = None
    r4 = x['collapsed'] and x['reveal'] in x['members'] and x['reveal']!=x['active']
    r5 = x['members']
    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: [({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 3, 2, 'b', True, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c'], 3, 2, None, False, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 3, 2, None, True, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 3, 0, 'b', True, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 3, 2, 'b', False, ['a', 'b', 'c']]), ({'members': [], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 0, 0, None, False, []])], 2: [({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 4, 2, 'b', True, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0'], 4, 2, None, False, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 4, 2, None, True, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 4, 0, 'b', True, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 4, 2, 'b', False, ['a', 'b', 'c', 'extra0']]), ({'members': ['extra0'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 1, 0, None, False, ['extra0']])], 3: [({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 5, 2, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0', 'extra1'], 5, 2, None, False, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 5, 2, None, True, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 5, 0, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 5, 2, 'b', False, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 2, 0, None, False, ['extra0', 'extra1']])], 4: [({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 6, 2, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 6, 2, None, False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 6, 2, None, True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 6, 0, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 6, 2, 'b', False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 3, 0, None, False, ['extra0', 'extra1', 'extra2']])], 5: [({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 7, 2, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 7, 2, None, False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 7, 2, None, True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 7, 0, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 7, 2, 'b', False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 4, 0, None, False, ['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['active']] if x['active'] in x['members'] else []) if x['collapsed'] else x['members']
    r1 = len(x['members'])
    r2 = sum(t in x['dirty'] for t in x['members'])
    r3 = x['active'] if x['collapsed'] else None
    r4 = x['collapsed'] and x['reveal'] in x['members'] and x['reveal']!=x['active']
    r5 = x['members']
    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: [({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 3, 2, 'b', True, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c'], 3, 2, None, False, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 3, 2, None, True, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 3, 0, 'b', True, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 3, 2, 'b', False, ['a', 'b', 'c']]), ({'members': [], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 0, 0, None, False, []])], 2: [({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 4, 2, 'b', True, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0'], 4, 2, None, False, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 4, 2, None, True, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 4, 0, 'b', True, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 4, 2, 'b', False, ['a', 'b', 'c', 'extra0']]), ({'members': ['extra0'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 1, 0, None, False, ['extra0']])], 3: [({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 5, 2, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0', 'extra1'], 5, 2, None, False, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 5, 2, None, True, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 5, 0, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 5, 2, 'b', False, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 2, 0, None, False, ['extra0', 'extra1']])], 4: [({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 6, 2, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 6, 2, None, False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 6, 2, None, True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 6, 0, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 6, 2, 'b', False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 3, 0, None, False, ['extra0', 'extra1', 'extra2']])], 5: [({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 7, 2, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 7, 2, None, False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 7, 2, None, True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 7, 0, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 7, 2, 'b', False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 4, 0, None, False, ['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 active placeholder.

Collapsed tab groups display only a header and active member placeholder; preserve membership, count dirty documents and expand before revealing an inactive member.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = ([x['active']] if x['active'] in x['members'] else []) if x['collapsed'] else x['members']
    r1 = len(x['members'])
    r2 = sum(t in x['dirty'] for t in x['members'])
    r3 = x['active'] if x['collapsed'] and x['active'] in x['members'] else None
    r4 = False
    r5 = x['members']
    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: [({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 3, 2, 'b', True, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c'], 3, 2, None, False, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 3, 2, None, True, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 3, 0, 'b', True, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 3, 2, 'b', False, ['a', 'b', 'c']]), ({'members': [], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 0, 0, None, False, []])], 2: [({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 4, 2, 'b', True, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0'], 4, 2, None, False, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 4, 2, None, True, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 4, 0, 'b', True, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 4, 2, 'b', False, ['a', 'b', 'c', 'extra0']]), ({'members': ['extra0'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 1, 0, None, False, ['extra0']])], 3: [({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 5, 2, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0', 'extra1'], 5, 2, None, False, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 5, 2, None, True, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 5, 0, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 5, 2, 'b', False, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 2, 0, None, False, ['extra0', 'extra1']])], 4: [({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 6, 2, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 6, 2, None, False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 6, 2, None, True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 6, 0, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 6, 2, 'b', False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 3, 0, None, False, ['extra0', 'extra1', 'extra2']])], 5: [({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 7, 2, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 7, 2, None, False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 7, 2, None, True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 7, 0, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 7, 2, 'b', False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 4, 0, None, False, ['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['active']] if x['active'] in x['members'] else []) if x['collapsed'] else x['members']
    r1 = len(x['members'])
    r2 = sum(t in x['dirty'] for t in x['members'])
    r3 = x['active'] if x['collapsed'] and x['active'] in x['members'] else None
    r4 = x['collapsed']
    r5 = x['members']
    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: [({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 3, 2, 'b', True, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c'], 3, 2, None, False, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 3, 2, None, True, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 3, 0, 'b', True, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 3, 2, 'b', False, ['a', 'b', 'c']]), ({'members': [], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 0, 0, None, False, []])], 2: [({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 4, 2, 'b', True, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0'], 4, 2, None, False, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 4, 2, None, True, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 4, 0, 'b', True, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 4, 2, 'b', False, ['a', 'b', 'c', 'extra0']]), ({'members': ['extra0'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 1, 0, None, False, ['extra0']])], 3: [({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 5, 2, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0', 'extra1'], 5, 2, None, False, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 5, 2, None, True, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 5, 0, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 5, 2, 'b', False, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 2, 0, None, False, ['extra0', 'extra1']])], 4: [({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 6, 2, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 6, 2, None, False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 6, 2, None, True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 6, 0, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 6, 2, 'b', False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 3, 0, None, False, ['extra0', 'extra1', 'extra2']])], 5: [({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 7, 2, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 7, 2, None, False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 7, 2, None, True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 7, 0, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 7, 2, 'b', False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 4, 0, None, False, ['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 reveal expansion.

Collapsed tab groups display only a header and active member placeholder; preserve membership, count dirty documents and expand before revealing an inactive member.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = ([x['active']] if x['active'] in x['members'] else []) if x['collapsed'] else x['members']
    r1 = len(x['members'])
    r2 = sum(t in x['dirty'] for t in x['members'])
    r3 = x['active'] if x['collapsed'] and x['active'] in x['members'] else None
    r4 = x['collapsed'] and x['reveal'] in x['members'] and x['reveal']!=x['active']
    r5 = [] if x['collapsed'] else x['members']
    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: [({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 3, 2, 'b', True, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c'], 3, 2, None, False, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 3, 2, None, True, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 3, 0, 'b', True, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 3, 2, 'b', False, ['a', 'b', 'c']]), ({'members': [], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 0, 0, None, False, []])], 2: [({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 4, 2, 'b', True, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0'], 4, 2, None, False, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 4, 2, None, True, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 4, 0, 'b', True, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 4, 2, 'b', False, ['a', 'b', 'c', 'extra0']]), ({'members': ['extra0'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 1, 0, None, False, ['extra0']])], 3: [({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 5, 2, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0', 'extra1'], 5, 2, None, False, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 5, 2, None, True, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 5, 0, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 5, 2, 'b', False, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 2, 0, None, False, ['extra0', 'extra1']])], 4: [({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 6, 2, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 6, 2, None, False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 6, 2, None, True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 6, 0, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 6, 2, 'b', False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 3, 0, None, False, ['extra0', 'extra1', 'extra2']])], 5: [({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 7, 2, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 7, 2, None, False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 7, 2, None, True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 7, 0, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 7, 2, 'b', False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 4, 0, None, False, ['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['active']] if x['active'] in x['members'] else []) if x['collapsed'] else x['members']
    r1 = len(x['members'])
    r2 = sum(t in x['dirty'] for t in x['members'])
    r3 = x['active'] if x['collapsed'] and x['active'] in x['members'] else None
    r4 = x['collapsed'] and x['reveal'] in x['members'] and x['reveal']!=x['active']
    r5 = [x['active']] if x['active'] in x['members'] else []
    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: [({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 3, 2, 'b', True, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c'], 3, 2, None, False, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 3, 2, None, True, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 3, 0, 'b', True, ['a', 'b', 'c']]), ({'members': ['a', 'b', 'c'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 3, 2, 'b', False, ['a', 'b', 'c']]), ({'members': [], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 0, 0, None, False, []])], 2: [({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 4, 2, 'b', True, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0'], 4, 2, None, False, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 4, 2, None, True, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 4, 0, 'b', True, ['a', 'b', 'c', 'extra0']]), ({'members': ['a', 'b', 'c', 'extra0'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 4, 2, 'b', False, ['a', 'b', 'c', 'extra0']]), ({'members': ['extra0'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 1, 0, None, False, ['extra0']])], 3: [({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 5, 2, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0', 'extra1'], 5, 2, None, False, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 5, 2, None, True, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 5, 0, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 5, 2, 'b', False, ['a', 'b', 'c', 'extra0', 'extra1']]), ({'members': ['extra0', 'extra1'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 2, 0, None, False, ['extra0', 'extra1']])], 4: [({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 6, 2, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 6, 2, None, False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 6, 2, None, True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 6, 0, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 6, 2, 'b', False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2']]), ({'members': ['extra0', 'extra1', 'extra2'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 3, 0, None, False, ['extra0', 'extra1', 'extra2']])], 5: [({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['b'], 7, 2, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': False, 'dirty': ['a', 'c'], 'reveal': 'c'}, [['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 7, 2, None, False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'z', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 7, 2, None, True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': [], 'reveal': 'c'}, [['b'], 7, 0, 'b', True, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'b'}, [['b'], 7, 2, 'b', False, ['a', 'b', 'c', 'extra0', 'extra1', 'extra2', 'extra3']]), ({'members': ['extra0', 'extra1', 'extra2', 'extra3'], 'active': 'b', 'collapsed': True, 'dirty': ['a', 'c'], 'reveal': 'c'}, [[], 4, 0, None, False, ['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 membership retention.

Collapsed tab groups display only a header and active member placeholder; preserve membership, count dirty documents and expand before revealing an inactive member.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = list(reversed(x['members']))
    r1 = [t for t in x['tabs'] if t not in x['members']]
    r2 = x['boundary']-sum(t in x['members'] for t in x['tabs'][:x['boundary']])
    r3 = all(t in x['members'] for t in x['tabs'][min(x['tabs'].index(t) for t in x['members']):x['boundary']]) and min(x['tabs'].index(t) for t in x['members'])<=x['boundary']<=max(x['tabs'].index(t) for t in x['members'])+1
    r4 = x['active']
    r5 = len(x['members'])
    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', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 1, True, 'c', 2])], 2: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 1, True, 'c', 2])], 3: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 1, True, 'c', 2])], 4: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1', 'background2'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 1, True, 'c', 2])], 5: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 1, True, 'c', 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

N = 1
observations = []
def solve(x):
    r0 = x['members'][:1]
    r1 = [t for t in x['tabs'] if t not in x['members']]
    r2 = x['boundary']-sum(t in x['members'] for t in x['tabs'][:x['boundary']])
    r3 = all(t in x['members'] for t in x['tabs'][min(x['tabs'].index(t) for t in x['members']):x['boundary']]) and min(x['tabs'].index(t) for t in x['members'])<=x['boundary']<=max(x['tabs'].index(t) for t in x['members'])+1
    r4 = x['active']
    r5 = len(x['members'])
    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', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 1, True, 'c', 2])], 2: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 1, True, 'c', 2])], 3: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 1, True, 'c', 2])], 4: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1', 'background2'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 1, True, 'c', 2])], 5: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 1, True, 'c', 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 group block order.

Move a contiguous tab group as one block: retain member order, remove all originals, rebase target boundary by members preceding it and preserve selected identity.

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['members']]
    r1 = [t for t in x['tabs'] if t!=x['members'][0]]
    r2 = x['boundary']-sum(t in x['members'] for t in x['tabs'][:x['boundary']])
    r3 = all(t in x['members'] for t in x['tabs'][min(x['tabs'].index(t) for t in x['members']):x['boundary']]) and min(x['tabs'].index(t) for t in x['members'])<=x['boundary']<=max(x['tabs'].index(t) for t in x['members'])+1
    r4 = x['active']
    r5 = len(x['members'])
    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', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 1, True, 'c', 2])], 2: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 1, True, 'c', 2])], 3: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 1, True, 'c', 2])], 4: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1', 'background2'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 1, True, 'c', 2])], 5: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 1, True, 'c', 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

N = 1
observations = []
def solve(x):
    r0 = [t for t in x['tabs'] if t in x['members']]
    r1 = x['tabs']
    r2 = x['boundary']-sum(t in x['members'] for t in x['tabs'][:x['boundary']])
    r3 = all(t in x['members'] for t in x['tabs'][min(x['tabs'].index(t) for t in x['members']):x['boundary']]) and min(x['tabs'].index(t) for t in x['members'])<=x['boundary']<=max(x['tabs'].index(t) for t in x['members'])+1
    r4 = x['active']
    r5 = len(x['members'])
    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', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 1, True, 'c', 2])], 2: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 1, True, 'c', 2])], 3: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 1, True, 'c', 2])], 4: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1', 'background2'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 1, True, 'c', 2])], 5: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 1, True, 'c', 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 group source removal.

Move a contiguous tab group as one block: retain member order, remove all originals, rebase target boundary by members preceding it and preserve selected identity.

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['members']]
    r1 = [t for t in x['tabs'] if t not in x['members']]
    r2 = x['boundary']
    r3 = all(t in x['members'] for t in x['tabs'][min(x['tabs'].index(t) for t in x['members']):x['boundary']]) and min(x['tabs'].index(t) for t in x['members'])<=x['boundary']<=max(x['tabs'].index(t) for t in x['members'])+1
    r4 = x['active']
    r5 = len(x['members'])
    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', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 1, True, 'c', 2])], 2: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 1, True, 'c', 2])], 3: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 1, True, 'c', 2])], 4: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1', 'background2'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 1, True, 'c', 2])], 5: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 1, True, 'c', 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

N = 1
observations = []
def solve(x):
    r0 = [t for t in x['tabs'] if t in x['members']]
    r1 = [t for t in x['tabs'] if t not in x['members']]
    r2 = max(0,x['boundary']-len(x['members']))
    r3 = all(t in x['members'] for t in x['tabs'][min(x['tabs'].index(t) for t in x['members']):x['boundary']]) and min(x['tabs'].index(t) for t in x['members'])<=x['boundary']<=max(x['tabs'].index(t) for t in x['members'])+1
    r4 = x['active']
    r5 = len(x['members'])
    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', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 1, True, 'c', 2])], 2: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 1, True, 'c', 2])], 3: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 1, True, 'c', 2])], 4: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1', 'background2'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 1, True, 'c', 2])], 5: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 1, True, 'c', 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 group boundary rebase.

Move a contiguous tab group as one block: retain member order, remove all originals, rebase target boundary by members preceding it and preserve selected identity.

split: open-access


prompt:
The tab workspace reports an incorrect self drop detection.

Move a contiguous tab group as one block: retain member order, remove all originals, rebase target boundary by members preceding it and preserve selected identity.

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['members']]
    r1 = [t for t in x['tabs'] if t not in x['members']]
    r2 = x['boundary']-sum(t in x['members'] for t in x['tabs'][:x['boundary']])
    r3 = all(t in x['members'] for t in x['tabs'][min(x['tabs'].index(t) for t in x['members']):x['boundary']]) and min(x['tabs'].index(t) for t in x['members'])<=x['boundary']<=max(x['tabs'].index(t) for t in x['members'])+1
    r4 = x['members'][0]
    r5 = len(x['members'])
    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', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 1, True, 'c', 2])], 2: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 1, True, 'c', 2])], 3: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 1, True, 'c', 2])], 4: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1', 'background2'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 1, True, 'c', 2])], 5: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 1, True, 'c', 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

N = 1
observations = []
def solve(x):
    r0 = [t for t in x['tabs'] if t in x['members']]
    r1 = [t for t in x['tabs'] if t not in x['members']]
    r2 = x['boundary']-sum(t in x['members'] for t in x['tabs'][:x['boundary']])
    r3 = all(t in x['members'] for t in x['tabs'][min(x['tabs'].index(t) for t in x['members']):x['boundary']]) and min(x['tabs'].index(t) for t in x['members'])<=x['boundary']<=max(x['tabs'].index(t) for t in x['members'])+1
    r4 = x['members'][-1]
    r5 = len(x['members'])
    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', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e'], 1, True, 'c', 2])], 2: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0'], 1, True, 'c', 2])], 3: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1'], 1, True, 'c', 2])], 4: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1', 'background2'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2'], 1, True, 'c', 2])], 5: [({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 0, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 0, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 3, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 1, True, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['c', 'd'], 'boundary': 5, 'active': 'c'}, [['c', 'd'], ['a', 'b', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'c', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 5, 'active': 'a'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 3, False, 'a', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 'members': ['b', 'c'], 'boundary': 1, 'active': 'c'}, [['b', 'c'], ['a', 'd', 'e', 'background0', 'background1', 'background2', 'background3'], 1, True, 'c', 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 group active retention.

Move a contiguous tab group as one block: retain member order, remove all originals, rebase target boundary by members preceding it and preserve selected identity.

split: open-access