FA-8091 / Disclosure widgets / Open access
Accordion open-panel state: Noncollapsible panels close on repeated activation · case 01
Noncollapsible panels close on repeated activation.
ROOT CAUSE
The collapse policy operation uses `if True: opened.remove(target)` where the contract requires `if collapsible: opened.remove(target)`.
THE FAILURE
The collapse policy operation uses `if True: opened.remove(target)` where the contract requires `if collapsible: opened.remove(target)`.
Unsuccessful approach: Disabling collapse universally breaks collapsible accordions.
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 True: 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'] | Failed |
| 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 / ca1972bd7750a8f436646032726fb23128250c0902138bff2a9628d5062fcd03
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 False: 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 | ['a'] | [] | Failed |
| multiple | ['a', 'b'] | ['a', 'b'] | Passed |
| single | ['b'] | ['b'] | Passed |
| parameterized panels | [0, 1] | [0, 1] | Passed |
| repeat single | ['b'] | ['b'] | Passed |
SHA-256 / 97eee2227914b6969f787cdcc2d9b897531588d3cf69d4a3f8b93e5020d7253f
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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.132215+00:00.
Case digest / 6c302ea1fa112ba52c917e97872c0761f18d944a666d2b155ccfc23932526684