FAILURE MAP
← Case archive

FA-8586 / Tab interfaces / Open access

Tab selection and activation mode: Removing the focused tab selects the wrong fallback · case 01

Removing the focused tab selects the wrong fallback.

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

ROOT CAUSE

The removed focus operation uses `if focused not in available: focused = available[-1]` where the contract requires `if focused not in available: focused = available[0]`.

THE FAILURE

The removed focus operation uses `if focused not in available: focused = available[-1]` where the contract requires `if focused not in available: focused = available[0]`.

Unsuccessful approach: Preserving an absent focus leaves no active tab stop.

Case contract

Focus traverses enabled tabs; automatic mode activates on focus, manual mode requires Enter or Space; removed focus or selection falls back to first enabled tab.

Why this case matters

A deterministic model of tab selection and activation mode; 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(tabs, focused, selected, key, automatic, disabled):
    available = [t for t in tabs if t not in disabled]
    if not available: return (None, None)
    if focused not in available: focused = available[-1]
    if key == 'Next': focused = available[(available.index(focused)+1) % len(available)]
    if key == 'Previous': focused = available[(available.index(focused)-1) % len(available)]
    if automatic or key in ('Enter','Space'): selected = focused
    if selected not in available: selected = available[0]
    return (focused, selected)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve(['a','b','c'], 'a', 'a', 'Next', True, ['b']), ('c', 'c'))
check('removed focus', solve(['a','b','c'], 'gone', 'a', 'none', False, []), ('a', 'a'))
check('next', solve(['a','b','c'], 'a', 'a', 'Next', True, []), ('b', 'b'))
check('manual', solve(['a','b','c'], 'a', 'a', 'Next', False, []), ('b', 'a'))
check('space', solve(['a','b'], 'b', 'a', 'Space', False, []), ('b', 'b'))
check('removed selection', solve(['a','b'], 'b', 'gone', 'none', False, []), ('b', 'a'))
check('empty', solve([], None, None, 'Next', True, []), (None, None))
check('parameterized tab identities', solve(list(range(N+2)), N, N, 'Next', True, []), (N+1,N+1))
for repetition in range(N):
    check('repeat empty', solve([], None, None, 'Next', True, []), (None, None))
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
disabled['c', 'c']['c', 'c']Passed
removed focus['c', 'a']['a', 'a']Failed
next['b', 'b']['b', 'b']Passed
manual['b', 'a']['b', 'a']Passed
space['b', 'b']['b', 'b']Passed
removed selection['b', 'a']['b', 'a']Passed
empty[None, None][None, None]Passed
parameterized tab identities[2, 2][2, 2]Passed
repeat empty[None, None][None, None]Passed

SHA-256 / 93213e9cba1dbe5256d7b1ee9e23e7f37337c29f076c4ee71145952b1a322339

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(tabs, focused, selected, key, automatic, disabled):
    available = [t for t in tabs if t not in disabled]
    if not available: return (None, None)
    if focused not in available: return (focused, selected)
    if key == 'Next': focused = available[(available.index(focused)+1) % len(available)]
    if key == 'Previous': focused = available[(available.index(focused)-1) % len(available)]
    if automatic or key in ('Enter','Space'): selected = focused
    if selected not in available: selected = available[0]
    return (focused, selected)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve(['a','b','c'], 'a', 'a', 'Next', True, ['b']), ('c', 'c'))
check('removed focus', solve(['a','b','c'], 'gone', 'a', 'none', False, []), ('a', 'a'))
check('next', solve(['a','b','c'], 'a', 'a', 'Next', True, []), ('b', 'b'))
check('manual', solve(['a','b','c'], 'a', 'a', 'Next', False, []), ('b', 'a'))
check('space', solve(['a','b'], 'b', 'a', 'Space', False, []), ('b', 'b'))
check('removed selection', solve(['a','b'], 'b', 'gone', 'none', False, []), ('b', 'a'))
check('empty', solve([], None, None, 'Next', True, []), (None, None))
check('parameterized tab identities', solve(list(range(N+2)), N, N, 'Next', True, []), (N+1,N+1))
for repetition in range(N):
    check('repeat empty', solve([], None, None, 'Next', True, []), (None, None))
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
disabled['c', 'c']['c', 'c']Passed
removed focus['gone', 'a']['a', 'a']Failed
next['b', 'b']['b', 'b']Passed
manual['b', 'a']['b', 'a']Passed
space['b', 'b']['b', 'b']Passed
removed selection['b', 'a']['b', 'a']Passed
empty[None, None][None, None]Passed
parameterized tab identities[2, 2][2, 2]Passed
repeat empty[None, None][None, None]Passed

SHA-256 / 57f4e00f46a7da17801c5681430651b8af5a96d216bf8fe3eb4cab5750d3679f

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 9 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:22.739483+00:00.

Case digest / 59e6b4f4f030f868a65571f824001c62d8b27295070d2fec27c00649d29661fe