FAILURE MAP
← Case archive

FA-8086 / Disclosure widgets / Open access

Accordion open-panel state: An unknown panel clears other open panels · case 01

An unknown panel clears other open panels.

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

ROOT CAUSE

The unknown target operation uses `if target not in valid: return []` where the contract requires `if target not in valid: return sorted(opened)`.

VERIFIED REPAIR

Implement the unknown target operation as `if target not in valid: return sorted(opened)`.

Unsuccessful approach: Adding unknown panels keeps impossible expansion state.

Case contract

Discard removed panels; ignore invalid targets; expanded panels close only when collapsible; multiple mode unions and single mode replaces.

Why this case matters

A deterministic model of accordion open-panel 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(panels, opened, target, multiple, collapsible):
    valid = set(panels)
    opened = set(opened) & valid
    if target not in valid: return []
    if target in opened:
        if collapsible: opened.remove(target)
    elif multiple: opened.add(target)
    else: opened = {target}
    return sorted(opened)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('removed', solve(['a','b'], ['a','gone'], 'unknown', True, True), ['a'])
check('unknown', solve(['a','b'], ['a'], 'unknown', True, True), ['a'])
check('locked', solve(['a','b'], ['a'], 'a', False, False), ['a'])
check('collapse', solve(['a','b'], ['a'], 'a', False, True), [])
check('multiple', solve(['a','b'], ['a'], 'b', True, True), ['a', 'b'])
check('single', solve(['a','b'], ['a'], 'b', False, True), ['b'])
check('parameterized panels', solve(list(range(N+1)), [0], N, True, True), [0,N])
for repetition in range(N):
    check('repeat single', solve(['a','b'], ['a'], 'b', False, True), ['b'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
removed[]['a']Failed
unknown[]['a']Failed
locked['a']['a']Passed
collapse[][]Passed
multiple['a', 'b']['a', 'b']Passed
single['b']['b']Passed
parameterized panels[0, 1][0, 1]Passed
repeat single['b']['b']Passed

SHA-256 / 5152fe25ab2cd0f10b26020792eb4543aa27d4638245bcc9488406c53fd0616b

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(panels, opened, target, multiple, collapsible):
    valid = set(panels)
    opened = set(opened) & valid
    if target not in valid: return sorted(opened | {target})
    if target in opened:
        if collapsible: opened.remove(target)
    elif multiple: opened.add(target)
    else: opened = {target}
    return sorted(opened)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('removed', solve(['a','b'], ['a','gone'], 'unknown', True, True), ['a'])
check('unknown', solve(['a','b'], ['a'], 'unknown', True, True), ['a'])
check('locked', solve(['a','b'], ['a'], 'a', False, False), ['a'])
check('collapse', solve(['a','b'], ['a'], 'a', False, True), [])
check('multiple', solve(['a','b'], ['a'], 'b', True, True), ['a', 'b'])
check('single', solve(['a','b'], ['a'], 'b', False, True), ['b'])
check('parameterized panels', solve(list(range(N+1)), [0], N, True, True), [0,N])
for repetition in range(N):
    check('repeat single', solve(['a','b'], ['a'], 'b', False, True), ['b'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
removed['a', 'unknown']['a']Failed
unknown['a', 'unknown']['a']Failed
locked['a']['a']Passed
collapse[][]Passed
multiple['a', 'b']['a', 'b']Passed
single['b']['b']Passed
parameterized panels[0, 1][0, 1]Passed
repeat single['b']['b']Passed

SHA-256 / acc01970a90fb4f6d24e1b8c568075f8880999bae2a7ac96ecf2e25a1df0a016

3 / The verified repair

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

N = 1
observations = []
def solve(panels, opened, target, multiple, collapsible):
    valid = set(panels)
    opened = set(opened) & valid
    if target not in valid: return sorted(opened)
    if target in opened:
        if collapsible: opened.remove(target)
    elif multiple: opened.add(target)
    else: opened = {target}
    return sorted(opened)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('removed', solve(['a','b'], ['a','gone'], 'unknown', True, True), ['a'])
check('unknown', solve(['a','b'], ['a'], 'unknown', True, True), ['a'])
check('locked', solve(['a','b'], ['a'], 'a', False, False), ['a'])
check('collapse', solve(['a','b'], ['a'], 'a', False, True), [])
check('multiple', solve(['a','b'], ['a'], 'b', True, True), ['a', 'b'])
check('single', solve(['a','b'], ['a'], 'b', False, True), ['b'])
check('parameterized panels', solve(list(range(N+1)), [0], N, True, True), [0,N])
for repetition in range(N):
    check('repeat single', solve(['a','b'], ['a'], 'b', False, True), ['b'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
removed['a']['a']Passed
unknown['a']['a']Passed
locked['a']['a']Passed
collapse[][]Passed
multiple['a', 'b']['a', 'b']Passed
single['b']['b']Passed
parameterized panels[0, 1][0, 1]Passed
repeat single['b']['b']Passed

SHA-256 / b8fe78cbde67bd47435fdfb2ceb8126435f2c64371760b474144ab9b1ae04f34

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

Case digest / b89c06c21879dd1b5cbad7f9daa5fae511cb7badb7a9a85306c39f088b774732