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

N = 1
observations = []
def solve(x):
    r0 = x['remaining']==0 and not x['root']
    r1 = x['remaining']==0 and x['root']
    r2 = x['pane']
    r3 = x['gutter'] if x['remaining']==0 and not x['root'] else 0
    r4 = x['sibling'] if x['remaining']==0 and not x['root'] and x['active']==x['pane'] else x['active']
    r5 = x['width']+x['sibling_width']+x['gutter'] if x['remaining']==0 and not x['root'] else x['sibling_width']
    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: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, True, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 208]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 0}, [True, False, 'q', 0, 'q', 500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200])], 2: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, True, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 416]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 0}, [True, False, 'q', 0, 'q', 1000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400])], 3: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, True, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 624]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 0}, [True, False, 'q', 0, 'q', 1500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600])], 4: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, True, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 832]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 0}, [True, False, 'q', 0, 'q', 2000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800])], 5: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, True, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 1040]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 0}, [True, False, 'q', 0, 'q', 2500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000])]}
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['remaining']==0 and not x['root']
    r1 = x['remaining']==0 and x['root']
    r2 = x['sibling']
    r3 = x['gutter'] if x['remaining']==0 and not x['root'] else 0
    r4 = x['sibling'] if x['remaining']==0 and not x['root'] and x['active']==x['pane'] else x['active']
    r5 = x['width']+x['sibling_width']+x['gutter'] if x['remaining']==0 and not x['root'] else x['sibling_width']
    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: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, True, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 208]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 0}, [True, False, 'q', 0, 'q', 500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200])], 2: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, True, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 416]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 0}, [True, False, 'q', 0, 'q', 1000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400])], 3: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, True, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 624]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 0}, [True, False, 'q', 0, 'q', 1500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600])], 4: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, True, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 832]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 0}, [True, False, 'q', 0, 'q', 2000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800])], 5: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, True, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 1040]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 0}, [True, False, 'q', 0, 'q', 2500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000])]}
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 promoted subtree.

A pane disappears only after its last tab closes; promote its sibling subtree, remove the separator, transfer active-pane ownership and retain sibling extent.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['remaining']==0 and not x['root']
    r1 = x['remaining']==0 and x['root']
    r2 = x['sibling'] if x['remaining']==0 and not x['root'] else x['pane']
    r3 = 0
    r4 = x['sibling'] if x['remaining']==0 and not x['root'] and x['active']==x['pane'] else x['active']
    r5 = x['width']+x['sibling_width']+x['gutter'] if x['remaining']==0 and not x['root'] else x['sibling_width']
    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: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, True, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 208]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 0}, [True, False, 'q', 0, 'q', 500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200])], 2: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, True, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 416]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 0}, [True, False, 'q', 0, 'q', 1000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400])], 3: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, True, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 624]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 0}, [True, False, 'q', 0, 'q', 1500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600])], 4: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, True, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 832]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 0}, [True, False, 'q', 0, 'q', 2000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800])], 5: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, True, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 1040]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 0}, [True, False, 'q', 0, 'q', 2500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000])]}
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['remaining']==0 and not x['root']
    r1 = x['remaining']==0 and x['root']
    r2 = x['sibling'] if x['remaining']==0 and not x['root'] else x['pane']
    r3 = x['gutter']
    r4 = x['sibling'] if x['remaining']==0 and not x['root'] and x['active']==x['pane'] else x['active']
    r5 = x['width']+x['sibling_width']+x['gutter'] if x['remaining']==0 and not x['root'] else x['sibling_width']
    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: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, True, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 208]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 0}, [True, False, 'q', 0, 'q', 500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200])], 2: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, True, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 416]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 0}, [True, False, 'q', 0, 'q', 1000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400])], 3: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, True, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 624]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 0}, [True, False, 'q', 0, 'q', 1500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600])], 4: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, True, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 832]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 0}, [True, False, 'q', 0, 'q', 2000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800])], 5: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, True, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 1040]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 0}, [True, False, 'q', 0, 'q', 2500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000])]}
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 separator reclamation.

A pane disappears only after its last tab closes; promote its sibling subtree, remove the separator, transfer active-pane ownership and retain sibling extent.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['remaining']==0 and not x['root']
    r1 = x['remaining']==0 and x['root']
    r2 = x['sibling'] if x['remaining']==0 and not x['root'] else x['pane']
    r3 = x['gutter'] if x['remaining']==0 and not x['root'] else 0
    r4 = x['active']
    r5 = x['width']+x['sibling_width']+x['gutter'] if x['remaining']==0 and not x['root'] else x['sibling_width']
    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: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, True, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 208]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 0}, [True, False, 'q', 0, 'q', 500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200])], 2: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, True, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 416]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 0}, [True, False, 'q', 0, 'q', 1000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400])], 3: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, True, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 624]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 0}, [True, False, 'q', 0, 'q', 1500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600])], 4: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, True, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 832]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 0}, [True, False, 'q', 0, 'q', 2000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800])], 5: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, True, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 1040]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 0}, [True, False, 'q', 0, 'q', 2500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000])]}
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['remaining']==0 and not x['root']
    r1 = x['remaining']==0 and x['root']
    r2 = x['sibling'] if x['remaining']==0 and not x['root'] else x['pane']
    r3 = x['gutter'] if x['remaining']==0 and not x['root'] else 0
    r4 = x['sibling']
    r5 = x['width']+x['sibling_width']+x['gutter'] if x['remaining']==0 and not x['root'] else x['sibling_width']
    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: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, True, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 208]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 0}, [True, False, 'q', 0, 'q', 500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200])], 2: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, True, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 416]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 0}, [True, False, 'q', 0, 'q', 1000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400])], 3: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, True, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 624]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 0}, [True, False, 'q', 0, 'q', 1500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600])], 4: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, True, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 832]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 0}, [True, False, 'q', 0, 'q', 2000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800])], 5: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, True, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 1040]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 0}, [True, False, 'q', 0, 'q', 2500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000])]}
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 pane transfer.

A pane disappears only after its last tab closes; promote its sibling subtree, remove the separator, transfer active-pane ownership and retain sibling extent.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['remaining']==0 and not x['root']
    r1 = x['remaining']==0 and x['root']
    r2 = x['sibling'] if x['remaining']==0 and not x['root'] else x['pane']
    r3 = x['gutter'] if x['remaining']==0 and not x['root'] else 0
    r4 = x['sibling'] if x['remaining']==0 and not x['root'] and x['active']==x['pane'] else x['active']
    r5 = x['sibling_width']
    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: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, True, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 208]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 0}, [True, False, 'q', 0, 'q', 500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200])], 2: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, True, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 416]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 0}, [True, False, 'q', 0, 'q', 1000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400])], 3: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, True, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 624]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 0}, [True, False, 'q', 0, 'q', 1500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600])], 4: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, True, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 832]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 0}, [True, False, 'q', 0, 'q', 2000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800])], 5: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, True, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 1040]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 0}, [True, False, 'q', 0, 'q', 2500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000])]}
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['remaining']==0 and not x['root']
    r1 = x['remaining']==0 and x['root']
    r2 = x['sibling'] if x['remaining']==0 and not x['root'] else x['pane']
    r3 = x['gutter'] if x['remaining']==0 and not x['root'] else 0
    r4 = x['sibling'] if x['remaining']==0 and not x['root'] and x['active']==x['pane'] else x['active']
    r5 = x['width']+x['sibling_width']
    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: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, True, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 208]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 0}, [True, False, 'q', 0, 'q', 500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200])], 2: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, True, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 416]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 0}, [True, False, 'q', 0, 'q', 1000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400])], 3: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, True, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 624]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 0}, [True, False, 'q', 0, 'q', 1500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600])], 4: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, True, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 832]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 0}, [True, False, 'q', 0, 'q', 2000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800])], 5: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, True, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 1040]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 0}, [True, False, 'q', 0, 'q', 2500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000])]}
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 promoted extent.

A pane disappears only after its last tab closes; promote its sibling subtree, remove the separator, transfer active-pane ownership and retain sibling extent.

split: open-access


prompt:
The tab workspace reports an incorrect horizontal anchor.

Detach a tab into a new window at pointer minus drag anchor, clamp within work area, copy zoom, assign new window ownership and keep original document identity.

split: open-access


prompt:
The tab workspace reports an incorrect vertical anchor.

Detach a tab into a new window at pointer minus drag anchor, clamp within work area, copy zoom, assign new window ownership and keep original document identity.

split: open-access


prompt:
The tab workspace reports an incorrect window ownership.

Detach a tab into a new window at pointer minus drag anchor, clamp within work area, copy zoom, assign new window ownership and keep original document identity.

split: open-access


prompt:
The tab workspace reports an incorrect document continuity.

Detach a tab into a new window at pointer minus drag anchor, clamp within work area, copy zoom, assign new window ownership and keep original document identity.

split: open-access


prompt:
The tab workspace reports an incorrect zoom continuity.

Detach a tab into a new window at pointer minus drag anchor, clamp within work area, copy zoom, assign new window ownership and keep original document identity.

split: open-access


prompt:
The tab workspace reports an incorrect workarea overflow.

Detach a tab into a new window at pointer minus drag anchor, clamp within work area, copy zoom, assign new window ownership and keep original document identity.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = 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['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 = [] 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['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 collapsed member visibility.

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 = 1 if x['collapsed'] else 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['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 = max(0,len(x['members'])-1)
    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['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 header count.

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 = len(x['dirty']) if not x['collapsed'] else 0
    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['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 = int(any(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['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 dirty group indicator.

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