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

N = 1
observations = []
def solve(normal, scroll, inset, height, container_end):
    natural = normal
    sticky = max(natural, inset)
    limit = container_end - scroll - height
    position = min(sticky, limit)
    return (position, position != natural)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('natural', solve(50, 10, 5, 20, 200), (40, False))
check('pinned', solve(50, 60, 5, 20, 200), (5, True))
check('container exits', solve(50, 180, 5, 20, 200), (0, True))
check('inset', solve(30, 40, 12, 10, 100), (12, True))
check('at natural', solve(50, 45, 5, 20, 200), (5, False))
check('parameterized sticky geometry', solve(5*N,6*N,N,2*N,20*N), (N,True))
for repetition in range(N):
    check('repeat at natural', solve(50, 45, 5, 20, 200), (5, 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-sticky-header

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

N = 1
observations = []
def solve(normal, scroll, inset, height, container_end):
    natural = normal + scroll
    sticky = max(natural, inset)
    limit = container_end - scroll - height
    position = min(sticky, limit)
    return (position, position != natural)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('natural', solve(50, 10, 5, 20, 200), (40, False))
check('pinned', solve(50, 60, 5, 20, 200), (5, True))
check('container exits', solve(50, 180, 5, 20, 200), (0, True))
check('inset', solve(30, 40, 12, 10, 100), (12, True))
check('at natural', solve(50, 45, 5, 20, 200), (5, False))
check('parameterized sticky geometry', solve(5*N,6*N,N,2*N,20*N), (N,True))
for repetition in range(N):
    check('repeat at natural', solve(50, 45, 5, 20, 200), (5, 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:
Sticky position ignores scroll displacement.

Convert normal and container positions to viewport coordinates; pin at inset until the containing block bottom, accounting for element height; report whether position differs from natural flow.

split: open-access


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

N = 1
observations = []
def solve(normal, scroll, inset, height, container_end):
    natural = normal - scroll
    sticky = max(natural, 0)
    limit = container_end - scroll - height
    position = min(sticky, limit)
    return (position, position != natural)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('natural', solve(50, 10, 5, 20, 200), (40, False))
check('pinned', solve(50, 60, 5, 20, 200), (5, True))
check('container exits', solve(50, 180, 5, 20, 200), (0, True))
check('inset', solve(30, 40, 12, 10, 100), (12, True))
check('at natural', solve(50, 45, 5, 20, 200), (5, False))
check('parameterized sticky geometry', solve(5*N,6*N,N,2*N,20*N), (N,True))
for repetition in range(N):
    check('repeat at natural', solve(50, 45, 5, 20, 200), (5, 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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

evaluation_group: xi-sticky-header

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

N = 1
observations = []
def solve(normal, scroll, inset, height, container_end):
    natural = normal - scroll
    sticky = min(natural, inset)
    limit = container_end - scroll - height
    position = min(sticky, limit)
    return (position, position != natural)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('natural', solve(50, 10, 5, 20, 200), (40, False))
check('pinned', solve(50, 60, 5, 20, 200), (5, True))
check('container exits', solve(50, 180, 5, 20, 200), (0, True))
check('inset', solve(30, 40, 12, 10, 100), (12, True))
check('at natural', solve(50, 45, 5, 20, 200), (5, False))
check('parameterized sticky geometry', solve(5*N,6*N,N,2*N,20*N), (N,True))
for repetition in range(N):
    check('repeat at natural', solve(50, 45, 5, 20, 200), (5, 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:
Sticky elements attach to zero instead of the configured inset.

Convert normal and container positions to viewport coordinates; pin at inset until the containing block bottom, accounting for element height; report whether position differs from natural flow.

split: open-access


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

N = 1
observations = []
def solve(normal, scroll, inset, height, container_end):
    natural = normal - scroll
    sticky = max(natural, inset)
    limit = container_end - height
    position = min(sticky, limit)
    return (position, position != natural)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('natural', solve(50, 10, 5, 20, 200), (40, False))
check('pinned', solve(50, 60, 5, 20, 200), (5, True))
check('container exits', solve(50, 180, 5, 20, 200), (0, True))
check('inset', solve(30, 40, 12, 10, 100), (12, True))
check('at natural', solve(50, 45, 5, 20, 200), (5, False))
check('parameterized sticky geometry', solve(5*N,6*N,N,2*N,20*N), (N,True))
for repetition in range(N):
    check('repeat at natural', solve(50, 45, 5, 20, 200), (5, 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-sticky-header

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

N = 1
observations = []
def solve(normal, scroll, inset, height, container_end):
    natural = normal - scroll
    sticky = max(natural, inset)
    limit = container_end + scroll - height
    position = min(sticky, limit)
    return (position, position != natural)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('natural', solve(50, 10, 5, 20, 200), (40, False))
check('pinned', solve(50, 60, 5, 20, 200), (5, True))
check('container exits', solve(50, 180, 5, 20, 200), (0, True))
check('inset', solve(30, 40, 12, 10, 100), (12, True))
check('at natural', solve(50, 45, 5, 20, 200), (5, False))
check('parameterized sticky geometry', solve(5*N,6*N,N,2*N,20*N), (N,True))
for repetition in range(N):
    check('repeat at natural', solve(50, 45, 5, 20, 200), (5, 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:
Sticky limits stay in document coordinates.

Convert normal and container positions to viewport coordinates; pin at inset until the containing block bottom, accounting for element height; report whether position differs from natural flow.

split: open-access


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

N = 1
observations = []
def solve(normal, scroll, inset, height, container_end):
    natural = normal - scroll
    sticky = max(natural, inset)
    limit = container_end - scroll
    position = min(sticky, limit)
    return (position, position != natural)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('natural', solve(50, 10, 5, 20, 200), (40, False))
check('pinned', solve(50, 60, 5, 20, 200), (5, True))
check('container exits', solve(50, 180, 5, 20, 200), (0, True))
check('inset', solve(30, 40, 12, 10, 100), (12, True))
check('at natural', solve(50, 45, 5, 20, 200), (5, False))
check('parameterized sticky geometry', solve(5*N,6*N,N,2*N,20*N), (N,True))
for repetition in range(N):
    check('repeat at natural', solve(50, 45, 5, 20, 200), (5, 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-sticky-header

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

N = 1
observations = []
def solve(normal, scroll, inset, height, container_end):
    natural = normal - scroll
    sticky = max(natural, inset)
    limit = container_end - scroll + height
    position = min(sticky, limit)
    return (position, position != natural)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('natural', solve(50, 10, 5, 20, 200), (40, False))
check('pinned', solve(50, 60, 5, 20, 200), (5, True))
check('container exits', solve(50, 180, 5, 20, 200), (0, True))
check('inset', solve(30, 40, 12, 10, 100), (12, True))
check('at natural', solve(50, 45, 5, 20, 200), (5, False))
check('parameterized sticky geometry', solve(5*N,6*N,N,2*N,20*N), (N,True))
for repetition in range(N):
    check('repeat at natural', solve(50, 45, 5, 20, 200), (5, 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:
The sticky element extends beyond its containing block.

Convert normal and container positions to viewport coordinates; pin at inset until the containing block bottom, accounting for element height; report whether position differs from natural flow.

split: open-access


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

N = 1
observations = []
def solve(normal, scroll, inset, height, container_end):
    natural = normal - scroll
    sticky = max(natural, inset)
    limit = container_end - scroll - height
    position = sticky
    return (position, position != natural)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('natural', solve(50, 10, 5, 20, 200), (40, False))
check('pinned', solve(50, 60, 5, 20, 200), (5, True))
check('container exits', solve(50, 180, 5, 20, 200), (0, True))
check('inset', solve(30, 40, 12, 10, 100), (12, True))
check('at natural', solve(50, 45, 5, 20, 200), (5, False))
check('parameterized sticky geometry', solve(5*N,6*N,N,2*N,20*N), (N,True))
for repetition in range(N):
    check('repeat at natural', solve(50, 45, 5, 20, 200), (5, 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-sticky-header

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

N = 1
observations = []
def solve(normal, scroll, inset, height, container_end):
    natural = normal - scroll
    sticky = max(natural, inset)
    limit = container_end - scroll - height
    position = max(sticky, limit)
    return (position, position != natural)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('natural', solve(50, 10, 5, 20, 200), (40, False))
check('pinned', solve(50, 60, 5, 20, 200), (5, True))
check('container exits', solve(50, 180, 5, 20, 200), (0, True))
check('inset', solve(30, 40, 12, 10, 100), (12, True))
check('at natural', solve(50, 45, 5, 20, 200), (5, False))
check('parameterized sticky geometry', solve(5*N,6*N,N,2*N,20*N), (N,True))
for repetition in range(N):
    check('repeat at natural', solve(50, 45, 5, 20, 200), (5, 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:
Sticky elements remain pinned after their container ends.

Convert normal and container positions to viewport coordinates; pin at inset until the containing block bottom, accounting for element height; report whether position differs from natural flow.

split: open-access


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

N = 1
observations = []
def solve(options, selected, target, required, disabled, event):
    if event == 'remove':
        options = [x for x in options if x == target]
        if selected not in options: selected = options[0] if required and options else None
    elif event == 'activate':
        if target in options and target not in disabled: selected = target
    elif event == 'clear' and not required: selected = None
    return (options, selected)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remove other', solve(['a','b','c'], 'a', 'b', False, [], 'remove'), (['a', 'c'], 'a'))
check('required removal', solve(['a','b','c'], 'a', 'a', True, [], 'remove'), (['b', 'c'], 'b'))
check('unknown', solve(['a','b'], 'a', 'x', False, [], 'activate'), (['a', 'b'], 'a'))
check('disabled', solve(['a','b'], 'a', 'b', False, ['b'], 'activate'), (['a', 'b'], 'a'))
check('required clear', solve(['a','b'], 'a', None, True, [], 'clear'), (['a', 'b'], 'a'))
check('optional clear', solve(['a','b'], 'a', None, False, [], 'clear'), (['a', 'b'], None))
check('activate', solve(['a','b'], 'a', 'b', False, [], 'activate'), (['a', 'b'], 'b'))
check('reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
check('parameterized radio options', solve(list(range(N+1)),0,N,False,[],'activate'), (list(range(N+1)),N))
for repetition in range(N):
    check('repeat reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
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-radio-group

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

N = 1
observations = []
def solve(options, selected, target, required, disabled, event):
    if event == 'remove':
        options = [x for x in options if False]
        if selected not in options: selected = options[0] if required and options else None
    elif event == 'activate':
        if target in options and target not in disabled: selected = target
    elif event == 'clear' and not required: selected = None
    return (options, selected)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remove other', solve(['a','b','c'], 'a', 'b', False, [], 'remove'), (['a', 'c'], 'a'))
check('required removal', solve(['a','b','c'], 'a', 'a', True, [], 'remove'), (['b', 'c'], 'b'))
check('unknown', solve(['a','b'], 'a', 'x', False, [], 'activate'), (['a', 'b'], 'a'))
check('disabled', solve(['a','b'], 'a', 'b', False, ['b'], 'activate'), (['a', 'b'], 'a'))
check('required clear', solve(['a','b'], 'a', None, True, [], 'clear'), (['a', 'b'], 'a'))
check('optional clear', solve(['a','b'], 'a', None, False, [], 'clear'), (['a', 'b'], None))
check('activate', solve(['a','b'], 'a', 'b', False, [], 'activate'), (['a', 'b'], 'b'))
check('reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
check('parameterized radio options', solve(list(range(N+1)),0,N,False,[],'activate'), (list(range(N+1)),N))
for repetition in range(N):
    check('repeat reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
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:
Removing an option retains it and removes its siblings.

Radio activation replaces selection with an existing enabled option and never toggles it off; required groups cannot clear; selected removal uses first remaining option only when required.

split: open-access


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

N = 1
observations = []
def solve(options, selected, target, required, disabled, event):
    if event == 'remove':
        options = [x for x in options if x != target]
        if selected not in options: selected = None
    elif event == 'activate':
        if target in options and target not in disabled: selected = target
    elif event == 'clear' and not required: selected = None
    return (options, selected)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remove other', solve(['a','b','c'], 'a', 'b', False, [], 'remove'), (['a', 'c'], 'a'))
check('required removal', solve(['a','b','c'], 'a', 'a', True, [], 'remove'), (['b', 'c'], 'b'))
check('unknown', solve(['a','b'], 'a', 'x', False, [], 'activate'), (['a', 'b'], 'a'))
check('disabled', solve(['a','b'], 'a', 'b', False, ['b'], 'activate'), (['a', 'b'], 'a'))
check('required clear', solve(['a','b'], 'a', None, True, [], 'clear'), (['a', 'b'], 'a'))
check('optional clear', solve(['a','b'], 'a', None, False, [], 'clear'), (['a', 'b'], None))
check('activate', solve(['a','b'], 'a', 'b', False, [], 'activate'), (['a', 'b'], 'b'))
check('reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
check('parameterized radio options', solve(list(range(N+1)),0,N,False,[],'activate'), (list(range(N+1)),N))
for repetition in range(N):
    check('repeat reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
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-radio-group

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

N = 1
observations = []
def solve(options, selected, target, required, disabled, event):
    if event == 'remove':
        options = [x for x in options if x != target]
        if selected not in options: selected = options[-1] if required and options else None
    elif event == 'activate':
        if target in options and target not in disabled: selected = target
    elif event == 'clear' and not required: selected = None
    return (options, selected)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remove other', solve(['a','b','c'], 'a', 'b', False, [], 'remove'), (['a', 'c'], 'a'))
check('required removal', solve(['a','b','c'], 'a', 'a', True, [], 'remove'), (['b', 'c'], 'b'))
check('unknown', solve(['a','b'], 'a', 'x', False, [], 'activate'), (['a', 'b'], 'a'))
check('disabled', solve(['a','b'], 'a', 'b', False, ['b'], 'activate'), (['a', 'b'], 'a'))
check('required clear', solve(['a','b'], 'a', None, True, [], 'clear'), (['a', 'b'], 'a'))
check('optional clear', solve(['a','b'], 'a', None, False, [], 'clear'), (['a', 'b'], None))
check('activate', solve(['a','b'], 'a', 'b', False, [], 'activate'), (['a', 'b'], 'b'))
check('reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
check('parameterized radio options', solve(list(range(N+1)),0,N,False,[],'activate'), (list(range(N+1)),N))
for repetition in range(N):
    check('repeat reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
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:
Removing the selected required option leaves the group unselected.

Radio activation replaces selection with an existing enabled option and never toggles it off; required groups cannot clear; selected removal uses first remaining option only when required.

split: open-access


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

N = 1
observations = []
def solve(options, selected, target, required, disabled, event):
    if event == 'remove':
        options = [x for x in options if x != target]
        if selected not in options: selected = options[0] if required and options else None
    elif event == 'activate':
        if target not in disabled: selected = target
    elif event == 'clear' and not required: selected = None
    return (options, selected)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remove other', solve(['a','b','c'], 'a', 'b', False, [], 'remove'), (['a', 'c'], 'a'))
check('required removal', solve(['a','b','c'], 'a', 'a', True, [], 'remove'), (['b', 'c'], 'b'))
check('unknown', solve(['a','b'], 'a', 'x', False, [], 'activate'), (['a', 'b'], 'a'))
check('disabled', solve(['a','b'], 'a', 'b', False, ['b'], 'activate'), (['a', 'b'], 'a'))
check('required clear', solve(['a','b'], 'a', None, True, [], 'clear'), (['a', 'b'], 'a'))
check('optional clear', solve(['a','b'], 'a', None, False, [], 'clear'), (['a', 'b'], None))
check('activate', solve(['a','b'], 'a', 'b', False, [], 'activate'), (['a', 'b'], 'b'))
check('reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
check('parameterized radio options', solve(list(range(N+1)),0,N,False,[],'activate'), (list(range(N+1)),N))
for repetition in range(N):
    check('repeat reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
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-radio-group

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

N = 1
observations = []
def solve(options, selected, target, required, disabled, event):
    if event == 'remove':
        options = [x for x in options if x != target]
        if selected not in options: selected = options[0] if required and options else None
    elif event == 'activate':
        if target in options: selected = target
    elif event == 'clear' and not required: selected = None
    return (options, selected)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remove other', solve(['a','b','c'], 'a', 'b', False, [], 'remove'), (['a', 'c'], 'a'))
check('required removal', solve(['a','b','c'], 'a', 'a', True, [], 'remove'), (['b', 'c'], 'b'))
check('unknown', solve(['a','b'], 'a', 'x', False, [], 'activate'), (['a', 'b'], 'a'))
check('disabled', solve(['a','b'], 'a', 'b', False, ['b'], 'activate'), (['a', 'b'], 'a'))
check('required clear', solve(['a','b'], 'a', None, True, [], 'clear'), (['a', 'b'], 'a'))
check('optional clear', solve(['a','b'], 'a', None, False, [], 'clear'), (['a', 'b'], None))
check('activate', solve(['a','b'], 'a', 'b', False, [], 'activate'), (['a', 'b'], 'b'))
check('reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
check('parameterized radio options', solve(list(range(N+1)),0,N,False,[],'activate'), (list(range(N+1)),N))
for repetition in range(N):
    check('repeat reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
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:
An unknown radio identity becomes selected.

Radio activation replaces selection with an existing enabled option and never toggles it off; required groups cannot clear; selected removal uses first remaining option only when required.

split: open-access


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

N = 1
observations = []
def solve(options, selected, target, required, disabled, event):
    if event == 'remove':
        options = [x for x in options if x != target]
        if selected not in options: selected = options[0] if required and options else None
    elif event == 'activate':
        if target in options and target not in disabled: selected = target
    elif event == 'clear': selected = None
    return (options, selected)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remove other', solve(['a','b','c'], 'a', 'b', False, [], 'remove'), (['a', 'c'], 'a'))
check('required removal', solve(['a','b','c'], 'a', 'a', True, [], 'remove'), (['b', 'c'], 'b'))
check('unknown', solve(['a','b'], 'a', 'x', False, [], 'activate'), (['a', 'b'], 'a'))
check('disabled', solve(['a','b'], 'a', 'b', False, ['b'], 'activate'), (['a', 'b'], 'a'))
check('required clear', solve(['a','b'], 'a', None, True, [], 'clear'), (['a', 'b'], 'a'))
check('optional clear', solve(['a','b'], 'a', None, False, [], 'clear'), (['a', 'b'], None))
check('activate', solve(['a','b'], 'a', 'b', False, [], 'activate'), (['a', 'b'], 'b'))
check('reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
check('parameterized radio options', solve(list(range(N+1)),0,N,False,[],'activate'), (list(range(N+1)),N))
for repetition in range(N):
    check('repeat reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
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-radio-group

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

N = 1
observations = []
def solve(options, selected, target, required, disabled, event):
    if event == 'remove':
        options = [x for x in options if x != target]
        if selected not in options: selected = options[0] if required and options else None
    elif event == 'activate':
        if target in options and target not in disabled: selected = target
    elif event == 'clear' and required: selected = None
    return (options, selected)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remove other', solve(['a','b','c'], 'a', 'b', False, [], 'remove'), (['a', 'c'], 'a'))
check('required removal', solve(['a','b','c'], 'a', 'a', True, [], 'remove'), (['b', 'c'], 'b'))
check('unknown', solve(['a','b'], 'a', 'x', False, [], 'activate'), (['a', 'b'], 'a'))
check('disabled', solve(['a','b'], 'a', 'b', False, ['b'], 'activate'), (['a', 'b'], 'a'))
check('required clear', solve(['a','b'], 'a', None, True, [], 'clear'), (['a', 'b'], 'a'))
check('optional clear', solve(['a','b'], 'a', None, False, [], 'clear'), (['a', 'b'], None))
check('activate', solve(['a','b'], 'a', 'b', False, [], 'activate'), (['a', 'b'], 'b'))
check('reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
check('parameterized radio options', solve(list(range(N+1)),0,N,False,[],'activate'), (list(range(N+1)),N))
for repetition in range(N):
    check('repeat reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
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 removes the selection from a required group.

Radio activation replaces selection with an existing enabled option and never toggles it off; required groups cannot clear; selected removal uses first remaining option only when required.

split: open-access


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

N = 1
observations = []
def solve(options, selected, target, required, disabled, event):
    if event == 'remove':
        options = [x for x in options if x != target]
        if selected not in options: selected = options[0] if required and options else None
    elif event == 'activate':
        if target in options and target not in disabled: selected = selected
    elif event == 'clear' and not required: selected = None
    return (options, selected)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remove other', solve(['a','b','c'], 'a', 'b', False, [], 'remove'), (['a', 'c'], 'a'))
check('required removal', solve(['a','b','c'], 'a', 'a', True, [], 'remove'), (['b', 'c'], 'b'))
check('unknown', solve(['a','b'], 'a', 'x', False, [], 'activate'), (['a', 'b'], 'a'))
check('disabled', solve(['a','b'], 'a', 'b', False, ['b'], 'activate'), (['a', 'b'], 'a'))
check('required clear', solve(['a','b'], 'a', None, True, [], 'clear'), (['a', 'b'], 'a'))
check('optional clear', solve(['a','b'], 'a', None, False, [], 'clear'), (['a', 'b'], None))
check('activate', solve(['a','b'], 'a', 'b', False, [], 'activate'), (['a', 'b'], 'b'))
check('reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
check('parameterized radio options', solve(list(range(N+1)),0,N,False,[],'activate'), (list(range(N+1)),N))
for repetition in range(N):
    check('repeat reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
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-radio-group

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

N = 1
observations = []
def solve(options, selected, target, required, disabled, event):
    if event == 'remove':
        options = [x for x in options if x != target]
        if selected not in options: selected = options[0] if required and options else None
    elif event == 'activate':
        if target in options and target not in disabled: selected = None if selected == target else target
    elif event == 'clear' and not required: selected = None
    return (options, selected)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remove other', solve(['a','b','c'], 'a', 'b', False, [], 'remove'), (['a', 'c'], 'a'))
check('required removal', solve(['a','b','c'], 'a', 'a', True, [], 'remove'), (['b', 'c'], 'b'))
check('unknown', solve(['a','b'], 'a', 'x', False, [], 'activate'), (['a', 'b'], 'a'))
check('disabled', solve(['a','b'], 'a', 'b', False, ['b'], 'activate'), (['a', 'b'], 'a'))
check('required clear', solve(['a','b'], 'a', None, True, [], 'clear'), (['a', 'b'], 'a'))
check('optional clear', solve(['a','b'], 'a', None, False, [], 'clear'), (['a', 'b'], None))
check('activate', solve(['a','b'], 'a', 'b', False, [], 'activate'), (['a', 'b'], 'b'))
check('reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
check('parameterized radio options', solve(list(range(N+1)),0,N,False,[],'activate'), (list(range(N+1)),N))
for repetition in range(N):
    check('repeat reactivate', solve(['a','b'], 'a', 'a', False, [], 'activate'), (['a', 'b'], 'a'))
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:
Activating a different radio fails to change selection.

Radio activation replaces selection with an existing enabled option and never toggles it off; required groups cannot clear; selected removal uses first remaining option only when required.

split: open-access


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

N = 1
observations = []
def solve(prop, local, default, event, incoming, mounted):
    controlled = bool(prop)
    if not mounted: local = default
    if event == 'input':
        if not controlled: local = incoming
        notification = incoming
    else: notification = None
    if event == 'reset' and not controlled: local = default
    visible = prop if controlled else local
    return (visible, local, notification)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty controlled', solve('', 'draft', 'default', 'none', None, True), ('', 'draft', None))
check('mounted', solve(None, 'edited', 'default', 'none', None, True), ('edited', 'edited', None))
check('mount', solve(None, None, 'default', 'none', None, False), ('default', 'default', None))
check('controlled event', solve('old', 'local', 'default', 'input', 'new', True), ('old', 'local', 'new'))
check('uncontrolled event', solve(None, 'local', 'default', 'input', 'new', True), ('new', 'new', 'new'))
check('controlled reset', solve('old', 'local', 'default', 'reset', None, True), ('old', 'local', None))
check('uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
check('parameterized proposed value', solve('old','local','default','input',str(N),True), ('old','local',str(N)))
for repetition in range(N):
    check('repeat uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
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-controlled-input

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

N = 1
observations = []
def solve(prop, local, default, event, incoming, mounted):
    controlled = prop != ""
    if not mounted: local = default
    if event == 'input':
        if not controlled: local = incoming
        notification = incoming
    else: notification = None
    if event == 'reset' and not controlled: local = default
    visible = prop if controlled else local
    return (visible, local, notification)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty controlled', solve('', 'draft', 'default', 'none', None, True), ('', 'draft', None))
check('mounted', solve(None, 'edited', 'default', 'none', None, True), ('edited', 'edited', None))
check('mount', solve(None, None, 'default', 'none', None, False), ('default', 'default', None))
check('controlled event', solve('old', 'local', 'default', 'input', 'new', True), ('old', 'local', 'new'))
check('uncontrolled event', solve(None, 'local', 'default', 'input', 'new', True), ('new', 'new', 'new'))
check('controlled reset', solve('old', 'local', 'default', 'reset', None, True), ('old', 'local', None))
check('uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
check('parameterized proposed value', solve('old','local','default','input',str(N),True), ('old','local',str(N)))
for repetition in range(N):
    check('repeat uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
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:
Empty controlled values are mistaken for uncontrolled state.

None alone signals uncontrolled; defaults initialize only on mount/reset; controlled values stay prop-owned while proposed changes are emitted; uncontrolled changes update local state.

split: open-access


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

N = 1
observations = []
def solve(prop, local, default, event, incoming, mounted):
    controlled = prop is not None
    if True: local = default
    if event == 'input':
        if not controlled: local = incoming
        notification = incoming
    else: notification = None
    if event == 'reset' and not controlled: local = default
    visible = prop if controlled else local
    return (visible, local, notification)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty controlled', solve('', 'draft', 'default', 'none', None, True), ('', 'draft', None))
check('mounted', solve(None, 'edited', 'default', 'none', None, True), ('edited', 'edited', None))
check('mount', solve(None, None, 'default', 'none', None, False), ('default', 'default', None))
check('controlled event', solve('old', 'local', 'default', 'input', 'new', True), ('old', 'local', 'new'))
check('uncontrolled event', solve(None, 'local', 'default', 'input', 'new', True), ('new', 'new', 'new'))
check('controlled reset', solve('old', 'local', 'default', 'reset', None, True), ('old', 'local', None))
check('uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
check('parameterized proposed value', solve('old','local','default','input',str(N),True), ('old','local',str(N)))
for repetition in range(N):
    check('repeat uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
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-controlled-input

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

N = 1
observations = []
def solve(prop, local, default, event, incoming, mounted):
    controlled = prop is not None
    if False: local = default
    if event == 'input':
        if not controlled: local = incoming
        notification = incoming
    else: notification = None
    if event == 'reset' and not controlled: local = default
    visible = prop if controlled else local
    return (visible, local, notification)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty controlled', solve('', 'draft', 'default', 'none', None, True), ('', 'draft', None))
check('mounted', solve(None, 'edited', 'default', 'none', None, True), ('edited', 'edited', None))
check('mount', solve(None, None, 'default', 'none', None, False), ('default', 'default', None))
check('controlled event', solve('old', 'local', 'default', 'input', 'new', True), ('old', 'local', 'new'))
check('uncontrolled event', solve(None, 'local', 'default', 'input', 'new', True), ('new', 'new', 'new'))
check('controlled reset', solve('old', 'local', 'default', 'reset', None, True), ('old', 'local', None))
check('uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
check('parameterized proposed value', solve('old','local','default','input',str(N),True), ('old','local',str(N)))
for repetition in range(N):
    check('repeat uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
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:
Default values overwrite user edits on each render.

None alone signals uncontrolled; defaults initialize only on mount/reset; controlled values stay prop-owned while proposed changes are emitted; uncontrolled changes update local state.

split: open-access


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

N = 1
observations = []
def solve(prop, local, default, event, incoming, mounted):
    controlled = prop is not None
    if not mounted: local = default
    if event == 'input':
        if True: local = incoming
        notification = incoming
    else: notification = None
    if event == 'reset' and not controlled: local = default
    visible = prop if controlled else local
    return (visible, local, notification)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty controlled', solve('', 'draft', 'default', 'none', None, True), ('', 'draft', None))
check('mounted', solve(None, 'edited', 'default', 'none', None, True), ('edited', 'edited', None))
check('mount', solve(None, None, 'default', 'none', None, False), ('default', 'default', None))
check('controlled event', solve('old', 'local', 'default', 'input', 'new', True), ('old', 'local', 'new'))
check('uncontrolled event', solve(None, 'local', 'default', 'input', 'new', True), ('new', 'new', 'new'))
check('controlled reset', solve('old', 'local', 'default', 'reset', None, True), ('old', 'local', None))
check('uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
check('parameterized proposed value', solve('old','local','default','input',str(N),True), ('old','local',str(N)))
for repetition in range(N):
    check('repeat uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
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-controlled-input

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

N = 1
observations = []
def solve(prop, local, default, event, incoming, mounted):
    controlled = prop is not None
    if not mounted: local = default
    if event == 'input':
        if controlled: local = incoming
        notification = incoming
    else: notification = None
    if event == 'reset' and not controlled: local = default
    visible = prop if controlled else local
    return (visible, local, notification)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty controlled', solve('', 'draft', 'default', 'none', None, True), ('', 'draft', None))
check('mounted', solve(None, 'edited', 'default', 'none', None, True), ('edited', 'edited', None))
check('mount', solve(None, None, 'default', 'none', None, False), ('default', 'default', None))
check('controlled event', solve('old', 'local', 'default', 'input', 'new', True), ('old', 'local', 'new'))
check('uncontrolled event', solve(None, 'local', 'default', 'input', 'new', True), ('new', 'new', 'new'))
check('controlled reset', solve('old', 'local', 'default', 'reset', None, True), ('old', 'local', None))
check('uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
check('parameterized proposed value', solve('old','local','default','input',str(N),True), ('old','local',str(N)))
for repetition in range(N):
    check('repeat uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
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:
Controlled input events mutate internal draft state.

None alone signals uncontrolled; defaults initialize only on mount/reset; controlled values stay prop-owned while proposed changes are emitted; uncontrolled changes update local state.

split: open-access


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

N = 1
observations = []
def solve(prop, local, default, event, incoming, mounted):
    controlled = prop is not None
    if not mounted: local = default
    if event == 'input':
        if not controlled: local = incoming
        notification = prop
    else: notification = None
    if event == 'reset' and not controlled: local = default
    visible = prop if controlled else local
    return (visible, local, notification)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty controlled', solve('', 'draft', 'default', 'none', None, True), ('', 'draft', None))
check('mounted', solve(None, 'edited', 'default', 'none', None, True), ('edited', 'edited', None))
check('mount', solve(None, None, 'default', 'none', None, False), ('default', 'default', None))
check('controlled event', solve('old', 'local', 'default', 'input', 'new', True), ('old', 'local', 'new'))
check('uncontrolled event', solve(None, 'local', 'default', 'input', 'new', True), ('new', 'new', 'new'))
check('controlled reset', solve('old', 'local', 'default', 'reset', None, True), ('old', 'local', None))
check('uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
check('parameterized proposed value', solve('old','local','default','input',str(N),True), ('old','local',str(N)))
for repetition in range(N):
    check('repeat uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
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-controlled-input

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

N = 1
observations = []
def solve(prop, local, default, event, incoming, mounted):
    controlled = prop is not None
    if not mounted: local = default
    if event == 'input':
        if not controlled: local = incoming
        notification = local
    else: notification = None
    if event == 'reset' and not controlled: local = default
    visible = prop if controlled else local
    return (visible, local, notification)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty controlled', solve('', 'draft', 'default', 'none', None, True), ('', 'draft', None))
check('mounted', solve(None, 'edited', 'default', 'none', None, True), ('edited', 'edited', None))
check('mount', solve(None, None, 'default', 'none', None, False), ('default', 'default', None))
check('controlled event', solve('old', 'local', 'default', 'input', 'new', True), ('old', 'local', 'new'))
check('uncontrolled event', solve(None, 'local', 'default', 'input', 'new', True), ('new', 'new', 'new'))
check('controlled reset', solve('old', 'local', 'default', 'reset', None, True), ('old', 'local', None))
check('uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
check('parameterized proposed value', solve('old','local','default','input',str(N),True), ('old','local',str(N)))
for repetition in range(N):
    check('repeat uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
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:
Change events report the old controlled value.

None alone signals uncontrolled; defaults initialize only on mount/reset; controlled values stay prop-owned while proposed changes are emitted; uncontrolled changes update local state.

split: open-access


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

N = 1
observations = []
def solve(prop, local, default, event, incoming, mounted):
    controlled = prop is not None
    if not mounted: local = default
    if event == 'input':
        if not controlled: local = incoming
        notification = incoming
    else: notification = None
    if event == 'reset': local = default
    visible = prop if controlled else local
    return (visible, local, notification)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty controlled', solve('', 'draft', 'default', 'none', None, True), ('', 'draft', None))
check('mounted', solve(None, 'edited', 'default', 'none', None, True), ('edited', 'edited', None))
check('mount', solve(None, None, 'default', 'none', None, False), ('default', 'default', None))
check('controlled event', solve('old', 'local', 'default', 'input', 'new', True), ('old', 'local', 'new'))
check('uncontrolled event', solve(None, 'local', 'default', 'input', 'new', True), ('new', 'new', 'new'))
check('controlled reset', solve('old', 'local', 'default', 'reset', None, True), ('old', 'local', None))
check('uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
check('parameterized proposed value', solve('old','local','default','input',str(N),True), ('old','local',str(N)))
for repetition in range(N):
    check('repeat uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
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-controlled-input

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

N = 1
observations = []
def solve(prop, local, default, event, incoming, mounted):
    controlled = prop is not None
    if not mounted: local = default
    if event == 'input':
        if not controlled: local = incoming
        notification = incoming
    else: notification = None
    if event == 'reset' and controlled: local = default
    visible = prop if controlled else local
    return (visible, local, notification)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty controlled', solve('', 'draft', 'default', 'none', None, True), ('', 'draft', None))
check('mounted', solve(None, 'edited', 'default', 'none', None, True), ('edited', 'edited', None))
check('mount', solve(None, None, 'default', 'none', None, False), ('default', 'default', None))
check('controlled event', solve('old', 'local', 'default', 'input', 'new', True), ('old', 'local', 'new'))
check('uncontrolled event', solve(None, 'local', 'default', 'input', 'new', True), ('new', 'new', 'new'))
check('controlled reset', solve('old', 'local', 'default', 'reset', None, True), ('old', 'local', None))
check('uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
check('parameterized proposed value', solve('old','local','default','input',str(N),True), ('old','local',str(N)))
for repetition in range(N):
    check('repeat uncontrolled reset', solve(None, 'local', 'default', 'reset', None, True), ('default', 'default', None))
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:
Reset rewrites local state owned by a controlled input.

None alone signals uncontrolled; defaults initialize only on mount/reset; controlled values stay prop-owned while proposed changes are emitted; uncontrolled changes update local state.

split: open-access


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

N = 1
observations = []
def solve(low, high, target, value, minimum, maximum, gap):
    if target == 'low': low = min(value, high-gap)
    elif target == 'high': high = min(maximum, max(value, low+gap))
    elif target == 'translate':
        delta = max(minimum-low, min(value, maximum-high))
        low += delta; high += delta
    return (low, high)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('low minimum', solve(20, 60, 'low', -10, 0, 100, 10), (0, 60))
check('low gap', solve(20, 60, 'low', 65, 0, 100, 10), (50, 60))
check('high maximum', solve(20, 60, 'high', 120, 0, 100, 10), (20, 100))
check('high gap', solve(20, 60, 'high', 15, 0, 100, 10), (20, 30))
check('translate upper', solve(20, 60, 'translate', 80, 0, 100, 10), (60, 100))
check('translate lower', solve(20, 60, 'translate', -40, 0, 100, 10), (0, 40))
check('ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
check('parameterized range translation', solve(2*N,6*N,'translate',N,0,10*N,N), (3*N,7*N))
for repetition in range(N):
    check('repeat ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
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-dual-slider

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

N = 1
observations = []
def solve(low, high, target, value, minimum, maximum, gap):
    if target == 'low': low = min(minimum, min(value, high-gap))
    elif target == 'high': high = min(maximum, max(value, low+gap))
    elif target == 'translate':
        delta = max(minimum-low, min(value, maximum-high))
        low += delta; high += delta
    return (low, high)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('low minimum', solve(20, 60, 'low', -10, 0, 100, 10), (0, 60))
check('low gap', solve(20, 60, 'low', 65, 0, 100, 10), (50, 60))
check('high maximum', solve(20, 60, 'high', 120, 0, 100, 10), (20, 100))
check('high gap', solve(20, 60, 'high', 15, 0, 100, 10), (20, 30))
check('translate upper', solve(20, 60, 'translate', 80, 0, 100, 10), (60, 100))
check('translate lower', solve(20, 60, 'translate', -40, 0, 100, 10), (0, 40))
check('ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
check('parameterized range translation', solve(2*N,6*N,'translate',N,0,10*N,N), (3*N,7*N))
for repetition in range(N):
    check('repeat ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
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 low thumb escapes the slider domain.

Thumbs clamp to domain and maintain minimum separation; translating preserves span and clamps delta against both domain edges.

split: open-access


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

N = 1
observations = []
def solve(low, high, target, value, minimum, maximum, gap):
    if target == 'low': low = max(minimum, min(value, high))
    elif target == 'high': high = min(maximum, max(value, low+gap))
    elif target == 'translate':
        delta = max(minimum-low, min(value, maximum-high))
        low += delta; high += delta
    return (low, high)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('low minimum', solve(20, 60, 'low', -10, 0, 100, 10), (0, 60))
check('low gap', solve(20, 60, 'low', 65, 0, 100, 10), (50, 60))
check('high maximum', solve(20, 60, 'high', 120, 0, 100, 10), (20, 100))
check('high gap', solve(20, 60, 'high', 15, 0, 100, 10), (20, 30))
check('translate upper', solve(20, 60, 'translate', 80, 0, 100, 10), (60, 100))
check('translate lower', solve(20, 60, 'translate', -40, 0, 100, 10), (0, 40))
check('ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
check('parameterized range translation', solve(2*N,6*N,'translate',N,0,10*N,N), (3*N,7*N))
for repetition in range(N):
    check('repeat ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
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-dual-slider

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

N = 1
observations = []
def solve(low, high, target, value, minimum, maximum, gap):
    if target == 'low': low = max(minimum, min(value, high+gap))
    elif target == 'high': high = min(maximum, max(value, low+gap))
    elif target == 'translate':
        delta = max(minimum-low, min(value, maximum-high))
        low += delta; high += delta
    return (low, high)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('low minimum', solve(20, 60, 'low', -10, 0, 100, 10), (0, 60))
check('low gap', solve(20, 60, 'low', 65, 0, 100, 10), (50, 60))
check('high maximum', solve(20, 60, 'high', 120, 0, 100, 10), (20, 100))
check('high gap', solve(20, 60, 'high', 15, 0, 100, 10), (20, 30))
check('translate upper', solve(20, 60, 'translate', 80, 0, 100, 10), (60, 100))
check('translate lower', solve(20, 60, 'translate', -40, 0, 100, 10), (0, 40))
check('ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
check('parameterized range translation', solve(2*N,6*N,'translate',N,0,10*N,N), (3*N,7*N))
for repetition in range(N):
    check('repeat ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
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 low thumb violates minimum thumb separation.

Thumbs clamp to domain and maintain minimum separation; translating preserves span and clamps delta against both domain edges.

split: open-access


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

N = 1
observations = []
def solve(low, high, target, value, minimum, maximum, gap):
    if target == 'low': low = max(minimum, min(value, high-gap))
    elif target == 'high': high = max(value, low+gap)
    elif target == 'translate':
        delta = max(minimum-low, min(value, maximum-high))
        low += delta; high += delta
    return (low, high)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('low minimum', solve(20, 60, 'low', -10, 0, 100, 10), (0, 60))
check('low gap', solve(20, 60, 'low', 65, 0, 100, 10), (50, 60))
check('high maximum', solve(20, 60, 'high', 120, 0, 100, 10), (20, 100))
check('high gap', solve(20, 60, 'high', 15, 0, 100, 10), (20, 30))
check('translate upper', solve(20, 60, 'translate', 80, 0, 100, 10), (60, 100))
check('translate lower', solve(20, 60, 'translate', -40, 0, 100, 10), (0, 40))
check('ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
check('parameterized range translation', solve(2*N,6*N,'translate',N,0,10*N,N), (3*N,7*N))
for repetition in range(N):
    check('repeat ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
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-dual-slider

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

N = 1
observations = []
def solve(low, high, target, value, minimum, maximum, gap):
    if target == 'low': low = max(minimum, min(value, high-gap))
    elif target == 'high': high = max(maximum, max(value, low+gap))
    elif target == 'translate':
        delta = max(minimum-low, min(value, maximum-high))
        low += delta; high += delta
    return (low, high)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('low minimum', solve(20, 60, 'low', -10, 0, 100, 10), (0, 60))
check('low gap', solve(20, 60, 'low', 65, 0, 100, 10), (50, 60))
check('high maximum', solve(20, 60, 'high', 120, 0, 100, 10), (20, 100))
check('high gap', solve(20, 60, 'high', 15, 0, 100, 10), (20, 30))
check('translate upper', solve(20, 60, 'translate', 80, 0, 100, 10), (60, 100))
check('translate lower', solve(20, 60, 'translate', -40, 0, 100, 10), (0, 40))
check('ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
check('parameterized range translation', solve(2*N,6*N,'translate',N,0,10*N,N), (3*N,7*N))
for repetition in range(N):
    check('repeat ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
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 high thumb escapes the slider domain.

Thumbs clamp to domain and maintain minimum separation; translating preserves span and clamps delta against both domain edges.

split: open-access


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

N = 1
observations = []
def solve(low, high, target, value, minimum, maximum, gap):
    if target == 'low': low = max(minimum, min(value, high-gap))
    elif target == 'high': high = min(maximum, max(value, low))
    elif target == 'translate':
        delta = max(minimum-low, min(value, maximum-high))
        low += delta; high += delta
    return (low, high)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('low minimum', solve(20, 60, 'low', -10, 0, 100, 10), (0, 60))
check('low gap', solve(20, 60, 'low', 65, 0, 100, 10), (50, 60))
check('high maximum', solve(20, 60, 'high', 120, 0, 100, 10), (20, 100))
check('high gap', solve(20, 60, 'high', 15, 0, 100, 10), (20, 30))
check('translate upper', solve(20, 60, 'translate', 80, 0, 100, 10), (60, 100))
check('translate lower', solve(20, 60, 'translate', -40, 0, 100, 10), (0, 40))
check('ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
check('parameterized range translation', solve(2*N,6*N,'translate',N,0,10*N,N), (3*N,7*N))
for repetition in range(N):
    check('repeat ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
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-dual-slider

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

N = 1
observations = []
def solve(low, high, target, value, minimum, maximum, gap):
    if target == 'low': low = max(minimum, min(value, high-gap))
    elif target == 'high': high = min(maximum, max(value, low-gap))
    elif target == 'translate':
        delta = max(minimum-low, min(value, maximum-high))
        low += delta; high += delta
    return (low, high)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('low minimum', solve(20, 60, 'low', -10, 0, 100, 10), (0, 60))
check('low gap', solve(20, 60, 'low', 65, 0, 100, 10), (50, 60))
check('high maximum', solve(20, 60, 'high', 120, 0, 100, 10), (20, 100))
check('high gap', solve(20, 60, 'high', 15, 0, 100, 10), (20, 30))
check('translate upper', solve(20, 60, 'translate', 80, 0, 100, 10), (60, 100))
check('translate lower', solve(20, 60, 'translate', -40, 0, 100, 10), (0, 40))
check('ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
check('parameterized range translation', solve(2*N,6*N,'translate',N,0,10*N,N), (3*N,7*N))
for repetition in range(N):
    check('repeat ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
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 high thumb violates minimum thumb separation.

Thumbs clamp to domain and maintain minimum separation; translating preserves span and clamps delta against both domain edges.

split: open-access


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

N = 1
observations = []
def solve(low, high, target, value, minimum, maximum, gap):
    if target == 'low': low = max(minimum, min(value, high-gap))
    elif target == 'high': high = min(maximum, max(value, low+gap))
    elif target == 'translate':
        delta = value
        low += delta; high += delta
    return (low, high)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('low minimum', solve(20, 60, 'low', -10, 0, 100, 10), (0, 60))
check('low gap', solve(20, 60, 'low', 65, 0, 100, 10), (50, 60))
check('high maximum', solve(20, 60, 'high', 120, 0, 100, 10), (20, 100))
check('high gap', solve(20, 60, 'high', 15, 0, 100, 10), (20, 30))
check('translate upper', solve(20, 60, 'translate', 80, 0, 100, 10), (60, 100))
check('translate lower', solve(20, 60, 'translate', -40, 0, 100, 10), (0, 40))
check('ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
check('parameterized range translation', solve(2*N,6*N,'translate',N,0,10*N,N), (3*N,7*N))
for repetition in range(N):
    check('repeat ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
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-dual-slider

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

N = 1
observations = []
def solve(low, high, target, value, minimum, maximum, gap):
    if target == 'low': low = max(minimum, min(value, high-gap))
    elif target == 'high': high = min(maximum, max(value, low+gap))
    elif target == 'translate':
        delta = max(minimum, min(value, maximum))
        low += delta; high += delta
    return (low, high)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('low minimum', solve(20, 60, 'low', -10, 0, 100, 10), (0, 60))
check('low gap', solve(20, 60, 'low', 65, 0, 100, 10), (50, 60))
check('high maximum', solve(20, 60, 'high', 120, 0, 100, 10), (20, 100))
check('high gap', solve(20, 60, 'high', 15, 0, 100, 10), (20, 30))
check('translate upper', solve(20, 60, 'translate', 80, 0, 100, 10), (60, 100))
check('translate lower', solve(20, 60, 'translate', -40, 0, 100, 10), (0, 40))
check('ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
check('parameterized range translation', solve(2*N,6*N,'translate',N,0,10*N,N), (3*N,7*N))
for repetition in range(N):
    check('repeat ordinary', solve(20, 60, 'low', 30, 0, 100, 10), (30, 60))
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:
Dragging the selected range moves it outside the domain.

Thumbs clamp to domain and maintain minimum separation; translating preserves span and clamps delta against both domain edges.

split: open-access


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

N = 1
observations = []
def solve(committed, preview, event, value, readonly, allow_clear):
    if readonly: return (value, None)
    if event == 'hover': preview = value
    elif event == 'leave': preview = None
    elif event == 'activate':
        committed = None if allow_clear and value == committed else value
        preview = None
    elif event == 'escape': preview = None
    return (committed, preview)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('readonly', solve(2, 4, 'activate', 5, True, True), (2, None))
check('hover', solve(2, None, 'hover', 4, False, True), (2, 4))
check('leave', solve(2, 4, 'leave', None, False, True), (2, None))
check('locked clear', solve(2, 4, 'activate', 2, False, False), (2, None))
check('change', solve(2, 4, 'activate', 5, False, True), (5, None))
check('clear', solve(2, 4, 'activate', 2, False, True), (None, None))
check('escape', solve(2, 4, 'escape', None, False, True), (2, None))
check('parameterized rating preview', solve(0,None,'hover',N,False,False), (0,N))
for repetition in range(N):
    check('repeat escape', solve(2, 4, 'escape', None, False, True), (2, None))
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-rating-preview

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

N = 1
observations = []
def solve(committed, preview, event, value, readonly, allow_clear):
    if readonly: return (committed, preview)
    if event == 'hover': preview = value
    elif event == 'leave': preview = None
    elif event == 'activate':
        committed = None if allow_clear and value == committed else value
        preview = None
    elif event == 'escape': preview = None
    return (committed, preview)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('readonly', solve(2, 4, 'activate', 5, True, True), (2, None))
check('hover', solve(2, None, 'hover', 4, False, True), (2, 4))
check('leave', solve(2, 4, 'leave', None, False, True), (2, None))
check('locked clear', solve(2, 4, 'activate', 2, False, False), (2, None))
check('change', solve(2, 4, 'activate', 5, False, True), (5, None))
check('clear', solve(2, 4, 'activate', 2, False, True), (None, None))
check('escape', solve(2, 4, 'escape', None, False, True), (2, None))
check('parameterized rating preview', solve(0,None,'hover',N,False,False), (0,N))
for repetition in range(N):
    check('repeat escape', solve(2, 4, 'escape', None, False, True), (2, None))
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:
Readonly ratings still change on interaction.

Hover changes preview only; leaving or Escape discards preview; activation commits and clears preview; repeated activation clears only when allowed; readonly ignores interaction and has no preview.

split: open-access


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

N = 1
observations = []
def solve(committed, preview, event, value, readonly, allow_clear):
    if readonly: return (committed, None)
    if event == 'hover': committed = value
    elif event == 'leave': preview = None
    elif event == 'activate':
        committed = None if allow_clear and value == committed else value
        preview = None
    elif event == 'escape': preview = None
    return (committed, preview)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('readonly', solve(2, 4, 'activate', 5, True, True), (2, None))
check('hover', solve(2, None, 'hover', 4, False, True), (2, 4))
check('leave', solve(2, 4, 'leave', None, False, True), (2, None))
check('locked clear', solve(2, 4, 'activate', 2, False, False), (2, None))
check('change', solve(2, 4, 'activate', 5, False, True), (5, None))
check('clear', solve(2, 4, 'activate', 2, False, True), (None, None))
check('escape', solve(2, 4, 'escape', None, False, True), (2, None))
check('parameterized rating preview', solve(0,None,'hover',N,False,False), (0,N))
for repetition in range(N):
    check('repeat escape', solve(2, 4, 'escape', None, False, True), (2, None))
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-rating-preview

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

N = 1
observations = []
def solve(committed, preview, event, value, readonly, allow_clear):
    if readonly: return (committed, None)
    if event == 'hover': preview = committed
    elif event == 'leave': preview = None
    elif event == 'activate':
        committed = None if allow_clear and value == committed else value
        preview = None
    elif event == 'escape': preview = None
    return (committed, preview)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('readonly', solve(2, 4, 'activate', 5, True, True), (2, None))
check('hover', solve(2, None, 'hover', 4, False, True), (2, 4))
check('leave', solve(2, 4, 'leave', None, False, True), (2, None))
check('locked clear', solve(2, 4, 'activate', 2, False, False), (2, None))
check('change', solve(2, 4, 'activate', 5, False, True), (5, None))
check('clear', solve(2, 4, 'activate', 2, False, True), (None, None))
check('escape', solve(2, 4, 'escape', None, False, True), (2, None))
check('parameterized rating preview', solve(0,None,'hover',N,False,False), (0,N))
for repetition in range(N):
    check('repeat escape', solve(2, 4, 'escape', None, False, True), (2, None))
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:
Hovering commits a rating before activation.

Hover changes preview only; leaving or Escape discards preview; activation commits and clears preview; repeated activation clears only when allowed; readonly ignores interaction and has no preview.

split: open-access


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

N = 1
observations = []
def solve(committed, preview, event, value, readonly, allow_clear):
    if readonly: return (committed, None)
    if event == 'hover': preview = value
    elif event == 'leave': committed = None
    elif event == 'activate':
        committed = None if allow_clear and value == committed else value
        preview = None
    elif event == 'escape': preview = None
    return (committed, preview)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('readonly', solve(2, 4, 'activate', 5, True, True), (2, None))
check('hover', solve(2, None, 'hover', 4, False, True), (2, 4))
check('leave', solve(2, 4, 'leave', None, False, True), (2, None))
check('locked clear', solve(2, 4, 'activate', 2, False, False), (2, None))
check('change', solve(2, 4, 'activate', 5, False, True), (5, None))
check('clear', solve(2, 4, 'activate', 2, False, True), (None, None))
check('escape', solve(2, 4, 'escape', None, False, True), (2, None))
check('parameterized rating preview', solve(0,None,'hover',N,False,False), (0,N))
for repetition in range(N):
    check('repeat escape', solve(2, 4, 'escape', None, False, True), (2, None))
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-rating-preview

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

N = 1
observations = []
def solve(committed, preview, event, value, readonly, allow_clear):
    if readonly: return (committed, None)
    if event == 'hover': preview = value
    elif event == 'leave': preview = committed
    elif event == 'activate':
        committed = None if allow_clear and value == committed else value
        preview = None
    elif event == 'escape': preview = None
    return (committed, preview)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('readonly', solve(2, 4, 'activate', 5, True, True), (2, None))
check('hover', solve(2, None, 'hover', 4, False, True), (2, 4))
check('leave', solve(2, 4, 'leave', None, False, True), (2, None))
check('locked clear', solve(2, 4, 'activate', 2, False, False), (2, None))
check('change', solve(2, 4, 'activate', 5, False, True), (5, None))
check('clear', solve(2, 4, 'activate', 2, False, True), (None, None))
check('escape', solve(2, 4, 'escape', None, False, True), (2, None))
check('parameterized rating preview', solve(0,None,'hover',N,False,False), (0,N))
for repetition in range(N):
    check('repeat escape', solve(2, 4, 'escape', None, False, True), (2, None))
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:
Pointer leave erases the committed rating.

Hover changes preview only; leaving or Escape discards preview; activation commits and clears preview; repeated activation clears only when allowed; readonly ignores interaction and has no preview.

split: open-access


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

N = 1
observations = []
def solve(committed, preview, event, value, readonly, allow_clear):
    if readonly: return (committed, None)
    if event == 'hover': preview = value
    elif event == 'leave': preview = None
    elif event == 'activate':
        committed = None if value == committed else value
        preview = None
    elif event == 'escape': preview = None
    return (committed, preview)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('readonly', solve(2, 4, 'activate', 5, True, True), (2, None))
check('hover', solve(2, None, 'hover', 4, False, True), (2, 4))
check('leave', solve(2, 4, 'leave', None, False, True), (2, None))
check('locked clear', solve(2, 4, 'activate', 2, False, False), (2, None))
check('change', solve(2, 4, 'activate', 5, False, True), (5, None))
check('clear', solve(2, 4, 'activate', 2, False, True), (None, None))
check('escape', solve(2, 4, 'escape', None, False, True), (2, None))
check('parameterized rating preview', solve(0,None,'hover',N,False,False), (0,N))
for repetition in range(N):
    check('repeat escape', solve(2, 4, 'escape', None, False, True), (2, None))
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-rating-preview

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

N = 1
observations = []
def solve(committed, preview, event, value, readonly, allow_clear):
    if readonly: return (committed, None)
    if event == 'hover': preview = value
    elif event == 'leave': preview = None
    elif event == 'activate':
        committed = None if allow_clear else value
        preview = None
    elif event == 'escape': preview = None
    return (committed, preview)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('readonly', solve(2, 4, 'activate', 5, True, True), (2, None))
check('hover', solve(2, None, 'hover', 4, False, True), (2, 4))
check('leave', solve(2, 4, 'leave', None, False, True), (2, None))
check('locked clear', solve(2, 4, 'activate', 2, False, False), (2, None))
check('change', solve(2, 4, 'activate', 5, False, True), (5, None))
check('clear', solve(2, 4, 'activate', 2, False, True), (None, None))
check('escape', solve(2, 4, 'escape', None, False, True), (2, None))
check('parameterized rating preview', solve(0,None,'hover',N,False,False), (0,N))
for repetition in range(N):
    check('repeat escape', solve(2, 4, 'escape', None, False, True), (2, None))
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:
Repeated activation clears a nonclearable rating.

Hover changes preview only; leaving or Escape discards preview; activation commits and clears preview; repeated activation clears only when allowed; readonly ignores interaction and has no preview.

split: open-access


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

N = 1
observations = []
def solve(committed, preview, event, value, readonly, allow_clear):
    if readonly: return (committed, None)
    if event == 'hover': preview = value
    elif event == 'leave': preview = None
    elif event == 'activate':
        committed = None if allow_clear and value == committed else value
        preview = preview
    elif event == 'escape': preview = None
    return (committed, preview)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('readonly', solve(2, 4, 'activate', 5, True, True), (2, None))
check('hover', solve(2, None, 'hover', 4, False, True), (2, 4))
check('leave', solve(2, 4, 'leave', None, False, True), (2, None))
check('locked clear', solve(2, 4, 'activate', 2, False, False), (2, None))
check('change', solve(2, 4, 'activate', 5, False, True), (5, None))
check('clear', solve(2, 4, 'activate', 2, False, True), (None, None))
check('escape', solve(2, 4, 'escape', None, False, True), (2, None))
check('parameterized rating preview', solve(0,None,'hover',N,False,False), (0,N))
for repetition in range(N):
    check('repeat escape', solve(2, 4, 'escape', None, False, True), (2, None))
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-rating-preview

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

N = 1
observations = []
def solve(committed, preview, event, value, readonly, allow_clear):
    if readonly: return (committed, None)
    if event == 'hover': preview = value
    elif event == 'leave': preview = None
    elif event == 'activate':
        committed = None if allow_clear and value == committed else value
        preview = committed
    elif event == 'escape': preview = None
    return (committed, preview)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('readonly', solve(2, 4, 'activate', 5, True, True), (2, None))
check('hover', solve(2, None, 'hover', 4, False, True), (2, 4))
check('leave', solve(2, 4, 'leave', None, False, True), (2, None))
check('locked clear', solve(2, 4, 'activate', 2, False, False), (2, None))
check('change', solve(2, 4, 'activate', 5, False, True), (5, None))
check('clear', solve(2, 4, 'activate', 2, False, True), (None, None))
check('escape', solve(2, 4, 'escape', None, False, True), (2, None))
check('parameterized rating preview', solve(0,None,'hover',N,False,False), (0,N))
for repetition in range(N):
    check('repeat escape', solve(2, 4, 'escape', None, False, True), (2, None))
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:
Activation retains an obsolete hover preview.

Hover changes preview only; leaving or Escape discards preview; activation commits and clears preview; repeated activation clears only when allowed; readonly ignores interaction and has no preview.

split: open-access


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

N = 1
observations = []
def solve(sorting, column, multi, removable):
    sorting = list(sorting)
    index = next((i for i, (c, d) in enumerate(sorting) if c == column), None)
    if index is None: entry = (column, 'desc')
    elif sorting[index][1] == 'asc': entry = (column, 'desc')
    else: entry = None if removable else (column, 'asc')
    if not multi: return [entry] if entry else []
    if index is None: return sorting + [entry]
    if entry is None: return sorting[:index] + sorting[index+1:]
    sorting[index] = entry
    return sorting
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new', solve([], 'a', False, True), [('a', 'asc')])
check('reverse', solve([('a','asc')], 'a', False, True), [('a', 'desc')])
check('locked', solve([('a','desc')], 'a', False, False), [('a', 'asc')])
check('remove', solve([('a','desc')], 'a', False, True), [])
check('single', solve([('a','asc')], 'b', False, True), [('b', 'asc')])
check('priority', solve([('a','asc'),('b','asc')], 'a', True, True), [('a', 'desc'), ('b', 'asc')])
check('append', solve([('a','asc')], 'b', True, True), [('a', 'asc'), ('b', 'asc')])
check('parameterized sort identity', solve([],str(N),False,True), [(str(N),'asc')])
for repetition in range(N):
    check('repeat append', solve([('a','asc')], 'b', True, True), [('a', 'asc'), ('b', 'asc')])
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-sort-indicator

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

N = 1
observations = []
def solve(sorting, column, multi, removable):
    sorting = list(sorting)
    index = next((i for i, (c, d) in enumerate(sorting) if c == column), None)
    if index is None: entry = None
    elif sorting[index][1] == 'asc': entry = (column, 'desc')
    else: entry = None if removable else (column, 'asc')
    if not multi: return [entry] if entry else []
    if index is None: return sorting + [entry]
    if entry is None: return sorting[:index] + sorting[index+1:]
    sorting[index] = entry
    return sorting
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new', solve([], 'a', False, True), [('a', 'asc')])
check('reverse', solve([('a','asc')], 'a', False, True), [('a', 'desc')])
check('locked', solve([('a','desc')], 'a', False, False), [('a', 'asc')])
check('remove', solve([('a','desc')], 'a', False, True), [])
check('single', solve([('a','asc')], 'b', False, True), [('b', 'asc')])
check('priority', solve([('a','asc'),('b','asc')], 'a', True, True), [('a', 'desc'), ('b', 'asc')])
check('append', solve([('a','asc')], 'b', True, True), [('a', 'asc'), ('b', 'asc')])
check('parameterized sort identity', solve([],str(N),False,True), [(str(N),'asc')])
for repetition in range(N):
    check('repeat append', solve([('a','asc')], 'b', True, True), [('a', 'asc'), ('b', 'asc')])
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:
New sort columns start descending despite ascending contract.

New sort is ascending; activation cycles ascending to descending to removed when allowed; single mode replaces all sorts; multi mode preserves priorities when changing direction.

split: open-access


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

N = 1
observations = []
def solve(sorting, column, multi, removable):
    sorting = list(sorting)
    index = next((i for i, (c, d) in enumerate(sorting) if c == column), None)
    if index is None: entry = (column, 'asc')
    elif sorting[index][1] == 'asc': entry = (column, 'asc')
    else: entry = None if removable else (column, 'asc')
    if not multi: return [entry] if entry else []
    if index is None: return sorting + [entry]
    if entry is None: return sorting[:index] + sorting[index+1:]
    sorting[index] = entry
    return sorting
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new', solve([], 'a', False, True), [('a', 'asc')])
check('reverse', solve([('a','asc')], 'a', False, True), [('a', 'desc')])
check('locked', solve([('a','desc')], 'a', False, False), [('a', 'asc')])
check('remove', solve([('a','desc')], 'a', False, True), [])
check('single', solve([('a','asc')], 'b', False, True), [('b', 'asc')])
check('priority', solve([('a','asc'),('b','asc')], 'a', True, True), [('a', 'desc'), ('b', 'asc')])
check('append', solve([('a','asc')], 'b', True, True), [('a', 'asc'), ('b', 'asc')])
check('parameterized sort identity', solve([],str(N),False,True), [(str(N),'asc')])
for repetition in range(N):
    check('repeat append', solve([('a','asc')], 'b', True, True), [('a', 'asc'), ('b', 'asc')])
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-sort-indicator

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

N = 1
observations = []
def solve(sorting, column, multi, removable):
    sorting = list(sorting)
    index = next((i for i, (c, d) in enumerate(sorting) if c == column), None)
    if index is None: entry = (column, 'asc')
    elif sorting[index][1] == 'asc': entry = None
    else: entry = None if removable else (column, 'asc')
    if not multi: return [entry] if entry else []
    if index is None: return sorting + [entry]
    if entry is None: return sorting[:index] + sorting[index+1:]
    sorting[index] = entry
    return sorting
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new', solve([], 'a', False, True), [('a', 'asc')])
check('reverse', solve([('a','asc')], 'a', False, True), [('a', 'desc')])
check('locked', solve([('a','desc')], 'a', False, False), [('a', 'asc')])
check('remove', solve([('a','desc')], 'a', False, True), [])
check('single', solve([('a','asc')], 'b', False, True), [('b', 'asc')])
check('priority', solve([('a','asc'),('b','asc')], 'a', True, True), [('a', 'desc'), ('b', 'asc')])
check('append', solve([('a','asc')], 'b', True, True), [('a', 'asc'), ('b', 'asc')])
check('parameterized sort identity', solve([],str(N),False,True), [(str(N),'asc')])
for repetition in range(N):
    check('repeat append', solve([('a','asc')], 'b', True, True), [('a', 'asc'), ('b', 'asc')])
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:
Reactivating ascending sort does not reverse direction.

New sort is ascending; activation cycles ascending to descending to removed when allowed; single mode replaces all sorts; multi mode preserves priorities when changing direction.

split: open-access


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

N = 1
observations = []
def solve(sorting, column, multi, removable):
    sorting = list(sorting)
    index = next((i for i, (c, d) in enumerate(sorting) if c == column), None)
    if index is None: entry = (column, 'asc')
    elif sorting[index][1] == 'asc': entry = (column, 'desc')
    else: entry = None
    if not multi: return [entry] if entry else []
    if index is None: return sorting + [entry]
    if entry is None: return sorting[:index] + sorting[index+1:]
    sorting[index] = entry
    return sorting
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new', solve([], 'a', False, True), [('a', 'asc')])
check('reverse', solve([('a','asc')], 'a', False, True), [('a', 'desc')])
check('locked', solve([('a','desc')], 'a', False, False), [('a', 'asc')])
check('remove', solve([('a','desc')], 'a', False, True), [])
check('single', solve([('a','asc')], 'b', False, True), [('b', 'asc')])
check('priority', solve([('a','asc'),('b','asc')], 'a', True, True), [('a', 'desc'), ('b', 'asc')])
check('append', solve([('a','asc')], 'b', True, True), [('a', 'asc'), ('b', 'asc')])
check('parameterized sort identity', solve([],str(N),False,True), [(str(N),'asc')])
for repetition in range(N):
    check('repeat append', solve([('a','asc')], 'b', True, True), [('a', 'asc'), ('b', 'asc')])
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-sort-indicator

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

N = 1
observations = []
def solve(sorting, column, multi, removable):
    sorting = list(sorting)
    index = next((i for i, (c, d) in enumerate(sorting) if c == column), None)
    if index is None: entry = (column, 'asc')
    elif sorting[index][1] == 'asc': entry = (column, 'desc')
    else: entry = (column, 'asc')
    if not multi: return [entry] if entry else []
    if index is None: return sorting + [entry]
    if entry is None: return sorting[:index] + sorting[index+1:]
    sorting[index] = entry
    return sorting
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new', solve([], 'a', False, True), [('a', 'asc')])
check('reverse', solve([('a','asc')], 'a', False, True), [('a', 'desc')])
check('locked', solve([('a','desc')], 'a', False, False), [('a', 'asc')])
check('remove', solve([('a','desc')], 'a', False, True), [])
check('single', solve([('a','asc')], 'b', False, True), [('b', 'asc')])
check('priority', solve([('a','asc'),('b','asc')], 'a', True, True), [('a', 'desc'), ('b', 'asc')])
check('append', solve([('a','asc')], 'b', True, True), [('a', 'asc'), ('b', 'asc')])
check('parameterized sort identity', solve([],str(N),False,True), [(str(N),'asc')])
for repetition in range(N):
    check('repeat append', solve([('a','asc')], 'b', True, True), [('a', 'asc'), ('b', 'asc')])
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:
Nonremovable sort columns can be cleared.

New sort is ascending; activation cycles ascending to descending to removed when allowed; single mode replaces all sorts; multi mode preserves priorities when changing direction.

split: open-access