{"abstract":"Reordering duplicates the dragged item instead of moving it.","category":"Direct manipulation","checks":7,"contract":"Cancellation, missing endpoints and self drops preserve order; otherwise remove the source and insert it immediately before or after the surviving target.","evaluation_group":"xi-drag-reorder","failed_approach":"Reversing before removal scrambles the unaffected items.","family":"xi-drag-reorder-remove-source","id":"FA-8221","implementations":{"attempt":{"sha256":"3bb47edaff7ab83f48040bcf0c3f6dc1a5771a355b88f51e55504581a4362e39","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(items, source, target, after, cancelled):\n    items = list(items)\n    if cancelled: return items\n    if source not in items or target not in items: return items\n    if source == target: return items\n    items.reverse(); items.remove(source)\n    index = items.index(target) + (1 if after else 0)\n    items.insert(index, source)\n    return items\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('cancel', solve(['a','b','c'], 'a', 'c', True, True), ['a', 'b', 'c'])\ncheck('missing', solve(['a','b'], 'a', 'gone', True, False), ['a', 'b'])\ncheck('self', solve(['a','b'], 'a', 'a', True, False), ['a', 'b'])\ncheck('after', solve(['a','b','c'], 'a', 'c', True, False), ['b', 'c', 'a'])\ncheck('before', solve(['a','b','c'], 'c', 'a', False, False), ['c', 'a', 'b'])\ncheck('parameterized drag length', solve(list(range(N+2)), 0, N+1, True, False), list(range(1,N+2))+[0])\nfor repetition in range(N):\n    check('repeat before', solve(['a','b','c'], 'c', 'a', False, False), ['c', 'a', 'b'])\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":"b2e4e548ba49cb519f90b5964db3405b142bcf328e36f26eb183bfeac58cf436","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(items, source, target, after, cancelled):\n    items = list(items)\n    if cancelled: return items\n    if source not in items or target not in items: return items\n    if source == target: return items\n    items = list(items)\n    index = items.index(target) + (1 if after else 0)\n    items.insert(index, source)\n    return items\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('cancel', solve(['a','b','c'], 'a', 'c', True, True), ['a', 'b', 'c'])\ncheck('missing', solve(['a','b'], 'a', 'gone', True, False), ['a', 'b'])\ncheck('self', solve(['a','b'], 'a', 'a', True, False), ['a', 'b'])\ncheck('after', solve(['a','b','c'], 'a', 'c', True, False), ['b', 'c', 'a'])\ncheck('before', solve(['a','b','c'], 'c', 'a', False, False), ['c', 'a', 'b'])\ncheck('parameterized drag length', solve(list(range(N+2)), 0, N+1, True, False), list(range(1,N+2))+[0])\nfor repetition in range(N):\n    check('repeat before', solve(['a','b','c'], 'c', 'a', False, False), ['c', 'a', 'b'])\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":"dd447b91b66ff81728f3bffe4798f9817fe7259a02b0987235ab214a33f6dfd8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(items, source, target, after, cancelled):\n    items = list(items)\n    if cancelled: return items\n    if source not in items or target not in items: return items\n    if source == target: return items\n    items.remove(source)\n    index = items.index(target) + (1 if after else 0)\n    items.insert(index, source)\n    return items\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('cancel', solve(['a','b','c'], 'a', 'c', True, True), ['a', 'b', 'c'])\ncheck('missing', solve(['a','b'], 'a', 'gone', True, False), ['a', 'b'])\ncheck('self', solve(['a','b'], 'a', 'a', True, False), ['a', 'b'])\ncheck('after', solve(['a','b','c'], 'a', 'c', True, False), ['b', 'c', 'a'])\ncheck('before', solve(['a','b','c'], 'c', 'a', False, False), ['c', 'a', 'b'])\ncheck('parameterized drag length', solve(list(range(N+2)), 0, N+1, True, False), list(range(1,N+2))+[0])\nfor repetition in range(N):\n    check('repeat before', solve(['a','b','c'], 'c', 'a', False, False), ['c', 'a', 'b'])\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-drag-reorder-remove-source","generated_at":"2026-09-29T14:38:19.558851+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic model of drag-and-drop list reordering; this isolates one interface invariant without requiring a browser.","repair":"Implement the remove source operation as `items.remove(source)`.","root_cause":"The remove source operation uses `items = list(items)` where the contract requires `items.remove(source)`.","sha256":"5d760e798bffca04163197cebd82c39847cae4bfaef4a552c1f9d99fb6ddd49c","title":"Drag-and-drop list reordering: Reordering duplicates the dragged item instead of moving it · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.114,"exit_code":1,"observations":[{"actual":["a","b","c"],"check":"cancel","expected":["a","b","c"],"passed":true},{"actual":["a","b"],"check":"missing","expected":["a","b"],"passed":true},{"actual":["a","b"],"check":"self","expected":["a","b"],"passed":true},{"actual":["c","a","b"],"check":"after","expected":["b","c","a"],"passed":false},{"actual":["b","c","a"],"check":"before","expected":["c","a","b"],"passed":false},{"actual":[2,0,1],"check":"parameterized drag length","expected":[1,2,0],"passed":false},{"actual":["b","c","a"],"check":"repeat before","expected":["c","a","b"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"cancel\", \"actual\": [\"a\", \"b\", \"c\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": true}, {\"check\": \"missing\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"self\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"after\", \"actual\": [\"c\", \"a\", \"b\"], \"expected\": [\"b\", \"c\", \"a\"], \"passed\": false}, {\"check\": \"before\", \"actual\": [\"b\", \"c\", \"a\"], \"expected\": [\"c\", \"a\", \"b\"], \"passed\": false}, {\"check\": \"parameterized drag length\", \"actual\": [2, 0, 1], \"expected\": [1, 2, 0], \"passed\": false}, {\"check\": \"repeat before\", \"actual\": [\"b\", \"c\", \"a\"], \"expected\": [\"c\", \"a\", \"b\"], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.223,"exit_code":1,"observations":[{"actual":["a","b","c"],"check":"cancel","expected":["a","b","c"],"passed":true},{"actual":["a","b"],"check":"missing","expected":["a","b"],"passed":true},{"actual":["a","b"],"check":"self","expected":["a","b"],"passed":true},{"actual":["a","b","c","a"],"check":"after","expected":["b","c","a"],"passed":false},{"actual":["c","a","b","c"],"check":"before","expected":["c","a","b"],"passed":false},{"actual":[0,1,2,0],"check":"parameterized drag length","expected":[1,2,0],"passed":false},{"actual":["c","a","b","c"],"check":"repeat before","expected":["c","a","b"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"cancel\", \"actual\": [\"a\", \"b\", \"c\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": true}, {\"check\": \"missing\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"self\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"after\", \"actual\": [\"a\", \"b\", \"c\", \"a\"], \"expected\": [\"b\", \"c\", \"a\"], \"passed\": false}, {\"check\": \"before\", \"actual\": [\"c\", \"a\", \"b\", \"c\"], \"expected\": [\"c\", \"a\", \"b\"], \"passed\": false}, {\"check\": \"parameterized drag length\", \"actual\": [0, 1, 2, 0], \"expected\": [1, 2, 0], \"passed\": false}, {\"check\": \"repeat before\", \"actual\": [\"c\", \"a\", \"b\", \"c\"], \"expected\": [\"c\", \"a\", \"b\"], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.383,"exit_code":0,"observations":[{"actual":["a","b","c"],"check":"cancel","expected":["a","b","c"],"passed":true},{"actual":["a","b"],"check":"missing","expected":["a","b"],"passed":true},{"actual":["a","b"],"check":"self","expected":["a","b"],"passed":true},{"actual":["b","c","a"],"check":"after","expected":["b","c","a"],"passed":true},{"actual":["c","a","b"],"check":"before","expected":["c","a","b"],"passed":true},{"actual":[1,2,0],"check":"parameterized drag length","expected":[1,2,0],"passed":true},{"actual":["c","a","b"],"check":"repeat before","expected":["c","a","b"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"cancel\", \"actual\": [\"a\", \"b\", \"c\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": true}, {\"check\": \"missing\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"self\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"after\", \"actual\": [\"b\", \"c\", \"a\"], \"expected\": [\"b\", \"c\", \"a\"], \"passed\": true}, {\"check\": \"before\", \"actual\": [\"c\", \"a\", \"b\"], \"expected\": [\"c\", \"a\", \"b\"], \"passed\": true}, {\"check\": \"parameterized drag length\", \"actual\": [1, 2, 0], \"expected\": [1, 2, 0], \"passed\": true}, {\"check\": \"repeat before\", \"actual\": [\"c\", \"a\", \"b\"], \"expected\": [\"c\", \"a\", \"b\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}