FA-54591 / Accessibility interaction semantics / Open access
Math tokens expose their node kind instead of content · case 01
Math tokens expose their node kind instead of content.
ROOT CAUSE
The token value decision in the math semantics adapter violates its declared contract.
VERIFIED REPAIR
Apply the exact contract at the token value decision: return node.get('value','')
Unsuccessful approach: The local repair substitutes return node.get('value','').upper() 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 kind
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 1 | fraction token over token end fraction | fraction 1 over x end fraction | Failed |
| contract fixture 2 | token to power token | x to power 1 | Failed |
| contract fixture 3 | square root token end root | square root x end root | Failed |
| contract fixture 4 | open token token close | open x close | Failed |
| contract fixture 5 | custom | custom | Passed |
| contract fixture 6 | token | x | Failed |
| contract fixture 7 | malformed | malformed | Passed |
| contract fixture 8 | malformed | malformed | Passed |
| contract fixture 9 | unsupported | unsupported | Passed |
| contract fixture 10 | | | Passed |
SHA-256 / 2c1ecbd5f004c770633aabc67bd2a7240af456367729d3d3519ca9f4a5d66c47
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','').upper()
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 1 | fraction 1 over X end fraction | fraction 1 over x end fraction | Failed |
| contract fixture 2 | X to power 1 | x to power 1 | Failed |
| contract fixture 3 | square root X end root | square root x end root | Failed |
| contract fixture 4 | open X close | open x close | Failed |
| contract fixture 5 | custom | custom | Passed |
| contract fixture 6 | X | x | Failed |
| contract fixture 7 | malformed | malformed | Passed |
| contract fixture 8 | malformed | malformed | Passed |
| contract fixture 9 | unsupported | unsupported | Passed |
| contract fixture 10 | | | Passed |
SHA-256 / 3b0cf46e450c9cdaa07cbe119ad5c0d3a406b77b874e085a873171db8ba26f0f
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 1 | fraction 1 over x end fraction | fraction 1 over x end fraction | Passed |
| contract fixture 2 | x to power 1 | x to power 1 | Passed |
| contract fixture 3 | square root x end root | square root x end root | Passed |
| contract fixture 4 | open x close | open x close | Passed |
| contract fixture 5 | custom | custom | Passed |
| contract fixture 6 | x | x | Passed |
| contract fixture 7 | malformed | malformed | Passed |
| contract fixture 8 | malformed | malformed | Passed |
| contract fixture 9 | unsupported | unsupported | Passed |
| contract fixture 10 | | | Passed |
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.821957+00:00.
Case digest / 8bafaa1fb94c57eac66c382e8fcb79335a6ff3437232d6dbeebd05892ea7219f