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

N = 1
observations = []
def solve(path, link, exact, case_sensitive):
    path = path.split('?', 1)[0].split('#', 1)[0]
    link = link.rstrip('/') or '/'
    path = path.rstrip('/') or '/'
    if not case_sensitive: path, link = path.casefold(), link.casefold()
    if exact or link == '/': return path == link
    return path == link or path.startswith(link)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('query', solve('/docs?x=1', '/docs', True, True), True)
check('fragment', solve('/docs#intro', '/docs', True, True), True)
check('slash', solve('/docs', '/docs/', True, True), True)
check('root', solve('/docs', '/', False, True), False)
check('root itself', solve('/', '/', True, True), True)
check('fold', solve("/DOCS", "/docs", True, False), True)
check('sensitive', solve("/DOCS", "/docs", True, True), False)
check('child', solve('/docs/a', '/docs', False, True), True)
check('prefix sibling', solve('/docstring', '/docs', False, True), False)
check('parameterized route segment', solve('/section'+str(N)+'/child','/section'+str(N),False,True), True)
for repetition in range(N):
    check('repeat prefix sibling', solve('/docstring', '/docs', False, True), False)
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)

evaluation_group: xi-route-active

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

N = 1
observations = []
def solve(path, link, exact, case_sensitive):
    path = path.split('?', 1)[0].split('#', 1)[0]
    link = link.rstrip('/') or '/'
    path = path.rstrip('/') or '/'
    if not case_sensitive: path, link = path.casefold(), link.casefold()
    if exact or link == '/': return path == link
    return path == link or link in path
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('query', solve('/docs?x=1', '/docs', True, True), True)
check('fragment', solve('/docs#intro', '/docs', True, True), True)
check('slash', solve('/docs', '/docs/', True, True), True)
check('root', solve('/docs', '/', False, True), False)
check('root itself', solve('/', '/', True, True), True)
check('fold', solve("/DOCS", "/docs", True, False), True)
check('sensitive', solve("/DOCS", "/docs", True, True), False)
check('child', solve('/docs/a', '/docs', False, True), True)
check('prefix sibling', solve('/docstring', '/docs', False, True), False)
check('parameterized route segment', solve('/section'+str(N)+'/child','/section'+str(N),False,True), True)
for repetition in range(N):
    check('repeat prefix sibling', solve('/docstring', '/docs', False, True), False)
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:
Sibling prefixes mark unrelated navigation items active.

Ignore URL query and fragment; normalize trailing slashes with root preserved; honor case policy; section matches require a slash boundary and root matches exactly.

split: open-access


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

N = 1
observations = []
def solve(layers, event, target):
    layers = [dict(x) for x in layers]
    if not layers: return layers
    active = layers[0]
    if event == 'escape' and active['escape']: return layers[:-1]
    if event == 'outside' and active['outside'] and target not in active['inside']: return layers[:-1]
    if event == 'remove': return [x for x in layers if x['id'] != target]
    return layers
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('topmost', solve([dict(id='a',escape=False,outside=False,inside=['a']),dict(id='z',escape=True,outside=True,inside=['z'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected escape', solve([dict(id='a',escape=False,outside=False,inside=['a'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected outside', solve([dict(id='a',escape=True,outside=False,inside=['a'])], 'outside', 'x'), [{'id': 'a', 'escape': True, 'outside': False, 'inside': ['a']}])
check('inside child', solve([dict(id='a',escape=True,outside=True,inside=['a','child'])], 'outside', 'child'), [{'id': 'a', 'escape': True, 'outside': True, 'inside': ['a', 'child']}])
check('outside', solve([dict(id='a',escape=True,outside=True,inside=['a'])], 'outside', 'x'), [])
check('remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
check('parameterized stack depth', solve([dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N)],'escape',None), [dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N-1)])
for repetition in range(N):
    check('repeat remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
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

evaluation_group: xi-dismiss-stack

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

N = 1
observations = []
def solve(layers, event, target):
    layers = [dict(x) for x in layers]
    if not layers: return layers
    active = min(layers, key=lambda x: x["id"])
    if event == 'escape' and active['escape']: return layers[:-1]
    if event == 'outside' and active['outside'] and target not in active['inside']: return layers[:-1]
    if event == 'remove': return [x for x in layers if x['id'] != target]
    return layers
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('topmost', solve([dict(id='a',escape=False,outside=False,inside=['a']),dict(id='z',escape=True,outside=True,inside=['z'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected escape', solve([dict(id='a',escape=False,outside=False,inside=['a'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected outside', solve([dict(id='a',escape=True,outside=False,inside=['a'])], 'outside', 'x'), [{'id': 'a', 'escape': True, 'outside': False, 'inside': ['a']}])
check('inside child', solve([dict(id='a',escape=True,outside=True,inside=['a','child'])], 'outside', 'child'), [{'id': 'a', 'escape': True, 'outside': True, 'inside': ['a', 'child']}])
check('outside', solve([dict(id='a',escape=True,outside=True,inside=['a'])], 'outside', 'x'), [])
check('remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
check('parameterized stack depth', solve([dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N)],'escape',None), [dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N-1)])
for repetition in range(N):
    check('repeat remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
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:
Dismissal policy is taken from an underlying overlay.

Only the topmost overlay handles Escape/outside policy; inside descendants are exempt; explicit unmount removes only its identity.

split: open-access


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

N = 1
observations = []
def solve(layers, event, target):
    layers = [dict(x) for x in layers]
    if not layers: return layers
    active = layers[-1]
    if event == 'escape': return layers[:-1]
    if event == 'outside' and active['outside'] and target not in active['inside']: return layers[:-1]
    if event == 'remove': return [x for x in layers if x['id'] != target]
    return layers
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('topmost', solve([dict(id='a',escape=False,outside=False,inside=['a']),dict(id='z',escape=True,outside=True,inside=['z'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected escape', solve([dict(id='a',escape=False,outside=False,inside=['a'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected outside', solve([dict(id='a',escape=True,outside=False,inside=['a'])], 'outside', 'x'), [{'id': 'a', 'escape': True, 'outside': False, 'inside': ['a']}])
check('inside child', solve([dict(id='a',escape=True,outside=True,inside=['a','child'])], 'outside', 'child'), [{'id': 'a', 'escape': True, 'outside': True, 'inside': ['a', 'child']}])
check('outside', solve([dict(id='a',escape=True,outside=True,inside=['a'])], 'outside', 'x'), [])
check('remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
check('parameterized stack depth', solve([dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N)],'escape',None), [dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N-1)])
for repetition in range(N):
    check('repeat remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
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)

evaluation_group: xi-dismiss-stack

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

N = 1
observations = []
def solve(layers, event, target):
    layers = [dict(x) for x in layers]
    if not layers: return layers
    active = layers[-1]
    if event == 'escape' and not active['escape']: return layers[:-1]
    if event == 'outside' and active['outside'] and target not in active['inside']: return layers[:-1]
    if event == 'remove': return [x for x in layers if x['id'] != target]
    return layers
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('topmost', solve([dict(id='a',escape=False,outside=False,inside=['a']),dict(id='z',escape=True,outside=True,inside=['z'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected escape', solve([dict(id='a',escape=False,outside=False,inside=['a'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected outside', solve([dict(id='a',escape=True,outside=False,inside=['a'])], 'outside', 'x'), [{'id': 'a', 'escape': True, 'outside': False, 'inside': ['a']}])
check('inside child', solve([dict(id='a',escape=True,outside=True,inside=['a','child'])], 'outside', 'child'), [{'id': 'a', 'escape': True, 'outside': True, 'inside': ['a', 'child']}])
check('outside', solve([dict(id='a',escape=True,outside=True,inside=['a'])], 'outside', 'x'), [])
check('remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
check('parameterized stack depth', solve([dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N)],'escape',None), [dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N-1)])
for repetition in range(N):
    check('repeat remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
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:
Escape closes layers explicitly configured nondismissible.

Only the topmost overlay handles Escape/outside policy; inside descendants are exempt; explicit unmount removes only its identity.

split: open-access


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

N = 1
observations = []
def solve(layers, event, target):
    layers = [dict(x) for x in layers]
    if not layers: return layers
    active = layers[-1]
    if event == 'escape' and active['escape']: return layers[:-1]
    if event == 'outside' and target not in active['inside']: return layers[:-1]
    if event == 'remove': return [x for x in layers if x['id'] != target]
    return layers
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('topmost', solve([dict(id='a',escape=False,outside=False,inside=['a']),dict(id='z',escape=True,outside=True,inside=['z'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected escape', solve([dict(id='a',escape=False,outside=False,inside=['a'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected outside', solve([dict(id='a',escape=True,outside=False,inside=['a'])], 'outside', 'x'), [{'id': 'a', 'escape': True, 'outside': False, 'inside': ['a']}])
check('inside child', solve([dict(id='a',escape=True,outside=True,inside=['a','child'])], 'outside', 'child'), [{'id': 'a', 'escape': True, 'outside': True, 'inside': ['a', 'child']}])
check('outside', solve([dict(id='a',escape=True,outside=True,inside=['a'])], 'outside', 'x'), [])
check('remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
check('parameterized stack depth', solve([dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N)],'escape',None), [dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N-1)])
for repetition in range(N):
    check('repeat remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
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)

evaluation_group: xi-dismiss-stack

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

N = 1
observations = []
def solve(layers, event, target):
    layers = [dict(x) for x in layers]
    if not layers: return layers
    active = layers[-1]
    if event == 'escape' and active['escape']: return layers[:-1]
    if event == 'outside' and not active['outside'] and target not in active['inside']: return layers[:-1]
    if event == 'remove': return [x for x in layers if x['id'] != target]
    return layers
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('topmost', solve([dict(id='a',escape=False,outside=False,inside=['a']),dict(id='z',escape=True,outside=True,inside=['z'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected escape', solve([dict(id='a',escape=False,outside=False,inside=['a'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected outside', solve([dict(id='a',escape=True,outside=False,inside=['a'])], 'outside', 'x'), [{'id': 'a', 'escape': True, 'outside': False, 'inside': ['a']}])
check('inside child', solve([dict(id='a',escape=True,outside=True,inside=['a','child'])], 'outside', 'child'), [{'id': 'a', 'escape': True, 'outside': True, 'inside': ['a', 'child']}])
check('outside', solve([dict(id='a',escape=True,outside=True,inside=['a'])], 'outside', 'x'), [])
check('remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
check('parameterized stack depth', solve([dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N)],'escape',None), [dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N-1)])
for repetition in range(N):
    check('repeat remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
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:
Outside interaction closes a modal that forbids it.

Only the topmost overlay handles Escape/outside policy; inside descendants are exempt; explicit unmount removes only its identity.

split: open-access


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

N = 1
observations = []
def solve(layers, event, target):
    layers = [dict(x) for x in layers]
    if not layers: return layers
    active = layers[-1]
    if event == 'escape' and active['escape']: return layers[:-1]
    if event == 'outside' and active['outside'] and target != active['id']: return layers[:-1]
    if event == 'remove': return [x for x in layers if x['id'] != target]
    return layers
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('topmost', solve([dict(id='a',escape=False,outside=False,inside=['a']),dict(id='z',escape=True,outside=True,inside=['z'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected escape', solve([dict(id='a',escape=False,outside=False,inside=['a'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected outside', solve([dict(id='a',escape=True,outside=False,inside=['a'])], 'outside', 'x'), [{'id': 'a', 'escape': True, 'outside': False, 'inside': ['a']}])
check('inside child', solve([dict(id='a',escape=True,outside=True,inside=['a','child'])], 'outside', 'child'), [{'id': 'a', 'escape': True, 'outside': True, 'inside': ['a', 'child']}])
check('outside', solve([dict(id='a',escape=True,outside=True,inside=['a'])], 'outside', 'x'), [])
check('remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
check('parameterized stack depth', solve([dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N)],'escape',None), [dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N-1)])
for repetition in range(N):
    check('repeat remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
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)

evaluation_group: xi-dismiss-stack

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

N = 1
observations = []
def solve(layers, event, target):
    layers = [dict(x) for x in layers]
    if not layers: return layers
    active = layers[-1]
    if event == 'escape' and active['escape']: return layers[:-1]
    if event == 'outside' and active['outside'] and target in active['inside']: return layers[:-1]
    if event == 'remove': return [x for x in layers if x['id'] != target]
    return layers
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('topmost', solve([dict(id='a',escape=False,outside=False,inside=['a']),dict(id='z',escape=True,outside=True,inside=['z'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected escape', solve([dict(id='a',escape=False,outside=False,inside=['a'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected outside', solve([dict(id='a',escape=True,outside=False,inside=['a'])], 'outside', 'x'), [{'id': 'a', 'escape': True, 'outside': False, 'inside': ['a']}])
check('inside child', solve([dict(id='a',escape=True,outside=True,inside=['a','child'])], 'outside', 'child'), [{'id': 'a', 'escape': True, 'outside': True, 'inside': ['a', 'child']}])
check('outside', solve([dict(id='a',escape=True,outside=True,inside=['a'])], 'outside', 'x'), [])
check('remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
check('parameterized stack depth', solve([dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N)],'escape',None), [dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N-1)])
for repetition in range(N):
    check('repeat remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
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:
Clicks on overlay descendants are mistaken for outside clicks.

Only the topmost overlay handles Escape/outside policy; inside descendants are exempt; explicit unmount removes only its identity.

split: open-access


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

N = 1
observations = []
def solve(layers, event, target):
    layers = [dict(x) for x in layers]
    if not layers: return layers
    active = layers[-1]
    if event == 'escape' and active['escape']: return layers[:-1]
    if event == 'outside' and active['outside'] and target not in active['inside']: return layers[:-1]
    if event == 'remove': return [x for x in layers if x['id'] == target]
    return layers
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('topmost', solve([dict(id='a',escape=False,outside=False,inside=['a']),dict(id='z',escape=True,outside=True,inside=['z'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected escape', solve([dict(id='a',escape=False,outside=False,inside=['a'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected outside', solve([dict(id='a',escape=True,outside=False,inside=['a'])], 'outside', 'x'), [{'id': 'a', 'escape': True, 'outside': False, 'inside': ['a']}])
check('inside child', solve([dict(id='a',escape=True,outside=True,inside=['a','child'])], 'outside', 'child'), [{'id': 'a', 'escape': True, 'outside': True, 'inside': ['a', 'child']}])
check('outside', solve([dict(id='a',escape=True,outside=True,inside=['a'])], 'outside', 'x'), [])
check('remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
check('parameterized stack depth', solve([dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N)],'escape',None), [dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N-1)])
for repetition in range(N):
    check('repeat remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
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)

evaluation_group: xi-dismiss-stack

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

N = 1
observations = []
def solve(layers, event, target):
    layers = [dict(x) for x in layers]
    if not layers: return layers
    active = layers[-1]
    if event == 'escape' and active['escape']: return layers[:-1]
    if event == 'outside' and active['outside'] and target not in active['inside']: return layers[:-1]
    if event == 'remove': return [x for x in layers if False]
    return layers
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('topmost', solve([dict(id='a',escape=False,outside=False,inside=['a']),dict(id='z',escape=True,outside=True,inside=['z'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected escape', solve([dict(id='a',escape=False,outside=False,inside=['a'])], 'escape', None), [{'id': 'a', 'escape': False, 'outside': False, 'inside': ['a']}])
check('protected outside', solve([dict(id='a',escape=True,outside=False,inside=['a'])], 'outside', 'x'), [{'id': 'a', 'escape': True, 'outside': False, 'inside': ['a']}])
check('inside child', solve([dict(id='a',escape=True,outside=True,inside=['a','child'])], 'outside', 'child'), [{'id': 'a', 'escape': True, 'outside': True, 'inside': ['a', 'child']}])
check('outside', solve([dict(id='a',escape=True,outside=True,inside=['a'])], 'outside', 'x'), [])
check('remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
check('parameterized stack depth', solve([dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N)],'escape',None), [dict(id=str(i),escape=True,outside=True,inside=[str(i)]) for i in range(N-1)])
for repetition in range(N):
    check('repeat remove', solve([dict(id='a',escape=True,outside=True,inside=['a']),dict(id='b',escape=True,outside=True,inside=['b'])], 'remove', 'a'), [{'id': 'b', 'escape': True, 'outside': True, 'inside': ['b']}])
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:
Unmounting one layer retains only the removed layer.

Only the topmost overlay handles Escape/outside policy; inside descendants are exempt; explicit unmount removes only its identity.

split: open-access


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

N = 1
observations = []
def solve(items, event, ident, message, limit):
    items = [dict(x) for x in items]
    if event == 'add':
        if any(x['message'] == message for x in items): return items
        items.append({'id': ident, 'message': message})
        return items[-limit:] if limit else []
    if event == 'update':
        for x in items:
            if x['id'] == ident: x['message'] = message
    if event == 'dismiss': items = [x for x in items if x['id'] != ident]
    if event == 'clear': items = []
    return items
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('distinct messages equal', solve([dict(id='a',message='same')], 'add', 'b', 'same', 3), [{'id': 'a', 'message': 'same'}, {'id': 'b', 'message': 'same'}])
check('retry identity', solve([dict(id='a',message='first')], 'add', 'a', 'new', 3), [{'id': 'a', 'message': 'first'}])
check('capacity', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'add', 'c', 'c', 2), [{'id': 'b', 'message': 'b'}, {'id': 'c', 'message': 'c'}])
check('zero', solve([], 'add', 'a', 'a', 0), [])
check('update', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'update', 'a', 'new', 3), [{'id': 'a', 'message': 'new'}, {'id': 'b', 'message': 'b'}])
check('dismiss', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'dismiss', 'a', None, 3), [{'id': 'b', 'message': 'b'}])
check('clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
check('parameterized toast identity', solve([], 'add', str(N), 'message'+str(N), 2), [dict(id=str(N),message='message'+str(N))])
for repetition in range(N):
    check('repeat clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
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)

evaluation_group: xi-toast

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

N = 1
observations = []
def solve(items, event, ident, message, limit):
    items = [dict(x) for x in items]
    if event == 'add':
        if any(False for x in items): return items
        items.append({'id': ident, 'message': message})
        return items[-limit:] if limit else []
    if event == 'update':
        for x in items:
            if x['id'] == ident: x['message'] = message
    if event == 'dismiss': items = [x for x in items if x['id'] != ident]
    if event == 'clear': items = []
    return items
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('distinct messages equal', solve([dict(id='a',message='same')], 'add', 'b', 'same', 3), [{'id': 'a', 'message': 'same'}, {'id': 'b', 'message': 'same'}])
check('retry identity', solve([dict(id='a',message='first')], 'add', 'a', 'new', 3), [{'id': 'a', 'message': 'first'}])
check('capacity', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'add', 'c', 'c', 2), [{'id': 'b', 'message': 'b'}, {'id': 'c', 'message': 'c'}])
check('zero', solve([], 'add', 'a', 'a', 0), [])
check('update', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'update', 'a', 'new', 3), [{'id': 'a', 'message': 'new'}, {'id': 'b', 'message': 'b'}])
check('dismiss', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'dismiss', 'a', None, 3), [{'id': 'b', 'message': 'b'}])
check('clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
check('parameterized toast identity', solve([], 'add', str(N), 'message'+str(N), 2), [dict(id=str(N),message='message'+str(N))])
for repetition in range(N):
    check('repeat clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
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:
Equal-message toasts with different identities are collapsed.

Toast IDs deduplicate additions; equal content may belong to distinct IDs; keep newest within capacity; update/dismiss target one ID; clear removes all.

split: open-access


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

N = 1
observations = []
def solve(items, event, ident, message, limit):
    items = [dict(x) for x in items]
    if event == 'add':
        if any(x['id'] == ident for x in items): return items
        items.append({'id': ident, 'message': message})
        return items[:limit] if limit else []
    if event == 'update':
        for x in items:
            if x['id'] == ident: x['message'] = message
    if event == 'dismiss': items = [x for x in items if x['id'] != ident]
    if event == 'clear': items = []
    return items
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('distinct messages equal', solve([dict(id='a',message='same')], 'add', 'b', 'same', 3), [{'id': 'a', 'message': 'same'}, {'id': 'b', 'message': 'same'}])
check('retry identity', solve([dict(id='a',message='first')], 'add', 'a', 'new', 3), [{'id': 'a', 'message': 'first'}])
check('capacity', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'add', 'c', 'c', 2), [{'id': 'b', 'message': 'b'}, {'id': 'c', 'message': 'c'}])
check('zero', solve([], 'add', 'a', 'a', 0), [])
check('update', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'update', 'a', 'new', 3), [{'id': 'a', 'message': 'new'}, {'id': 'b', 'message': 'b'}])
check('dismiss', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'dismiss', 'a', None, 3), [{'id': 'b', 'message': 'b'}])
check('clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
check('parameterized toast identity', solve([], 'add', str(N), 'message'+str(N), 2), [dict(id=str(N),message='message'+str(N))])
for repetition in range(N):
    check('repeat clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
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)

evaluation_group: xi-toast

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

N = 1
observations = []
def solve(items, event, ident, message, limit):
    items = [dict(x) for x in items]
    if event == 'add':
        if any(x['id'] == ident for x in items): return items
        items.append({'id': ident, 'message': message})
        return items[-limit:]
    if event == 'update':
        for x in items:
            if x['id'] == ident: x['message'] = message
    if event == 'dismiss': items = [x for x in items if x['id'] != ident]
    if event == 'clear': items = []
    return items
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('distinct messages equal', solve([dict(id='a',message='same')], 'add', 'b', 'same', 3), [{'id': 'a', 'message': 'same'}, {'id': 'b', 'message': 'same'}])
check('retry identity', solve([dict(id='a',message='first')], 'add', 'a', 'new', 3), [{'id': 'a', 'message': 'first'}])
check('capacity', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'add', 'c', 'c', 2), [{'id': 'b', 'message': 'b'}, {'id': 'c', 'message': 'c'}])
check('zero', solve([], 'add', 'a', 'a', 0), [])
check('update', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'update', 'a', 'new', 3), [{'id': 'a', 'message': 'new'}, {'id': 'b', 'message': 'b'}])
check('dismiss', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'dismiss', 'a', None, 3), [{'id': 'b', 'message': 'b'}])
check('clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
check('parameterized toast identity', solve([], 'add', str(N), 'message'+str(N), 2), [dict(id=str(N),message='message'+str(N))])
for repetition in range(N):
    check('repeat clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
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:
Capacity eviction removes the newest notifications.

Toast IDs deduplicate additions; equal content may belong to distinct IDs; keep newest within capacity; update/dismiss target one ID; clear removes all.

split: open-access


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

N = 1
observations = []
def solve(items, event, ident, message, limit):
    items = [dict(x) for x in items]
    if event == 'add':
        if any(x['id'] == ident for x in items): return items
        items.append({'id': ident, 'message': message})
        return items[-limit:] if limit else []
    if event == 'update':
        for x in items:
            if True: x['message'] = message
    if event == 'dismiss': items = [x for x in items if x['id'] != ident]
    if event == 'clear': items = []
    return items
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('distinct messages equal', solve([dict(id='a',message='same')], 'add', 'b', 'same', 3), [{'id': 'a', 'message': 'same'}, {'id': 'b', 'message': 'same'}])
check('retry identity', solve([dict(id='a',message='first')], 'add', 'a', 'new', 3), [{'id': 'a', 'message': 'first'}])
check('capacity', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'add', 'c', 'c', 2), [{'id': 'b', 'message': 'b'}, {'id': 'c', 'message': 'c'}])
check('zero', solve([], 'add', 'a', 'a', 0), [])
check('update', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'update', 'a', 'new', 3), [{'id': 'a', 'message': 'new'}, {'id': 'b', 'message': 'b'}])
check('dismiss', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'dismiss', 'a', None, 3), [{'id': 'b', 'message': 'b'}])
check('clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
check('parameterized toast identity', solve([], 'add', str(N), 'message'+str(N), 2), [dict(id=str(N),message='message'+str(N))])
for repetition in range(N):
    check('repeat clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
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)

evaluation_group: xi-toast

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

N = 1
observations = []
def solve(items, event, ident, message, limit):
    items = [dict(x) for x in items]
    if event == 'add':
        if any(x['id'] == ident for x in items): return items
        items.append({'id': ident, 'message': message})
        return items[-limit:] if limit else []
    if event == 'update':
        for x in items:
            if x['id'] != ident: x['message'] = message
    if event == 'dismiss': items = [x for x in items if x['id'] != ident]
    if event == 'clear': items = []
    return items
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('distinct messages equal', solve([dict(id='a',message='same')], 'add', 'b', 'same', 3), [{'id': 'a', 'message': 'same'}, {'id': 'b', 'message': 'same'}])
check('retry identity', solve([dict(id='a',message='first')], 'add', 'a', 'new', 3), [{'id': 'a', 'message': 'first'}])
check('capacity', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'add', 'c', 'c', 2), [{'id': 'b', 'message': 'b'}, {'id': 'c', 'message': 'c'}])
check('zero', solve([], 'add', 'a', 'a', 0), [])
check('update', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'update', 'a', 'new', 3), [{'id': 'a', 'message': 'new'}, {'id': 'b', 'message': 'b'}])
check('dismiss', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'dismiss', 'a', None, 3), [{'id': 'b', 'message': 'b'}])
check('clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
check('parameterized toast identity', solve([], 'add', str(N), 'message'+str(N), 2), [dict(id=str(N),message='message'+str(N))])
for repetition in range(N):
    check('repeat clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
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:
Updating one toast overwrites all toast messages.

Toast IDs deduplicate additions; equal content may belong to distinct IDs; keep newest within capacity; update/dismiss target one ID; clear removes all.

split: open-access


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

N = 1
observations = []
def solve(items, event, ident, message, limit):
    items = [dict(x) for x in items]
    if event == 'add':
        if any(x['id'] == ident for x in items): return items
        items.append({'id': ident, 'message': message})
        return items[-limit:] if limit else []
    if event == 'update':
        for x in items:
            if x['id'] == ident: x['message'] = message
    if event == 'dismiss': items = [x for x in items if x['id'] == ident]
    if event == 'clear': items = []
    return items
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('distinct messages equal', solve([dict(id='a',message='same')], 'add', 'b', 'same', 3), [{'id': 'a', 'message': 'same'}, {'id': 'b', 'message': 'same'}])
check('retry identity', solve([dict(id='a',message='first')], 'add', 'a', 'new', 3), [{'id': 'a', 'message': 'first'}])
check('capacity', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'add', 'c', 'c', 2), [{'id': 'b', 'message': 'b'}, {'id': 'c', 'message': 'c'}])
check('zero', solve([], 'add', 'a', 'a', 0), [])
check('update', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'update', 'a', 'new', 3), [{'id': 'a', 'message': 'new'}, {'id': 'b', 'message': 'b'}])
check('dismiss', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'dismiss', 'a', None, 3), [{'id': 'b', 'message': 'b'}])
check('clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
check('parameterized toast identity', solve([], 'add', str(N), 'message'+str(N), 2), [dict(id=str(N),message='message'+str(N))])
for repetition in range(N):
    check('repeat clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
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)

evaluation_group: xi-toast

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

N = 1
observations = []
def solve(items, event, ident, message, limit):
    items = [dict(x) for x in items]
    if event == 'add':
        if any(x['id'] == ident for x in items): return items
        items.append({'id': ident, 'message': message})
        return items[-limit:] if limit else []
    if event == 'update':
        for x in items:
            if x['id'] == ident: x['message'] = message
    if event == 'dismiss': items = [x for x in items if False]
    if event == 'clear': items = []
    return items
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('distinct messages equal', solve([dict(id='a',message='same')], 'add', 'b', 'same', 3), [{'id': 'a', 'message': 'same'}, {'id': 'b', 'message': 'same'}])
check('retry identity', solve([dict(id='a',message='first')], 'add', 'a', 'new', 3), [{'id': 'a', 'message': 'first'}])
check('capacity', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'add', 'c', 'c', 2), [{'id': 'b', 'message': 'b'}, {'id': 'c', 'message': 'c'}])
check('zero', solve([], 'add', 'a', 'a', 0), [])
check('update', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'update', 'a', 'new', 3), [{'id': 'a', 'message': 'new'}, {'id': 'b', 'message': 'b'}])
check('dismiss', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'dismiss', 'a', None, 3), [{'id': 'b', 'message': 'b'}])
check('clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
check('parameterized toast identity', solve([], 'add', str(N), 'message'+str(N), 2), [dict(id=str(N),message='message'+str(N))])
for repetition in range(N):
    check('repeat clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
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:
Dismissing a toast retains the dismissed toast and removes others.

Toast IDs deduplicate additions; equal content may belong to distinct IDs; keep newest within capacity; update/dismiss target one ID; clear removes all.

split: open-access


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

N = 1
observations = []
def solve(items, event, ident, message, limit):
    items = [dict(x) for x in items]
    if event == 'add':
        if any(x['id'] == ident for x in items): return items
        items.append({'id': ident, 'message': message})
        return items[-limit:] if limit else []
    if event == 'update':
        for x in items:
            if x['id'] == ident: x['message'] = message
    if event == 'dismiss': items = [x for x in items if x['id'] != ident]
    if event == 'clear': items = items[:-1]
    return items
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('distinct messages equal', solve([dict(id='a',message='same')], 'add', 'b', 'same', 3), [{'id': 'a', 'message': 'same'}, {'id': 'b', 'message': 'same'}])
check('retry identity', solve([dict(id='a',message='first')], 'add', 'a', 'new', 3), [{'id': 'a', 'message': 'first'}])
check('capacity', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'add', 'c', 'c', 2), [{'id': 'b', 'message': 'b'}, {'id': 'c', 'message': 'c'}])
check('zero', solve([], 'add', 'a', 'a', 0), [])
check('update', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'update', 'a', 'new', 3), [{'id': 'a', 'message': 'new'}, {'id': 'b', 'message': 'b'}])
check('dismiss', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'dismiss', 'a', None, 3), [{'id': 'b', 'message': 'b'}])
check('clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
check('parameterized toast identity', solve([], 'add', str(N), 'message'+str(N), 2), [dict(id=str(N),message='message'+str(N))])
for repetition in range(N):
    check('repeat clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
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)

evaluation_group: xi-toast

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

N = 1
observations = []
def solve(items, event, ident, message, limit):
    items = [dict(x) for x in items]
    if event == 'add':
        if any(x['id'] == ident for x in items): return items
        items.append({'id': ident, 'message': message})
        return items[-limit:] if limit else []
    if event == 'update':
        for x in items:
            if x['id'] == ident: x['message'] = message
    if event == 'dismiss': items = [x for x in items if x['id'] != ident]
    if event == 'clear': items = items[1:]
    return items
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('distinct messages equal', solve([dict(id='a',message='same')], 'add', 'b', 'same', 3), [{'id': 'a', 'message': 'same'}, {'id': 'b', 'message': 'same'}])
check('retry identity', solve([dict(id='a',message='first')], 'add', 'a', 'new', 3), [{'id': 'a', 'message': 'first'}])
check('capacity', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'add', 'c', 'c', 2), [{'id': 'b', 'message': 'b'}, {'id': 'c', 'message': 'c'}])
check('zero', solve([], 'add', 'a', 'a', 0), [])
check('update', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'update', 'a', 'new', 3), [{'id': 'a', 'message': 'new'}, {'id': 'b', 'message': 'b'}])
check('dismiss', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'dismiss', 'a', None, 3), [{'id': 'b', 'message': 'b'}])
check('clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
check('parameterized toast identity', solve([], 'add', str(N), 'message'+str(N), 2), [dict(id=str(N),message='message'+str(N))])
for repetition in range(N):
    check('repeat clear', solve([dict(id='a',message='a'),dict(id='b',message='b')], 'clear', None, None, 3), [])
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:
Clear-all removes only the newest toast.

Toast IDs deduplicate additions; equal content may belong to distinct IDs; keep newest within capacity; update/dismiss target one ID; clear removes all.

split: open-access


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

N = 1
observations = []
def solve(value, minimum, maximum, label, busy):
    if value is None: return {'role':'progressbar', 'label':label, 'busy':True, 'value':0}
    value = max(minimum, min(value, maximum))
    ratio = (value-minimum)/(maximum-minimum) if maximum > minimum else 1
    return {'role':'progressbar', 'label':label, 'busy':busy, 'value':value, 'percent':round(ratio*100)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('indeterminate', solve(None, 0, 100, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True})
check('below', solve(-5, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 10, 'percent': 0})
check('above', solve(40, 10, 30, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 30, 'percent': 100})
check('offset', solve(20, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 20, 'percent': 50})
check('empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
check('parameterized progress range', solve(2*N,N,3*N,'Task',True), dict(role='progressbar',label='Task',busy=True,value=2*N,percent=50))
for repetition in range(N):
    check('repeat empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
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)

evaluation_group: xi-progress

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

N = 1
observations = []
def solve(value, minimum, maximum, label, busy):
    if value is None: return {'role':'progressbar', 'label':label, 'busy':False}
    value = max(minimum, min(value, maximum))
    ratio = (value-minimum)/(maximum-minimum) if maximum > minimum else 1
    return {'role':'progressbar', 'label':label, 'busy':busy, 'value':value, 'percent':round(ratio*100)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('indeterminate', solve(None, 0, 100, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True})
check('below', solve(-5, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 10, 'percent': 0})
check('above', solve(40, 10, 30, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 30, 'percent': 100})
check('offset', solve(20, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 20, 'percent': 50})
check('empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
check('parameterized progress range', solve(2*N,N,3*N,'Task',True), dict(role='progressbar',label='Task',busy=True,value=2*N,percent=50))
for repetition in range(N):
    check('repeat empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
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:
Indeterminate progress is announced as zero completion.

Indeterminate indicators omit numeric value and are busy; determinate values clamp, percentages normalize the range, zero-span means complete, and busy reflects explicit state.

split: open-access


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

N = 1
observations = []
def solve(value, minimum, maximum, label, busy):
    if value is None: return {'role':'progressbar', 'label':label, 'busy':True}
    value = value
    ratio = (value-minimum)/(maximum-minimum) if maximum > minimum else 1
    return {'role':'progressbar', 'label':label, 'busy':busy, 'value':value, 'percent':round(ratio*100)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('indeterminate', solve(None, 0, 100, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True})
check('below', solve(-5, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 10, 'percent': 0})
check('above', solve(40, 10, 30, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 30, 'percent': 100})
check('offset', solve(20, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 20, 'percent': 50})
check('empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
check('parameterized progress range', solve(2*N,N,3*N,'Task',True), dict(role='progressbar',label='Task',busy=True,value=2*N,percent=50))
for repetition in range(N):
    check('repeat empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
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)

evaluation_group: xi-progress

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

N = 1
observations = []
def solve(value, minimum, maximum, label, busy):
    if value is None: return {'role':'progressbar', 'label':label, 'busy':True}
    value = min(value, maximum)
    ratio = (value-minimum)/(maximum-minimum) if maximum > minimum else 1
    return {'role':'progressbar', 'label':label, 'busy':busy, 'value':value, 'percent':round(ratio*100)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('indeterminate', solve(None, 0, 100, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True})
check('below', solve(-5, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 10, 'percent': 0})
check('above', solve(40, 10, 30, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 30, 'percent': 100})
check('offset', solve(20, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 20, 'percent': 50})
check('empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
check('parameterized progress range', solve(2*N,N,3*N,'Task',True), dict(role='progressbar',label='Task',busy=True,value=2*N,percent=50))
for repetition in range(N):
    check('repeat empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
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:
Out-of-range progress exposes invalid accessible values.

Indeterminate indicators omit numeric value and are busy; determinate values clamp, percentages normalize the range, zero-span means complete, and busy reflects explicit state.

split: open-access


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

N = 1
observations = []
def solve(value, minimum, maximum, label, busy):
    if value is None: return {'role':'progressbar', 'label':label, 'busy':True}
    value = max(minimum, min(value, maximum))
    ratio = value/(maximum-minimum) if maximum > minimum else 1
    return {'role':'progressbar', 'label':label, 'busy':busy, 'value':value, 'percent':round(ratio*100)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('indeterminate', solve(None, 0, 100, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True})
check('below', solve(-5, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 10, 'percent': 0})
check('above', solve(40, 10, 30, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 30, 'percent': 100})
check('offset', solve(20, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 20, 'percent': 50})
check('empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
check('parameterized progress range', solve(2*N,N,3*N,'Task',True), dict(role='progressbar',label='Task',busy=True,value=2*N,percent=50))
for repetition in range(N):
    check('repeat empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
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)

evaluation_group: xi-progress

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

N = 1
observations = []
def solve(value, minimum, maximum, label, busy):
    if value is None: return {'role':'progressbar', 'label':label, 'busy':True}
    value = max(minimum, min(value, maximum))
    ratio = (value-minimum)/maximum if maximum > minimum else 1
    return {'role':'progressbar', 'label':label, 'busy':busy, 'value':value, 'percent':round(ratio*100)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('indeterminate', solve(None, 0, 100, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True})
check('below', solve(-5, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 10, 'percent': 0})
check('above', solve(40, 10, 30, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 30, 'percent': 100})
check('offset', solve(20, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 20, 'percent': 50})
check('empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
check('parameterized progress range', solve(2*N,N,3*N,'Task',True), dict(role='progressbar',label='Task',busy=True,value=2*N,percent=50))
for repetition in range(N):
    check('repeat empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
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:
Progress percentage ignores a nonzero range origin.

Indeterminate indicators omit numeric value and are busy; determinate values clamp, percentages normalize the range, zero-span means complete, and busy reflects explicit state.

split: open-access


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

N = 1
observations = []
def solve(value, minimum, maximum, label, busy):
    if value is None: return {'role':'progressbar', 'label':label, 'busy':True}
    value = max(minimum, min(value, maximum))
    ratio = (value-minimum)/(maximum-minimum) if maximum > minimum else 0
    return {'role':'progressbar', 'label':label, 'busy':busy, 'value':value, 'percent':round(ratio*100)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('indeterminate', solve(None, 0, 100, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True})
check('below', solve(-5, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 10, 'percent': 0})
check('above', solve(40, 10, 30, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 30, 'percent': 100})
check('offset', solve(20, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 20, 'percent': 50})
check('empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
check('parameterized progress range', solve(2*N,N,3*N,'Task',True), dict(role='progressbar',label='Task',busy=True,value=2*N,percent=50))
for repetition in range(N):
    check('repeat empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
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)

evaluation_group: xi-progress

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

N = 1
observations = []
def solve(value, minimum, maximum, label, busy):
    if value is None: return {'role':'progressbar', 'label':label, 'busy':True}
    value = max(minimum, min(value, maximum))
    ratio = (value-minimum)/(maximum-minimum) if maximum > minimum else 0.5
    return {'role':'progressbar', 'label':label, 'busy':busy, 'value':value, 'percent':round(ratio*100)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('indeterminate', solve(None, 0, 100, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True})
check('below', solve(-5, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 10, 'percent': 0})
check('above', solve(40, 10, 30, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 30, 'percent': 100})
check('offset', solve(20, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 20, 'percent': 50})
check('empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
check('parameterized progress range', solve(2*N,N,3*N,'Task',True), dict(role='progressbar',label='Task',busy=True,value=2*N,percent=50))
for repetition in range(N):
    check('repeat empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
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:
A completed zero-span range is announced as unstarted.

Indeterminate indicators omit numeric value and are busy; determinate values clamp, percentages normalize the range, zero-span means complete, and busy reflects explicit state.

split: open-access


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

N = 1
observations = []
def solve(value, minimum, maximum, label, busy):
    if value is None: return {'role':'progressbar', 'label':label, 'busy':True}
    value = max(minimum, min(value, maximum))
    ratio = (value-minimum)/(maximum-minimum) if maximum > minimum else 1
    return {'role':'progressbar', 'label':label, 'busy':True, 'value':value, 'percent':round(ratio*100)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('indeterminate', solve(None, 0, 100, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True})
check('below', solve(-5, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 10, 'percent': 0})
check('above', solve(40, 10, 30, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 30, 'percent': 100})
check('offset', solve(20, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 20, 'percent': 50})
check('empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
check('parameterized progress range', solve(2*N,N,3*N,'Task',True), dict(role='progressbar',label='Task',busy=True,value=2*N,percent=50))
for repetition in range(N):
    check('repeat empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
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)

evaluation_group: xi-progress

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

N = 1
observations = []
def solve(value, minimum, maximum, label, busy):
    if value is None: return {'role':'progressbar', 'label':label, 'busy':True}
    value = max(minimum, min(value, maximum))
    ratio = (value-minimum)/(maximum-minimum) if maximum > minimum else 1
    return {'role':'progressbar', 'label':label, 'busy':False, 'value':value, 'percent':round(ratio*100)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('indeterminate', solve(None, 0, 100, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True})
check('below', solve(-5, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 10, 'percent': 0})
check('above', solve(40, 10, 30, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 30, 'percent': 100})
check('offset', solve(20, 10, 30, 'Upload', True), {'role': 'progressbar', 'label': 'Upload', 'busy': True, 'value': 20, 'percent': 50})
check('empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
check('parameterized progress range', solve(2*N,N,3*N,'Task',True), dict(role='progressbar',label='Task',busy=True,value=2*N,percent=50))
for repetition in range(N):
    check('repeat empty range', solve(10, 10, 10, 'Upload', False), {'role': 'progressbar', 'label': 'Upload', 'busy': False, 'value': 10, 'percent': 100})
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:
Completed progress remains announced as busy.

Indeterminate indicators omit numeric value and are busy; determinate values clamp, percentages normalize the range, zero-span means complete, and busy reflects explicit state.

split: open-access


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

N = 1
observations = []
def solve(size, delta, minimum, maximum, reversed_axis, disabled):
    if disabled: return minimum
    change = -delta if reversed_axis else delta
    wanted = size + change
    return max(minimum, min(maximum, wanted))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve(50, 10, 20, 100, False, True), 50)
check('forward', solve(50, 10, 20, 100, False, False), 60)
check('reversed', solve(50, 10, 20, 100, True, False), 40)
check('min', solve(30, -50, 20, 100, False, False), 20)
check('max', solve(80, 50, 20, 100, False, False), 100)
check('zero', solve(50, 0, 20, 100, False, False), 50)
check('parameterized resize distance', solve(10*N,N,0,100*N,False,False),11*N)
for repetition in range(N):
    check('repeat zero', solve(50, 0, 20, 100, False, False), 50)
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)

evaluation_group: xi-resize-handle

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

N = 1
observations = []
def solve(size, delta, minimum, maximum, reversed_axis, disabled):
    if False: return size
    change = -delta if reversed_axis else delta
    wanted = size + change
    return max(minimum, min(maximum, wanted))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve(50, 10, 20, 100, False, True), 50)
check('forward', solve(50, 10, 20, 100, False, False), 60)
check('reversed', solve(50, 10, 20, 100, True, False), 40)
check('min', solve(30, -50, 20, 100, False, False), 20)
check('max', solve(80, 50, 20, 100, False, False), 100)
check('zero', solve(50, 0, 20, 100, False, False), 50)
check('parameterized resize distance', solve(10*N,N,0,100*N,False,False),11*N)
for repetition in range(N):
    check('repeat zero', solve(50, 0, 20, 100, False, False), 50)
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:
Disabled resizing unexpectedly collapses the panel.

Disabled handles preserve size; trailing-axis handles reverse delta; add deltas to current size and clamp to min/max.

split: open-access


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

N = 1
observations = []
def solve(size, delta, minimum, maximum, reversed_axis, disabled):
    if disabled: return size
    change = delta
    wanted = size + change
    return max(minimum, min(maximum, wanted))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve(50, 10, 20, 100, False, True), 50)
check('forward', solve(50, 10, 20, 100, False, False), 60)
check('reversed', solve(50, 10, 20, 100, True, False), 40)
check('min', solve(30, -50, 20, 100, False, False), 20)
check('max', solve(80, 50, 20, 100, False, False), 100)
check('zero', solve(50, 0, 20, 100, False, False), 50)
check('parameterized resize distance', solve(10*N,N,0,100*N,False,False),11*N)
for repetition in range(N):
    check('repeat zero', solve(50, 0, 20, 100, False, False), 50)
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)

evaluation_group: xi-resize-handle

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

N = 1
observations = []
def solve(size, delta, minimum, maximum, reversed_axis, disabled):
    if disabled: return size
    change = -delta
    wanted = size + change
    return max(minimum, min(maximum, wanted))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve(50, 10, 20, 100, False, True), 50)
check('forward', solve(50, 10, 20, 100, False, False), 60)
check('reversed', solve(50, 10, 20, 100, True, False), 40)
check('min', solve(30, -50, 20, 100, False, False), 20)
check('max', solve(80, 50, 20, 100, False, False), 100)
check('zero', solve(50, 0, 20, 100, False, False), 50)
check('parameterized resize distance', solve(10*N,N,0,100*N,False,False),11*N)
for repetition in range(N):
    check('repeat zero', solve(50, 0, 20, 100, False, False), 50)
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:
Trailing-edge handles resize in the wrong visual direction.

Disabled handles preserve size; trailing-axis handles reverse delta; add deltas to current size and clamp to min/max.

split: open-access


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

N = 1
observations = []
def solve(size, delta, minimum, maximum, reversed_axis, disabled):
    if disabled: return size
    change = -delta if reversed_axis else delta
    wanted = change
    return max(minimum, min(maximum, wanted))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve(50, 10, 20, 100, False, True), 50)
check('forward', solve(50, 10, 20, 100, False, False), 60)
check('reversed', solve(50, 10, 20, 100, True, False), 40)
check('min', solve(30, -50, 20, 100, False, False), 20)
check('max', solve(80, 50, 20, 100, False, False), 100)
check('zero', solve(50, 0, 20, 100, False, False), 50)
check('parameterized resize distance', solve(10*N,N,0,100*N,False,False),11*N)
for repetition in range(N):
    check('repeat zero', solve(50, 0, 20, 100, False, False), 50)
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)

evaluation_group: xi-resize-handle

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

N = 1
observations = []
def solve(size, delta, minimum, maximum, reversed_axis, disabled):
    if disabled: return size
    change = -delta if reversed_axis else delta
    wanted = size - change
    return max(minimum, min(maximum, wanted))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve(50, 10, 20, 100, False, True), 50)
check('forward', solve(50, 10, 20, 100, False, False), 60)
check('reversed', solve(50, 10, 20, 100, True, False), 40)
check('min', solve(30, -50, 20, 100, False, False), 20)
check('max', solve(80, 50, 20, 100, False, False), 100)
check('zero', solve(50, 0, 20, 100, False, False), 50)
check('parameterized resize distance', solve(10*N,N,0,100*N,False,False),11*N)
for repetition in range(N):
    check('repeat zero', solve(50, 0, 20, 100, False, False), 50)
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:
Resize deltas replace the absolute panel size.

Disabled handles preserve size; trailing-axis handles reverse delta; add deltas to current size and clamp to min/max.

split: open-access


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

N = 1
observations = []
def solve(size, delta, minimum, maximum, reversed_axis, disabled):
    if disabled: return size
    change = -delta if reversed_axis else delta
    wanted = size + change
    return min(maximum, wanted)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve(50, 10, 20, 100, False, True), 50)
check('forward', solve(50, 10, 20, 100, False, False), 60)
check('reversed', solve(50, 10, 20, 100, True, False), 40)
check('min', solve(30, -50, 20, 100, False, False), 20)
check('max', solve(80, 50, 20, 100, False, False), 100)
check('zero', solve(50, 0, 20, 100, False, False), 50)
check('parameterized resize distance', solve(10*N,N,0,100*N,False,False),11*N)
for repetition in range(N):
    check('repeat zero', solve(50, 0, 20, 100, False, False), 50)
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)

evaluation_group: xi-resize-handle

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

N = 1
observations = []
def solve(size, delta, minimum, maximum, reversed_axis, disabled):
    if disabled: return size
    change = -delta if reversed_axis else delta
    wanted = size + change
    return min(minimum, min(maximum, wanted))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve(50, 10, 20, 100, False, True), 50)
check('forward', solve(50, 10, 20, 100, False, False), 60)
check('reversed', solve(50, 10, 20, 100, True, False), 40)
check('min', solve(30, -50, 20, 100, False, False), 20)
check('max', solve(80, 50, 20, 100, False, False), 100)
check('zero', solve(50, 0, 20, 100, False, False), 50)
check('parameterized resize distance', solve(10*N,N,0,100*N,False,False),11*N)
for repetition in range(N):
    check('repeat zero', solve(50, 0, 20, 100, False, False), 50)
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:
Panels shrink below their minimum usable size.

Disabled handles preserve size; trailing-axis handles reverse delta; add deltas to current size and clamp to min/max.

split: open-access


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

N = 1
observations = []
def solve(size, delta, minimum, maximum, reversed_axis, disabled):
    if disabled: return size
    change = -delta if reversed_axis else delta
    wanted = size + change
    return max(minimum, wanted)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve(50, 10, 20, 100, False, True), 50)
check('forward', solve(50, 10, 20, 100, False, False), 60)
check('reversed', solve(50, 10, 20, 100, True, False), 40)
check('min', solve(30, -50, 20, 100, False, False), 20)
check('max', solve(80, 50, 20, 100, False, False), 100)
check('zero', solve(50, 0, 20, 100, False, False), 50)
check('parameterized resize distance', solve(10*N,N,0,100*N,False,False),11*N)
for repetition in range(N):
    check('repeat zero', solve(50, 0, 20, 100, False, False), 50)
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)

evaluation_group: xi-resize-handle

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

N = 1
observations = []
def solve(size, delta, minimum, maximum, reversed_axis, disabled):
    if disabled: return size
    change = -delta if reversed_axis else delta
    wanted = size + change
    return max(minimum, max(maximum, wanted))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve(50, 10, 20, 100, False, True), 50)
check('forward', solve(50, 10, 20, 100, False, False), 60)
check('reversed', solve(50, 10, 20, 100, True, False), 40)
check('min', solve(30, -50, 20, 100, False, False), 20)
check('max', solve(80, 50, 20, 100, False, False), 100)
check('zero', solve(50, 0, 20, 100, False, False), 50)
check('parameterized resize distance', solve(10*N,N,0,100*N,False,False),11*N)
for repetition in range(N):
    check('repeat zero', solve(50, 0, 20, 100, False, False), 50)
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:
Panels expand beyond their maximum size.

Disabled handles preserve size; trailing-axis handles reverse delta; add deltas to current size and clamp to min/max.

split: open-access


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

N = 1
observations = []
def solve(total, divider, requested, minimum_first, minimum_second):
    available = total
    if available < minimum_first + minimum_second:
        first = available * minimum_first / (minimum_first + minimum_second) if minimum_first + minimum_second else 0
    else: first = max(minimum_first, min(requested, available-minimum_second))
    return (first, available-first)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('normal', solve(110, 10, 40, 20, 30), (40, 60))
check('narrow', solve(40, 10, 25, 20, 40), (10, 20))
check('first min', solve(110, 10, 5, 20, 30), (20, 80))
check('second min', solve(110, 10, 95, 20, 30), (70, 30))
check('large request', solve(210, 10, 100, 20, 40), (100, 100))
check('zero', solve(0, 10, 5, 0, 0), (0, 0))
check('parameterized panel extent', solve(11*N,N,4*N,2*N,3*N), (4*N,6*N))
for repetition in range(N):
    check('repeat zero', solve(0, 10, 5, 0, 0), (0, 0))
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)

evaluation_group: xi-split-pane

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

N = 1
observations = []
def solve(total, divider, requested, minimum_first, minimum_second):
    available = max(0, total + divider)
    if available < minimum_first + minimum_second:
        first = available * minimum_first / (minimum_first + minimum_second) if minimum_first + minimum_second else 0
    else: first = max(minimum_first, min(requested, available-minimum_second))
    return (first, available-first)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('normal', solve(110, 10, 40, 20, 30), (40, 60))
check('narrow', solve(40, 10, 25, 20, 40), (10, 20))
check('first min', solve(110, 10, 5, 20, 30), (20, 80))
check('second min', solve(110, 10, 95, 20, 30), (70, 30))
check('large request', solve(210, 10, 100, 20, 40), (100, 100))
check('zero', solve(0, 10, 5, 0, 0), (0, 0))
check('parameterized panel extent', solve(11*N,N,4*N,2*N,3*N), (4*N,6*N))
for repetition in range(N):
    check('repeat zero', solve(0, 10, 5, 0, 0), (0, 0))
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:
Divider width is counted as usable pane area.

Subtract divider from total; honor both minimums when feasible; otherwise share available width in proportion to minima; panes sum to available space.

split: open-access


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

N = 1
observations = []
def solve(total, divider, requested, minimum_first, minimum_second):
    available = max(0, total - divider)
    if False:
        first = available * minimum_first / (minimum_first + minimum_second) if minimum_first + minimum_second else 0
    else: first = max(minimum_first, min(requested, available-minimum_second))
    return (first, available-first)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('normal', solve(110, 10, 40, 20, 30), (40, 60))
check('narrow', solve(40, 10, 25, 20, 40), (10, 20))
check('first min', solve(110, 10, 5, 20, 30), (20, 80))
check('second min', solve(110, 10, 95, 20, 30), (70, 30))
check('large request', solve(210, 10, 100, 20, 40), (100, 100))
check('zero', solve(0, 10, 5, 0, 0), (0, 0))
check('parameterized panel extent', solve(11*N,N,4*N,2*N,3*N), (4*N,6*N))
for repetition in range(N):
    check('repeat zero', solve(0, 10, 5, 0, 0), (0, 0))
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)

evaluation_group: xi-split-pane

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

N = 1
observations = []
def solve(total, divider, requested, minimum_first, minimum_second):
    available = max(0, total - divider)
    if True:
        first = available * minimum_first / (minimum_first + minimum_second) if minimum_first + minimum_second else 0
    else: first = max(minimum_first, min(requested, available-minimum_second))
    return (first, available-first)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('normal', solve(110, 10, 40, 20, 30), (40, 60))
check('narrow', solve(40, 10, 25, 20, 40), (10, 20))
check('first min', solve(110, 10, 5, 20, 30), (20, 80))
check('second min', solve(110, 10, 95, 20, 30), (70, 30))
check('large request', solve(210, 10, 100, 20, 40), (100, 100))
check('zero', solve(0, 10, 5, 0, 0), (0, 0))
check('parameterized panel extent', solve(11*N,N,4*N,2*N,3*N), (4*N,6*N))
for repetition in range(N):
    check('repeat zero', solve(0, 10, 5, 0, 0), (0, 0))
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:
Impossible minimum constraints overflow a narrow container.

Subtract divider from total; honor both minimums when feasible; otherwise share available width in proportion to minima; panes sum to available space.

split: open-access


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

N = 1
observations = []
def solve(total, divider, requested, minimum_first, minimum_second):
    available = max(0, total - divider)
    if available < minimum_first + minimum_second:
        first = available / 2 if minimum_first + minimum_second else 0
    else: first = max(minimum_first, min(requested, available-minimum_second))
    return (first, available-first)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('normal', solve(110, 10, 40, 20, 30), (40, 60))
check('narrow', solve(40, 10, 25, 20, 40), (10, 20))
check('first min', solve(110, 10, 5, 20, 30), (20, 80))
check('second min', solve(110, 10, 95, 20, 30), (70, 30))
check('large request', solve(210, 10, 100, 20, 40), (100, 100))
check('zero', solve(0, 10, 5, 0, 0), (0, 0))
check('parameterized panel extent', solve(11*N,N,4*N,2*N,3*N), (4*N,6*N))
for repetition in range(N):
    check('repeat zero', solve(0, 10, 5, 0, 0), (0, 0))
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)

evaluation_group: xi-split-pane

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

N = 1
observations = []
def solve(total, divider, requested, minimum_first, minimum_second):
    available = max(0, total - divider)
    if available < minimum_first + minimum_second:
        first = available * minimum_second / (minimum_first + minimum_second) if minimum_first + minimum_second else 0
    else: first = max(minimum_first, min(requested, available-minimum_second))
    return (first, available-first)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('normal', solve(110, 10, 40, 20, 30), (40, 60))
check('narrow', solve(40, 10, 25, 20, 40), (10, 20))
check('first min', solve(110, 10, 5, 20, 30), (20, 80))
check('second min', solve(110, 10, 95, 20, 30), (70, 30))
check('large request', solve(210, 10, 100, 20, 40), (100, 100))
check('zero', solve(0, 10, 5, 0, 0), (0, 0))
check('parameterized panel extent', solve(11*N,N,4*N,2*N,3*N), (4*N,6*N))
for repetition in range(N):
    check('repeat zero', solve(0, 10, 5, 0, 0), (0, 0))
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:
Compressed panes ignore their relative minimum sizes.

Subtract divider from total; honor both minimums when feasible; otherwise share available width in proportion to minima; panes sum to available space.

split: open-access


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

N = 1
observations = []
def solve(total, divider, requested, minimum_first, minimum_second):
    available = max(0, total - divider)
    if available < minimum_first + minimum_second:
        first = available * minimum_first / (minimum_first + minimum_second) if minimum_first + minimum_second else 0
    else: first = min(requested, available-minimum_second)
    return (first, available-first)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('normal', solve(110, 10, 40, 20, 30), (40, 60))
check('narrow', solve(40, 10, 25, 20, 40), (10, 20))
check('first min', solve(110, 10, 5, 20, 30), (20, 80))
check('second min', solve(110, 10, 95, 20, 30), (70, 30))
check('large request', solve(210, 10, 100, 20, 40), (100, 100))
check('zero', solve(0, 10, 5, 0, 0), (0, 0))
check('parameterized panel extent', solve(11*N,N,4*N,2*N,3*N), (4*N,6*N))
for repetition in range(N):
    check('repeat zero', solve(0, 10, 5, 0, 0), (0, 0))
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)

evaluation_group: xi-split-pane

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

N = 1
observations = []
def solve(total, divider, requested, minimum_first, minimum_second):
    available = max(0, total - divider)
    if available < minimum_first + minimum_second:
        first = available * minimum_first / (minimum_first + minimum_second) if minimum_first + minimum_second else 0
    else: first = min(minimum_first, min(requested, available-minimum_second))
    return (first, available-first)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('normal', solve(110, 10, 40, 20, 30), (40, 60))
check('narrow', solve(40, 10, 25, 20, 40), (10, 20))
check('first min', solve(110, 10, 5, 20, 30), (20, 80))
check('second min', solve(110, 10, 95, 20, 30), (70, 30))
check('large request', solve(210, 10, 100, 20, 40), (100, 100))
check('zero', solve(0, 10, 5, 0, 0), (0, 0))
check('parameterized panel extent', solve(11*N,N,4*N,2*N,3*N), (4*N,6*N))
for repetition in range(N):
    check('repeat zero', solve(0, 10, 5, 0, 0), (0, 0))
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 first pane shrinks below its minimum.

Subtract divider from total; honor both minimums when feasible; otherwise share available width in proportion to minima; panes sum to available space.

split: open-access


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

N = 1
observations = []
def solve(total, divider, requested, minimum_first, minimum_second):
    available = max(0, total - divider)
    if available < minimum_first + minimum_second:
        first = available * minimum_first / (minimum_first + minimum_second) if minimum_first + minimum_second else 0
    else: first = max(minimum_first, min(requested, available))
    return (first, available-first)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('normal', solve(110, 10, 40, 20, 30), (40, 60))
check('narrow', solve(40, 10, 25, 20, 40), (10, 20))
check('first min', solve(110, 10, 5, 20, 30), (20, 80))
check('second min', solve(110, 10, 95, 20, 30), (70, 30))
check('large request', solve(210, 10, 100, 20, 40), (100, 100))
check('zero', solve(0, 10, 5, 0, 0), (0, 0))
check('parameterized panel extent', solve(11*N,N,4*N,2*N,3*N), (4*N,6*N))
for repetition in range(N):
    check('repeat zero', solve(0, 10, 5, 0, 0), (0, 0))
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)

evaluation_group: xi-split-pane

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

N = 1
observations = []
def solve(total, divider, requested, minimum_first, minimum_second):
    available = max(0, total - divider)
    if available < minimum_first + minimum_second:
        first = available * minimum_first / (minimum_first + minimum_second) if minimum_first + minimum_second else 0
    else: first = max(minimum_first, min(requested, available-minimum_first))
    return (first, available-first)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('normal', solve(110, 10, 40, 20, 30), (40, 60))
check('narrow', solve(40, 10, 25, 20, 40), (10, 20))
check('first min', solve(110, 10, 5, 20, 30), (20, 80))
check('second min', solve(110, 10, 95, 20, 30), (70, 30))
check('large request', solve(210, 10, 100, 20, 40), (100, 100))
check('zero', solve(0, 10, 5, 0, 0), (0, 0))
check('parameterized panel extent', solve(11*N,N,4*N,2*N,3*N), (4*N,6*N))
for repetition in range(N):
    check('repeat zero', solve(0, 10, 5, 0, 0), (0, 0))
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 first pane consumes space reserved for the second minimum.

Subtract divider from total; honor both minimums when feasible; otherwise share available width in proportion to minima; panes sum to available space.

split: open-access