FAILURE MAP
← Case archive

FA-8381 / Tree accessibility / Open access

Tree keyboard expansion: Right-arrow fails to expand the focused parent · case 01

Right-arrow fails to expand the focused parent.

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

ROOT CAUSE

The expand right operation uses `expanded.clear()` where the contract requires `expanded.add(node)`.

THE FAILURE

The expand right operation uses `expanded.clear()` where the contract requires `expanded.add(node)`.

Unsuccessful approach: Expanding children does not expand their parent.

Case contract

Right expands then enters the first child; Left collapses only the current branch or focuses its parent; roots retain focus; collapse-all clears every expansion.

Why this case matters

A deterministic model of tree keyboard expansion; 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(node, expanded, parents, children, key):
    expanded = set(expanded)
    kids = children.get(node, [])
    if key == 'Right' and kids:
        if node not in expanded: expanded.clear()
        else: node = kids[0]
    elif key == 'Left':
        if node in expanded: expanded.remove(node)
        else: node = parents.get(node, node)
    elif key == 'CollapseAll': expanded.clear()
    return (node, sorted(expanded))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('expand', solve('a', ['z'], {}, {'a':['b','c']}, 'Right'), ('a', ['a', 'z']))
check('descend', solve('a', ['a'], {}, {'a':['b','c']}, 'Right'), ('b', ['a']))
check('collapse', solve('a', ['a','z'], {}, {'a':['b']}, 'Left'), ('a', ['z']))
check('parent', solve('b', [], {'b':'a'}, {}, 'Left'), ('a', []))
check('root', solve('a', [], {}, {}, 'Left'), ('a', []))
check('all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
check('parameterized child count', solve('a', [], {}, {'a':list(range(N))}, 'Right'), ('a',['a']))
for repetition in range(N):
    check('repeat all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
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
expand['a', []]['a', ['a', 'z']]Failed
descend['b', ['a']]['b', ['a']]Passed
collapse['a', ['z']]['a', ['z']]Passed
parent['a', []]['a', []]Passed
root['a', []]['a', []]Passed
all['a', []]['a', []]Passed
parameterized child count['a', []]['a', ['a']]Failed
repeat all['a', []]['a', []]Passed

SHA-256 / 2b6bf8c1c81c90d37ceca2e5e4ae1c8bba1d2ed1ef87a98f0c927a22bbd447ef

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(node, expanded, parents, children, key):
    expanded = set(expanded)
    kids = children.get(node, [])
    if key == 'Right' and kids:
        if node not in expanded: expanded.update(kids)
        else: node = kids[0]
    elif key == 'Left':
        if node in expanded: expanded.remove(node)
        else: node = parents.get(node, node)
    elif key == 'CollapseAll': expanded.clear()
    return (node, sorted(expanded))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('expand', solve('a', ['z'], {}, {'a':['b','c']}, 'Right'), ('a', ['a', 'z']))
check('descend', solve('a', ['a'], {}, {'a':['b','c']}, 'Right'), ('b', ['a']))
check('collapse', solve('a', ['a','z'], {}, {'a':['b']}, 'Left'), ('a', ['z']))
check('parent', solve('b', [], {'b':'a'}, {}, 'Left'), ('a', []))
check('root', solve('a', [], {}, {}, 'Left'), ('a', []))
check('all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
check('parameterized child count', solve('a', [], {}, {'a':list(range(N))}, 'Right'), ('a',['a']))
for repetition in range(N):
    check('repeat all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
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
expand['a', ['b', 'c', 'z']]['a', ['a', 'z']]Failed
descend['b', ['a']]['b', ['a']]Passed
collapse['a', ['z']]['a', ['z']]Passed
parent['a', []]['a', []]Passed
root['a', []]['a', []]Passed
all['a', []]['a', []]Passed
parameterized child count['a', [0]]['a', ['a']]Failed
repeat all['a', []]['a', []]Passed

SHA-256 / 26a16bb64babe35990a7afc7ee934e4313d1861eb167cea110c7d5bac796b53b

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

Case digest / 5c7d207fd796cc954bf26265f9b54a1f21360551081c9e2b721f973a05cdd4e5