FA-54546 / Accessibility interaction semantics / Open access
Ruby base mode unexpectedly substitutes pronunciation text · case 01
Ruby base mode unexpectedly substitutes pronunciation text.
ROOT CAUSE
The base mode decision in the ruby projection adapter violates its declared contract.
VERIFIED REPAIR
Apply the exact contract at the base mode decision: if mode == 'annotation' and annotation:
Unsuccessful approach: The local repair substitutes if mode != 'combined' and annotation: but still mishandles the regression fixtures.
Case contract
Input [segments,mode] where segments [base,annotation,fallback,language,hidden_annotation]. mode is base,annotation,combined. In annotation mode use nonempty visible annotation, otherwise base. Combined adds parenthesized visible annotation only when nonempty and different from base; fallback is markup-only content and never exposed. Return [text,runs] with runs [start,end,language,source], omitting zero-length contributions. Each segment is concatenated without implicit spaces. Combined annotation run includes parentheses. Source is base or annotation. Preserve original strings and language, including empty language.
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):
segments,mode = data
text = ''
runs = []
for base,annotation,fallback,language,hidden in segments:
annotation = '' if hidden else annotation
parts = []
if annotation: parts = [(annotation,'annotation')]
else:
parts = [(base,'base')]
if mode == 'combined' and annotation and annotation != base: parts.append(('('+annotation+')','annotation'))
for value,source in parts:
if not value: continue
start = len(text)
text += value
runs.append([start,len(text),language,source])
return [text,runs]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[['字'*N,'ji','fallback','ja',False]],'combined'],), ['字'*N+'(ji)',[[0,N,'ja','base'],[N,N+4,'ja','annotation']]])
check('contract fixture 2', solve([[['字','ji','fallback','ja',False]],'annotation'],), ['ji',[[0,2,'ja','annotation']]])
check('contract fixture 3', solve([[['字','ji','fallback','ja',True]],'annotation'],), ['字',[[0,1,'ja','base']]])
check('contract fixture 4', solve([[['same','same','fallback','',False]],'combined'],), ['same',[[0,4,'','base']]])
check('contract fixture 5', solve([[['A','','fallback','en',False],['B','bee','fallback','en',False]],'base'],), ['AB',[[0,1,'en','base'],[1,2,'en','base']]])
check('contract fixture 6', solve([[['','','fallback','en',False]],'combined'],), ['',[]])
check('contract fixture 7', solve([[['A','','fallback','en',False]],'annotation'],), ['A',[[0,1,'en','base']]])
check('contract fixture 8', solve([[],'annotation'],), ['',[]])
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 | ['ji', [[0, 2, 'ja', 'annotation']]] | ['字(ji)', [[0, 1, 'ja', 'base'], [1, 5, 'ja', 'annotation']]] | Failed |
| contract fixture 2 | ['ji', [[0, 2, 'ja', 'annotation']]] | ['ji', [[0, 2, 'ja', 'annotation']]] | Passed |
| contract fixture 3 | ['字', [[0, 1, 'ja', 'base']]] | ['字', [[0, 1, 'ja', 'base']]] | Passed |
| contract fixture 4 | ['same', [[0, 4, '', 'annotation']]] | ['same', [[0, 4, '', 'base']]] | Failed |
| contract fixture 5 | ['Abee', [[0, 1, 'en', 'base'], [1, 4, 'en', 'annotation']]] | ['AB', [[0, 1, 'en', 'base'], [1, 2, 'en', 'base']]] | Failed |
| contract fixture 6 | ['', []] | ['', []] | Passed |
| contract fixture 7 | ['A', [[0, 1, 'en', 'base']]] | ['A', [[0, 1, 'en', 'base']]] | Passed |
| contract fixture 8 | ['', []] | ['', []] | Passed |
SHA-256 / 44305e57f7f0cb35a533076b7261fbce4ee8917a4edd12683994f7f841fb62d3
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(data):
segments,mode = data
text = ''
runs = []
for base,annotation,fallback,language,hidden in segments:
annotation = '' if hidden else annotation
parts = []
if mode != 'combined' and annotation: parts = [(annotation,'annotation')]
else:
parts = [(base,'base')]
if mode == 'combined' and annotation and annotation != base: parts.append(('('+annotation+')','annotation'))
for value,source in parts:
if not value: continue
start = len(text)
text += value
runs.append([start,len(text),language,source])
return [text,runs]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[['字'*N,'ji','fallback','ja',False]],'combined'],), ['字'*N+'(ji)',[[0,N,'ja','base'],[N,N+4,'ja','annotation']]])
check('contract fixture 2', solve([[['字','ji','fallback','ja',False]],'annotation'],), ['ji',[[0,2,'ja','annotation']]])
check('contract fixture 3', solve([[['字','ji','fallback','ja',True]],'annotation'],), ['字',[[0,1,'ja','base']]])
check('contract fixture 4', solve([[['same','same','fallback','',False]],'combined'],), ['same',[[0,4,'','base']]])
check('contract fixture 5', solve([[['A','','fallback','en',False],['B','bee','fallback','en',False]],'base'],), ['AB',[[0,1,'en','base'],[1,2,'en','base']]])
check('contract fixture 6', solve([[['','','fallback','en',False]],'combined'],), ['',[]])
check('contract fixture 7', solve([[['A','','fallback','en',False]],'annotation'],), ['A',[[0,1,'en','base']]])
check('contract fixture 8', solve([[],'annotation'],), ['',[]])
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 | ['字(ji)', [[0, 1, 'ja', 'base'], [1, 5, 'ja', 'annotation']]] | ['字(ji)', [[0, 1, 'ja', 'base'], [1, 5, 'ja', 'annotation']]] | Passed |
| contract fixture 2 | ['ji', [[0, 2, 'ja', 'annotation']]] | ['ji', [[0, 2, 'ja', 'annotation']]] | Passed |
| contract fixture 3 | ['字', [[0, 1, 'ja', 'base']]] | ['字', [[0, 1, 'ja', 'base']]] | Passed |
| contract fixture 4 | ['same', [[0, 4, '', 'base']]] | ['same', [[0, 4, '', 'base']]] | Passed |
| contract fixture 5 | ['Abee', [[0, 1, 'en', 'base'], [1, 4, 'en', 'annotation']]] | ['AB', [[0, 1, 'en', 'base'], [1, 2, 'en', 'base']]] | Failed |
| contract fixture 6 | ['', []] | ['', []] | Passed |
| contract fixture 7 | ['A', [[0, 1, 'en', 'base']]] | ['A', [[0, 1, 'en', 'base']]] | Passed |
| contract fixture 8 | ['', []] | ['', []] | Passed |
SHA-256 / 052a5eeee13f1e31fdff102c9f862ffec6d1cbd510e2a723a47cef0c400688ce
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(data):
segments,mode = data
text = ''
runs = []
for base,annotation,fallback,language,hidden in segments:
annotation = '' if hidden else annotation
parts = []
if mode == 'annotation' and annotation: parts = [(annotation,'annotation')]
else:
parts = [(base,'base')]
if mode == 'combined' and annotation and annotation != base: parts.append(('('+annotation+')','annotation'))
for value,source in parts:
if not value: continue
start = len(text)
text += value
runs.append([start,len(text),language,source])
return [text,runs]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[['字'*N,'ji','fallback','ja',False]],'combined'],), ['字'*N+'(ji)',[[0,N,'ja','base'],[N,N+4,'ja','annotation']]])
check('contract fixture 2', solve([[['字','ji','fallback','ja',False]],'annotation'],), ['ji',[[0,2,'ja','annotation']]])
check('contract fixture 3', solve([[['字','ji','fallback','ja',True]],'annotation'],), ['字',[[0,1,'ja','base']]])
check('contract fixture 4', solve([[['same','same','fallback','',False]],'combined'],), ['same',[[0,4,'','base']]])
check('contract fixture 5', solve([[['A','','fallback','en',False],['B','bee','fallback','en',False]],'base'],), ['AB',[[0,1,'en','base'],[1,2,'en','base']]])
check('contract fixture 6', solve([[['','','fallback','en',False]],'combined'],), ['',[]])
check('contract fixture 7', solve([[['A','','fallback','en',False]],'annotation'],), ['A',[[0,1,'en','base']]])
check('contract fixture 8', solve([[],'annotation'],), ['',[]])
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 | ['字(ji)', [[0, 1, 'ja', 'base'], [1, 5, 'ja', 'annotation']]] | ['字(ji)', [[0, 1, 'ja', 'base'], [1, 5, 'ja', 'annotation']]] | Passed |
| contract fixture 2 | ['ji', [[0, 2, 'ja', 'annotation']]] | ['ji', [[0, 2, 'ja', 'annotation']]] | Passed |
| contract fixture 3 | ['字', [[0, 1, 'ja', 'base']]] | ['字', [[0, 1, 'ja', 'base']]] | Passed |
| contract fixture 4 | ['same', [[0, 4, '', 'base']]] | ['same', [[0, 4, '', 'base']]] | Passed |
| contract fixture 5 | ['AB', [[0, 1, 'en', 'base'], [1, 2, 'en', 'base']]] | ['AB', [[0, 1, 'en', 'base'], [1, 2, 'en', 'base']]] | Passed |
| contract fixture 6 | ['', []] | ['', []] | Passed |
| contract fixture 7 | ['A', [[0, 1, 'en', 'base']]] | ['A', [[0, 1, 'en', 'base']]] | Passed |
| contract fixture 8 | ['', []] | ['', []] | Passed |
SHA-256 / eb81ebe6d091c6f59a4ebe679a3d7b873702f24bdc0e46661bd6b7f67a35b703
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.270401+00:00.
Case digest / b18198037f6e2b64d8d2c427da49bcd3c84d684359c0d89ddd98dbe99b0a5f20