FAILURE MAP
← Case archive

FA-7946 / Selection controls / Open access

Hierarchical checkbox state: Outside selections contaminate the parent indicator · case 01

Outside selections contaminate the parent indicator.

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

ROOT CAUSE

The aggregate scope operation uses `selected` where the contract requires `selected & children`.

VERIFIED REPAIR

Implement the aggregate scope operation as `selected & children`.

Unsuccessful approach: Complementing selection inverts the aggregate state.

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
    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'], 'mixed'][['a', 'b', 'x'], 'all']Failed
none keeps outside[['x'], 'mixed'][['x'], 'none']Failed
toggle off[[], 'none'][[], 'none']Passed
toggle on[['a'], 'mixed'][['a'], 'mixed']Passed
outside only[['x'], 'mixed'][['x'], 'none']Failed
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 / a93fc0727d8f838a3127f69481c59425ffdcfabbc383f4abdd458d60dc6c7cf0

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 = children - selected
    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'], 'none'][['a', 'b', 'x'], 'all']Failed
none keeps outside[['x'], 'all'][['x'], 'none']Failed
toggle off[[], 'all'][[], 'none']Failed
toggle on[['a'], 'mixed'][['a'], 'mixed']Passed
outside only[['x'], 'all'][['x'], 'none']Failed
all[['a', 'b'], 'none'][['a', 'b'], 'all']Failed
parameterized checked subtree[[0], 'none'][[0], 'all']Failed
repeat all[['a', 'b'], 'none'][['a', 'b'], 'all']Failed

SHA-256 / ea036ce3d75b26102b3eee31332a17a9a3c6652641ecf8366131d4c067745aeb

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.786801+00:00.

Case digest / b589d2da0dfcb62761588a005a283398ca127ac9fc5ebb6effd9e47ef1ae4b37