{"abstract":"Dropping an item onto itself destroys the list.","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 the list is not a no-op self drop.","family":"xi-drag-reorder-self","id":"FA-8216","implementations":{"attempt":{"sha256":"837dbe73dc06f2b261c2f38b08290448cbf4cfe9314a9e77f791bd7748be285b","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[::-1]\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"},"broken":{"sha256":"c0d013b93406cf336c9b1f006b3a0a6c3037774e42b414b1049a2f07fdfc9820","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 []\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"},"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-self","generated_at":"2026-09-29T14:38:19.557038+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 self operation as `if source == target: return items`.","root_cause":"The self operation uses `if source == target: return []` where the contract requires `if source == target: return items`.","sha256":"7fec5c79d3d4da348023e04869cd37fb165a0b84d3c79e9965314b36cc02e20a","title":"Drag-and-drop list reordering: Dropping an item onto itself destroys the list · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.047,"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":["b","a"],"check":"self","expected":["a","b"],"passed":false},{"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":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\": [\"b\", \"a\"], \"expected\": [\"a\", \"b\"], \"passed\": false}, {\"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\": false}\n"},"broken":{"elapsed_ms":39.321,"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":[],"check":"self","expected":["a","b"],"passed":false},{"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":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\": [], \"expected\": [\"a\", \"b\"], \"passed\": false}, {\"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\": false}\n"},"fixed":{"elapsed_ms":38.554,"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"}