{"abstract":"Nested dialogs erase the outer return target.","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":"Prepending makes the oldest target appear newest.","family":"xi-focus-scope-push","id":"FA-7856","implementations":{"attempt":{"sha256":"7614f006979f3dd8a57830372591fae48efeeb2677a1c3fa10c9e65bd3a45c1a","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 [target] + stack\n    if event == 'close': return stack[:-1]\n    if event == 'restore': return next((x for x in reversed(stack) if x 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":"12cbad0b0d9fdecd59db57642f21aa874d77a42bba3108a55e6c7c36c80be72b","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 [target]\n    if event == 'close': return stack[:-1]\n    if event == 'restore': return next((x for x in reversed(stack) if x 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"}},"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-push","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 push operation uses `[target]` where the contract requires `stack + [target]`.","sha256":"3444a38f317883b8eff820b9a0bee9fc633ea1b2d4f9615fcef01568ae59bf2e","title":"Modal focus restoration: Nested dialogs erase the outer return target · 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":39.768,"exit_code":1,"observations":[{"actual":["inner","outer"],"check":"nested open","expected":["outer","inner"],"passed":false},{"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":"outer","check":"detached","expected":"outer","passed":true},{"actual":["outer"],"check":"escape one","expected":["outer"],"passed":true},{"actual":[],"check":"clear","expected":[],"passed":true},{"actual":["dialog1","outer"],"check":"parameterized opener","expected":["outer","dialog1"],"passed":false},{"actual":[],"check":"repeat clear","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"nested open\", \"actual\": [\"inner\", \"outer\"], \"expected\": [\"outer\", \"inner\"], \"passed\": false}, {\"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\": \"outer\", \"expected\": \"outer\", \"passed\": true}, {\"check\": \"escape one\", \"actual\": [\"outer\"], \"expected\": [\"outer\"], \"passed\": true}, {\"check\": \"clear\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"parameterized opener\", \"actual\": [\"dialog1\", \"outer\"], \"expected\": [\"outer\", \"dialog1\"], \"passed\": false}, {\"check\": \"repeat clear\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.509,"exit_code":1,"observations":[{"actual":["inner"],"check":"nested open","expected":["outer","inner"],"passed":false},{"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":"outer","check":"detached","expected":"outer","passed":true},{"actual":["outer"],"check":"escape one","expected":["outer"],"passed":true},{"actual":[],"check":"clear","expected":[],"passed":true},{"actual":["dialog1"],"check":"parameterized opener","expected":["outer","dialog1"],"passed":false},{"actual":[],"check":"repeat clear","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"nested open\", \"actual\": [\"inner\"], \"expected\": [\"outer\", \"inner\"], \"passed\": false}, {\"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\": \"outer\", \"expected\": \"outer\", \"passed\": true}, {\"check\": \"escape one\", \"actual\": [\"outer\"], \"expected\": [\"outer\"], \"passed\": true}, {\"check\": \"clear\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"parameterized opener\", \"actual\": [\"dialog1\"], \"expected\": [\"outer\", \"dialog1\"], \"passed\": false}, {\"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."}}