{"abstract":"Collapse-all leaves unrelated expanded branches open.","category":"Tree accessibility","checks":8,"contract":"Right expands then enters the first child; Left collapses only the current branch or focuses its parent; roots retain focus; collapse-all clears every expansion.","evaluation_group":"xi-tree-navigation","failed_approach":"Adding the current node opens a branch instead of closing all.","family":"xi-tree-navigation-collapse-all","id":"FA-8401","implementations":{"attempt":{"sha256":"01acf5e6a11aba2c5b5a8379de52fe51ee5c8fbe59c9c407bdb308eefe7de09b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(node, expanded, parents, children, key):\n    expanded = set(expanded)\n    kids = children.get(node, [])\n    if key == 'Right' and kids:\n        if node not in expanded: expanded.add(node)\n        else: node = kids[0]\n    elif key == 'Left':\n        if node in expanded: expanded.remove(node)\n        else: node = parents.get(node, node)\n    elif key == 'CollapseAll': expanded.add(node)\n    return (node, sorted(expanded))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('expand', solve('a', ['z'], {}, {'a':['b','c']}, 'Right'), ('a', ['a', 'z']))\ncheck('descend', solve('a', ['a'], {}, {'a':['b','c']}, 'Right'), ('b', ['a']))\ncheck('collapse', solve('a', ['a','z'], {}, {'a':['b']}, 'Left'), ('a', ['z']))\ncheck('parent', solve('b', [], {'b':'a'}, {}, 'Left'), ('a', []))\ncheck('root', solve('a', [], {}, {}, 'Left'), ('a', []))\ncheck('all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))\ncheck('parameterized child count', solve('a', [], {}, {'a':list(range(N))}, 'Right'), ('a',['a']))\nfor repetition in range(N):\n    check('repeat all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))\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":"1bf6133744ea5663a6eca333c6a7e4d1442251c0100efe1f2759a80c46c902e8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(node, expanded, parents, children, key):\n    expanded = set(expanded)\n    kids = children.get(node, [])\n    if key == 'Right' and kids:\n        if node not in expanded: expanded.add(node)\n        else: node = kids[0]\n    elif key == 'Left':\n        if node in expanded: expanded.remove(node)\n        else: node = parents.get(node, node)\n    elif key == 'CollapseAll': expanded.discard(node)\n    return (node, sorted(expanded))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('expand', solve('a', ['z'], {}, {'a':['b','c']}, 'Right'), ('a', ['a', 'z']))\ncheck('descend', solve('a', ['a'], {}, {'a':['b','c']}, 'Right'), ('b', ['a']))\ncheck('collapse', solve('a', ['a','z'], {}, {'a':['b']}, 'Left'), ('a', ['z']))\ncheck('parent', solve('b', [], {'b':'a'}, {}, 'Left'), ('a', []))\ncheck('root', solve('a', [], {}, {}, 'Left'), ('a', []))\ncheck('all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))\ncheck('parameterized child count', solve('a', [], {}, {'a':list(range(N))}, 'Right'), ('a',['a']))\nfor repetition in range(N):\n    check('repeat all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))\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":"d8cc0e4d8b47f71a93b2eb97d9a27e6666808598de5a935b5c45db1e6e515900","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(node, expanded, parents, children, key):\n    expanded = set(expanded)\n    kids = children.get(node, [])\n    if key == 'Right' and kids:\n        if node not in expanded: expanded.add(node)\n        else: node = kids[0]\n    elif key == 'Left':\n        if node in expanded: expanded.remove(node)\n        else: node = parents.get(node, node)\n    elif key == 'CollapseAll': expanded.clear()\n    return (node, sorted(expanded))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('expand', solve('a', ['z'], {}, {'a':['b','c']}, 'Right'), ('a', ['a', 'z']))\ncheck('descend', solve('a', ['a'], {}, {'a':['b','c']}, 'Right'), ('b', ['a']))\ncheck('collapse', solve('a', ['a','z'], {}, {'a':['b']}, 'Left'), ('a', ['z']))\ncheck('parent', solve('b', [], {'b':'a'}, {}, 'Left'), ('a', []))\ncheck('root', solve('a', [], {}, {}, 'Left'), ('a', []))\ncheck('all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))\ncheck('parameterized child count', solve('a', [], {}, {'a':list(range(N))}, 'Right'), ('a',['a']))\nfor repetition in range(N):\n    check('repeat all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))\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-tree-navigation-collapse-all","generated_at":"2026-09-29T14:38:21.061370+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic model of tree keyboard expansion; this isolates one interface invariant without requiring a browser.","repair":"Implement the collapse all operation as `elif key == 'CollapseAll': expanded.clear()`.","root_cause":"The collapse all operation uses `elif key == 'CollapseAll': expanded.discard(node)` where the contract requires `elif key == 'CollapseAll': expanded.clear()`.","sha256":"9da93dd1b8899f19ff07289d0aa56e678267fc21310b7c13d49db73cee277d97","title":"Tree keyboard expansion: Collapse-all leaves unrelated expanded branches open · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.543,"exit_code":1,"observations":[{"actual":["a",["a","z"]],"check":"expand","expected":["a",["a","z"]],"passed":true},{"actual":["b",["a"]],"check":"descend","expected":["b",["a"]],"passed":true},{"actual":["a",["z"]],"check":"collapse","expected":["a",["z"]],"passed":true},{"actual":["a",[]],"check":"parent","expected":["a",[]],"passed":true},{"actual":["a",[]],"check":"root","expected":["a",[]],"passed":true},{"actual":["a",["a","z"]],"check":"all","expected":["a",[]],"passed":false},{"actual":["a",["a"]],"check":"parameterized child count","expected":["a",["a"]],"passed":true},{"actual":["a",["a","z"]],"check":"repeat all","expected":["a",[]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"expand\", \"actual\": [\"a\", [\"a\", \"z\"]], \"expected\": [\"a\", [\"a\", \"z\"]], \"passed\": true}, {\"check\": \"descend\", \"actual\": [\"b\", [\"a\"]], \"expected\": [\"b\", [\"a\"]], \"passed\": true}, {\"check\": \"collapse\", \"actual\": [\"a\", [\"z\"]], \"expected\": [\"a\", [\"z\"]], \"passed\": true}, {\"check\": \"parent\", \"actual\": [\"a\", []], \"expected\": [\"a\", []], \"passed\": true}, {\"check\": \"root\", \"actual\": [\"a\", []], \"expected\": [\"a\", []], \"passed\": true}, {\"check\": \"all\", \"actual\": [\"a\", [\"a\", \"z\"]], \"expected\": [\"a\", []], \"passed\": false}, {\"check\": \"parameterized child count\", \"actual\": [\"a\", [\"a\"]], \"expected\": [\"a\", [\"a\"]], \"passed\": true}, {\"check\": \"repeat all\", \"actual\": [\"a\", [\"a\", \"z\"]], \"expected\": [\"a\", []], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.364,"exit_code":1,"observations":[{"actual":["a",["a","z"]],"check":"expand","expected":["a",["a","z"]],"passed":true},{"actual":["b",["a"]],"check":"descend","expected":["b",["a"]],"passed":true},{"actual":["a",["z"]],"check":"collapse","expected":["a",["z"]],"passed":true},{"actual":["a",[]],"check":"parent","expected":["a",[]],"passed":true},{"actual":["a",[]],"check":"root","expected":["a",[]],"passed":true},{"actual":["a",["z"]],"check":"all","expected":["a",[]],"passed":false},{"actual":["a",["a"]],"check":"parameterized child count","expected":["a",["a"]],"passed":true},{"actual":["a",["z"]],"check":"repeat all","expected":["a",[]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"expand\", \"actual\": [\"a\", [\"a\", \"z\"]], \"expected\": [\"a\", [\"a\", \"z\"]], \"passed\": true}, {\"check\": \"descend\", \"actual\": [\"b\", [\"a\"]], \"expected\": [\"b\", [\"a\"]], \"passed\": true}, {\"check\": \"collapse\", \"actual\": [\"a\", [\"z\"]], \"expected\": [\"a\", [\"z\"]], \"passed\": true}, {\"check\": \"parent\", \"actual\": [\"a\", []], \"expected\": [\"a\", []], \"passed\": true}, {\"check\": \"root\", \"actual\": [\"a\", []], \"expected\": [\"a\", []], \"passed\": true}, {\"check\": \"all\", \"actual\": [\"a\", [\"z\"]], \"expected\": [\"a\", []], \"passed\": false}, {\"check\": \"parameterized child count\", \"actual\": [\"a\", [\"a\"]], \"expected\": [\"a\", [\"a\"]], \"passed\": true}, {\"check\": \"repeat all\", \"actual\": [\"a\", [\"z\"]], \"expected\": [\"a\", []], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":37.345,"exit_code":0,"observations":[{"actual":["a",["a","z"]],"check":"expand","expected":["a",["a","z"]],"passed":true},{"actual":["b",["a"]],"check":"descend","expected":["b",["a"]],"passed":true},{"actual":["a",["z"]],"check":"collapse","expected":["a",["z"]],"passed":true},{"actual":["a",[]],"check":"parent","expected":["a",[]],"passed":true},{"actual":["a",[]],"check":"root","expected":["a",[]],"passed":true},{"actual":["a",[]],"check":"all","expected":["a",[]],"passed":true},{"actual":["a",["a"]],"check":"parameterized child count","expected":["a",["a"]],"passed":true},{"actual":["a",[]],"check":"repeat all","expected":["a",[]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"expand\", \"actual\": [\"a\", [\"a\", \"z\"]], \"expected\": [\"a\", [\"a\", \"z\"]], \"passed\": true}, {\"check\": \"descend\", \"actual\": [\"b\", [\"a\"]], \"expected\": [\"b\", [\"a\"]], \"passed\": true}, {\"check\": \"collapse\", \"actual\": [\"a\", [\"z\"]], \"expected\": [\"a\", [\"z\"]], \"passed\": true}, {\"check\": \"parent\", \"actual\": [\"a\", []], \"expected\": [\"a\", []], \"passed\": true}, {\"check\": \"root\", \"actual\": [\"a\", []], \"expected\": [\"a\", []], \"passed\": true}, {\"check\": \"all\", \"actual\": [\"a\", []], \"expected\": [\"a\", []], \"passed\": true}, {\"check\": \"parameterized child count\", \"actual\": [\"a\", [\"a\"]], \"expected\": [\"a\", [\"a\"]], \"passed\": true}, {\"check\": \"repeat all\", \"actual\": [\"a\", []], \"expected\": [\"a\", []], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}