{"abstract":"Restoration targets a detached opener.","category":"Keyboard accessibility","checks":9,"contract":"Opening pushes one return target; closing or Escape pops one scope; restoration chooses the newest connected target; clear empties the stack.","contract_signature":"stack, event, target, connected","evaluation_group":"xi-focus-scope","failed_approach":"Selecting detached nodes still cannot restore focus.","family":"xi-focus-scope-connected","id":"FA-7871","implementations":{"attempt":{"sha256":"1696518443c17ecd5314bbe11b96496fda47f3d81657f8c481ffb64fc74f4e3a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(stack, event, target, connected):\n    stack = list(stack)\n    if event == 'open': return stack + [target]\n    if event == 'close': return stack[:-1]\n    if event == 'restore': return next((x for x in reversed(stack) if x not in connected), None)\n    if event == 'escape': return stack[:-1] if stack else []\n    if event == 'clear': return []\n    return stack\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('nested open', solve(['outer'], 'open', 'inner', []), ['outer', 'inner'])\ncheck('nested close', solve(['outer','inner'], 'close', None, []), ['outer'])\ncheck('newest live', solve(['z','a'], 'restore', None, ['z','a']), 'a')\ncheck('ordered newest', solve(['a','z'], 'restore', None, ['a','z']), 'z')\ncheck('detached', solve(['outer','gone'], 'restore', None, ['outer']), 'outer')\ncheck('escape one', solve(['outer','inner'], 'escape', None, []), ['outer'])\ncheck('clear', solve(['outer'], 'clear', None, []), [])\ncheck('parameterized opener', solve(['outer'], 'open', 'dialog'+str(N), []), ['outer', 'dialog'+str(N)])\nfor repetition in range(N):\n    check('repeat clear', solve(['outer'], 'clear', None, []), [])\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":"490068627e857f7bb90fdd5f07aa7c9a57c0d77ae6372ebb62b41d9d96a7fd7e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(stack, event, target, connected):\n    stack = list(stack)\n    if event == 'open': return stack + [target]\n    if event == 'close': return stack[:-1]\n    if event == 'restore': return next((x for x in reversed(stack) if True), None)\n    if event == 'escape': return stack[:-1] if stack else []\n    if event == 'clear': return []\n    return stack\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('nested open', solve(['outer'], 'open', 'inner', []), ['outer', 'inner'])\ncheck('nested close', solve(['outer','inner'], 'close', None, []), ['outer'])\ncheck('newest live', solve(['z','a'], 'restore', None, ['z','a']), 'a')\ncheck('ordered newest', solve(['a','z'], 'restore', None, ['a','z']), 'z')\ncheck('detached', solve(['outer','gone'], 'restore', None, ['outer']), 'outer')\ncheck('escape one', solve(['outer','inner'], 'escape', None, []), ['outer'])\ncheck('clear', solve(['outer'], 'clear', None, []), [])\ncheck('parameterized opener', solve(['outer'], 'open', 'dialog'+str(N), []), ['outer', 'dialog'+str(N)])\nfor repetition in range(N):\n    check('repeat clear', solve(['outer'], 'clear', None, []), [])\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":" 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":"xi-focus-scope-connected","generated_at":"2026-09-29T14:38:16.127797+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic model of modal focus restoration; this isolates one interface invariant without requiring a browser.","root_cause":"The connected operation uses `if True` where the contract requires `if x in connected`.","sha256":"ab83e54146e41533f3edc445f1ac2190d45d42e2dc84b2c6747a276a260126a9","title":"Modal focus restoration: Restoration targets a detached opener · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":42.88,"exit_code":1,"observations":[{"actual":["outer","inner"],"check":"nested open","expected":["outer","inner"],"passed":true},{"actual":["outer"],"check":"nested close","expected":["outer"],"passed":true},{"actual":null,"check":"newest live","expected":"a","passed":false},{"actual":null,"check":"ordered newest","expected":"z","passed":false},{"actual":"gone","check":"detached","expected":"outer","passed":false},{"actual":["outer"],"check":"escape one","expected":["outer"],"passed":true},{"actual":[],"check":"clear","expected":[],"passed":true},{"actual":["outer","dialog1"],"check":"parameterized opener","expected":["outer","dialog1"],"passed":true},{"actual":[],"check":"repeat clear","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"nested open\", \"actual\": [\"outer\", \"inner\"], \"expected\": [\"outer\", \"inner\"], \"passed\": true}, {\"check\": \"nested close\", \"actual\": [\"outer\"], \"expected\": [\"outer\"], \"passed\": true}, {\"check\": \"newest live\", \"actual\": null, \"expected\": \"a\", \"passed\": false}, {\"check\": \"ordered newest\", \"actual\": null, \"expected\": \"z\", \"passed\": false}, {\"check\": \"detached\", \"actual\": \"gone\", \"expected\": \"outer\", \"passed\": false}, {\"check\": \"escape one\", \"actual\": [\"outer\"], \"expected\": [\"outer\"], \"passed\": true}, {\"check\": \"clear\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"parameterized opener\", \"actual\": [\"outer\", \"dialog1\"], \"expected\": [\"outer\", \"dialog1\"], \"passed\": true}, {\"check\": \"repeat clear\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.087,"exit_code":1,"observations":[{"actual":["outer","inner"],"check":"nested open","expected":["outer","inner"],"passed":true},{"actual":["outer"],"check":"nested close","expected":["outer"],"passed":true},{"actual":"a","check":"newest live","expected":"a","passed":true},{"actual":"z","check":"ordered newest","expected":"z","passed":true},{"actual":"gone","check":"detached","expected":"outer","passed":false},{"actual":["outer"],"check":"escape one","expected":["outer"],"passed":true},{"actual":[],"check":"clear","expected":[],"passed":true},{"actual":["outer","dialog1"],"check":"parameterized opener","expected":["outer","dialog1"],"passed":true},{"actual":[],"check":"repeat clear","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"nested open\", \"actual\": [\"outer\", \"inner\"], \"expected\": [\"outer\", \"inner\"], \"passed\": true}, {\"check\": \"nested close\", \"actual\": [\"outer\"], \"expected\": [\"outer\"], \"passed\": true}, {\"check\": \"newest live\", \"actual\": \"a\", \"expected\": \"a\", \"passed\": true}, {\"check\": \"ordered newest\", \"actual\": \"z\", \"expected\": \"z\", \"passed\": true}, {\"check\": \"detached\", \"actual\": \"gone\", \"expected\": \"outer\", \"passed\": false}, {\"check\": \"escape one\", \"actual\": [\"outer\"], \"expected\": [\"outer\"], \"passed\": true}, {\"check\": \"clear\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"parameterized opener\", \"actual\": [\"outer\", \"dialog1\"], \"expected\": [\"outer\", \"dialog1\"], \"passed\": true}, {\"check\": \"repeat clear\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}