FAILURE MAP
← Case archive

FA-54596 / Accessibility interaction semantics / Open access

Authored math alternatives lose priority over structure · case 01

Authored math alternatives lose priority over structure.

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

ROOT CAUSE

The annotation choice decision in the math semantics adapter violates its declared contract.

VERIFIED REPAIR

Apply the exact contract at the annotation choice decision: node.get('alternative') or (render(children[0]) if len(children)==1 else 'malformed')

Unsuccessful approach: The local repair substitutes node.get('value') or (render(children[0]) if len(children)==1 else 'malformed') but still mishandles the regression fixtures.

Case contract

Input AST limited to token(value), row(children), fraction(two children), power(two children), root(one child), fenced(children), annotation(primary,alternative) encoded dict kind, value, children, alternative. Empty rows expose empty string. Tokens preserve value. Fraction says fraction numerator over denominator end fraction; power says base to power exponent; root says square root child end root; fenced says open contents close. Empty child output omitted between single spaces. Annotation uses a nonempty alternative verbatim, otherwise its sole primary child. Unknown kinds return unsupported; wrong arity returns malformed without traversing children.

Why this case matters

Offline accessibility bridge model with explicit policy; useful for testing semantic API adapters independently of browser implementations.

1 / The failure

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

N = 1
observations = []
def solve(data):
    def render(node):
        kind = node['kind']
        children = node.get('children',[])
        if kind == 'token': return node.get('value','')
        if kind == 'annotation': return render(children[0]) if len(children)==1 else 'malformed'
        if kind in ('fraction','power') and len(children)!=2: return 'malformed'
        if kind == 'root' and len(children)!=1: return 'malformed'
        if kind not in ('row','fraction','power','root','fenced'): return 'unsupported'
        parts = [render(child) for child in children]
        if kind == 'row': out = parts
        elif kind == 'fraction': out = ['fraction',parts[0],'over',parts[1],'end fraction']
        elif kind == 'power': out = [parts[0],'to power',parts[1]]
        elif kind == 'root': out = ['square root',parts[0],'end root']
        else: out = ['open']+parts+['close']
        return ' '.join(part for part in out if part)
    return render(data)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve({'kind':'fraction','children':[{'kind':'token','value':str(N)},{'kind':'token','value':'x'}]},), 'fraction '+str(N)+' over x end fraction')
check('contract fixture 2', solve({'kind':'power','children':[{'kind':'token','value':'x'},{'kind':'token','value':str(N)}]},), 'x to power '+str(N))
check('contract fixture 3', solve({'kind':'root','children':[{'kind':'token','value':'x'}]},), 'square root x end root')
check('contract fixture 4', solve({'kind':'fenced','children':[{'kind':'row','children':[{'kind':'token','value':''},{'kind':'token','value':'x'}]}]},), 'open x close')
check('contract fixture 5', solve({'kind':'annotation','alternative':'custom','children':[{'kind':'token','value':'x'}]},), 'custom')
check('contract fixture 6', solve({'kind':'annotation','alternative':'','children':[{'kind':'token','value':'x'}]},), 'x')
check('contract fixture 7', solve({'kind':'fraction','children':[]},), 'malformed')
check('contract fixture 8', solve({'kind':'root','children':[]},), 'malformed')
check('contract fixture 9', solve({'kind':'unknown','children':[]},), 'unsupported')
check('contract fixture 10', solve({'kind':'row','children':[]},), '')
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
contract fixture 1fraction 1 over x end fractionfraction 1 over x end fractionPassed
contract fixture 2x to power 1x to power 1Passed
contract fixture 3square root x end rootsquare root x end rootPassed
contract fixture 4open x closeopen x closePassed
contract fixture 5xcustomFailed
contract fixture 6xxPassed
contract fixture 7malformedmalformedPassed
contract fixture 8malformedmalformedPassed
contract fixture 9unsupportedunsupportedPassed
contract fixture 10Passed

SHA-256 / b6af3c0766bacb195185daecd55e4a2a61e12ef9470caae18c9535e2478314b1

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(data):
    def render(node):
        kind = node['kind']
        children = node.get('children',[])
        if kind == 'token': return node.get('value','')
        if kind == 'annotation': return node.get('value') or (render(children[0]) if len(children)==1 else 'malformed')
        if kind in ('fraction','power') and len(children)!=2: return 'malformed'
        if kind == 'root' and len(children)!=1: return 'malformed'
        if kind not in ('row','fraction','power','root','fenced'): return 'unsupported'
        parts = [render(child) for child in children]
        if kind == 'row': out = parts
        elif kind == 'fraction': out = ['fraction',parts[0],'over',parts[1],'end fraction']
        elif kind == 'power': out = [parts[0],'to power',parts[1]]
        elif kind == 'root': out = ['square root',parts[0],'end root']
        else: out = ['open']+parts+['close']
        return ' '.join(part for part in out if part)
    return render(data)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve({'kind':'fraction','children':[{'kind':'token','value':str(N)},{'kind':'token','value':'x'}]},), 'fraction '+str(N)+' over x end fraction')
check('contract fixture 2', solve({'kind':'power','children':[{'kind':'token','value':'x'},{'kind':'token','value':str(N)}]},), 'x to power '+str(N))
check('contract fixture 3', solve({'kind':'root','children':[{'kind':'token','value':'x'}]},), 'square root x end root')
check('contract fixture 4', solve({'kind':'fenced','children':[{'kind':'row','children':[{'kind':'token','value':''},{'kind':'token','value':'x'}]}]},), 'open x close')
check('contract fixture 5', solve({'kind':'annotation','alternative':'custom','children':[{'kind':'token','value':'x'}]},), 'custom')
check('contract fixture 6', solve({'kind':'annotation','alternative':'','children':[{'kind':'token','value':'x'}]},), 'x')
check('contract fixture 7', solve({'kind':'fraction','children':[]},), 'malformed')
check('contract fixture 8', solve({'kind':'root','children':[]},), 'malformed')
check('contract fixture 9', solve({'kind':'unknown','children':[]},), 'unsupported')
check('contract fixture 10', solve({'kind':'row','children':[]},), '')
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
contract fixture 1fraction 1 over x end fractionfraction 1 over x end fractionPassed
contract fixture 2x to power 1x to power 1Passed
contract fixture 3square root x end rootsquare root x end rootPassed
contract fixture 4open x closeopen x closePassed
contract fixture 5xcustomFailed
contract fixture 6xxPassed
contract fixture 7malformedmalformedPassed
contract fixture 8malformedmalformedPassed
contract fixture 9unsupportedunsupportedPassed
contract fixture 10Passed

SHA-256 / c687237bba23bed531d492b4503147740eab36f0f169b74b236c50f25e23c422

3 / The verified repair

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

N = 1
observations = []
def solve(data):
    def render(node):
        kind = node['kind']
        children = node.get('children',[])
        if kind == 'token': return node.get('value','')
        if kind == 'annotation': return node.get('alternative') or (render(children[0]) if len(children)==1 else 'malformed')
        if kind in ('fraction','power') and len(children)!=2: return 'malformed'
        if kind == 'root' and len(children)!=1: return 'malformed'
        if kind not in ('row','fraction','power','root','fenced'): return 'unsupported'
        parts = [render(child) for child in children]
        if kind == 'row': out = parts
        elif kind == 'fraction': out = ['fraction',parts[0],'over',parts[1],'end fraction']
        elif kind == 'power': out = [parts[0],'to power',parts[1]]
        elif kind == 'root': out = ['square root',parts[0],'end root']
        else: out = ['open']+parts+['close']
        return ' '.join(part for part in out if part)
    return render(data)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve({'kind':'fraction','children':[{'kind':'token','value':str(N)},{'kind':'token','value':'x'}]},), 'fraction '+str(N)+' over x end fraction')
check('contract fixture 2', solve({'kind':'power','children':[{'kind':'token','value':'x'},{'kind':'token','value':str(N)}]},), 'x to power '+str(N))
check('contract fixture 3', solve({'kind':'root','children':[{'kind':'token','value':'x'}]},), 'square root x end root')
check('contract fixture 4', solve({'kind':'fenced','children':[{'kind':'row','children':[{'kind':'token','value':''},{'kind':'token','value':'x'}]}]},), 'open x close')
check('contract fixture 5', solve({'kind':'annotation','alternative':'custom','children':[{'kind':'token','value':'x'}]},), 'custom')
check('contract fixture 6', solve({'kind':'annotation','alternative':'','children':[{'kind':'token','value':'x'}]},), 'x')
check('contract fixture 7', solve({'kind':'fraction','children':[]},), 'malformed')
check('contract fixture 8', solve({'kind':'root','children':[]},), 'malformed')
check('contract fixture 9', solve({'kind':'unknown','children':[]},), 'unsupported')
check('contract fixture 10', solve({'kind':'row','children':[]},), '')
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
contract fixture 1fraction 1 over x end fractionfraction 1 over x end fractionPassed
contract fixture 2x to power 1x to power 1Passed
contract fixture 3square root x end rootsquare root x end rootPassed
contract fixture 4open x closeopen x closePassed
contract fixture 5customcustomPassed
contract fixture 6xxPassed
contract fixture 7malformedmalformedPassed
contract fixture 8malformedmalformedPassed
contract fixture 9unsupportedunsupportedPassed
contract fixture 10Passed

SHA-256 / a4b07a10e73a5deba55e681549aec7a18eaf21936256879f212ca33892983e8d

Verification & scope

Stipulated finite adapter contract, not a claim of platform accessibility or ARIA conformance. 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:45:49.856578+00:00.

Case digest / f8fcfe245ab3d51de1af841c1f429aa977c757346413e5d0af1ed1ff52bd5a3e