{"abstract":"An unchanged edit creates an undo step and destroys redo.","category":"Undo and history","checks":8,"contract":"Distinct edits push the old present and clear redo; undo and redo transfer one state while preserving order; no-op edits and unavailable traversal preserve history.","evaluation_group":"xi-undo","failed_approach":"Accepting only unchanged edits discards actual edits.","family":"xi-undo-noop","id":"FA-8031","implementations":{"attempt":{"sha256":"21252877d192884789cf54254bf00a9ecd88ebcb8dd97c7e3e08c6d0e15224f6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(past, present, future, event, value):\n    past, future = list(past), list(future)\n    if event == 'edit' and value == present: return (past + [present], value, [])\n    if event == 'undo' and past: return (past[:-1], past[-1], [present] + future)\n    if event == 'redo' and future: return (past + [present], future[0], future[1:])\n    return (past, present, future)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('noop retains redo', solve(['a'], 'b', ['c'], 'edit', 'b'), (['a'], 'b', ['c']))\ncheck('branch', solve(['a'], 'b', ['c'], 'edit', 'x'), (['a', 'b'], 'x', []))\ncheck('undo', solve(['a','b'], 'c', ['d'], 'undo', None), (['a'], 'b', ['c', 'd']))\ncheck('redo', solve(['a'], 'b', ['c','d'], 'redo', None), (['a', 'b'], 'c', ['d']))\ncheck('empty undo', solve([], 'a', [], 'undo', None), ([], 'a', []))\ncheck('empty redo', solve([], 'a', [], 'redo', None), ([], 'a', []))\ncheck('parameterized history length', solve(list(range(N)), N, [], 'edit', N+1), (list(range(N+1)), N+1, []))\nfor repetition in range(N):\n    check('repeat empty redo', solve([], 'a', [], 'redo', None), ([], '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":"a0c1c7a9d66fd5469da31fc64fb352edc8364f6b63c1195c3accf549a127baa9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(past, present, future, event, value):\n    past, future = list(past), list(future)\n    if event == 'edit': return (past + [present], value, [])\n    if event == 'undo' and past: return (past[:-1], past[-1], [present] + future)\n    if event == 'redo' and future: return (past + [present], future[0], future[1:])\n    return (past, present, future)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('noop retains redo', solve(['a'], 'b', ['c'], 'edit', 'b'), (['a'], 'b', ['c']))\ncheck('branch', solve(['a'], 'b', ['c'], 'edit', 'x'), (['a', 'b'], 'x', []))\ncheck('undo', solve(['a','b'], 'c', ['d'], 'undo', None), (['a'], 'b', ['c', 'd']))\ncheck('redo', solve(['a'], 'b', ['c','d'], 'redo', None), (['a', 'b'], 'c', ['d']))\ncheck('empty undo', solve([], 'a', [], 'undo', None), ([], 'a', []))\ncheck('empty redo', solve([], 'a', [], 'redo', None), ([], 'a', []))\ncheck('parameterized history length', solve(list(range(N)), N, [], 'edit', N+1), (list(range(N+1)), N+1, []))\nfor repetition in range(N):\n    check('repeat empty redo', solve([], 'a', [], 'redo', None), ([], '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":"dae50cc92d1d321aec589e97f3f328c59a42305b416a5d870a20baf5d3824433","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(past, present, future, event, value):\n    past, future = list(past), list(future)\n    if event == 'edit' and value != present: return (past + [present], value, [])\n    if event == 'undo' and past: return (past[:-1], past[-1], [present] + future)\n    if event == 'redo' and future: return (past + [present], future[0], future[1:])\n    return (past, present, future)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('noop retains redo', solve(['a'], 'b', ['c'], 'edit', 'b'), (['a'], 'b', ['c']))\ncheck('branch', solve(['a'], 'b', ['c'], 'edit', 'x'), (['a', 'b'], 'x', []))\ncheck('undo', solve(['a','b'], 'c', ['d'], 'undo', None), (['a'], 'b', ['c', 'd']))\ncheck('redo', solve(['a'], 'b', ['c','d'], 'redo', None), (['a', 'b'], 'c', ['d']))\ncheck('empty undo', solve([], 'a', [], 'undo', None), ([], 'a', []))\ncheck('empty redo', solve([], 'a', [], 'redo', None), ([], 'a', []))\ncheck('parameterized history length', solve(list(range(N)), N, [], 'edit', N+1), (list(range(N+1)), N+1, []))\nfor repetition in range(N):\n    check('repeat empty redo', solve([], 'a', [], 'redo', None), ([], '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-noop","generated_at":"2026-09-29T14:38:17.482487+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic model of undo stack transitions; this isolates one interface invariant without requiring a browser.","repair":"Implement the noop operation as ` and value != present`.","root_cause":"The noop operation uses `` where the contract requires ` and value != present`.","sha256":"050f4cb647c4f587866f3c7e547c2f50d8f2f4a0913f943233edfdcd54f9780a","title":"Undo stack transitions: An unchanged edit creates an undo step and destroys redo · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":38.626,"exit_code":1,"observations":[{"actual":[["a","b"],"b",[]],"check":"noop retains redo","expected":[["a"],"b",["c"]],"passed":false},{"actual":[["a"],"b",["c"]],"check":"branch","expected":[["a","b"],"x",[]],"passed":false},{"actual":[["a"],"b",["c","d"]],"check":"undo","expected":[["a"],"b",["c","d"]],"passed":true},{"actual":[["a","b"],"c",["d"]],"check":"redo","expected":[["a","b"],"c",["d"]],"passed":true},{"actual":[[],"a",[]],"check":"empty undo","expected":[[],"a",[]],"passed":true},{"actual":[[],"a",[]],"check":"empty redo","expected":[[],"a",[]],"passed":true},{"actual":[[0],1,[]],"check":"parameterized history length","expected":[[0,1],2,[]],"passed":false},{"actual":[[],"a",[]],"check":"repeat empty redo","expected":[[],"a",[]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"noop retains redo\", \"actual\": [[\"a\", \"b\"], \"b\", []], \"expected\": [[\"a\"], \"b\", [\"c\"]], \"passed\": false}, {\"check\": \"branch\", \"actual\": [[\"a\"], \"b\", [\"c\"]], \"expected\": [[\"a\", \"b\"], \"x\", []], \"passed\": false}, {\"check\": \"undo\", \"actual\": [[\"a\"], \"b\", [\"c\", \"d\"]], \"expected\": [[\"a\"], \"b\", [\"c\", \"d\"]], \"passed\": true}, {\"check\": \"redo\", \"actual\": [[\"a\", \"b\"], \"c\", [\"d\"]], \"expected\": [[\"a\", \"b\"], \"c\", [\"d\"]], \"passed\": true}, {\"check\": \"empty undo\", \"actual\": [[], \"a\", []], \"expected\": [[], \"a\", []], \"passed\": true}, {\"check\": \"empty redo\", \"actual\": [[], \"a\", []], \"expected\": [[], \"a\", []], \"passed\": true}, {\"check\": \"parameterized history length\", \"actual\": [[0], 1, []], \"expected\": [[0, 1], 2, []], \"passed\": false}, {\"check\": \"repeat empty redo\", \"actual\": [[], \"a\", []], \"expected\": [[], \"a\", []], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.154,"exit_code":1,"observations":[{"actual":[["a","b"],"b",[]],"check":"noop retains redo","expected":[["a"],"b",["c"]],"passed":false},{"actual":[["a","b"],"x",[]],"check":"branch","expected":[["a","b"],"x",[]],"passed":true},{"actual":[["a"],"b",["c","d"]],"check":"undo","expected":[["a"],"b",["c","d"]],"passed":true},{"actual":[["a","b"],"c",["d"]],"check":"redo","expected":[["a","b"],"c",["d"]],"passed":true},{"actual":[[],"a",[]],"check":"empty undo","expected":[[],"a",[]],"passed":true},{"actual":[[],"a",[]],"check":"empty redo","expected":[[],"a",[]],"passed":true},{"actual":[[0,1],2,[]],"check":"parameterized history length","expected":[[0,1],2,[]],"passed":true},{"actual":[[],"a",[]],"check":"repeat empty redo","expected":[[],"a",[]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"noop retains redo\", \"actual\": [[\"a\", \"b\"], \"b\", []], \"expected\": [[\"a\"], \"b\", [\"c\"]], \"passed\": false}, {\"check\": \"branch\", \"actual\": [[\"a\", \"b\"], \"x\", []], \"expected\": [[\"a\", \"b\"], \"x\", []], \"passed\": true}, {\"check\": \"undo\", \"actual\": [[\"a\"], \"b\", [\"c\", \"d\"]], \"expected\": [[\"a\"], \"b\", [\"c\", \"d\"]], \"passed\": true}, {\"check\": \"redo\", \"actual\": [[\"a\", \"b\"], \"c\", [\"d\"]], \"expected\": [[\"a\", \"b\"], \"c\", [\"d\"]], \"passed\": true}, {\"check\": \"empty undo\", \"actual\": [[], \"a\", []], \"expected\": [[], \"a\", []], \"passed\": true}, {\"check\": \"empty redo\", \"actual\": [[], \"a\", []], \"expected\": [[], \"a\", []], \"passed\": true}, {\"check\": \"parameterized history length\", \"actual\": [[0, 1], 2, []], \"expected\": [[0, 1], 2, []], \"passed\": true}, {\"check\": \"repeat empty redo\", \"actual\": [[], \"a\", []], \"expected\": [[], \"a\", []], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.146,"exit_code":0,"observations":[{"actual":[["a"],"b",["c"]],"check":"noop retains redo","expected":[["a"],"b",["c"]],"passed":true},{"actual":[["a","b"],"x",[]],"check":"branch","expected":[["a","b"],"x",[]],"passed":true},{"actual":[["a"],"b",["c","d"]],"check":"undo","expected":[["a"],"b",["c","d"]],"passed":true},{"actual":[["a","b"],"c",["d"]],"check":"redo","expected":[["a","b"],"c",["d"]],"passed":true},{"actual":[[],"a",[]],"check":"empty undo","expected":[[],"a",[]],"passed":true},{"actual":[[],"a",[]],"check":"empty redo","expected":[[],"a",[]],"passed":true},{"actual":[[0,1],2,[]],"check":"parameterized history length","expected":[[0,1],2,[]],"passed":true},{"actual":[[],"a",[]],"check":"repeat empty redo","expected":[[],"a",[]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"noop retains redo\", \"actual\": [[\"a\"], \"b\", [\"c\"]], \"expected\": [[\"a\"], \"b\", [\"c\"]], \"passed\": true}, {\"check\": \"branch\", \"actual\": [[\"a\", \"b\"], \"x\", []], \"expected\": [[\"a\", \"b\"], \"x\", []], \"passed\": true}, {\"check\": \"undo\", \"actual\": [[\"a\"], \"b\", [\"c\", \"d\"]], \"expected\": [[\"a\"], \"b\", [\"c\", \"d\"]], \"passed\": true}, {\"check\": \"redo\", \"actual\": [[\"a\", \"b\"], \"c\", [\"d\"]], \"expected\": [[\"a\", \"b\"], \"c\", [\"d\"]], \"passed\": true}, {\"check\": \"empty undo\", \"actual\": [[], \"a\", []], \"expected\": [[], \"a\", []], \"passed\": true}, {\"check\": \"empty redo\", \"actual\": [[], \"a\", []], \"expected\": [[], \"a\", []], \"passed\": true}, {\"check\": \"parameterized history length\", \"actual\": [[0, 1], 2, []], \"expected\": [[0, 1], 2, []], \"passed\": true}, {\"check\": \"repeat empty redo\", \"actual\": [[], \"a\", []], \"expected\": [[], \"a\", []], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}