FA-54556 / Accessibility interaction semantics / Open access
Ruby annotations are appended in base-only mode · case 01
Ruby annotations are appended in base-only mode.
ROOT CAUSE
The combined only decision in the ruby projection adapter violates its declared contract.
VERIFIED REPAIR
Apply the exact contract at the combined only decision: mode == 'combined' and annotation and annotation != base
Unsuccessful approach: The local repair substitutes annotation and annotation != base 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 mode == 'annotation' and annotation: parts = [(annotation,'annotation')]
else:
parts = [(base,'base')]
if mode != 'annotation' 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(bee)', [[0, 1, 'en', 'base'], [1, 2, 'en', 'base'], [2, 7, '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 / 5eea07d66236f29dfbf8c054ed5a74452ca61c1ae742f5ea5183eb6de2c0ed89
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 == 'annotation' and annotation: parts = [(annotation,'annotation')]
else:
parts = [(base,'base')]
if 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(bee)', [[0, 1, 'en', 'base'], [1, 2, 'en', 'base'], [2, 7, '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 / d19617e5de174b5b34f607ddbf58df6f8d01d5da89b82090249c3b3eb69bf842
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.517787+00:00.
Case digest / 6ddeb1378b904239becd4e6a56f3ff42b5fe80e84605d09bbd7bcf754140338a