{"abstract":"A label query returns controls from unrelated documents.","category":"Accessibility interaction semantics","checks":9,"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.","evaluation_group":"s3-accessibility-label-association","failed_approach":"The local repair substitutes doc != document and not labelable but still mishandles the regression fixtures.","family":"s3-accessibility-label-association-control-document","id":"FA-54346","implementations":{"attempt":{"sha256":"503b1256eb50e94551f9cea2218b620e45a38f16e3b21de2afdcbd3ee70e852e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(data):\n    controls,labels,document = data\n    result = []\n    for ident,doc,labelable,wrapper in controls:\n        if doc != document and not labelable: continue\n        selected = []\n        seen = set()\n        for lid,ldoc,target,text,order in sorted(labels,key=lambda row:row[4]):\n            if ldoc != document or not text: continue\n            match = target == ident if target is not None else lid == wrapper\n            if not match or lid in seen: continue\n            seen.add(lid)\n            selected.append(text)\n        result.append([ident,selected])\n    return result\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('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']]])\ncheck('contract fixture 2', solve([[['c','d',True,'wrap']],[['wrap','d','other','Wrong',0],['empty','d','','Wrong',1]],'d'],), [['c',[]]])\ncheck('contract fixture 3', solve([[['c','d',True,'wrap'],['foreign','e',True,None],['not','d',False,None]],[['wrap','e',None,'Other doc',0]],'d'],), [['c',[]]])\ncheck('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']]])\ncheck('contract fixture 5', solve([[['c','d',True,None]],[['a','d','c','',0],['b','d','c',' A ',1]],'d'],), [['c',[' A ']]])\ncheck('contract fixture 6', solve([[['c','d',True,None]],[],'d'],), [['c',[]]])\ncheck('contract fixture 7', solve([[['c','d',True,'wrap']],[['wrap','d','','wrong',0]],'d'],), [['c',[]]])\ncheck('contract fixture 8', solve([[['c','d',True,None]],[['z','d','c','first',0],['a','d','c','second',1]],'d'],), [['c',['first','second']]])\ncheck('contract fixture 9', solve([[],[],'d'],), [])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"0a1fb4a60216fb5463aa5d3e6f914a3d5a28e3a083a1abbe0a18bd3451901f9c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(data):\n    controls,labels,document = data\n    result = []\n    for ident,doc,labelable,wrapper in controls:\n        if not labelable: continue\n        selected = []\n        seen = set()\n        for lid,ldoc,target,text,order in sorted(labels,key=lambda row:row[4]):\n            if ldoc != document or not text: continue\n            match = target == ident if target is not None else lid == wrapper\n            if not match or lid in seen: continue\n            seen.add(lid)\n            selected.append(text)\n        result.append([ident,selected])\n    return result\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('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']]])\ncheck('contract fixture 2', solve([[['c','d',True,'wrap']],[['wrap','d','other','Wrong',0],['empty','d','','Wrong',1]],'d'],), [['c',[]]])\ncheck('contract fixture 3', solve([[['c','d',True,'wrap'],['foreign','e',True,None],['not','d',False,None]],[['wrap','e',None,'Other doc',0]],'d'],), [['c',[]]])\ncheck('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']]])\ncheck('contract fixture 5', solve([[['c','d',True,None]],[['a','d','c','',0],['b','d','c',' A ',1]],'d'],), [['c',[' A ']]])\ncheck('contract fixture 6', solve([[['c','d',True,None]],[],'d'],), [['c',[]]])\ncheck('contract fixture 7', solve([[['c','d',True,'wrap']],[['wrap','d','','wrong',0]],'d'],), [['c',[]]])\ncheck('contract fixture 8', solve([[['c','d',True,None]],[['z','d','c','first',0],['a','d','c','second',1]],'d'],), [['c',['first','second']]])\ncheck('contract fixture 9', solve([[],[],'d'],), [])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"46bb14925fab587f95313cdbd6c276258105a97ea10b11ce59240ffc74e649ed","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(data):\n    controls,labels,document = data\n    result = []\n    for ident,doc,labelable,wrapper in controls:\n        if doc != document or not labelable: continue\n        selected = []\n        seen = set()\n        for lid,ldoc,target,text,order in sorted(labels,key=lambda row:row[4]):\n            if ldoc != document or not text: continue\n            match = target == ident if target is not None else lid == wrapper\n            if not match or lid in seen: continue\n            seen.add(lid)\n            selected.append(text)\n        result.append([ident,selected])\n    return result\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('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']]])\ncheck('contract fixture 2', solve([[['c','d',True,'wrap']],[['wrap','d','other','Wrong',0],['empty','d','','Wrong',1]],'d'],), [['c',[]]])\ncheck('contract fixture 3', solve([[['c','d',True,'wrap'],['foreign','e',True,None],['not','d',False,None]],[['wrap','e',None,'Other doc',0]],'d'],), [['c',[]]])\ncheck('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']]])\ncheck('contract fixture 5', solve([[['c','d',True,None]],[['a','d','c','',0],['b','d','c',' A ',1]],'d'],), [['c',[' A ']]])\ncheck('contract fixture 6', solve([[['c','d',True,None]],[],'d'],), [['c',[]]])\ncheck('contract fixture 7', solve([[['c','d',True,'wrap']],[['wrap','d','','wrong',0]],'d'],), [['c',[]]])\ncheck('contract fixture 8', solve([[['c','d',True,None]],[['z','d','c','first',0],['a','d','c','second',1]],'d'],), [['c',['first','second']]])\ncheck('contract fixture 9', solve([[],[],'d'],), [])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"s3-accessibility-label-association-control-document","generated_at":"2026-09-29T14:45:47.547019+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Offline accessibility bridge model with explicit policy; useful for testing semantic API adapters independently of browser implementations.","repair":"Apply the exact contract at the control document decision: doc != document or not labelable","root_cause":"The control document decision in the label association adapter violates its declared contract.","sha256":"d370ba581a2525f4325edb7772cf8438b26a11c5bb478040d806aa5ef7083841","title":"A label query returns controls from unrelated documents · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.712,"exit_code":1,"observations":[{"actual":[["c",["First1","Second","Wrapped"]]],"check":"contract fixture 1","expected":[["c",["First1","Second","Wrapped"]]],"passed":true},{"actual":[["c",[]]],"check":"contract fixture 2","expected":[["c",[]]],"passed":true},{"actual":[["c",[]],["foreign",[]],["not",[]]],"check":"contract fixture 3","expected":[["c",[]]],"passed":false},{"actual":[["c",["Same","Same"]]],"check":"contract fixture 4","expected":[["c",["Same","Same"]]],"passed":true},{"actual":[["c",[" A "]]],"check":"contract fixture 5","expected":[["c",[" A "]]],"passed":true},{"actual":[["c",[]]],"check":"contract fixture 6","expected":[["c",[]]],"passed":true},{"actual":[["c",[]]],"check":"contract fixture 7","expected":[["c",[]]],"passed":true},{"actual":[["c",["first","second"]]],"check":"contract fixture 8","expected":[["c",["first","second"]]],"passed":true},{"actual":[],"check":"contract fixture 9","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"contract fixture 1\", \"actual\": [[\"c\", [\"First1\", \"Second\", \"Wrapped\"]]], \"expected\": [[\"c\", [\"First1\", \"Second\", \"Wrapped\"]]], \"passed\": true}, {\"check\": \"contract fixture 2\", \"actual\": [[\"c\", []]], \"expected\": [[\"c\", []]], \"passed\": true}, {\"check\": \"contract fixture 3\", \"actual\": [[\"c\", []], [\"foreign\", []], [\"not\", []]], \"expected\": [[\"c\", []]], \"passed\": false}, {\"check\": \"contract fixture 4\", \"actual\": [[\"c\", [\"Same\", \"Same\"]]], \"expected\": [[\"c\", [\"Same\", \"Same\"]]], \"passed\": true}, {\"check\": \"contract fixture 5\", \"actual\": [[\"c\", [\" A \"]]], \"expected\": [[\"c\", [\" A \"]]], \"passed\": true}, {\"check\": \"contract fixture 6\", \"actual\": [[\"c\", []]], \"expected\": [[\"c\", []]], \"passed\": true}, {\"check\": \"contract fixture 7\", \"actual\": [[\"c\", []]], \"expected\": [[\"c\", []]], \"passed\": true}, {\"check\": \"contract fixture 8\", \"actual\": [[\"c\", [\"first\", \"second\"]]], \"expected\": [[\"c\", [\"first\", \"second\"]]], \"passed\": true}, {\"check\": \"contract fixture 9\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.438,"exit_code":1,"observations":[{"actual":[["c",["First1","Second","Wrapped"]]],"check":"contract fixture 1","expected":[["c",["First1","Second","Wrapped"]]],"passed":true},{"actual":[["c",[]]],"check":"contract fixture 2","expected":[["c",[]]],"passed":true},{"actual":[["c",[]],["foreign",[]]],"check":"contract fixture 3","expected":[["c",[]]],"passed":false},{"actual":[["c",["Same","Same"]]],"check":"contract fixture 4","expected":[["c",["Same","Same"]]],"passed":true},{"actual":[["c",[" A "]]],"check":"contract fixture 5","expected":[["c",[" A "]]],"passed":true},{"actual":[["c",[]]],"check":"contract fixture 6","expected":[["c",[]]],"passed":true},{"actual":[["c",[]]],"check":"contract fixture 7","expected":[["c",[]]],"passed":true},{"actual":[["c",["first","second"]]],"check":"contract fixture 8","expected":[["c",["first","second"]]],"passed":true},{"actual":[],"check":"contract fixture 9","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"contract fixture 1\", \"actual\": [[\"c\", [\"First1\", \"Second\", \"Wrapped\"]]], \"expected\": [[\"c\", [\"First1\", \"Second\", \"Wrapped\"]]], \"passed\": true}, {\"check\": \"contract fixture 2\", \"actual\": [[\"c\", []]], \"expected\": [[\"c\", []]], \"passed\": true}, {\"check\": \"contract fixture 3\", \"actual\": [[\"c\", []], [\"foreign\", []]], \"expected\": [[\"c\", []]], \"passed\": false}, {\"check\": \"contract fixture 4\", \"actual\": [[\"c\", [\"Same\", \"Same\"]]], \"expected\": [[\"c\", [\"Same\", \"Same\"]]], \"passed\": true}, {\"check\": \"contract fixture 5\", \"actual\": [[\"c\", [\" A \"]]], \"expected\": [[\"c\", [\" A \"]]], \"passed\": true}, {\"check\": \"contract fixture 6\", \"actual\": [[\"c\", []]], \"expected\": [[\"c\", []]], \"passed\": true}, {\"check\": \"contract fixture 7\", \"actual\": [[\"c\", []]], \"expected\": [[\"c\", []]], \"passed\": true}, {\"check\": \"contract fixture 8\", \"actual\": [[\"c\", [\"first\", \"second\"]]], \"expected\": [[\"c\", [\"first\", \"second\"]]], \"passed\": true}, {\"check\": \"contract fixture 9\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.899,"exit_code":0,"observations":[{"actual":[["c",["First1","Second","Wrapped"]]],"check":"contract fixture 1","expected":[["c",["First1","Second","Wrapped"]]],"passed":true},{"actual":[["c",[]]],"check":"contract fixture 2","expected":[["c",[]]],"passed":true},{"actual":[["c",[]]],"check":"contract fixture 3","expected":[["c",[]]],"passed":true},{"actual":[["c",["Same","Same"]]],"check":"contract fixture 4","expected":[["c",["Same","Same"]]],"passed":true},{"actual":[["c",[" A "]]],"check":"contract fixture 5","expected":[["c",[" A "]]],"passed":true},{"actual":[["c",[]]],"check":"contract fixture 6","expected":[["c",[]]],"passed":true},{"actual":[["c",[]]],"check":"contract fixture 7","expected":[["c",[]]],"passed":true},{"actual":[["c",["first","second"]]],"check":"contract fixture 8","expected":[["c",["first","second"]]],"passed":true},{"actual":[],"check":"contract fixture 9","expected":[],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"contract fixture 1\", \"actual\": [[\"c\", [\"First1\", \"Second\", \"Wrapped\"]]], \"expected\": [[\"c\", [\"First1\", \"Second\", \"Wrapped\"]]], \"passed\": true}, {\"check\": \"contract fixture 2\", \"actual\": [[\"c\", []]], \"expected\": [[\"c\", []]], \"passed\": true}, {\"check\": \"contract fixture 3\", \"actual\": [[\"c\", []]], \"expected\": [[\"c\", []]], \"passed\": true}, {\"check\": \"contract fixture 4\", \"actual\": [[\"c\", [\"Same\", \"Same\"]]], \"expected\": [[\"c\", [\"Same\", \"Same\"]]], \"passed\": true}, {\"check\": \"contract fixture 5\", \"actual\": [[\"c\", [\" A \"]]], \"expected\": [[\"c\", [\" A \"]]], \"passed\": true}, {\"check\": \"contract fixture 6\", \"actual\": [[\"c\", []]], \"expected\": [[\"c\", []]], \"passed\": true}, {\"check\": \"contract fixture 7\", \"actual\": [[\"c\", []]], \"expected\": [[\"c\", []]], \"passed\": true}, {\"check\": \"contract fixture 8\", \"actual\": [[\"c\", [\"first\", \"second\"]]], \"expected\": [[\"c\", [\"first\", \"second\"]]], \"passed\": true}, {\"check\": \"contract fixture 9\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}