FAILURE MAP
← Case archive

FA-54761 / Accessibility interaction semantics / Open access

Platform language tags retain underscore separators · case 01

Platform language tags retain underscore separators.

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

ROOT CAUSE

The language tag decision in the document properties adapter violates its declared contract.

VERIFIED REPAIR

Apply the exact contract at the language tag decision: x['language'].replace('_','-')

Unsuccessful approach: The local repair substitutes x['language'].replace('_','-',1) but still mishandles the regression fixtures.

Case contract

Input document record title,url,language,mime,loaded,percent,security,private,permissions,revision. Return name (title else URL basename stripping query and fragment), address (None if private), language (replace underscore with hyphen), content_type (lowercase MIME before semicolon), loading (not loaded), progress (100 if loaded otherwise clamp integer percent0..99), secure (security exactly verified), actions (print then copy only when each permission and loaded; copy also forbidden in private), revision. Empty URL fallback is empty name. This policy is deliberately stipulated for a document accessibility bridge.

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):
    x = data
    url = x['url']
    fallback = url.split('#',1)[0].split('?',1)[0].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded'] and not x['private'] and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'],'content_type':x['mime'].split(';',1)[0].strip().lower(),'loading':not x['loaded'],'progress':100 if x['loaded'] else max(0,min(99,x['percent'])),'secure':x['security']=='verified','actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
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 1{'actions': ['print', 'copy'], 'address': 'https://x/a?key=1#f', 'content_type': 'text/html', 'language': 'en_US', 'loading': False, 'name': 'Title1', 'progress': 100, 'revision': 1, 'secure': True}{'actions': ['print', 'copy'], 'address': 'https://x/a?key=1#f', 'content_type': 'text/html', 'language': 'en-US', 'loading': False, 'name': 'Title1', 'progress': 100, 'revision': 1, 'secure': True}Failed
contract fixture 2{'actions': [], 'address': 'https://x/a?key=1#f', 'content_type': 'text/plain', 'language': 'ja', 'loading': True, 'name': 'a', 'progress': 99, 'revision': 1, 'secure': False}{'actions': [], 'address': 'https://x/a?key=1#f', 'content_type': 'text/plain', 'language': 'ja', 'loading': True, 'name': 'a', 'progress': 99, 'revision': 1, 'secure': False}Passed
contract fixture 3{'actions': ['print'], 'address': None, 'content_type': 'text/plain', 'language': '', 'loading': False, 'name': 'Secret', 'progress': 100, 'revision': 1, 'secure': False}{'actions': ['print'], 'address': None, 'content_type': 'text/plain', 'language': '', 'loading': False, 'name': 'Secret', 'progress': 100, 'revision': 1, 'secure': False}Passed
contract fixture 4{'actions': [], 'address': '', 'content_type': 'text/plain', 'language': 'en', 'loading': True, 'name': '', 'progress': 0, 'revision': 1, 'secure': False}{'actions': [], 'address': '', 'content_type': 'text/plain', 'language': 'en', 'loading': True, 'name': '', 'progress': 0, 'revision': 1, 'secure': False}Passed
contract fixture 5{'actions': [], 'address': 'https://x/path/#frag', 'content_type': 'text/xml', 'language': 'en', 'loading': False, 'name': 'path', 'progress': 100, 'revision': 1, 'secure': True}{'actions': [], 'address': 'https://x/path/#frag', 'content_type': 'text/xml', 'language': 'en', 'loading': False, 'name': 'path', 'progress': 100, 'revision': 1, 'secure': True}Passed
contract fixture 6{'actions': [], 'address': 'a', 'content_type': 'text/plain', 'language': 'zh_Hant_TW', 'loading': True, 'name': 'a', 'progress': 1, 'revision': 1, 'secure': True}{'actions': [], 'address': 'a', 'content_type': 'text/plain', 'language': 'zh-Hant-TW', 'loading': True, 'name': 'a', 'progress': 1, 'revision': 1, 'secure': True}Failed

SHA-256 / 253c6b68beb9a0df92211fbd9877989a9f1ec54dab54b9e480cc99d140587c9d

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(data):
    x = data
    url = x['url']
    fallback = url.split('#',1)[0].split('?',1)[0].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded'] and not x['private'] and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'].replace('_','-',1),'content_type':x['mime'].split(';',1)[0].strip().lower(),'loading':not x['loaded'],'progress':100 if x['loaded'] else max(0,min(99,x['percent'])),'secure':x['security']=='verified','actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
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 1{'actions': ['print', 'copy'], 'address': 'https://x/a?key=1#f', 'content_type': 'text/html', 'language': 'en-US', 'loading': False, 'name': 'Title1', 'progress': 100, 'revision': 1, 'secure': True}{'actions': ['print', 'copy'], 'address': 'https://x/a?key=1#f', 'content_type': 'text/html', 'language': 'en-US', 'loading': False, 'name': 'Title1', 'progress': 100, 'revision': 1, 'secure': True}Passed
contract fixture 2{'actions': [], 'address': 'https://x/a?key=1#f', 'content_type': 'text/plain', 'language': 'ja', 'loading': True, 'name': 'a', 'progress': 99, 'revision': 1, 'secure': False}{'actions': [], 'address': 'https://x/a?key=1#f', 'content_type': 'text/plain', 'language': 'ja', 'loading': True, 'name': 'a', 'progress': 99, 'revision': 1, 'secure': False}Passed
contract fixture 3{'actions': ['print'], 'address': None, 'content_type': 'text/plain', 'language': '', 'loading': False, 'name': 'Secret', 'progress': 100, 'revision': 1, 'secure': False}{'actions': ['print'], 'address': None, 'content_type': 'text/plain', 'language': '', 'loading': False, 'name': 'Secret', 'progress': 100, 'revision': 1, 'secure': False}Passed
contract fixture 4{'actions': [], 'address': '', 'content_type': 'text/plain', 'language': 'en', 'loading': True, 'name': '', 'progress': 0, 'revision': 1, 'secure': False}{'actions': [], 'address': '', 'content_type': 'text/plain', 'language': 'en', 'loading': True, 'name': '', 'progress': 0, 'revision': 1, 'secure': False}Passed
contract fixture 5{'actions': [], 'address': 'https://x/path/#frag', 'content_type': 'text/xml', 'language': 'en', 'loading': False, 'name': 'path', 'progress': 100, 'revision': 1, 'secure': True}{'actions': [], 'address': 'https://x/path/#frag', 'content_type': 'text/xml', 'language': 'en', 'loading': False, 'name': 'path', 'progress': 100, 'revision': 1, 'secure': True}Passed
contract fixture 6{'actions': [], 'address': 'a', 'content_type': 'text/plain', 'language': 'zh-Hant_TW', 'loading': True, 'name': 'a', 'progress': 1, 'revision': 1, 'secure': True}{'actions': [], 'address': 'a', 'content_type': 'text/plain', 'language': 'zh-Hant-TW', 'loading': True, 'name': 'a', 'progress': 1, 'revision': 1, 'secure': True}Failed

SHA-256 / 10c5d46a3b826c0c617df5402f2410a7eb0d353be86a526708f3738f6f2ce26e

3 / The verified repair

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

N = 1
observations = []
def solve(data):
    x = data
    url = x['url']
    fallback = url.split('#',1)[0].split('?',1)[0].rstrip('/').rsplit('/',1)[-1]
    actions = []
    if x['loaded'] and 'print' in x['permissions']: actions.append('print')
    if x['loaded'] and not x['private'] and 'copy' in x['permissions']: actions.append('copy')
    return {'name':x['title'] or fallback,'address':None if x['private'] else url,'language':x['language'].replace('_','-'),'content_type':x['mime'].split(';',1)[0].strip().lower(),'loading':not x['loaded'],'progress':100 if x['loaded'] else max(0,min(99,x['percent'])),'secure':x['security']=='verified','actions':actions,'revision':x['revision']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve(dict(title='Title'+str(N),url='https://x/a?key=1#f',language='en_US',mime='Text/HTML; charset=utf8',loaded=True,percent=30,security='verified',private=False,permissions=['copy','print'],revision=N),), {'name':'Title'+str(N),'address':'https://x/a?key=1#f','language':'en-US','content_type':'text/html','loading':False,'progress':100,'secure':True,'actions':['print','copy'],'revision':N})
check('contract fixture 2', solve(dict(title='',url='https://x/a?key=1#f',language='ja',mime='text/plain',loaded=False,percent=150,security='unverified',private=False,permissions=['copy','print'],revision=N),), {'name':'a','address':'https://x/a?key=1#f','language':'ja','content_type':'text/plain','loading':True,'progress':99,'secure':False,'actions':[],'revision':N})
check('contract fixture 3', solve(dict(title='Secret',url='file:///secret',language='',mime='text/plain',loaded=True,percent=100,security='blocked',private=True,permissions=['copy','print'],revision=N),), {'name':'Secret','address':None,'language':'','content_type':'text/plain','loading':False,'progress':100,'secure':False,'actions':['print'],'revision':N})
check('contract fixture 4', solve(dict(title='',url='',language='en',mime='text/plain',loaded=False,percent=-5,security='unknown',private=False,permissions=[],revision=N),), {'name':'','address':'','language':'en','content_type':'text/plain','loading':True,'progress':0,'secure':False,'actions':[],'revision':N})
check('contract fixture 5', solve(dict(title='',url='https://x/path/#frag',language='en',mime=' TEXT/XML ',loaded=True,percent=0,security='verified',private=False,permissions=[],revision=N),), {'name':'path','address':'https://x/path/#frag','language':'en','content_type':'text/xml','loading':False,'progress':100,'secure':True,'actions':[],'revision':N})
check('contract fixture 6', solve(dict(title='',url='a',language='zh_Hant_TW',mime='text/plain',loaded=False,percent=N,security='verified',private=False,permissions=[],revision=N),), {'name':'a','address':'a','language':'zh-Hant-TW','content_type':'text/plain','loading':True,'progress':N,'secure':True,'actions':[],'revision':N})
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 1{'actions': ['print', 'copy'], 'address': 'https://x/a?key=1#f', 'content_type': 'text/html', 'language': 'en-US', 'loading': False, 'name': 'Title1', 'progress': 100, 'revision': 1, 'secure': True}{'actions': ['print', 'copy'], 'address': 'https://x/a?key=1#f', 'content_type': 'text/html', 'language': 'en-US', 'loading': False, 'name': 'Title1', 'progress': 100, 'revision': 1, 'secure': True}Passed
contract fixture 2{'actions': [], 'address': 'https://x/a?key=1#f', 'content_type': 'text/plain', 'language': 'ja', 'loading': True, 'name': 'a', 'progress': 99, 'revision': 1, 'secure': False}{'actions': [], 'address': 'https://x/a?key=1#f', 'content_type': 'text/plain', 'language': 'ja', 'loading': True, 'name': 'a', 'progress': 99, 'revision': 1, 'secure': False}Passed
contract fixture 3{'actions': ['print'], 'address': None, 'content_type': 'text/plain', 'language': '', 'loading': False, 'name': 'Secret', 'progress': 100, 'revision': 1, 'secure': False}{'actions': ['print'], 'address': None, 'content_type': 'text/plain', 'language': '', 'loading': False, 'name': 'Secret', 'progress': 100, 'revision': 1, 'secure': False}Passed
contract fixture 4{'actions': [], 'address': '', 'content_type': 'text/plain', 'language': 'en', 'loading': True, 'name': '', 'progress': 0, 'revision': 1, 'secure': False}{'actions': [], 'address': '', 'content_type': 'text/plain', 'language': 'en', 'loading': True, 'name': '', 'progress': 0, 'revision': 1, 'secure': False}Passed
contract fixture 5{'actions': [], 'address': 'https://x/path/#frag', 'content_type': 'text/xml', 'language': 'en', 'loading': False, 'name': 'path', 'progress': 100, 'revision': 1, 'secure': True}{'actions': [], 'address': 'https://x/path/#frag', 'content_type': 'text/xml', 'language': 'en', 'loading': False, 'name': 'path', 'progress': 100, 'revision': 1, 'secure': True}Passed
contract fixture 6{'actions': [], 'address': 'a', 'content_type': 'text/plain', 'language': 'zh-Hant-TW', 'loading': True, 'name': 'a', 'progress': 1, 'revision': 1, 'secure': True}{'actions': [], 'address': 'a', 'content_type': 'text/plain', 'language': 'zh-Hant-TW', 'loading': True, 'name': 'a', 'progress': 1, 'revision': 1, 'secure': True}Passed

SHA-256 / 0cec32027bbf0638afb26ba660cc78c3660e3e8d03b61184b28d0d091675a799

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

Case digest / 3e8f935832450271c2a6bb95da58fa4ab5f67df4b6e9bed531fc96c63a89a6cd