FA-54346 / Accessibility interaction semantics / Open access
A label query returns controls from unrelated documents · case 01
A label query returns controls from unrelated documents.
ROOT CAUSE
The control document decision in the label association adapter violates its declared contract.
VERIFIED REPAIR
Apply the exact contract at the control document decision: doc != document or not labelable
Unsuccessful approach: The local repair substitutes doc != document and not labelable but still mishandles the regression fixtures.
Case contract
Input [controls,labels,document] controls [id,doc,labelable,wrapping_label], labels [id,doc,for_id,text,order]. Labels with for_id None apply only through wrapping_label; explicit empty for_id never wraps. For each labelable control in document, combine matching labels sorted order, ignoring other documents; repeated text retained but each label ID occurs at most once. Explicit for_id matches exact control ID and overrides wrapping. Preserve text verbatim except skip empty text. Return [control_id,label_texts]. Every control ID is unique within document, labels may repeat IDs; first eligible duplicate wins.
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):
controls,labels,document = data
result = []
for ident,doc,labelable,wrapper in controls:
if not labelable: continue
selected = []
seen = set()
for lid,ldoc,target,text,order in sorted(labels,key=lambda row:row[4]):
if ldoc != document or not text: continue
match = target == ident if target is not None else lid == wrapper
if not match or lid in seen: continue
seen.add(lid)
selected.append(text)
result.append([ident,selected])
return result
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[['c','d',True,'wrap']],[['later','d','c','Second',N+1],['first','d','c','First'+str(N),N],['wrap','d',None,'Wrapped',N+2]],'d'],), [['c',['First'+str(N),'Second','Wrapped']]])
check('contract fixture 2', solve([[['c','d',True,'wrap']],[['wrap','d','other','Wrong',0],['empty','d','','Wrong',1]],'d'],), [['c',[]]])
check('contract fixture 3', solve([[['c','d',True,'wrap'],['foreign','e',True,None],['not','d',False,None]],[['wrap','e',None,'Other doc',0]],'d'],), [['c',[]]])
check('contract fixture 4', solve([[['c','d',True,None]],[['a','d','c','Same',0],['b','d','c','Same',1],['a','d','c','Duplicate ID',2]],'d'],), [['c',['Same','Same']]])
check('contract fixture 5', solve([[['c','d',True,None]],[['a','d','c','',0],['b','d','c',' A ',1]],'d'],), [['c',[' A ']]])
check('contract fixture 6', solve([[['c','d',True,None]],[],'d'],), [['c',[]]])
check('contract fixture 7', solve([[['c','d',True,'wrap']],[['wrap','d','','wrong',0]],'d'],), [['c',[]]])
check('contract fixture 8', solve([[['c','d',True,None]],[['z','d','c','first',0],['a','d','c','second',1]],'d'],), [['c',['first','second']]])
check('contract fixture 9', solve([[],[],'d'],), [])
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 | [['c', ['First1', 'Second', 'Wrapped']]] | [['c', ['First1', 'Second', 'Wrapped']]] | Passed |
| contract fixture 2 | [['c', []]] | [['c', []]] | Passed |
| contract fixture 3 | [['c', []], ['foreign', []]] | [['c', []]] | Failed |
| contract fixture 4 | [['c', ['Same', 'Same']]] | [['c', ['Same', 'Same']]] | Passed |
| contract fixture 5 | [['c', [' A ']]] | [['c', [' A ']]] | Passed |
| contract fixture 6 | [['c', []]] | [['c', []]] | Passed |
| contract fixture 7 | [['c', []]] | [['c', []]] | Passed |
| contract fixture 8 | [['c', ['first', 'second']]] | [['c', ['first', 'second']]] | Passed |
| contract fixture 9 | [] | [] | Passed |
SHA-256 / 0a1fb4a60216fb5463aa5d3e6f914a3d5a28e3a083a1abbe0a18bd3451901f9c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(data):
controls,labels,document = data
result = []
for ident,doc,labelable,wrapper in controls:
if doc != document and not labelable: continue
selected = []
seen = set()
for lid,ldoc,target,text,order in sorted(labels,key=lambda row:row[4]):
if ldoc != document or not text: continue
match = target == ident if target is not None else lid == wrapper
if not match or lid in seen: continue
seen.add(lid)
selected.append(text)
result.append([ident,selected])
return result
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[['c','d',True,'wrap']],[['later','d','c','Second',N+1],['first','d','c','First'+str(N),N],['wrap','d',None,'Wrapped',N+2]],'d'],), [['c',['First'+str(N),'Second','Wrapped']]])
check('contract fixture 2', solve([[['c','d',True,'wrap']],[['wrap','d','other','Wrong',0],['empty','d','','Wrong',1]],'d'],), [['c',[]]])
check('contract fixture 3', solve([[['c','d',True,'wrap'],['foreign','e',True,None],['not','d',False,None]],[['wrap','e',None,'Other doc',0]],'d'],), [['c',[]]])
check('contract fixture 4', solve([[['c','d',True,None]],[['a','d','c','Same',0],['b','d','c','Same',1],['a','d','c','Duplicate ID',2]],'d'],), [['c',['Same','Same']]])
check('contract fixture 5', solve([[['c','d',True,None]],[['a','d','c','',0],['b','d','c',' A ',1]],'d'],), [['c',[' A ']]])
check('contract fixture 6', solve([[['c','d',True,None]],[],'d'],), [['c',[]]])
check('contract fixture 7', solve([[['c','d',True,'wrap']],[['wrap','d','','wrong',0]],'d'],), [['c',[]]])
check('contract fixture 8', solve([[['c','d',True,None]],[['z','d','c','first',0],['a','d','c','second',1]],'d'],), [['c',['first','second']]])
check('contract fixture 9', solve([[],[],'d'],), [])
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 | [['c', ['First1', 'Second', 'Wrapped']]] | [['c', ['First1', 'Second', 'Wrapped']]] | Passed |
| contract fixture 2 | [['c', []]] | [['c', []]] | Passed |
| contract fixture 3 | [['c', []], ['foreign', []], ['not', []]] | [['c', []]] | Failed |
| contract fixture 4 | [['c', ['Same', 'Same']]] | [['c', ['Same', 'Same']]] | Passed |
| contract fixture 5 | [['c', [' A ']]] | [['c', [' A ']]] | Passed |
| contract fixture 6 | [['c', []]] | [['c', []]] | Passed |
| contract fixture 7 | [['c', []]] | [['c', []]] | Passed |
| contract fixture 8 | [['c', ['first', 'second']]] | [['c', ['first', 'second']]] | Passed |
| contract fixture 9 | [] | [] | Passed |
SHA-256 / 503b1256eb50e94551f9cea2218b620e45a38f16e3b21de2afdcbd3ee70e852e
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(data):
controls,labels,document = data
result = []
for ident,doc,labelable,wrapper in controls:
if doc != document or not labelable: continue
selected = []
seen = set()
for lid,ldoc,target,text,order in sorted(labels,key=lambda row:row[4]):
if ldoc != document or not text: continue
match = target == ident if target is not None else lid == wrapper
if not match or lid in seen: continue
seen.add(lid)
selected.append(text)
result.append([ident,selected])
return result
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('contract fixture 1', solve([[['c','d',True,'wrap']],[['later','d','c','Second',N+1],['first','d','c','First'+str(N),N],['wrap','d',None,'Wrapped',N+2]],'d'],), [['c',['First'+str(N),'Second','Wrapped']]])
check('contract fixture 2', solve([[['c','d',True,'wrap']],[['wrap','d','other','Wrong',0],['empty','d','','Wrong',1]],'d'],), [['c',[]]])
check('contract fixture 3', solve([[['c','d',True,'wrap'],['foreign','e',True,None],['not','d',False,None]],[['wrap','e',None,'Other doc',0]],'d'],), [['c',[]]])
check('contract fixture 4', solve([[['c','d',True,None]],[['a','d','c','Same',0],['b','d','c','Same',1],['a','d','c','Duplicate ID',2]],'d'],), [['c',['Same','Same']]])
check('contract fixture 5', solve([[['c','d',True,None]],[['a','d','c','',0],['b','d','c',' A ',1]],'d'],), [['c',[' A ']]])
check('contract fixture 6', solve([[['c','d',True,None]],[],'d'],), [['c',[]]])
check('contract fixture 7', solve([[['c','d',True,'wrap']],[['wrap','d','','wrong',0]],'d'],), [['c',[]]])
check('contract fixture 8', solve([[['c','d',True,None]],[['z','d','c','first',0],['a','d','c','second',1]],'d'],), [['c',['first','second']]])
check('contract fixture 9', solve([[],[],'d'],), [])
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 | [['c', ['First1', 'Second', 'Wrapped']]] | [['c', ['First1', 'Second', 'Wrapped']]] | Passed |
| contract fixture 2 | [['c', []]] | [['c', []]] | Passed |
| contract fixture 3 | [['c', []]] | [['c', []]] | Passed |
| contract fixture 4 | [['c', ['Same', 'Same']]] | [['c', ['Same', 'Same']]] | Passed |
| contract fixture 5 | [['c', [' A ']]] | [['c', [' A ']]] | Passed |
| contract fixture 6 | [['c', []]] | [['c', []]] | Passed |
| contract fixture 7 | [['c', []]] | [['c', []]] | Passed |
| contract fixture 8 | [['c', ['first', 'second']]] | [['c', ['first', 'second']]] | Passed |
| contract fixture 9 | [] | [] | Passed |
SHA-256 / 46bb14925fab587f95313cdbd6c276258105a97ea10b11ce59240ffc74e649ed
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:47.547019+00:00.
Case digest / d370ba581a2525f4325edb7772cf8438b26a11c5bb478040d806aa5ef7083841