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

N = 1
observations = []
def solve(x):
    r0 = x['event_view']==x['source']
    r1 = True
    r2 = x['token']!=x['last']
    r3 = x['scroll']*x['peer_range']//x['source_range']
    r4 = min(x['peer_range'],max(0,x['scroll']*x['peer_range']//x['source_range']))
    r5 = x['token']
    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: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [False, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, False, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 3, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, False, 100, 100, 3]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 0, 'source_range': 100, 'peer_range': 250}, [True, True, True, 0, 0, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 100, 'source_range': 100, 'peer_range': 250}, [True, True, True, 250, 250, 4])], 2: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [False, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, False, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 6, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, False, 200, 200, 6]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 0, 'source_range': 200, 'peer_range': 500}, [True, True, True, 0, 0, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 200, 'source_range': 200, 'peer_range': 500}, [True, True, True, 500, 500, 8])], 3: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [False, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, False, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 9, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, False, 300, 300, 9]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 0, 'source_range': 300, 'peer_range': 750}, [True, True, True, 0, 0, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 300, 'source_range': 300, 'peer_range': 750}, [True, True, True, 750, 750, 12])], 4: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [False, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, False, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, False, 400, 400, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 0, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 0, 0, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 400, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 1000, 1000, 16])], 5: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [False, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, False, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 15, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, False, 500, 500, 15]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 0, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 0, 0, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 500, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 1250, 1250, 20])]}
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['event_view']==x['source']
    r1 = x['doc'] is None
    r2 = x['token']!=x['last']
    r3 = x['scroll']*x['peer_range']//x['source_range']
    r4 = min(x['peer_range'],max(0,x['scroll']*x['peer_range']//x['source_range']))
    r5 = x['token']
    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: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [False, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, False, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 3, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, False, 100, 100, 3]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 0, 'source_range': 100, 'peer_range': 250}, [True, True, True, 0, 0, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 100, 'source_range': 100, 'peer_range': 250}, [True, True, True, 250, 250, 4])], 2: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [False, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, False, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 6, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, False, 200, 200, 6]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 0, 'source_range': 200, 'peer_range': 500}, [True, True, True, 0, 0, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 200, 'source_range': 200, 'peer_range': 500}, [True, True, True, 500, 500, 8])], 3: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [False, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, False, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 9, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, False, 300, 300, 9]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 0, 'source_range': 300, 'peer_range': 750}, [True, True, True, 0, 0, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 300, 'source_range': 300, 'peer_range': 750}, [True, True, True, 750, 750, 12])], 4: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [False, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, False, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, False, 400, 400, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 0, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 0, 0, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 400, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 1000, 1000, 16])], 5: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [False, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, False, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 15, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, False, 500, 500, 15]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 0, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 0, 0, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 500, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 1250, 1250, 20])]}
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 document link scope.

Linked views of one document synchronize only scroll events from the elected source; map proportional content positions into the peer range and suppress echoed tokens.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['event_view']==x['source']
    r1 = x['doc']==x['peer_doc']
    r2 = True
    r3 = x['scroll']*x['peer_range']//x['source_range']
    r4 = min(x['peer_range'],max(0,x['scroll']*x['peer_range']//x['source_range']))
    r5 = x['token']
    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: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [False, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, False, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 3, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, False, 100, 100, 3]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 0, 'source_range': 100, 'peer_range': 250}, [True, True, True, 0, 0, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 100, 'source_range': 100, 'peer_range': 250}, [True, True, True, 250, 250, 4])], 2: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [False, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, False, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 6, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, False, 200, 200, 6]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 0, 'source_range': 200, 'peer_range': 500}, [True, True, True, 0, 0, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 200, 'source_range': 200, 'peer_range': 500}, [True, True, True, 500, 500, 8])], 3: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [False, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, False, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 9, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, False, 300, 300, 9]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 0, 'source_range': 300, 'peer_range': 750}, [True, True, True, 0, 0, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 300, 'source_range': 300, 'peer_range': 750}, [True, True, True, 750, 750, 12])], 4: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [False, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, False, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, False, 400, 400, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 0, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 0, 0, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 400, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 1000, 1000, 16])], 5: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [False, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, False, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 15, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, False, 500, 500, 15]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 0, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 0, 0, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 500, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 1250, 1250, 20])]}
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['event_view']==x['source']
    r1 = x['doc']==x['peer_doc']
    r2 = x['token']<x['last']
    r3 = x['scroll']*x['peer_range']//x['source_range']
    r4 = min(x['peer_range'],max(0,x['scroll']*x['peer_range']//x['source_range']))
    r5 = x['token']
    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: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [False, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, False, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 3, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, False, 100, 100, 3]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 0, 'source_range': 100, 'peer_range': 250}, [True, True, True, 0, 0, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 100, 'source_range': 100, 'peer_range': 250}, [True, True, True, 250, 250, 4])], 2: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [False, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, False, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 6, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, False, 200, 200, 6]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 0, 'source_range': 200, 'peer_range': 500}, [True, True, True, 0, 0, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 200, 'source_range': 200, 'peer_range': 500}, [True, True, True, 500, 500, 8])], 3: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [False, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, False, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 9, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, False, 300, 300, 9]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 0, 'source_range': 300, 'peer_range': 750}, [True, True, True, 0, 0, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 300, 'source_range': 300, 'peer_range': 750}, [True, True, True, 750, 750, 12])], 4: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [False, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, False, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, False, 400, 400, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 0, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 0, 0, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 400, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 1000, 1000, 16])], 5: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [False, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, False, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 15, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, False, 500, 500, 15]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 0, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 0, 0, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 500, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 1250, 1250, 20])]}
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 echo suppression.

Linked views of one document synchronize only scroll events from the elected source; map proportional content positions into the peer range and suppress echoed tokens.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['event_view']==x['source']
    r1 = x['doc']==x['peer_doc']
    r2 = x['token']!=x['last']
    r3 = x['scroll']
    r4 = min(x['peer_range'],max(0,x['scroll']*x['peer_range']//x['source_range']))
    r5 = x['token']
    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: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [False, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, False, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 3, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, False, 100, 100, 3]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 0, 'source_range': 100, 'peer_range': 250}, [True, True, True, 0, 0, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 100, 'source_range': 100, 'peer_range': 250}, [True, True, True, 250, 250, 4])], 2: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [False, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, False, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 6, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, False, 200, 200, 6]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 0, 'source_range': 200, 'peer_range': 500}, [True, True, True, 0, 0, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 200, 'source_range': 200, 'peer_range': 500}, [True, True, True, 500, 500, 8])], 3: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [False, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, False, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 9, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, False, 300, 300, 9]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 0, 'source_range': 300, 'peer_range': 750}, [True, True, True, 0, 0, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 300, 'source_range': 300, 'peer_range': 750}, [True, True, True, 750, 750, 12])], 4: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [False, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, False, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, False, 400, 400, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 0, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 0, 0, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 400, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 1000, 1000, 16])], 5: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [False, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, False, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 15, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, False, 500, 500, 15]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 0, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 0, 0, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 500, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 1250, 1250, 20])]}
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['event_view']==x['source']
    r1 = x['doc']==x['peer_doc']
    r2 = x['token']!=x['last']
    r3 = x['scroll']*x['source_range']//x['peer_range']
    r4 = min(x['peer_range'],max(0,x['scroll']*x['peer_range']//x['source_range']))
    r5 = x['token']
    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: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [False, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, False, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 3, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, False, 100, 100, 3]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 0, 'source_range': 100, 'peer_range': 250}, [True, True, True, 0, 0, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 100, 'source_range': 100, 'peer_range': 250}, [True, True, True, 250, 250, 4])], 2: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [False, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, False, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 6, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, False, 200, 200, 6]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 0, 'source_range': 200, 'peer_range': 500}, [True, True, True, 0, 0, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 200, 'source_range': 200, 'peer_range': 500}, [True, True, True, 500, 500, 8])], 3: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [False, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, False, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 9, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, False, 300, 300, 9]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 0, 'source_range': 300, 'peer_range': 750}, [True, True, True, 0, 0, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 300, 'source_range': 300, 'peer_range': 750}, [True, True, True, 750, 750, 12])], 4: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [False, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, False, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, False, 400, 400, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 0, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 0, 0, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 400, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 1000, 1000, 16])], 5: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [False, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, False, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 15, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, False, 500, 500, 15]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 0, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 0, 0, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 500, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 1250, 1250, 20])]}
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 proportional scroll.

Linked views of one document synchronize only scroll events from the elected source; map proportional content positions into the peer range and suppress echoed tokens.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['event_view']==x['source']
    r1 = x['doc']==x['peer_doc']
    r2 = x['token']!=x['last']
    r3 = x['scroll']*x['peer_range']//x['source_range']
    r4 = min(x['source_range'],x['scroll']*x['peer_range']//x['source_range'])
    r5 = x['token']
    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: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [False, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, False, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 3, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, False, 100, 100, 3]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 0, 'source_range': 100, 'peer_range': 250}, [True, True, True, 0, 0, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 100, 'source_range': 100, 'peer_range': 250}, [True, True, True, 250, 250, 4])], 2: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [False, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, False, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 6, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, False, 200, 200, 6]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 0, 'source_range': 200, 'peer_range': 500}, [True, True, True, 0, 0, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 200, 'source_range': 200, 'peer_range': 500}, [True, True, True, 500, 500, 8])], 3: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [False, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, False, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 9, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, False, 300, 300, 9]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 0, 'source_range': 300, 'peer_range': 750}, [True, True, True, 0, 0, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 300, 'source_range': 300, 'peer_range': 750}, [True, True, True, 750, 750, 12])], 4: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [False, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, False, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, False, 400, 400, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 0, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 0, 0, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 400, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 1000, 1000, 16])], 5: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [False, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, False, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 15, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, False, 500, 500, 15]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 0, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 0, 0, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 500, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 1250, 1250, 20])]}
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['event_view']==x['source']
    r1 = x['doc']==x['peer_doc']
    r2 = x['token']!=x['last']
    r3 = x['scroll']*x['peer_range']//x['source_range']
    r4 = max(0,x['scroll'])
    r5 = x['token']
    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: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [False, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, False, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 3, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, False, 100, 100, 3]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 0, 'source_range': 100, 'peer_range': 250}, [True, True, True, 0, 0, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 100, 'source_range': 100, 'peer_range': 250}, [True, True, True, 250, 250, 4])], 2: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [False, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, False, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 6, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, False, 200, 200, 6]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 0, 'source_range': 200, 'peer_range': 500}, [True, True, True, 0, 0, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 200, 'source_range': 200, 'peer_range': 500}, [True, True, True, 500, 500, 8])], 3: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [False, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, False, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 9, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, False, 300, 300, 9]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 0, 'source_range': 300, 'peer_range': 750}, [True, True, True, 0, 0, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 300, 'source_range': 300, 'peer_range': 750}, [True, True, True, 750, 750, 12])], 4: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [False, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, False, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, False, 400, 400, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 0, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 0, 0, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 400, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 1000, 1000, 16])], 5: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [False, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, False, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 15, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, False, 500, 500, 15]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 0, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 0, 0, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 500, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 1250, 1250, 20])]}
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 peer end clamp.

Linked views of one document synchronize only scroll events from the elected source; map proportional content positions into the peer range and suppress echoed tokens.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['event_view']==x['source']
    r1 = x['doc']==x['peer_doc']
    r2 = x['token']!=x['last']
    r3 = x['scroll']*x['peer_range']//x['source_range']
    r4 = min(x['peer_range'],max(0,x['scroll']*x['peer_range']//x['source_range']))
    r5 = x['last']
    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: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [False, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, False, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 3, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, False, 100, 100, 3]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 0, 'source_range': 100, 'peer_range': 250}, [True, True, True, 0, 0, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 100, 'source_range': 100, 'peer_range': 250}, [True, True, True, 250, 250, 4])], 2: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [False, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, False, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 6, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, False, 200, 200, 6]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 0, 'source_range': 200, 'peer_range': 500}, [True, True, True, 0, 0, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 200, 'source_range': 200, 'peer_range': 500}, [True, True, True, 500, 500, 8])], 3: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [False, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, False, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 9, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, False, 300, 300, 9]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 0, 'source_range': 300, 'peer_range': 750}, [True, True, True, 0, 0, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 300, 'source_range': 300, 'peer_range': 750}, [True, True, True, 750, 750, 12])], 4: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [False, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, False, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, False, 400, 400, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 0, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 0, 0, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 400, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 1000, 1000, 16])], 5: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [False, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, False, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 15, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, False, 500, 500, 15]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 0, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 0, 0, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 500, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 1250, 1250, 20])]}
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['event_view']==x['source']
    r1 = x['doc']==x['peer_doc']
    r2 = x['token']!=x['last']
    r3 = x['scroll']*x['peer_range']//x['source_range']
    r4 = min(x['peer_range'],max(0,x['scroll']*x['peer_range']//x['source_range']))
    r5 = x['token']+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: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [False, True, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 4, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, False, True, 100, 100, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 3, 'last': 3, 'scroll': 40, 'source_range': 100, 'peer_range': 250}, [True, True, False, 100, 100, 3]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 0, 'source_range': 100, 'peer_range': 250}, [True, True, True, 0, 0, 4]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 4, 'last': 3, 'scroll': 100, 'source_range': 100, 'peer_range': 250}, [True, True, True, 250, 250, 4])], 2: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [False, True, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 8, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, False, True, 200, 200, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 6, 'last': 6, 'scroll': 80, 'source_range': 200, 'peer_range': 500}, [True, True, False, 200, 200, 6]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 0, 'source_range': 200, 'peer_range': 500}, [True, True, True, 0, 0, 8]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 8, 'last': 6, 'scroll': 200, 'source_range': 200, 'peer_range': 500}, [True, True, True, 500, 500, 8])], 3: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [False, True, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 12, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, False, True, 300, 300, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 9, 'last': 9, 'scroll': 120, 'source_range': 300, 'peer_range': 750}, [True, True, False, 300, 300, 9]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 0, 'source_range': 300, 'peer_range': 750}, [True, True, True, 0, 0, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 9, 'scroll': 300, 'source_range': 300, 'peer_range': 750}, [True, True, True, 750, 750, 12])], 4: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [False, True, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 16, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, False, True, 400, 400, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 12, 'last': 12, 'scroll': 160, 'source_range': 400, 'peer_range': 1000}, [True, True, False, 400, 400, 12]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 0, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 0, 0, 16]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 16, 'last': 12, 'scroll': 400, 'source_range': 400, 'peer_range': 1000}, [True, True, True, 1000, 1000, 16])], 5: [({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'b', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [False, True, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'e', 'token': 20, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, False, True, 500, 500, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 15, 'last': 15, 'scroll': 200, 'source_range': 500, 'peer_range': 1250}, [True, True, False, 500, 500, 15]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 0, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 0, 0, 20]), ({'source': 'a', 'event_view': 'a', 'doc': 'd', 'peer_doc': 'd', 'token': 20, 'last': 15, 'scroll': 500, 'source_range': 500, 'peer_range': 1250}, [True, True, True, 1250, 1250, 20])]}
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 forwarded token.

Linked views of one document synchronize only scroll events from the elected source; map proportional content positions into the peer range and suppress echoed tokens.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['remaining']==0
    r1 = x['remaining']==0 and x['root']
    r2 = x['sibling'] if x['remaining']==0 and not x['root'] else x['pane']
    r3 = x['gutter'] if x['remaining']==0 and not x['root'] else 0
    r4 = x['sibling'] if x['remaining']==0 and not x['root'] and x['active']==x['pane'] else x['active']
    r5 = x['width']+x['sibling_width']+x['gutter'] if x['remaining']==0 and not x['root'] else x['sibling_width']
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, True, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 208]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 0}, [True, False, 'q', 0, 'q', 500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200])], 2: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, True, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 416]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 0}, [True, False, 'q', 0, 'q', 1000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400])], 3: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, True, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 624]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 0}, [True, False, 'q', 0, 'q', 1500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600])], 4: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, True, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 832]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 0}, [True, False, 'q', 0, 'q', 2000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800])], 5: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, True, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 1040]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 0}, [True, False, 'q', 0, 'q', 2500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x):
    r0 = not x['root']
    r1 = x['remaining']==0 and x['root']
    r2 = x['sibling'] if x['remaining']==0 and not x['root'] else x['pane']
    r3 = x['gutter'] if x['remaining']==0 and not x['root'] else 0
    r4 = x['sibling'] if x['remaining']==0 and not x['root'] and x['active']==x['pane'] else x['active']
    r5 = x['width']+x['sibling_width']+x['gutter'] if x['remaining']==0 and not x['root'] else x['sibling_width']
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, True, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 208]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 0}, [True, False, 'q', 0, 'q', 500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200])], 2: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, True, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 416]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 0}, [True, False, 'q', 0, 'q', 1000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400])], 3: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, True, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 624]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 0}, [True, False, 'q', 0, 'q', 1500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600])], 4: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, True, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 832]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 0}, [True, False, 'q', 0, 'q', 2000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800])], 5: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, True, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 1040]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 0}, [True, False, 'q', 0, 'q', 2500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The tab workspace reports an incorrect collapse trigger.

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

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['remaining']==0 and not x['root']
    r1 = False
    r2 = x['sibling'] if x['remaining']==0 and not x['root'] else x['pane']
    r3 = x['gutter'] if x['remaining']==0 and not x['root'] else 0
    r4 = x['sibling'] if x['remaining']==0 and not x['root'] and x['active']==x['pane'] else x['active']
    r5 = x['width']+x['sibling_width']+x['gutter'] if x['remaining']==0 and not x['root'] else x['sibling_width']
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, True, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 208]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 0}, [True, False, 'q', 0, 'q', 500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200])], 2: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, True, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 416]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 0}, [True, False, 'q', 0, 'q', 1000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400])], 3: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, True, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 624]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 0}, [True, False, 'q', 0, 'q', 1500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600])], 4: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, True, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 832]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 0}, [True, False, 'q', 0, 'q', 2000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800])], 5: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, True, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 1040]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 0}, [True, False, 'q', 0, 'q', 2500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x):
    r0 = x['remaining']==0 and not x['root']
    r1 = x['root']
    r2 = x['sibling'] if x['remaining']==0 and not x['root'] else x['pane']
    r3 = x['gutter'] if x['remaining']==0 and not x['root'] else 0
    r4 = x['sibling'] if x['remaining']==0 and not x['root'] and x['active']==x['pane'] else x['active']
    r5 = x['width']+x['sibling_width']+x['gutter'] if x['remaining']==0 and not x['root'] else x['sibling_width']
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, True, 'p', 0, 'p', 200]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 508]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 200, 'gutter': 8}, [True, False, 'q', 8, 'q', 208]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 0}, [True, False, 'q', 0, 'q', 500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 300, 'sibling_width': 200, 'gutter': 8}, [False, False, 'p', 0, 'p', 200])], 2: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, True, 'p', 0, 'p', 400]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 1016]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 400, 'gutter': 16}, [True, False, 'q', 16, 'q', 416]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 0}, [True, False, 'q', 0, 'q', 1000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 600, 'sibling_width': 400, 'gutter': 16}, [False, False, 'p', 0, 'p', 400])], 3: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, True, 'p', 0, 'p', 600]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 1524]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 600, 'gutter': 24}, [True, False, 'q', 24, 'q', 624]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 0}, [True, False, 'q', 0, 'q', 1500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 900, 'sibling_width': 600, 'gutter': 24}, [False, False, 'p', 0, 'p', 600])], 4: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, True, 'p', 0, 'p', 800]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 2032]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 800, 'gutter': 32}, [True, False, 'q', 32, 'q', 832]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 0}, [True, False, 'q', 0, 'q', 2000]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1200, 'sibling_width': 800, 'gutter': 32}, [False, False, 'p', 0, 'p', 800])], 5: [({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 1, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, True, 'p', 0, 'p', 1000]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'q', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 2540]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 0, 'sibling_width': 1000, 'gutter': 40}, [True, False, 'q', 40, 'q', 1040]), ({'remaining': 0, 'root': False, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 0}, [True, False, 'q', 0, 'q', 2500]), ({'remaining': 1, 'root': True, 'sibling': 'q', 'pane': 'p', 'active': 'p', 'width': 1500, 'sibling_width': 1000, 'gutter': 40}, [False, False, 'p', 0, 'p', 1000])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The tab workspace reports an incorrect root placeholder.

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

split: open-access