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

N = 1
observations = []
def solve(x):
    r0 = x['icon']+x['gap'] if x['icon_visible'] else 0
    r1 = x['dirty_width']+x['gap'] if x['dirty'] else 0
    r2 = x['close_width']+x['gap']
    r3 = 2*x['padding']
    r4 = max(0,x['width']-2*x['padding']-(x['icon']+x['gap'] if x['icon_visible'] else 0)-(x['dirty_width']+x['gap'] if x['dirty'] else 0)-(x['close_width']+x['gap'] if x['close'] else 0))
    r5 = x['title_width']>max(0,x['width']-2*x['padding']-(x['icon']+x['gap'] if x['icon_visible'] else 0)-(x['dirty_width']+x['gap'] if x['dirty'] else 0)-(x['close_width']+x['gap'] if x['close'] else 0))
    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: [({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 22, 16, 72, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': False, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [0, 10, 22, 16, 92, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': False, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 0, 22, 16, 82, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': False, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 0, 16, 94, True]), ({'width': 220, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 22, 16, 152, False]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 0, 'title_width': 110}, [16, 6, 18, 16, 84, True])], 2: [({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 44, 32, 144, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': False, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [0, 20, 44, 32, 184, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': False, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 0, 44, 32, 164, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': False, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 0, 32, 188, True]), ({'width': 440, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 44, 32, 304, False]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 0, 'title_width': 220}, [32, 12, 36, 32, 168, True])], 3: [({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 66, 48, 216, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': False, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [0, 30, 66, 48, 276, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': False, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 0, 66, 48, 246, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': False, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 0, 48, 282, True]), ({'width': 660, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 66, 48, 456, False]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 0, 'title_width': 330}, [48, 18, 54, 48, 252, True])], 4: [({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 88, 64, 288, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': False, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [0, 40, 88, 64, 368, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': False, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 0, 88, 64, 328, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': False, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 0, 64, 376, True]), ({'width': 880, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 88, 64, 608, False]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 0, 'title_width': 440}, [64, 24, 72, 64, 336, True])], 5: [({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 110, 80, 360, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': False, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [0, 50, 110, 80, 460, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': False, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 0, 110, 80, 410, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': False, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 0, 80, 470, True]), ({'width': 1100, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 110, 80, 760, False]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 0, 'title_width': 550}, [80, 30, 90, 80, 420, True])]}
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['icon']+x['gap'] if x['icon_visible'] else 0
    r1 = x['dirty_width']+x['gap'] if x['dirty'] else 0
    r2 = x['close_width'] if x['close'] else 0
    r3 = 2*x['padding']
    r4 = max(0,x['width']-2*x['padding']-(x['icon']+x['gap'] if x['icon_visible'] else 0)-(x['dirty_width']+x['gap'] if x['dirty'] else 0)-(x['close_width']+x['gap'] if x['close'] else 0))
    r5 = x['title_width']>max(0,x['width']-2*x['padding']-(x['icon']+x['gap'] if x['icon_visible'] else 0)-(x['dirty_width']+x['gap'] if x['dirty'] else 0)-(x['close_width']+x['gap'] if x['close'] else 0))
    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: [({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 22, 16, 72, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': False, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [0, 10, 22, 16, 92, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': False, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 0, 22, 16, 82, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': False, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 0, 16, 94, True]), ({'width': 220, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 22, 16, 152, False]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 0, 'title_width': 110}, [16, 6, 18, 16, 84, True])], 2: [({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 44, 32, 144, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': False, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [0, 20, 44, 32, 184, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': False, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 0, 44, 32, 164, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': False, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 0, 32, 188, True]), ({'width': 440, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 44, 32, 304, False]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 0, 'title_width': 220}, [32, 12, 36, 32, 168, True])], 3: [({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 66, 48, 216, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': False, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [0, 30, 66, 48, 276, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': False, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 0, 66, 48, 246, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': False, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 0, 48, 282, True]), ({'width': 660, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 66, 48, 456, False]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 0, 'title_width': 330}, [48, 18, 54, 48, 252, True])], 4: [({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 88, 64, 288, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': False, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [0, 40, 88, 64, 368, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': False, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 0, 88, 64, 328, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': False, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 0, 64, 376, True]), ({'width': 880, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 88, 64, 608, False]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 0, 'title_width': 440}, [64, 24, 72, 64, 336, True])], 5: [({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 110, 80, 360, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': False, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [0, 50, 110, 80, 460, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': False, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 0, 110, 80, 410, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': False, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 0, 80, 470, True]), ({'width': 1100, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 110, 80, 760, False]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 0, 'title_width': 550}, [80, 30, 90, 80, 420, True])]}
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 close footprint.

Tab label layout reserves distinct icon, dirty marker, close button and padding footprints before truncating the title; absent decorations consume no width.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['icon']+x['gap'] if x['icon_visible'] else 0
    r1 = x['dirty_width']+x['gap'] if x['dirty'] else 0
    r2 = x['close_width']+x['gap'] if x['close'] else 0
    r3 = x['padding']
    r4 = max(0,x['width']-2*x['padding']-(x['icon']+x['gap'] if x['icon_visible'] else 0)-(x['dirty_width']+x['gap'] if x['dirty'] else 0)-(x['close_width']+x['gap'] if x['close'] else 0))
    r5 = x['title_width']>max(0,x['width']-2*x['padding']-(x['icon']+x['gap'] if x['icon_visible'] else 0)-(x['dirty_width']+x['gap'] if x['dirty'] else 0)-(x['close_width']+x['gap'] if x['close'] else 0))
    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: [({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 22, 16, 72, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': False, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [0, 10, 22, 16, 92, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': False, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 0, 22, 16, 82, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': False, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 0, 16, 94, True]), ({'width': 220, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 22, 16, 152, False]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 0, 'title_width': 110}, [16, 6, 18, 16, 84, True])], 2: [({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 44, 32, 144, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': False, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [0, 20, 44, 32, 184, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': False, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 0, 44, 32, 164, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': False, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 0, 32, 188, True]), ({'width': 440, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 44, 32, 304, False]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 0, 'title_width': 220}, [32, 12, 36, 32, 168, True])], 3: [({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 66, 48, 216, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': False, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [0, 30, 66, 48, 276, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': False, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 0, 66, 48, 246, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': False, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 0, 48, 282, True]), ({'width': 660, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 66, 48, 456, False]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 0, 'title_width': 330}, [48, 18, 54, 48, 252, True])], 4: [({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 88, 64, 288, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': False, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [0, 40, 88, 64, 368, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': False, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 0, 88, 64, 328, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': False, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 0, 64, 376, True]), ({'width': 880, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 88, 64, 608, False]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 0, 'title_width': 440}, [64, 24, 72, 64, 336, True])], 5: [({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 110, 80, 360, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': False, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [0, 50, 110, 80, 460, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': False, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 0, 110, 80, 410, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': False, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 0, 80, 470, True]), ({'width': 1100, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 110, 80, 760, False]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 0, 'title_width': 550}, [80, 30, 90, 80, 420, True])]}
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['icon']+x['gap'] if x['icon_visible'] else 0
    r1 = x['dirty_width']+x['gap'] if x['dirty'] else 0
    r2 = x['close_width']+x['gap'] if x['close'] else 0
    r3 = 0
    r4 = max(0,x['width']-2*x['padding']-(x['icon']+x['gap'] if x['icon_visible'] else 0)-(x['dirty_width']+x['gap'] if x['dirty'] else 0)-(x['close_width']+x['gap'] if x['close'] else 0))
    r5 = x['title_width']>max(0,x['width']-2*x['padding']-(x['icon']+x['gap'] if x['icon_visible'] else 0)-(x['dirty_width']+x['gap'] if x['dirty'] else 0)-(x['close_width']+x['gap'] if x['close'] else 0))
    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: [({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 22, 16, 72, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': False, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [0, 10, 22, 16, 92, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': False, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 0, 22, 16, 82, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': False, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 0, 16, 94, True]), ({'width': 220, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 22, 16, 152, False]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 0, 'title_width': 110}, [16, 6, 18, 16, 84, True])], 2: [({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 44, 32, 144, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': False, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [0, 20, 44, 32, 184, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': False, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 0, 44, 32, 164, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': False, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 0, 32, 188, True]), ({'width': 440, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 44, 32, 304, False]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 0, 'title_width': 220}, [32, 12, 36, 32, 168, True])], 3: [({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 66, 48, 216, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': False, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [0, 30, 66, 48, 276, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': False, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 0, 66, 48, 246, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': False, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 0, 48, 282, True]), ({'width': 660, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 66, 48, 456, False]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 0, 'title_width': 330}, [48, 18, 54, 48, 252, True])], 4: [({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 88, 64, 288, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': False, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [0, 40, 88, 64, 368, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': False, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 0, 88, 64, 328, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': False, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 0, 64, 376, True]), ({'width': 880, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 88, 64, 608, False]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 0, 'title_width': 440}, [64, 24, 72, 64, 336, True])], 5: [({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 110, 80, 360, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': False, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [0, 50, 110, 80, 460, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': False, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 0, 110, 80, 410, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': False, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 0, 80, 470, True]), ({'width': 1100, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 110, 80, 760, False]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 0, 'title_width': 550}, [80, 30, 90, 80, 420, True])]}
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 double padding.

Tab label layout reserves distinct icon, dirty marker, close button and padding footprints before truncating the title; absent decorations consume no width.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['icon']+x['gap'] if x['icon_visible'] else 0
    r1 = x['dirty_width']+x['gap'] if x['dirty'] else 0
    r2 = x['close_width']+x['gap'] if x['close'] else 0
    r3 = 2*x['padding']
    r4 = x['width']-2*x['padding']
    r5 = x['title_width']>max(0,x['width']-2*x['padding']-(x['icon']+x['gap'] if x['icon_visible'] else 0)-(x['dirty_width']+x['gap'] if x['dirty'] else 0)-(x['close_width']+x['gap'] if x['close'] else 0))
    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: [({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 22, 16, 72, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': False, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [0, 10, 22, 16, 92, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': False, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 0, 22, 16, 82, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': False, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 0, 16, 94, True]), ({'width': 220, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 22, 16, 152, False]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 0, 'title_width': 110}, [16, 6, 18, 16, 84, True])], 2: [({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 44, 32, 144, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': False, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [0, 20, 44, 32, 184, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': False, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 0, 44, 32, 164, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': False, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 0, 32, 188, True]), ({'width': 440, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 44, 32, 304, False]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 0, 'title_width': 220}, [32, 12, 36, 32, 168, True])], 3: [({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 66, 48, 216, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': False, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [0, 30, 66, 48, 276, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': False, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 0, 66, 48, 246, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': False, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 0, 48, 282, True]), ({'width': 660, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 66, 48, 456, False]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 0, 'title_width': 330}, [48, 18, 54, 48, 252, True])], 4: [({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 88, 64, 288, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': False, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [0, 40, 88, 64, 368, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': False, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 0, 88, 64, 328, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': False, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 0, 64, 376, True]), ({'width': 880, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 88, 64, 608, False]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 0, 'title_width': 440}, [64, 24, 72, 64, 336, True])], 5: [({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 110, 80, 360, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': False, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [0, 50, 110, 80, 460, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': False, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 0, 110, 80, 410, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': False, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 0, 80, 470, True]), ({'width': 1100, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 110, 80, 760, False]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 0, 'title_width': 550}, [80, 30, 90, 80, 420, True])]}
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['icon']+x['gap'] if x['icon_visible'] else 0
    r1 = x['dirty_width']+x['gap'] if x['dirty'] else 0
    r2 = x['close_width']+x['gap'] if x['close'] else 0
    r3 = 2*x['padding']
    r4 = max(0,x['width']-2*x['padding']-x['icon']-x['close_width'])
    r5 = x['title_width']>max(0,x['width']-2*x['padding']-(x['icon']+x['gap'] if x['icon_visible'] else 0)-(x['dirty_width']+x['gap'] if x['dirty'] else 0)-(x['close_width']+x['gap'] if x['close'] else 0))
    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: [({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 22, 16, 72, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': False, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [0, 10, 22, 16, 92, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': False, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 0, 22, 16, 82, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': False, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 0, 16, 94, True]), ({'width': 220, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 22, 16, 152, False]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 0, 'title_width': 110}, [16, 6, 18, 16, 84, True])], 2: [({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 44, 32, 144, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': False, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [0, 20, 44, 32, 184, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': False, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 0, 44, 32, 164, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': False, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 0, 32, 188, True]), ({'width': 440, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 44, 32, 304, False]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 0, 'title_width': 220}, [32, 12, 36, 32, 168, True])], 3: [({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 66, 48, 216, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': False, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [0, 30, 66, 48, 276, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': False, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 0, 66, 48, 246, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': False, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 0, 48, 282, True]), ({'width': 660, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 66, 48, 456, False]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 0, 'title_width': 330}, [48, 18, 54, 48, 252, True])], 4: [({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 88, 64, 288, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': False, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [0, 40, 88, 64, 368, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': False, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 0, 88, 64, 328, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': False, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 0, 64, 376, True]), ({'width': 880, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 88, 64, 608, False]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 0, 'title_width': 440}, [64, 24, 72, 64, 336, True])], 5: [({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 110, 80, 360, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': False, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [0, 50, 110, 80, 460, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': False, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 0, 110, 80, 410, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': False, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 0, 80, 470, True]), ({'width': 1100, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 110, 80, 760, False]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 0, 'title_width': 550}, [80, 30, 90, 80, 420, True])]}
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 title available width.

Tab label layout reserves distinct icon, dirty marker, close button and padding footprints before truncating the title; absent decorations consume no width.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['icon']+x['gap'] if x['icon_visible'] else 0
    r1 = x['dirty_width']+x['gap'] if x['dirty'] else 0
    r2 = x['close_width']+x['gap'] if x['close'] else 0
    r3 = 2*x['padding']
    r4 = max(0,x['width']-2*x['padding']-(x['icon']+x['gap'] if x['icon_visible'] else 0)-(x['dirty_width']+x['gap'] if x['dirty'] else 0)-(x['close_width']+x['gap'] if x['close'] else 0))
    r5 = x['title_width']>x['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: [({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 22, 16, 72, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': False, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [0, 10, 22, 16, 92, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': False, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 0, 22, 16, 82, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': False, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 0, 16, 94, True]), ({'width': 220, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 22, 16, 152, False]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 0, 'title_width': 110}, [16, 6, 18, 16, 84, True])], 2: [({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 44, 32, 144, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': False, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [0, 20, 44, 32, 184, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': False, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 0, 44, 32, 164, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': False, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 0, 32, 188, True]), ({'width': 440, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 44, 32, 304, False]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 0, 'title_width': 220}, [32, 12, 36, 32, 168, True])], 3: [({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 66, 48, 216, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': False, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [0, 30, 66, 48, 276, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': False, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 0, 66, 48, 246, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': False, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 0, 48, 282, True]), ({'width': 660, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 66, 48, 456, False]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 0, 'title_width': 330}, [48, 18, 54, 48, 252, True])], 4: [({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 88, 64, 288, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': False, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [0, 40, 88, 64, 368, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': False, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 0, 88, 64, 328, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': False, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 0, 64, 376, True]), ({'width': 880, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 88, 64, 608, False]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 0, 'title_width': 440}, [64, 24, 72, 64, 336, True])], 5: [({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 110, 80, 360, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': False, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [0, 50, 110, 80, 460, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': False, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 0, 110, 80, 410, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': False, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 0, 80, 470, True]), ({'width': 1100, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 110, 80, 760, False]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 0, 'title_width': 550}, [80, 30, 90, 80, 420, True])]}
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['icon']+x['gap'] if x['icon_visible'] else 0
    r1 = x['dirty_width']+x['gap'] if x['dirty'] else 0
    r2 = x['close_width']+x['gap'] if x['close'] else 0
    r3 = 2*x['padding']
    r4 = max(0,x['width']-2*x['padding']-(x['icon']+x['gap'] if x['icon_visible'] else 0)-(x['dirty_width']+x['gap'] if x['dirty'] else 0)-(x['close_width']+x['gap'] if x['close'] else 0))
    r5 = True
    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: [({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 22, 16, 72, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': False, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [0, 10, 22, 16, 92, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': False, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 0, 22, 16, 82, True]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': False, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 0, 16, 94, True]), ({'width': 220, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 4, 'title_width': 110}, [20, 10, 22, 16, 152, False]), ({'width': 140, 'padding': 8, 'icon': 16, 'icon_visible': True, 'dirty': True, 'dirty_width': 6, 'close': True, 'close_width': 18, 'gap': 0, 'title_width': 110}, [16, 6, 18, 16, 84, True])], 2: [({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 44, 32, 144, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': False, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [0, 20, 44, 32, 184, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': False, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 0, 44, 32, 164, True]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': False, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 0, 32, 188, True]), ({'width': 440, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 8, 'title_width': 220}, [40, 20, 44, 32, 304, False]), ({'width': 280, 'padding': 16, 'icon': 32, 'icon_visible': True, 'dirty': True, 'dirty_width': 12, 'close': True, 'close_width': 36, 'gap': 0, 'title_width': 220}, [32, 12, 36, 32, 168, True])], 3: [({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 66, 48, 216, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': False, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [0, 30, 66, 48, 276, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': False, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 0, 66, 48, 246, True]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': False, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 0, 48, 282, True]), ({'width': 660, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 12, 'title_width': 330}, [60, 30, 66, 48, 456, False]), ({'width': 420, 'padding': 24, 'icon': 48, 'icon_visible': True, 'dirty': True, 'dirty_width': 18, 'close': True, 'close_width': 54, 'gap': 0, 'title_width': 330}, [48, 18, 54, 48, 252, True])], 4: [({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 88, 64, 288, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': False, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [0, 40, 88, 64, 368, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': False, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 0, 88, 64, 328, True]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': False, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 0, 64, 376, True]), ({'width': 880, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 16, 'title_width': 440}, [80, 40, 88, 64, 608, False]), ({'width': 560, 'padding': 32, 'icon': 64, 'icon_visible': True, 'dirty': True, 'dirty_width': 24, 'close': True, 'close_width': 72, 'gap': 0, 'title_width': 440}, [64, 24, 72, 64, 336, True])], 5: [({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 110, 80, 360, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': False, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [0, 50, 110, 80, 460, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': False, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 0, 110, 80, 410, True]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': False, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 0, 80, 470, True]), ({'width': 1100, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 20, 'title_width': 550}, [100, 50, 110, 80, 760, False]), ({'width': 700, 'padding': 40, 'icon': 80, 'icon_visible': True, 'dirty': True, 'dirty_width': 30, 'close': True, 'close_width': 90, 'gap': 0, 'title_width': 550}, [80, 30, 90, 80, 420, True])]}
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 title truncation decision.

Tab label layout reserves distinct icon, dirty marker, close button and padding footprints before truncating the title; absent decorations consume no width.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['active']
    r1 = x['selection'] if x['context'] in x['selection'] else [x['context']]
    r2 = x['active']
    r3 = x['context'] in x['dirty']
    r4 = 'unpin' if x['context'] in x['pins'] else 'pin'
    r5 = x['tabs'].index(x['context'])
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 2: [({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 3: [({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 4: [({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 5: [({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x):
    r0 = x['selection'][0] if x['selection'] else x['active']
    r1 = x['selection'] if x['context'] in x['selection'] else [x['context']]
    r2 = x['active']
    r3 = x['context'] in x['dirty']
    r4 = 'unpin' if x['context'] in x['pins'] else 'pin'
    r5 = x['tabs'].index(x['context'])
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 2: [({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 3: [({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 4: [({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 5: [({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The tab workspace reports an incorrect context command target.

Context commands act on the right-clicked tab even when another tab is active; bulk commands expand only when that target belongs to the existing multiselection.

split: open-access


prompt:
The tab workspace reports an incorrect bulk selection expansion.

Context commands act on the right-clicked tab even when another tab is active; bulk commands expand only when that target belongs to the existing multiselection.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['context']
    r1 = x['selection'] if x['context'] in x['selection'] else [x['context']]
    r2 = x['context']
    r3 = x['context'] in x['dirty']
    r4 = 'unpin' if x['context'] in x['pins'] else 'pin'
    r5 = x['tabs'].index(x['context'])
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 2: [({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 3: [({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 4: [({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 5: [({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x):
    r0 = x['context']
    r1 = x['selection'] if x['context'] in x['selection'] else [x['context']]
    r2 = x['tabs'][0]
    r3 = x['context'] in x['dirty']
    r4 = 'unpin' if x['context'] in x['pins'] else 'pin'
    r5 = x['tabs'].index(x['context'])
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 2: [({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 3: [({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 4: [({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 5: [({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The tab workspace reports an incorrect context does not activate.

Context commands act on the right-clicked tab even when another tab is active; bulk commands expand only when that target belongs to the existing multiselection.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['context']
    r1 = x['selection'] if x['context'] in x['selection'] else [x['context']]
    r2 = x['active']
    r3 = x['active'] in x['dirty']
    r4 = 'unpin' if x['context'] in x['pins'] else 'pin'
    r5 = x['tabs'].index(x['context'])
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 2: [({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 3: [({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 4: [({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 5: [({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x):
    r0 = x['context']
    r1 = x['selection'] if x['context'] in x['selection'] else [x['context']]
    r2 = x['active']
    r3 = bool(x['dirty'])
    r4 = 'unpin' if x['context'] in x['pins'] else 'pin'
    r5 = x['tabs'].index(x['context'])
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 2: [({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 3: [({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 4: [({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])], 5: [({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'a', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['a', ['a'], 'a', False, 'pin', 0]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'b', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['b', ['b', 'c'], 'a', False, 'unpin', 1]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'c', 'selection': [], 'dirty': ['c'], 'pins': ['b']}, ['c', ['c'], 'a', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'd', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['c'], 'pins': ['b']}, ['c', ['b', 'c'], 'd', True, 'pin', 2]), ({'tabs': ['a', 'b', 'c', 'd', 'background0', 'background1', 'background2', 'background3'], 'active': 'a', 'context': 'c', 'selection': ['b', 'c'], 'dirty': ['b', 'c'], 'pins': ['b']}, ['c', ['b', 'c'], 'a', True, 'pin', 2])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The tab workspace reports an incorrect context dirty affordance.

Context commands act on the right-clicked tab even when another tab is active; bulk commands expand only when that target belongs to the existing multiselection.

split: open-access