FA-8096 / Disclosure widgets / Open access
Accordion open-panel state: Opening a second panel in multiple mode closes the first · case 01
Opening a second panel in multiple mode closes the first.
ROOT CAUSE
The multi open operation uses `elif multiple: opened = {target}` where the contract requires `elif multiple: opened.add(target)`.
VERIFIED REPAIR
Implement the multi open operation as `elif multiple: opened.add(target)`.
Unsuccessful approach: Removing the target never opens it.
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 sorted(opened)
if target in opened:
if collapsible: opened.remove(target)
elif multiple: opened = {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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| removed | ['a'] | ['a'] | Passed |
| unknown | ['a'] | ['a'] | Passed |
| locked | ['a'] | ['a'] | Passed |
| collapse | [] | [] | Passed |
| multiple | ['b'] | ['a', 'b'] | Failed |
| single | ['b'] | ['b'] | Passed |
| parameterized panels | [1] | [0, 1] | Failed |
| repeat single | ['b'] | ['b'] | Passed |
SHA-256 / 4413714cb9af475fba787dcca6d03c25e9b8c156a57d009932efb23a20c8e22c
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)
if target in opened:
if collapsible: opened.remove(target)
elif multiple: opened.discard(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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| removed | ['a'] | ['a'] | Passed |
| unknown | ['a'] | ['a'] | Passed |
| locked | ['a'] | ['a'] | Passed |
| collapse | [] | [] | Passed |
| multiple | ['a'] | ['a', 'b'] | Failed |
| single | ['b'] | ['b'] | Passed |
| parameterized panels | [0] | [0, 1] | Failed |
| repeat single | ['b'] | ['b'] | Passed |
SHA-256 / 11ae8756f4d6168c460f671273f9381d876cb44ca061c00f9d8f175155ba3fc7
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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.129057+00:00.
Case digest / 81d3cdbaf75e93b75483c2034505a3048a774ff99ff5149ae301019f7979c20a