FAILURE MAP
← Case archive

FA-8431 / Assistive semantics / Open access

Accessible name precedence: Referenced labels are reordered alphabetically · case 01

Referenced labels are reordered alphabetically.

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

ROOT CAUSE

The reference order operation uses `' '.join(sorted(referenced))` where the contract requires `' '.join(referenced)`.

VERIFIED REPAIR

Implement the reference order operation as `' '.join(referenced)`.

Unsuccessful approach: Reversing references also violates explicit label order.

Case contract

Resolve existing labelledby references in order, including explicit empty labels; then aria-label, native label, and visible content; explicit labels take precedence over fallback content.

Why this case matters

A deterministic model of accessible name precedence; 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(labelledby, nodes, aria_label, native_label, content, hidden):
    referenced = [nodes[x] for x in labelledby if x in nodes]
    if referenced: return ' '.join(sorted(referenced))
    if aria_label is not None: return aria_label
    if native_label is not None: return native_label
    if hidden: return ''
    return content
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('reference order', solve(['z','a'], {'z':'Zulu','a':'Alpha'}, 'fallback', 'native', 'body', False), 'Zulu Alpha')
check('aria empty', solve([], {}, '', 'native', 'body', False), '')
check('native empty', solve([], {}, None, '', 'body', False), '')
check('hidden', solve([], {}, None, None, 'secret', True), '')
check('visible', solve([], {}, None, None, 'visible', False), 'visible')
check('empty reference', solve(['missing','empty'], {'empty':''}, 'fallback', None, 'body', False), '')
check('parameterized label content', solve([], {}, 'label'+str(N), None, 'body', False), 'label'+str(N))
for repetition in range(N):
    check('repeat empty reference', solve(['missing','empty'], {'empty':''}, 'fallback', None, 'body', False), '')
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
reference orderAlpha ZuluZulu AlphaFailed
aria emptyPassed
native emptyPassed
hiddenPassed
visiblevisiblevisiblePassed
empty referencePassed
parameterized label contentlabel1label1Passed
repeat empty referencePassed

SHA-256 / 132a672f7747a8b2996fa9f0d9aee1c280c9ea500e8989e04481ea1ec583b2e1

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(labelledby, nodes, aria_label, native_label, content, hidden):
    referenced = [nodes[x] for x in labelledby if x in nodes]
    if referenced: return ' '.join(reversed(referenced))
    if aria_label is not None: return aria_label
    if native_label is not None: return native_label
    if hidden: return ''
    return content
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('reference order', solve(['z','a'], {'z':'Zulu','a':'Alpha'}, 'fallback', 'native', 'body', False), 'Zulu Alpha')
check('aria empty', solve([], {}, '', 'native', 'body', False), '')
check('native empty', solve([], {}, None, '', 'body', False), '')
check('hidden', solve([], {}, None, None, 'secret', True), '')
check('visible', solve([], {}, None, None, 'visible', False), 'visible')
check('empty reference', solve(['missing','empty'], {'empty':''}, 'fallback', None, 'body', False), '')
check('parameterized label content', solve([], {}, 'label'+str(N), None, 'body', False), 'label'+str(N))
for repetition in range(N):
    check('repeat empty reference', solve(['missing','empty'], {'empty':''}, 'fallback', None, 'body', False), '')
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
reference orderAlpha ZuluZulu AlphaFailed
aria emptyPassed
native emptyPassed
hiddenPassed
visiblevisiblevisiblePassed
empty referencePassed
parameterized label contentlabel1label1Passed
repeat empty referencePassed

SHA-256 / 561686d73251015a860d641464024189bc86c752d13c623241d28a08fe6b636e

3 / The verified repair

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

N = 1
observations = []
def solve(labelledby, nodes, aria_label, native_label, content, hidden):
    referenced = [nodes[x] for x in labelledby if x in nodes]
    if referenced: return ' '.join(referenced)
    if aria_label is not None: return aria_label
    if native_label is not None: return native_label
    if hidden: return ''
    return content
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('reference order', solve(['z','a'], {'z':'Zulu','a':'Alpha'}, 'fallback', 'native', 'body', False), 'Zulu Alpha')
check('aria empty', solve([], {}, '', 'native', 'body', False), '')
check('native empty', solve([], {}, None, '', 'body', False), '')
check('hidden', solve([], {}, None, None, 'secret', True), '')
check('visible', solve([], {}, None, None, 'visible', False), 'visible')
check('empty reference', solve(['missing','empty'], {'empty':''}, 'fallback', None, 'body', False), '')
check('parameterized label content', solve([], {}, 'label'+str(N), None, 'body', False), 'label'+str(N))
for repetition in range(N):
    check('repeat empty reference', solve(['missing','empty'], {'empty':''}, 'fallback', None, 'body', False), '')
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
reference orderZulu AlphaZulu AlphaPassed
aria emptyPassed
native emptyPassed
hiddenPassed
visiblevisiblevisiblePassed
empty referencePassed
parameterized label contentlabel1label1Passed
repeat empty referencePassed

SHA-256 / 4a8117238ad2ac80817d300f0e91664c1ddb47df852ab045ba134c325fc2746f

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

Case digest / 8c8f18036aa9b0262df557a1703d2105536dc67df9fda91fc0d6374f0e0e8c06