{"abstract":"Deletion transactions merge as if they were adjacent typing.","category":"Undo and history","checks":9,"contract":"Only contiguous insertion edits without explicit boundary coalesce; preserve the first before-state and newest after-state; no-op input creates no history.","evaluation_group":"xi-undo-grouping","failed_approach":"Allowing only deletion prevents normal insertion grouping.","family":"xi-undo-grouping-kind","id":"FA-9036","implementations":{"attempt":{"sha256":"e0875b533128df38f7eb1295f18d3b129e221fbd4eaa8ab92866f5557b94ca9a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(history, before, after, previous_kind, kind, previous_caret, caret, boundary):\n    history = list(history)\n    if before == after: return history\n    merge = bool(history) and kind == 'delete' and previous_kind == kind and previous_caret == caret and not boundary\n    if merge: history[-1] = (history[-1][0], after)\n    else: history.append((before, after))\n    return history\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('noop', solve([('a','ab')], 'ab', 'ab', 'insert', 'insert', 2, 2, False), [('a', 'ab')])\ncheck('empty noop', solve([], 'a', 'a', None, 'insert', None, 1, False), [])\ncheck('delete', solve([('abcd','abc')], 'abc', 'ab', 'delete', 'delete', 3, 3, False), [('abcd', 'abc'), ('abc', 'ab')])\ncheck('contiguous', solve([('a','ab')], 'ab', 'abc', 'insert', 'insert', 2, 2, False), [('a', 'abc')])\ncheck('moved caret', solve([('a','ab')], 'ab', 'axb', 'insert', 'insert', 2, 1, False), [('a', 'ab'), ('ab', 'axb')])\ncheck('boundary', solve([('a','ab')], 'ab', 'abc', 'insert', 'insert', 2, 2, True), [('a', 'ab'), ('ab', 'abc')])\ncheck('empty', solve([], '', 'a', None, 'insert', None, 0, False), [('', 'a')])\ncheck('parameterized inserted length', solve([], '', 'a'*N, None, 'insert', None, 0, False), [('', 'a'*N)])\nfor repetition in range(N):\n    check('repeat empty', solve([], '', 'a', None, 'insert', None, 0, False), [('', '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":"987d9bf3a722e7fcb8871b6d33eea0134f6579bda3d27e1ceceba5d29ead675a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(history, before, after, previous_kind, kind, previous_caret, caret, boundary):\n    history = list(history)\n    if before == after: return history\n    merge = bool(history) and True and previous_kind == kind and previous_caret == caret and not boundary\n    if merge: history[-1] = (history[-1][0], after)\n    else: history.append((before, after))\n    return history\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('noop', solve([('a','ab')], 'ab', 'ab', 'insert', 'insert', 2, 2, False), [('a', 'ab')])\ncheck('empty noop', solve([], 'a', 'a', None, 'insert', None, 1, False), [])\ncheck('delete', solve([('abcd','abc')], 'abc', 'ab', 'delete', 'delete', 3, 3, False), [('abcd', 'abc'), ('abc', 'ab')])\ncheck('contiguous', solve([('a','ab')], 'ab', 'abc', 'insert', 'insert', 2, 2, False), [('a', 'abc')])\ncheck('moved caret', solve([('a','ab')], 'ab', 'axb', 'insert', 'insert', 2, 1, False), [('a', 'ab'), ('ab', 'axb')])\ncheck('boundary', solve([('a','ab')], 'ab', 'abc', 'insert', 'insert', 2, 2, True), [('a', 'ab'), ('ab', 'abc')])\ncheck('empty', solve([], '', 'a', None, 'insert', None, 0, False), [('', 'a')])\ncheck('parameterized inserted length', solve([], '', 'a'*N, None, 'insert', None, 0, False), [('', 'a'*N)])\nfor repetition in range(N):\n    check('repeat empty', solve([], '', 'a', None, 'insert', None, 0, False), [('', '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":"9040f12ffc91fc2ab35075ff16280fb5513fb66e42e9db5093b7a765e2946624","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(history, before, after, previous_kind, kind, previous_caret, caret, boundary):\n    history = list(history)\n    if before == after: return history\n    merge = bool(history) and kind == 'insert' and previous_kind == kind and previous_caret == caret and not boundary\n    if merge: history[-1] = (history[-1][0], after)\n    else: history.append((before, after))\n    return history\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('noop', solve([('a','ab')], 'ab', 'ab', 'insert', 'insert', 2, 2, False), [('a', 'ab')])\ncheck('empty noop', solve([], 'a', 'a', None, 'insert', None, 1, False), [])\ncheck('delete', solve([('abcd','abc')], 'abc', 'ab', 'delete', 'delete', 3, 3, False), [('abcd', 'abc'), ('abc', 'ab')])\ncheck('contiguous', solve([('a','ab')], 'ab', 'abc', 'insert', 'insert', 2, 2, False), [('a', 'abc')])\ncheck('moved caret', solve([('a','ab')], 'ab', 'axb', 'insert', 'insert', 2, 1, False), [('a', 'ab'), ('ab', 'axb')])\ncheck('boundary', solve([('a','ab')], 'ab', 'abc', 'insert', 'insert', 2, 2, True), [('a', 'ab'), ('ab', 'abc')])\ncheck('empty', solve([], '', 'a', None, 'insert', None, 0, False), [('', 'a')])\ncheck('parameterized inserted length', solve([], '', 'a'*N, None, 'insert', None, 0, False), [('', 'a'*N)])\nfor repetition in range(N):\n    check('repeat empty', solve([], '', 'a', None, 'insert', None, 0, False), [('', '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-undo-grouping-kind","generated_at":"2026-09-29T14:38:26.568539+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic model of adjacent typing undo coalescing; this isolates one interface invariant without requiring a browser.","repair":"Implement the kind operation as `kind == 'insert'`.","root_cause":"The kind operation uses `True` where the contract requires `kind == 'insert'`.","sha256":"7782b31174d41a448ea73c799a250316f278570f2de8cefcf9040dbbe5892434","title":"Adjacent typing undo coalescing: Deletion transactions merge as if they were adjacent typing · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":37.375,"exit_code":1,"observations":[{"actual":[["a","ab"]],"check":"noop","expected":[["a","ab"]],"passed":true},{"actual":[],"check":"empty noop","expected":[],"passed":true},{"actual":[["abcd","ab"]],"check":"delete","expected":[["abcd","abc"],["abc","ab"]],"passed":false},{"actual":[["a","ab"],["ab","abc"]],"check":"contiguous","expected":[["a","abc"]],"passed":false},{"actual":[["a","ab"],["ab","axb"]],"check":"moved caret","expected":[["a","ab"],["ab","axb"]],"passed":true},{"actual":[["a","ab"],["ab","abc"]],"check":"boundary","expected":[["a","ab"],["ab","abc"]],"passed":true},{"actual":[["","a"]],"check":"empty","expected":[["","a"]],"passed":true},{"actual":[["","a"]],"check":"parameterized inserted length","expected":[["","a"]],"passed":true},{"actual":[["","a"]],"check":"repeat empty","expected":[["","a"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"noop\", \"actual\": [[\"a\", \"ab\"]], \"expected\": [[\"a\", \"ab\"]], \"passed\": true}, {\"check\": \"empty noop\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"delete\", \"actual\": [[\"abcd\", \"ab\"]], \"expected\": [[\"abcd\", \"abc\"], [\"abc\", \"ab\"]], \"passed\": false}, {\"check\": \"contiguous\", \"actual\": [[\"a\", \"ab\"], [\"ab\", \"abc\"]], \"expected\": [[\"a\", \"abc\"]], \"passed\": false}, {\"check\": \"moved caret\", \"actual\": [[\"a\", \"ab\"], [\"ab\", \"axb\"]], \"expected\": [[\"a\", \"ab\"], [\"ab\", \"axb\"]], \"passed\": true}, {\"check\": \"boundary\", \"actual\": [[\"a\", \"ab\"], [\"ab\", \"abc\"]], \"expected\": [[\"a\", \"ab\"], [\"ab\", \"abc\"]], \"passed\": true}, {\"check\": \"empty\", \"actual\": [[\"\", \"a\"]], \"expected\": [[\"\", \"a\"]], \"passed\": true}, {\"check\": \"parameterized inserted length\", \"actual\": [[\"\", \"a\"]], \"expected\": [[\"\", \"a\"]], \"passed\": true}, {\"check\": \"repeat empty\", \"actual\": [[\"\", \"a\"]], \"expected\": [[\"\", \"a\"]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":36.441,"exit_code":1,"observations":[{"actual":[["a","ab"]],"check":"noop","expected":[["a","ab"]],"passed":true},{"actual":[],"check":"empty noop","expected":[],"passed":true},{"actual":[["abcd","ab"]],"check":"delete","expected":[["abcd","abc"],["abc","ab"]],"passed":false},{"actual":[["a","abc"]],"check":"contiguous","expected":[["a","abc"]],"passed":true},{"actual":[["a","ab"],["ab","axb"]],"check":"moved caret","expected":[["a","ab"],["ab","axb"]],"passed":true},{"actual":[["a","ab"],["ab","abc"]],"check":"boundary","expected":[["a","ab"],["ab","abc"]],"passed":true},{"actual":[["","a"]],"check":"empty","expected":[["","a"]],"passed":true},{"actual":[["","a"]],"check":"parameterized inserted length","expected":[["","a"]],"passed":true},{"actual":[["","a"]],"check":"repeat empty","expected":[["","a"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"noop\", \"actual\": [[\"a\", \"ab\"]], \"expected\": [[\"a\", \"ab\"]], \"passed\": true}, {\"check\": \"empty noop\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"delete\", \"actual\": [[\"abcd\", \"ab\"]], \"expected\": [[\"abcd\", \"abc\"], [\"abc\", \"ab\"]], \"passed\": false}, {\"check\": \"contiguous\", \"actual\": [[\"a\", \"abc\"]], \"expected\": [[\"a\", \"abc\"]], \"passed\": true}, {\"check\": \"moved caret\", \"actual\": [[\"a\", \"ab\"], [\"ab\", \"axb\"]], \"expected\": [[\"a\", \"ab\"], [\"ab\", \"axb\"]], \"passed\": true}, {\"check\": \"boundary\", \"actual\": [[\"a\", \"ab\"], [\"ab\", \"abc\"]], \"expected\": [[\"a\", \"ab\"], [\"ab\", \"abc\"]], \"passed\": true}, {\"check\": \"empty\", \"actual\": [[\"\", \"a\"]], \"expected\": [[\"\", \"a\"]], \"passed\": true}, {\"check\": \"parameterized inserted length\", \"actual\": [[\"\", \"a\"]], \"expected\": [[\"\", \"a\"]], \"passed\": true}, {\"check\": \"repeat empty\", \"actual\": [[\"\", \"a\"]], \"expected\": [[\"\", \"a\"]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":37.557,"exit_code":0,"observations":[{"actual":[["a","ab"]],"check":"noop","expected":[["a","ab"]],"passed":true},{"actual":[],"check":"empty noop","expected":[],"passed":true},{"actual":[["abcd","abc"],["abc","ab"]],"check":"delete","expected":[["abcd","abc"],["abc","ab"]],"passed":true},{"actual":[["a","abc"]],"check":"contiguous","expected":[["a","abc"]],"passed":true},{"actual":[["a","ab"],["ab","axb"]],"check":"moved caret","expected":[["a","ab"],["ab","axb"]],"passed":true},{"actual":[["a","ab"],["ab","abc"]],"check":"boundary","expected":[["a","ab"],["ab","abc"]],"passed":true},{"actual":[["","a"]],"check":"empty","expected":[["","a"]],"passed":true},{"actual":[["","a"]],"check":"parameterized inserted length","expected":[["","a"]],"passed":true},{"actual":[["","a"]],"check":"repeat empty","expected":[["","a"]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"noop\", \"actual\": [[\"a\", \"ab\"]], \"expected\": [[\"a\", \"ab\"]], \"passed\": true}, {\"check\": \"empty noop\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"delete\", \"actual\": [[\"abcd\", \"abc\"], [\"abc\", \"ab\"]], \"expected\": [[\"abcd\", \"abc\"], [\"abc\", \"ab\"]], \"passed\": true}, {\"check\": \"contiguous\", \"actual\": [[\"a\", \"abc\"]], \"expected\": [[\"a\", \"abc\"]], \"passed\": true}, {\"check\": \"moved caret\", \"actual\": [[\"a\", \"ab\"], [\"ab\", \"axb\"]], \"expected\": [[\"a\", \"ab\"], [\"ab\", \"axb\"]], \"passed\": true}, {\"check\": \"boundary\", \"actual\": [[\"a\", \"ab\"], [\"ab\", \"abc\"]], \"expected\": [[\"a\", \"ab\"], [\"ab\", \"abc\"]], \"passed\": true}, {\"check\": \"empty\", \"actual\": [[\"\", \"a\"]], \"expected\": [[\"\", \"a\"]], \"passed\": true}, {\"check\": \"parameterized inserted length\", \"actual\": [[\"\", \"a\"]], \"expected\": [[\"\", \"a\"]], \"passed\": true}, {\"check\": \"repeat empty\", \"actual\": [[\"\", \"a\"]], \"expected\": [[\"\", \"a\"]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}