FAILURE MAP
← Case archive

FA-7951 / Selection controls / Open access

Hierarchical checkbox state: Partially selected parents are announced as fully checked · case 01

Partially selected parents are announced as fully checked.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The mixed operation uses `'all'` where the contract requires `('all' if visible == children else 'mixed')`.

VERIFIED REPAIR

Implement the mixed operation as `('all' if visible == children else 'mixed')`.

Unsuccessful approach: Always reporting mixed misrepresents completely selected parents.

Case contract

Subtree actions preserve outside selections; toggle is symmetric; parent status depends only on selected descendants and distinguishes none, mixed and all.

Why this case matters

A deterministic model of hierarchical checkbox state; this isolates one interface invariant without requiring a browser.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(selected, children, event, child):
    selected = set(selected)
    children = set(children)
    if event == 'all': selected |= children
    elif event == 'none': selected -= children
    elif event == 'toggle': selected.symmetric_difference_update({child})
    visible = selected & children
    state = 'none' if not visible else 'all'
    return (sorted(selected), state)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('all keeps outside', solve(['x','a'], ['a','b'], 'all', None), (['a', 'b', 'x'], 'all'))
check('none keeps outside', solve(['x','a'], ['a','b'], 'none', None), (['x'], 'none'))
check('toggle off', solve(['a'], ['a','b'], 'toggle', 'a'), ([], 'none'))
check('toggle on', solve([], ['a','b'], 'toggle', 'a'), (['a'], 'mixed'))
check('outside only', solve(['x'], ['a','b'], 'read', None), (['x'], 'none'))
check('all', solve(['a','b'], ['a','b'], 'read', None), (['a', 'b'], 'all'))
check('parameterized checked subtree', solve(list(range(N)), list(range(N)), 'read', None), (list(range(N)), 'all'))
for repetition in range(N):
    check('repeat all', solve(['a','b'], ['a','b'], 'read', None), (['a', 'b'], 'all'))
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)
Boundary fixtureActualExpectedOutcome
all keeps outside[['a', 'b', 'x'], 'all'][['a', 'b', 'x'], 'all']Passed
none keeps outside[['x'], 'none'][['x'], 'none']Passed
toggle off[[], 'none'][[], 'none']Passed
toggle on[['a'], 'all'][['a'], 'mixed']Failed
outside only[['x'], 'none'][['x'], 'none']Passed
all[['a', 'b'], 'all'][['a', 'b'], 'all']Passed
parameterized checked subtree[[0], 'all'][[0], 'all']Passed
repeat all[['a', 'b'], 'all'][['a', 'b'], 'all']Passed

SHA-256 / f7ceb15314a2430ea33c8f285e4945fe54a40c04a7c13c76fa667858f657a29e

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(selected, children, event, child):
    selected = set(selected)
    children = set(children)
    if event == 'all': selected |= children
    elif event == 'none': selected -= children
    elif event == 'toggle': selected.symmetric_difference_update({child})
    visible = selected & children
    state = 'none' if not visible else 'mixed'
    return (sorted(selected), state)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('all keeps outside', solve(['x','a'], ['a','b'], 'all', None), (['a', 'b', 'x'], 'all'))
check('none keeps outside', solve(['x','a'], ['a','b'], 'none', None), (['x'], 'none'))
check('toggle off', solve(['a'], ['a','b'], 'toggle', 'a'), ([], 'none'))
check('toggle on', solve([], ['a','b'], 'toggle', 'a'), (['a'], 'mixed'))
check('outside only', solve(['x'], ['a','b'], 'read', None), (['x'], 'none'))
check('all', solve(['a','b'], ['a','b'], 'read', None), (['a', 'b'], 'all'))
check('parameterized checked subtree', solve(list(range(N)), list(range(N)), 'read', None), (list(range(N)), 'all'))
for repetition in range(N):
    check('repeat all', solve(['a','b'], ['a','b'], 'read', None), (['a', 'b'], 'all'))
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)
Boundary fixtureActualExpectedOutcome
all keeps outside[['a', 'b', 'x'], 'mixed'][['a', 'b', 'x'], 'all']Failed
none keeps outside[['x'], 'none'][['x'], 'none']Passed
toggle off[[], 'none'][[], 'none']Passed
toggle on[['a'], 'mixed'][['a'], 'mixed']Passed
outside only[['x'], 'none'][['x'], 'none']Passed
all[['a', 'b'], 'mixed'][['a', 'b'], 'all']Failed
parameterized checked subtree[[0], 'mixed'][[0], 'all']Failed
repeat all[['a', 'b'], 'mixed'][['a', 'b'], 'all']Failed

SHA-256 / 412ee07a1460a141013bfb98e1b843fffa3abb982b63e4fda25248195d9849e7

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(selected, children, event, child):
    selected = set(selected)
    children = set(children)
    if event == 'all': selected |= children
    elif event == 'none': selected -= children
    elif event == 'toggle': selected.symmetric_difference_update({child})
    visible = selected & children
    state = 'none' if not visible else ('all' if visible == children else 'mixed')
    return (sorted(selected), state)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('all keeps outside', solve(['x','a'], ['a','b'], 'all', None), (['a', 'b', 'x'], 'all'))
check('none keeps outside', solve(['x','a'], ['a','b'], 'none', None), (['x'], 'none'))
check('toggle off', solve(['a'], ['a','b'], 'toggle', 'a'), ([], 'none'))
check('toggle on', solve([], ['a','b'], 'toggle', 'a'), (['a'], 'mixed'))
check('outside only', solve(['x'], ['a','b'], 'read', None), (['x'], 'none'))
check('all', solve(['a','b'], ['a','b'], 'read', None), (['a', 'b'], 'all'))
check('parameterized checked subtree', solve(list(range(N)), list(range(N)), 'read', None), (list(range(N)), 'all'))
for repetition in range(N):
    check('repeat all', solve(['a','b'], ['a','b'], 'read', None), (['a', 'b'], 'all'))
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)
Boundary fixtureActualExpectedOutcome
all keeps outside[['a', 'b', 'x'], 'all'][['a', 'b', 'x'], 'all']Passed
none keeps outside[['x'], 'none'][['x'], 'none']Passed
toggle off[[], 'none'][[], 'none']Passed
toggle on[['a'], 'mixed'][['a'], 'mixed']Passed
outside only[['x'], 'none'][['x'], 'none']Passed
all[['a', 'b'], 'all'][['a', 'b'], 'all']Passed
parameterized checked subtree[[0], 'all'][[0], 'all']Passed
repeat all[['a', 'b'], 'all'][['a', 'b'], 'all']Passed

SHA-256 / 8601b5edb6a2428e9f04dc68f017ac8fa14035179bf7c42f7b2dc6a5cc451f6a

Verification & scope

This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:38:16.793233+00:00.

Case digest / 1c26630323bd063e7b255b1a2f48db622664efaabe725fddb8e0e33f5b244a8c