{"abstract":"Drop-after inserts before the target.","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":"Always adding one breaks drop-before positioning.","family":"xi-drag-reorder-after","id":"FA-8226","implementations":{"attempt":{"sha256":"8b059dbb62195880bdd8ec6d6bd473ffba9c429f2723650393e9500795fd635e","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\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":"8d292f695a163181a2a888dfdf5af7133ee1c108124bb772a56716f75ce2ba8a","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) + 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-after","generated_at":"2026-09-29T14:38:19.561924+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 after operation as `(1 if after else 0)`.","root_cause":"The after operation uses `0` where the contract requires `(1 if after else 0)`.","sha256":"69f2e70f375559df615d925dee7821d7192751e524cea653458b99cce92caed1","title":"Drag-and-drop list reordering: Drop-after inserts before the target · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.859,"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":["b","c","a"],"check":"after","expected":["b","c","a"],"passed":true},{"actual":["a","c","b"],"check":"before","expected":["c","a","b"],"passed":false},{"actual":[1,2,0],"check":"parameterized drag length","expected":[1,2,0],"passed":true},{"actual":["a","c","b"],"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\": [\"b\", \"c\", \"a\"], \"expected\": [\"b\", \"c\", \"a\"], \"passed\": true}, {\"check\": \"before\", \"actual\": [\"a\", \"c\", \"b\"], \"expected\": [\"c\", \"a\", \"b\"], \"passed\": false}, {\"check\": \"parameterized drag length\", \"actual\": [1, 2, 0], \"expected\": [1, 2, 0], \"passed\": true}, {\"check\": \"repeat before\", \"actual\": [\"a\", \"c\", \"b\"], \"expected\": [\"c\", \"a\", \"b\"], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":36.77,"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":["b","a","c"],"check":"after","expected":["b","c","a"],"passed":false},{"actual":["c","a","b"],"check":"before","expected":["c","a","b"],"passed":true},{"actual":[1,0,2],"check":"parameterized drag length","expected":[1,2,0],"passed":false},{"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\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"after\", \"actual\": [\"b\", \"a\", \"c\"], \"expected\": [\"b\", \"c\", \"a\"], \"passed\": false}, {\"check\": \"before\", \"actual\": [\"c\", \"a\", \"b\"], \"expected\": [\"c\", \"a\", \"b\"], \"passed\": true}, {\"check\": \"parameterized drag length\", \"actual\": [1, 0, 2], \"expected\": [1, 2, 0], \"passed\": false}, {\"check\": \"repeat before\", \"actual\": [\"c\", \"a\", \"b\"], \"expected\": [\"c\", \"a\", \"b\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":34.783,"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"}