{"abstract":"Move records contain the previous sibling position.","category":"Accessibility interaction semantics","checks":7,"contract":"Input [before,after] maps stable object ID to {role,name,parent,order}. Return delta operations in phases: removed IDs sorted lexical; added IDs sorted by after order then ID; common IDs sorted lexical get role-replace if role differs, otherwise name-set if name differs; parent/order changes append move even after role-replace. Removed values use old role, added records preserve complete new record, name-set preserves empty names. Same ID is never remove+add just for role changes. Return operations lists.","evaluation_group":"s3-accessibility-snapshot-delta","failed_approach":"The local repair substitutes ['move',ident,new['parent'],new['order']+1] but still mishandles the regression fixtures.","family":"s3-accessibility-snapshot-delta-move-position","id":"FA-54341","implementations":{"attempt":{"sha256":"ada2e0cbd35f29bbb6faceb5777dadedbafb00cba13f3a0f57ca09e0aea1dfa1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(data):\n    before,after = data\n    result = []\n    for ident in sorted(set(before)-set(after)): result.append(['remove',ident,before[ident]['role']])\n    for ident in sorted(set(after)-set(before),key=lambda x:(after[x]['order'],x)): result.append(['add',ident,after[ident]])\n    for ident in sorted(set(before)&set(after)):\n        old,new = before[ident],after[ident]\n        if old['role'] != new['role']: result.append(['replace-role',ident,new['role']])\n        elif old['name'] != new['name']: result.append(['set-name',ident,new['name']])\n        if old['parent'] != new['parent'] or old['order'] != new['order']: result.append(['move',ident,new['parent'],new['order']+1])\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([{'x':{'role':'image','name':'old','parent':'a','order':N}},{'x':{'role':'button','name':'new','parent':'b','order':N+1}}],), [['replace-role','x','button'],['move','x','b',N+1]])\ncheck('contract fixture 2', solve([{'x':{'role':'image','name':'old','parent':None,'order':0}},{'x':{'role':'image','name':'','parent':None,'order':0}}],), [['set-name','x','']])\ncheck('contract fixture 3', solve([{'z':{'role':'image','name':'Z','parent':None,'order':0},'a':{'role':'group','name':'A','parent':None,'order':1}},{}],), [['remove','a','group'],['remove','z','image']])\ncheck('contract fixture 4', solve([{}, {'z':{'role':'image','name':'Z','parent':None,'order':0},'a':{'role':'group','name':'A','parent':None,'order':1}}],), [['add','z',{'role':'image','name':'Z','parent':None,'order':0}],['add','a',{'role':'group','name':'A','parent':None,'order':1}]])\ncheck('contract fixture 5', solve([{'x':{'role':'image','name':'X','parent':'a','order':0}},{'x':{'role':'image','name':'X','parent':'a','order':N}}],), [['move','x','a',N]])\ncheck('contract fixture 6', solve([{'x':{'role':'image','name':'X','parent':'a','order':0}},{'x':{'role':'image','name':'X','parent':'b','order':0}}],), [['move','x','b',0]])\ncheck('contract fixture 7', solve([{},{}],), [])\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":"4ea370dbd694e4fb53f51c29f55f2125b135095efc98f37d3bafda182d6f69dd","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(data):\n    before,after = data\n    result = []\n    for ident in sorted(set(before)-set(after)): result.append(['remove',ident,before[ident]['role']])\n    for ident in sorted(set(after)-set(before),key=lambda x:(after[x]['order'],x)): result.append(['add',ident,after[ident]])\n    for ident in sorted(set(before)&set(after)):\n        old,new = before[ident],after[ident]\n        if old['role'] != new['role']: result.append(['replace-role',ident,new['role']])\n        elif old['name'] != new['name']: result.append(['set-name',ident,new['name']])\n        if old['parent'] != new['parent'] or old['order'] != new['order']: result.append(['move',ident,new['parent'],old['order']])\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([{'x':{'role':'image','name':'old','parent':'a','order':N}},{'x':{'role':'button','name':'new','parent':'b','order':N+1}}],), [['replace-role','x','button'],['move','x','b',N+1]])\ncheck('contract fixture 2', solve([{'x':{'role':'image','name':'old','parent':None,'order':0}},{'x':{'role':'image','name':'','parent':None,'order':0}}],), [['set-name','x','']])\ncheck('contract fixture 3', solve([{'z':{'role':'image','name':'Z','parent':None,'order':0},'a':{'role':'group','name':'A','parent':None,'order':1}},{}],), [['remove','a','group'],['remove','z','image']])\ncheck('contract fixture 4', solve([{}, {'z':{'role':'image','name':'Z','parent':None,'order':0},'a':{'role':'group','name':'A','parent':None,'order':1}}],), [['add','z',{'role':'image','name':'Z','parent':None,'order':0}],['add','a',{'role':'group','name':'A','parent':None,'order':1}]])\ncheck('contract fixture 5', solve([{'x':{'role':'image','name':'X','parent':'a','order':0}},{'x':{'role':'image','name':'X','parent':'a','order':N}}],), [['move','x','a',N]])\ncheck('contract fixture 6', solve([{'x':{'role':'image','name':'X','parent':'a','order':0}},{'x':{'role':'image','name':'X','parent':'b','order':0}}],), [['move','x','b',0]])\ncheck('contract fixture 7', solve([{},{}],), [])\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":"9354be8a55177f12917ccdb77fbde6bed5abc6e05a83b2081b5ca1d202d92629","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(data):\n    before,after = data\n    result = []\n    for ident in sorted(set(before)-set(after)): result.append(['remove',ident,before[ident]['role']])\n    for ident in sorted(set(after)-set(before),key=lambda x:(after[x]['order'],x)): result.append(['add',ident,after[ident]])\n    for ident in sorted(set(before)&set(after)):\n        old,new = before[ident],after[ident]\n        if old['role'] != new['role']: result.append(['replace-role',ident,new['role']])\n        elif old['name'] != new['name']: result.append(['set-name',ident,new['name']])\n        if old['parent'] != new['parent'] or old['order'] != new['order']: result.append(['move',ident,new['parent'],new['order']])\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([{'x':{'role':'image','name':'old','parent':'a','order':N}},{'x':{'role':'button','name':'new','parent':'b','order':N+1}}],), [['replace-role','x','button'],['move','x','b',N+1]])\ncheck('contract fixture 2', solve([{'x':{'role':'image','name':'old','parent':None,'order':0}},{'x':{'role':'image','name':'','parent':None,'order':0}}],), [['set-name','x','']])\ncheck('contract fixture 3', solve([{'z':{'role':'image','name':'Z','parent':None,'order':0},'a':{'role':'group','name':'A','parent':None,'order':1}},{}],), [['remove','a','group'],['remove','z','image']])\ncheck('contract fixture 4', solve([{}, {'z':{'role':'image','name':'Z','parent':None,'order':0},'a':{'role':'group','name':'A','parent':None,'order':1}}],), [['add','z',{'role':'image','name':'Z','parent':None,'order':0}],['add','a',{'role':'group','name':'A','parent':None,'order':1}]])\ncheck('contract fixture 5', solve([{'x':{'role':'image','name':'X','parent':'a','order':0}},{'x':{'role':'image','name':'X','parent':'a','order':N}}],), [['move','x','a',N]])\ncheck('contract fixture 6', solve([{'x':{'role':'image','name':'X','parent':'a','order':0}},{'x':{'role':'image','name':'X','parent':'b','order':0}}],), [['move','x','b',0]])\ncheck('contract fixture 7', solve([{},{}],), [])\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-snapshot-delta-move-position","generated_at":"2026-09-29T14:45:47.427179+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 move position decision: ['move',ident,new['parent'],new['order']]","root_cause":"The move position decision in the snapshot delta adapter violates its declared contract.","sha256":"dc4115d190fbcf351a503daafea8e140dcb6940c5dda23dcd3e55855651f6e10","title":"Move records contain the previous sibling position · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.044,"exit_code":1,"observations":[{"actual":[["replace-role","x","button"],["move","x","b",3]],"check":"contract fixture 1","expected":[["replace-role","x","button"],["move","x","b",2]],"passed":false},{"actual":[["set-name","x",""]],"check":"contract fixture 2","expected":[["set-name","x",""]],"passed":true},{"actual":[["remove","a","group"],["remove","z","image"]],"check":"contract fixture 3","expected":[["remove","a","group"],["remove","z","image"]],"passed":true},{"actual":[["add","z",{"name":"Z","order":0,"parent":null,"role":"image"}],["add","a",{"name":"A","order":1,"parent":null,"role":"group"}]],"check":"contract fixture 4","expected":[["add","z",{"name":"Z","order":0,"parent":null,"role":"image"}],["add","a",{"name":"A","order":1,"parent":null,"role":"group"}]],"passed":true},{"actual":[["move","x","a",2]],"check":"contract fixture 5","expected":[["move","x","a",1]],"passed":false},{"actual":[["move","x","b",1]],"check":"contract fixture 6","expected":[["move","x","b",0]],"passed":false},{"actual":[],"check":"contract fixture 7","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"contract fixture 1\", \"actual\": [[\"replace-role\", \"x\", \"button\"], [\"move\", \"x\", \"b\", 3]], \"expected\": [[\"replace-role\", \"x\", \"button\"], [\"move\", \"x\", \"b\", 2]], \"passed\": false}, {\"check\": \"contract fixture 2\", \"actual\": [[\"set-name\", \"x\", \"\"]], \"expected\": [[\"set-name\", \"x\", \"\"]], \"passed\": true}, {\"check\": \"contract fixture 3\", \"actual\": [[\"remove\", \"a\", \"group\"], [\"remove\", \"z\", \"image\"]], \"expected\": [[\"remove\", \"a\", \"group\"], [\"remove\", \"z\", \"image\"]], \"passed\": true}, {\"check\": \"contract fixture 4\", \"actual\": [[\"add\", \"z\", {\"role\": \"image\", \"name\": \"Z\", \"parent\": null, \"order\": 0}], [\"add\", \"a\", {\"role\": \"group\", \"name\": \"A\", \"parent\": null, \"order\": 1}]], \"expected\": [[\"add\", \"z\", {\"role\": \"image\", \"name\": \"Z\", \"parent\": null, \"order\": 0}], [\"add\", \"a\", {\"role\": \"group\", \"name\": \"A\", \"parent\": null, \"order\": 1}]], \"passed\": true}, {\"check\": \"contract fixture 5\", \"actual\": [[\"move\", \"x\", \"a\", 2]], \"expected\": [[\"move\", \"x\", \"a\", 1]], \"passed\": false}, {\"check\": \"contract fixture 6\", \"actual\": [[\"move\", \"x\", \"b\", 1]], \"expected\": [[\"move\", \"x\", \"b\", 0]], \"passed\": false}, {\"check\": \"contract fixture 7\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.184,"exit_code":1,"observations":[{"actual":[["replace-role","x","button"],["move","x","b",1]],"check":"contract fixture 1","expected":[["replace-role","x","button"],["move","x","b",2]],"passed":false},{"actual":[["set-name","x",""]],"check":"contract fixture 2","expected":[["set-name","x",""]],"passed":true},{"actual":[["remove","a","group"],["remove","z","image"]],"check":"contract fixture 3","expected":[["remove","a","group"],["remove","z","image"]],"passed":true},{"actual":[["add","z",{"name":"Z","order":0,"parent":null,"role":"image"}],["add","a",{"name":"A","order":1,"parent":null,"role":"group"}]],"check":"contract fixture 4","expected":[["add","z",{"name":"Z","order":0,"parent":null,"role":"image"}],["add","a",{"name":"A","order":1,"parent":null,"role":"group"}]],"passed":true},{"actual":[["move","x","a",0]],"check":"contract fixture 5","expected":[["move","x","a",1]],"passed":false},{"actual":[["move","x","b",0]],"check":"contract fixture 6","expected":[["move","x","b",0]],"passed":true},{"actual":[],"check":"contract fixture 7","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"contract fixture 1\", \"actual\": [[\"replace-role\", \"x\", \"button\"], [\"move\", \"x\", \"b\", 1]], \"expected\": [[\"replace-role\", \"x\", \"button\"], [\"move\", \"x\", \"b\", 2]], \"passed\": false}, {\"check\": \"contract fixture 2\", \"actual\": [[\"set-name\", \"x\", \"\"]], \"expected\": [[\"set-name\", \"x\", \"\"]], \"passed\": true}, {\"check\": \"contract fixture 3\", \"actual\": [[\"remove\", \"a\", \"group\"], [\"remove\", \"z\", \"image\"]], \"expected\": [[\"remove\", \"a\", \"group\"], [\"remove\", \"z\", \"image\"]], \"passed\": true}, {\"check\": \"contract fixture 4\", \"actual\": [[\"add\", \"z\", {\"role\": \"image\", \"name\": \"Z\", \"parent\": null, \"order\": 0}], [\"add\", \"a\", {\"role\": \"group\", \"name\": \"A\", \"parent\": null, \"order\": 1}]], \"expected\": [[\"add\", \"z\", {\"role\": \"image\", \"name\": \"Z\", \"parent\": null, \"order\": 0}], [\"add\", \"a\", {\"role\": \"group\", \"name\": \"A\", \"parent\": null, \"order\": 1}]], \"passed\": true}, {\"check\": \"contract fixture 5\", \"actual\": [[\"move\", \"x\", \"a\", 0]], \"expected\": [[\"move\", \"x\", \"a\", 1]], \"passed\": false}, {\"check\": \"contract fixture 6\", \"actual\": [[\"move\", \"x\", \"b\", 0]], \"expected\": [[\"move\", \"x\", \"b\", 0]], \"passed\": true}, {\"check\": \"contract fixture 7\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.145,"exit_code":0,"observations":[{"actual":[["replace-role","x","button"],["move","x","b",2]],"check":"contract fixture 1","expected":[["replace-role","x","button"],["move","x","b",2]],"passed":true},{"actual":[["set-name","x",""]],"check":"contract fixture 2","expected":[["set-name","x",""]],"passed":true},{"actual":[["remove","a","group"],["remove","z","image"]],"check":"contract fixture 3","expected":[["remove","a","group"],["remove","z","image"]],"passed":true},{"actual":[["add","z",{"name":"Z","order":0,"parent":null,"role":"image"}],["add","a",{"name":"A","order":1,"parent":null,"role":"group"}]],"check":"contract fixture 4","expected":[["add","z",{"name":"Z","order":0,"parent":null,"role":"image"}],["add","a",{"name":"A","order":1,"parent":null,"role":"group"}]],"passed":true},{"actual":[["move","x","a",1]],"check":"contract fixture 5","expected":[["move","x","a",1]],"passed":true},{"actual":[["move","x","b",0]],"check":"contract fixture 6","expected":[["move","x","b",0]],"passed":true},{"actual":[],"check":"contract fixture 7","expected":[],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"contract fixture 1\", \"actual\": [[\"replace-role\", \"x\", \"button\"], [\"move\", \"x\", \"b\", 2]], \"expected\": [[\"replace-role\", \"x\", \"button\"], [\"move\", \"x\", \"b\", 2]], \"passed\": true}, {\"check\": \"contract fixture 2\", \"actual\": [[\"set-name\", \"x\", \"\"]], \"expected\": [[\"set-name\", \"x\", \"\"]], \"passed\": true}, {\"check\": \"contract fixture 3\", \"actual\": [[\"remove\", \"a\", \"group\"], [\"remove\", \"z\", \"image\"]], \"expected\": [[\"remove\", \"a\", \"group\"], [\"remove\", \"z\", \"image\"]], \"passed\": true}, {\"check\": \"contract fixture 4\", \"actual\": [[\"add\", \"z\", {\"role\": \"image\", \"name\": \"Z\", \"parent\": null, \"order\": 0}], [\"add\", \"a\", {\"role\": \"group\", \"name\": \"A\", \"parent\": null, \"order\": 1}]], \"expected\": [[\"add\", \"z\", {\"role\": \"image\", \"name\": \"Z\", \"parent\": null, \"order\": 0}], [\"add\", \"a\", {\"role\": \"group\", \"name\": \"A\", \"parent\": null, \"order\": 1}]], \"passed\": true}, {\"check\": \"contract fixture 5\", \"actual\": [[\"move\", \"x\", \"a\", 1]], \"expected\": [[\"move\", \"x\", \"a\", 1]], \"passed\": true}, {\"check\": \"contract fixture 6\", \"actual\": [[\"move\", \"x\", \"b\", 0]], \"expected\": [[\"move\", \"x\", \"b\", 0]], \"passed\": true}, {\"check\": \"contract fixture 7\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}