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

N = 1
observations = []
def solve(x):
    r0 = x['preview'] is not None and not x['dirty'] and not x['pinned']
    r1 = x['preview']
    r2 = 0 if x['incoming']!=x['preview'] else x['scroll']
    r3 = 'durable' if x['promote'] else 'preview'
    r4 = x['dirty'] or x['pinned']
    r5 = x['slot'] if x['preview'] is not None and not x['dirty'] and not x['pinned'] else x['slot']+1
    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: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'old', 70, 'durable', False, 2])], 2: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'old', 140, 'durable', False, 2])], 3: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'old', 210, 'durable', False, 2])], 4: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'old', 280, 'durable', False, 2])], 5: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'old', 350, 'durable', False, 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['preview'] is not None and not x['dirty'] and not x['pinned']
    r1 = x['preview'] if x['preview'] else x['incoming']
    r2 = 0 if x['incoming']!=x['preview'] else x['scroll']
    r3 = 'durable' if x['promote'] else 'preview'
    r4 = x['dirty'] or x['pinned']
    r5 = x['slot'] if x['preview'] is not None and not x['dirty'] and not x['pinned'] else x['slot']+1
    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: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'old', 70, 'durable', False, 2])], 2: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'old', 140, 'durable', False, 2])], 3: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'old', 210, 'durable', False, 2])], 4: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'old', 280, 'durable', False, 2])], 5: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'old', 350, 'durable', False, 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 replacement document.

A preview can replace only a clean unpinned preview. Reusing the view retains its slot but replaces document state; promotion makes it durable.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['preview'] is not None and not x['dirty'] and not x['pinned']
    r1 = x['incoming']
    r2 = x['scroll']
    r3 = 'durable' if x['promote'] else 'preview'
    r4 = x['dirty'] or x['pinned']
    r5 = x['slot'] if x['preview'] is not None and not x['dirty'] and not x['pinned'] else x['slot']+1
    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: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'old', 70, 'durable', False, 2])], 2: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'old', 140, 'durable', False, 2])], 3: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'old', 210, 'durable', False, 2])], 4: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'old', 280, 'durable', False, 2])], 5: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'old', 350, 'durable', False, 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)

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['preview'] is not None and not x['dirty'] and not x['pinned']
    r1 = x['incoming']
    r2 = 0
    r3 = 'durable' if x['promote'] else 'preview'
    r4 = x['dirty'] or x['pinned']
    r5 = x['slot'] if x['preview'] is not None and not x['dirty'] and not x['pinned'] else x['slot']+1
    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: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'old', 70, 'durable', False, 2])], 2: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'old', 140, 'durable', False, 2])], 3: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'old', 210, 'durable', False, 2])], 4: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'old', 280, 'durable', False, 2])], 5: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'old', 350, 'durable', False, 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 scroll reset.

A preview can replace only a clean unpinned preview. Reusing the view retains its slot but replaces document state; promotion makes it durable.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['preview'] is not None and not x['dirty'] and not x['pinned']
    r1 = x['incoming']
    r2 = 0 if x['incoming']!=x['preview'] else x['scroll']
    r3 = 'preview'
    r4 = x['dirty'] or x['pinned']
    r5 = x['slot'] if x['preview'] is not None and not x['dirty'] and not x['pinned'] else x['slot']+1
    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: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'old', 70, 'durable', False, 2])], 2: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'old', 140, 'durable', False, 2])], 3: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'old', 210, 'durable', False, 2])], 4: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'old', 280, 'durable', False, 2])], 5: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'old', 350, 'durable', False, 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['preview'] is not None and not x['dirty'] and not x['pinned']
    r1 = x['incoming']
    r2 = 0 if x['incoming']!=x['preview'] else x['scroll']
    r3 = 'durable'
    r4 = x['dirty'] or x['pinned']
    r5 = x['slot'] if x['preview'] is not None and not x['dirty'] and not x['pinned'] else x['slot']+1
    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: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'old', 70, 'durable', False, 2])], 2: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'old', 140, 'durable', False, 2])], 3: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'old', 210, 'durable', False, 2])], 4: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'old', 280, 'durable', False, 2])], 5: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'old', 350, 'durable', False, 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 promotion lifetime.

A preview can replace only a clean unpinned preview. Reusing the view retains its slot but replaces document state; promotion makes it durable.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['preview'] is not None and not x['dirty'] and not x['pinned']
    r1 = x['incoming']
    r2 = 0 if x['incoming']!=x['preview'] else x['scroll']
    r3 = 'durable' if x['promote'] else 'preview'
    r4 = False
    r5 = x['slot'] if x['preview'] is not None and not x['dirty'] and not x['pinned'] else x['slot']+1
    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: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'old', 70, 'durable', False, 2])], 2: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'old', 140, 'durable', False, 2])], 3: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'old', 210, 'durable', False, 2])], 4: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'old', 280, 'durable', False, 2])], 5: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'old', 350, 'durable', False, 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['preview'] is not None and not x['dirty'] and not x['pinned']
    r1 = x['incoming']
    r2 = 0 if x['incoming']!=x['preview'] else x['scroll']
    r3 = 'durable' if x['promote'] else 'preview'
    r4 = x['dirty']
    r5 = x['slot'] if x['preview'] is not None and not x['dirty'] and not x['pinned'] else x['slot']+1
    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: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'old', 70, 'durable', False, 2])], 2: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'old', 140, 'durable', False, 2])], 3: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'old', 210, 'durable', False, 2])], 4: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'old', 280, 'durable', False, 2])], 5: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'old', 350, 'durable', False, 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 old dirty retention.

A preview can replace only a clean unpinned preview. Reusing the view retains its slot but replaces document state; promotion makes it durable.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['preview'] is not None and not x['dirty'] and not x['pinned']
    r1 = x['incoming']
    r2 = 0 if x['incoming']!=x['preview'] else x['scroll']
    r3 = 'durable' if x['promote'] else 'preview'
    r4 = x['dirty'] or x['pinned']
    r5 = x['slot']
    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: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'old', 70, 'durable', False, 2])], 2: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'old', 140, 'durable', False, 2])], 3: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'old', 210, 'durable', False, 2])], 4: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'old', 280, 'durable', False, 2])], 5: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'old', 350, 'durable', False, 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['preview'] is not None and not x['dirty'] and not x['pinned']
    r1 = x['incoming']
    r2 = 0 if x['incoming']!=x['preview'] else x['scroll']
    r3 = 'durable' if x['promote'] else 'preview'
    r4 = x['dirty'] or x['pinned']
    r5 = x['slot']+1
    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: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 70, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 70, 'promote': True}, [True, 'old', 70, 'durable', False, 2])], 2: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 140, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 140, 'promote': True}, [True, 'old', 140, 'durable', False, 2])], 3: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 210, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 210, 'promote': True}, [True, 'old', 210, 'durable', False, 2])], 4: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 280, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 280, 'promote': True}, [True, 'old', 280, 'durable', False, 2])], 5: [({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'new', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': True, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': True, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', True, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': False}, [True, 'new', 0, 'preview', False, 2]), ({'preview': None, 'dirty': False, 'pinned': False, 'incoming': 'new', 'slot': 2, 'scroll': 350, 'promote': True}, [False, 'new', 0, 'durable', False, 3]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 0, 'promote': True}, [True, 'old', 0, 'durable', False, 2]), ({'preview': 'old', 'dirty': False, 'pinned': False, 'incoming': 'old', 'slot': 2, 'scroll': 350, 'promote': True}, [True, 'old', 350, 'durable', False, 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 reuse slot.

A preview can replace only a clean unpinned preview. Reusing the view retains its slot but replaces document state; promotion makes it durable.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['view']
    r1 = x['doc']
    r2 = x['caret']
    r3 = x['scroll']
    r4 = x['buffer_revision']
    r5 = x['view_refs']+1
    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: [({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 40, 'width': 300, 'gutter': 10, 'ratio': 40, 'buffer_revision': 9, 'disk_revision': 7, 'view_refs': 2}, ['w', 'd', [3, 8], 40, 9, 3]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 40, 'width': 300, 'gutter': 10, 'ratio': 60, 'buffer_revision': 9, 'disk_revision': 7, 'view_refs': 2}, ['w', 'd', [3, 8], 40, 9, 3]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 40, 'width': 300, 'gutter': 20, 'ratio': 40, 'buffer_revision': 9, 'disk_revision': 7, 'view_refs': 2}, ['w', 'd', [3, 8], 40, 9, 3]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 0, 'width': 300, 'gutter': 10, 'ratio': 40, 'buffer_revision': 9, 'disk_revision': 7, 'view_refs': 2}, ['w', 'd', [3, 8], 0, 9, 3]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [0, 0], 'scroll': 40, 'width': 300, 'gutter': 10, 'ratio': 40, 'buffer_revision': 9, 'disk_revision': 7, 'view_refs': 2}, ['w', 'd', [0, 0], 40, 9, 3]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 40, 'width': 501, 'gutter': 10, 'ratio': 40, 'buffer_revision': 9, 'disk_revision': 7, 'view_refs': 2}, ['w', 'd', [3, 8], 40, 9, 3]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 40, 'width': 300, 'gutter': 10, 'ratio': 40, 'buffer_revision': 7, 'disk_revision': 7, 'view_refs': 2}, ['w', 'd', [3, 8], 40, 7, 3]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 40, 'width': 300, 'gutter': 10, 'ratio': 40, 'buffer_revision': 9, 'disk_revision': 7, 'view_refs': 1}, ['w', 'd', [3, 8], 40, 9, 2])], 2: [({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 80, 'width': 600, 'gutter': 20, 'ratio': 40, 'buffer_revision': 18, 'disk_revision': 14, 'view_refs': 4}, ['w', 'd', [3, 8], 80, 18, 5]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 80, 'width': 600, 'gutter': 20, 'ratio': 60, 'buffer_revision': 18, 'disk_revision': 14, 'view_refs': 4}, ['w', 'd', [3, 8], 80, 18, 5]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 80, 'width': 600, 'gutter': 40, 'ratio': 40, 'buffer_revision': 18, 'disk_revision': 14, 'view_refs': 4}, ['w', 'd', [3, 8], 80, 18, 5]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 0, 'width': 600, 'gutter': 20, 'ratio': 40, 'buffer_revision': 18, 'disk_revision': 14, 'view_refs': 4}, ['w', 'd', [3, 8], 0, 18, 5]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [0, 0], 'scroll': 80, 'width': 600, 'gutter': 20, 'ratio': 40, 'buffer_revision': 18, 'disk_revision': 14, 'view_refs': 4}, ['w', 'd', [0, 0], 80, 18, 5]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 80, 'width': 1002, 'gutter': 20, 'ratio': 40, 'buffer_revision': 18, 'disk_revision': 14, 'view_refs': 4}, ['w', 'd', [3, 8], 80, 18, 5]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 80, 'width': 600, 'gutter': 20, 'ratio': 40, 'buffer_revision': 14, 'disk_revision': 14, 'view_refs': 4}, ['w', 'd', [3, 8], 80, 14, 5]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 80, 'width': 600, 'gutter': 20, 'ratio': 40, 'buffer_revision': 18, 'disk_revision': 14, 'view_refs': 2}, ['w', 'd', [3, 8], 80, 18, 3])], 3: [({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 120, 'width': 900, 'gutter': 30, 'ratio': 40, 'buffer_revision': 27, 'disk_revision': 21, 'view_refs': 6}, ['w', 'd', [3, 8], 120, 27, 7]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 120, 'width': 900, 'gutter': 30, 'ratio': 60, 'buffer_revision': 27, 'disk_revision': 21, 'view_refs': 6}, ['w', 'd', [3, 8], 120, 27, 7]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 120, 'width': 900, 'gutter': 60, 'ratio': 40, 'buffer_revision': 27, 'disk_revision': 21, 'view_refs': 6}, ['w', 'd', [3, 8], 120, 27, 7]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 0, 'width': 900, 'gutter': 30, 'ratio': 40, 'buffer_revision': 27, 'disk_revision': 21, 'view_refs': 6}, ['w', 'd', [3, 8], 0, 27, 7]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [0, 0], 'scroll': 120, 'width': 900, 'gutter': 30, 'ratio': 40, 'buffer_revision': 27, 'disk_revision': 21, 'view_refs': 6}, ['w', 'd', [0, 0], 120, 27, 7]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 120, 'width': 1503, 'gutter': 30, 'ratio': 40, 'buffer_revision': 27, 'disk_revision': 21, 'view_refs': 6}, ['w', 'd', [3, 8], 120, 27, 7]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 120, 'width': 900, 'gutter': 30, 'ratio': 40, 'buffer_revision': 21, 'disk_revision': 21, 'view_refs': 6}, ['w', 'd', [3, 8], 120, 21, 7]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 120, 'width': 900, 'gutter': 30, 'ratio': 40, 'buffer_revision': 27, 'disk_revision': 21, 'view_refs': 3}, ['w', 'd', [3, 8], 120, 27, 4])], 4: [({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 160, 'width': 1200, 'gutter': 40, 'ratio': 40, 'buffer_revision': 36, 'disk_revision': 28, 'view_refs': 8}, ['w', 'd', [3, 8], 160, 36, 9]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 160, 'width': 1200, 'gutter': 40, 'ratio': 60, 'buffer_revision': 36, 'disk_revision': 28, 'view_refs': 8}, ['w', 'd', [3, 8], 160, 36, 9]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 160, 'width': 1200, 'gutter': 80, 'ratio': 40, 'buffer_revision': 36, 'disk_revision': 28, 'view_refs': 8}, ['w', 'd', [3, 8], 160, 36, 9]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 0, 'width': 1200, 'gutter': 40, 'ratio': 40, 'buffer_revision': 36, 'disk_revision': 28, 'view_refs': 8}, ['w', 'd', [3, 8], 0, 36, 9]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [0, 0], 'scroll': 160, 'width': 1200, 'gutter': 40, 'ratio': 40, 'buffer_revision': 36, 'disk_revision': 28, 'view_refs': 8}, ['w', 'd', [0, 0], 160, 36, 9]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 160, 'width': 2004, 'gutter': 40, 'ratio': 40, 'buffer_revision': 36, 'disk_revision': 28, 'view_refs': 8}, ['w', 'd', [3, 8], 160, 36, 9]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 160, 'width': 1200, 'gutter': 40, 'ratio': 40, 'buffer_revision': 28, 'disk_revision': 28, 'view_refs': 8}, ['w', 'd', [3, 8], 160, 28, 9]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 160, 'width': 1200, 'gutter': 40, 'ratio': 40, 'buffer_revision': 36, 'disk_revision': 28, 'view_refs': 4}, ['w', 'd', [3, 8], 160, 36, 5])], 5: [({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 200, 'width': 1500, 'gutter': 50, 'ratio': 40, 'buffer_revision': 45, 'disk_revision': 35, 'view_refs': 10}, ['w', 'd', [3, 8], 200, 45, 11]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 200, 'width': 1500, 'gutter': 50, 'ratio': 60, 'buffer_revision': 45, 'disk_revision': 35, 'view_refs': 10}, ['w', 'd', [3, 8], 200, 45, 11]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 200, 'width': 1500, 'gutter': 100, 'ratio': 40, 'buffer_revision': 45, 'disk_revision': 35, 'view_refs': 10}, ['w', 'd', [3, 8], 200, 45, 11]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 0, 'width': 1500, 'gutter': 50, 'ratio': 40, 'buffer_revision': 45, 'disk_revision': 35, 'view_refs': 10}, ['w', 'd', [3, 8], 0, 45, 11]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [0, 0], 'scroll': 200, 'width': 1500, 'gutter': 50, 'ratio': 40, 'buffer_revision': 45, 'disk_revision': 35, 'view_refs': 10}, ['w', 'd', [0, 0], 200, 45, 11]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 200, 'width': 2505, 'gutter': 50, 'ratio': 40, 'buffer_revision': 45, 'disk_revision': 35, 'view_refs': 10}, ['w', 'd', [3, 8], 200, 45, 11]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 200, 'width': 1500, 'gutter': 50, 'ratio': 40, 'buffer_revision': 35, 'disk_revision': 35, 'view_refs': 10}, ['w', 'd', [3, 8], 200, 35, 11]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 200, 'width': 1500, 'gutter': 50, 'ratio': 40, 'buffer_revision': 45, 'disk_revision': 35, 'view_refs': 5}, ['w', 'd', [3, 8], 200, 45, 6])]}
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['doc']
    r1 = x['doc']
    r2 = x['caret']
    r3 = x['scroll']
    r4 = x['buffer_revision']
    r5 = x['view_refs']+1
    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: [({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 40, 'width': 300, 'gutter': 10, 'ratio': 40, 'buffer_revision': 9, 'disk_revision': 7, 'view_refs': 2}, ['w', 'd', [3, 8], 40, 9, 3]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 40, 'width': 300, 'gutter': 10, 'ratio': 60, 'buffer_revision': 9, 'disk_revision': 7, 'view_refs': 2}, ['w', 'd', [3, 8], 40, 9, 3]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 40, 'width': 300, 'gutter': 20, 'ratio': 40, 'buffer_revision': 9, 'disk_revision': 7, 'view_refs': 2}, ['w', 'd', [3, 8], 40, 9, 3]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 0, 'width': 300, 'gutter': 10, 'ratio': 40, 'buffer_revision': 9, 'disk_revision': 7, 'view_refs': 2}, ['w', 'd', [3, 8], 0, 9, 3]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [0, 0], 'scroll': 40, 'width': 300, 'gutter': 10, 'ratio': 40, 'buffer_revision': 9, 'disk_revision': 7, 'view_refs': 2}, ['w', 'd', [0, 0], 40, 9, 3]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 40, 'width': 501, 'gutter': 10, 'ratio': 40, 'buffer_revision': 9, 'disk_revision': 7, 'view_refs': 2}, ['w', 'd', [3, 8], 40, 9, 3]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 40, 'width': 300, 'gutter': 10, 'ratio': 40, 'buffer_revision': 7, 'disk_revision': 7, 'view_refs': 2}, ['w', 'd', [3, 8], 40, 7, 3]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 40, 'width': 300, 'gutter': 10, 'ratio': 40, 'buffer_revision': 9, 'disk_revision': 7, 'view_refs': 1}, ['w', 'd', [3, 8], 40, 9, 2])], 2: [({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 80, 'width': 600, 'gutter': 20, 'ratio': 40, 'buffer_revision': 18, 'disk_revision': 14, 'view_refs': 4}, ['w', 'd', [3, 8], 80, 18, 5]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 80, 'width': 600, 'gutter': 20, 'ratio': 60, 'buffer_revision': 18, 'disk_revision': 14, 'view_refs': 4}, ['w', 'd', [3, 8], 80, 18, 5]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 80, 'width': 600, 'gutter': 40, 'ratio': 40, 'buffer_revision': 18, 'disk_revision': 14, 'view_refs': 4}, ['w', 'd', [3, 8], 80, 18, 5]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 0, 'width': 600, 'gutter': 20, 'ratio': 40, 'buffer_revision': 18, 'disk_revision': 14, 'view_refs': 4}, ['w', 'd', [3, 8], 0, 18, 5]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [0, 0], 'scroll': 80, 'width': 600, 'gutter': 20, 'ratio': 40, 'buffer_revision': 18, 'disk_revision': 14, 'view_refs': 4}, ['w', 'd', [0, 0], 80, 18, 5]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 80, 'width': 1002, 'gutter': 20, 'ratio': 40, 'buffer_revision': 18, 'disk_revision': 14, 'view_refs': 4}, ['w', 'd', [3, 8], 80, 18, 5]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 80, 'width': 600, 'gutter': 20, 'ratio': 40, 'buffer_revision': 14, 'disk_revision': 14, 'view_refs': 4}, ['w', 'd', [3, 8], 80, 14, 5]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 80, 'width': 600, 'gutter': 20, 'ratio': 40, 'buffer_revision': 18, 'disk_revision': 14, 'view_refs': 2}, ['w', 'd', [3, 8], 80, 18, 3])], 3: [({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 120, 'width': 900, 'gutter': 30, 'ratio': 40, 'buffer_revision': 27, 'disk_revision': 21, 'view_refs': 6}, ['w', 'd', [3, 8], 120, 27, 7]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 120, 'width': 900, 'gutter': 30, 'ratio': 60, 'buffer_revision': 27, 'disk_revision': 21, 'view_refs': 6}, ['w', 'd', [3, 8], 120, 27, 7]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 120, 'width': 900, 'gutter': 60, 'ratio': 40, 'buffer_revision': 27, 'disk_revision': 21, 'view_refs': 6}, ['w', 'd', [3, 8], 120, 27, 7]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 0, 'width': 900, 'gutter': 30, 'ratio': 40, 'buffer_revision': 27, 'disk_revision': 21, 'view_refs': 6}, ['w', 'd', [3, 8], 0, 27, 7]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [0, 0], 'scroll': 120, 'width': 900, 'gutter': 30, 'ratio': 40, 'buffer_revision': 27, 'disk_revision': 21, 'view_refs': 6}, ['w', 'd', [0, 0], 120, 27, 7]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 120, 'width': 1503, 'gutter': 30, 'ratio': 40, 'buffer_revision': 27, 'disk_revision': 21, 'view_refs': 6}, ['w', 'd', [3, 8], 120, 27, 7]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 120, 'width': 900, 'gutter': 30, 'ratio': 40, 'buffer_revision': 21, 'disk_revision': 21, 'view_refs': 6}, ['w', 'd', [3, 8], 120, 21, 7]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 120, 'width': 900, 'gutter': 30, 'ratio': 40, 'buffer_revision': 27, 'disk_revision': 21, 'view_refs': 3}, ['w', 'd', [3, 8], 120, 27, 4])], 4: [({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 160, 'width': 1200, 'gutter': 40, 'ratio': 40, 'buffer_revision': 36, 'disk_revision': 28, 'view_refs': 8}, ['w', 'd', [3, 8], 160, 36, 9]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 160, 'width': 1200, 'gutter': 40, 'ratio': 60, 'buffer_revision': 36, 'disk_revision': 28, 'view_refs': 8}, ['w', 'd', [3, 8], 160, 36, 9]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 160, 'width': 1200, 'gutter': 80, 'ratio': 40, 'buffer_revision': 36, 'disk_revision': 28, 'view_refs': 8}, ['w', 'd', [3, 8], 160, 36, 9]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 0, 'width': 1200, 'gutter': 40, 'ratio': 40, 'buffer_revision': 36, 'disk_revision': 28, 'view_refs': 8}, ['w', 'd', [3, 8], 0, 36, 9]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [0, 0], 'scroll': 160, 'width': 1200, 'gutter': 40, 'ratio': 40, 'buffer_revision': 36, 'disk_revision': 28, 'view_refs': 8}, ['w', 'd', [0, 0], 160, 36, 9]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 160, 'width': 2004, 'gutter': 40, 'ratio': 40, 'buffer_revision': 36, 'disk_revision': 28, 'view_refs': 8}, ['w', 'd', [3, 8], 160, 36, 9]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 160, 'width': 1200, 'gutter': 40, 'ratio': 40, 'buffer_revision': 28, 'disk_revision': 28, 'view_refs': 8}, ['w', 'd', [3, 8], 160, 28, 9]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 160, 'width': 1200, 'gutter': 40, 'ratio': 40, 'buffer_revision': 36, 'disk_revision': 28, 'view_refs': 4}, ['w', 'd', [3, 8], 160, 36, 5])], 5: [({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 200, 'width': 1500, 'gutter': 50, 'ratio': 40, 'buffer_revision': 45, 'disk_revision': 35, 'view_refs': 10}, ['w', 'd', [3, 8], 200, 45, 11]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 200, 'width': 1500, 'gutter': 50, 'ratio': 60, 'buffer_revision': 45, 'disk_revision': 35, 'view_refs': 10}, ['w', 'd', [3, 8], 200, 45, 11]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 200, 'width': 1500, 'gutter': 100, 'ratio': 40, 'buffer_revision': 45, 'disk_revision': 35, 'view_refs': 10}, ['w', 'd', [3, 8], 200, 45, 11]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 0, 'width': 1500, 'gutter': 50, 'ratio': 40, 'buffer_revision': 45, 'disk_revision': 35, 'view_refs': 10}, ['w', 'd', [3, 8], 0, 45, 11]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [0, 0], 'scroll': 200, 'width': 1500, 'gutter': 50, 'ratio': 40, 'buffer_revision': 45, 'disk_revision': 35, 'view_refs': 10}, ['w', 'd', [0, 0], 200, 45, 11]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 200, 'width': 2505, 'gutter': 50, 'ratio': 40, 'buffer_revision': 45, 'disk_revision': 35, 'view_refs': 10}, ['w', 'd', [3, 8], 200, 45, 11]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 200, 'width': 1500, 'gutter': 50, 'ratio': 40, 'buffer_revision': 35, 'disk_revision': 35, 'view_refs': 10}, ['w', 'd', [3, 8], 200, 35, 11]), ({'view': 'v', 'doc': 'd', 'new_view': 'w', 'caret': [3, 8], 'scroll': 200, 'width': 1500, 'gutter': 50, 'ratio': 40, 'buffer_revision': 45, 'disk_revision': 35, 'view_refs': 5}, ['w', 'd', [3, 8], 200, 45, 6])]}
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 clone view identity.

Cloning a document into an adjacent pane creates a new view identity, shares the current unsaved document revision, copies caret and scroll, and acquires exactly one document view reference.

split: open-access