{"abstract":"Editing after undo retains an invalid redo branch.","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.","contract_signature":"past, present, future, event, value","evaluation_group":"xi-undo","failed_approach":"Clearing both sides discards valid undo history.","family":"xi-undo-branch","id":"FA-8036","implementations":{"attempt":{"sha256":"fb019f2496abdd746b0173ef8c1b7dd6085f481aab6a87349900406f14289f2f","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 ([], 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":"9de42b97a0731ad2d0af2deebf8f1c6f2dc0e179835672b92e71319d553e76bd","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, future)\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-branch","generated_at":"2026-09-29T14:38:17.739177+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.","root_cause":"The branch operation uses `(past + [present], value, future)` where the contract requires `(past + [present], value, [])`.","sha256":"154672635d2403665a15b3b7e6628130f6343b3ce929ba5c2bf5f14839cdc32b","title":"Undo stack transitions: Editing after undo retains an invalid redo branch · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":40.484,"exit_code":1,"observations":[{"actual":[["a"],"b",["c"]],"check":"noop retains redo","expected":[["a"],"b",["c"]],"passed":true},{"actual":[[],"x",[]],"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":[[],2,[]],"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\", [\"c\"]], \"expected\": [[\"a\"], \"b\", [\"c\"]], \"passed\": true}, {\"check\": \"branch\", \"actual\": [[], \"x\", []], \"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\": [[], 2, []], \"expected\": [[0, 1], 2, []], \"passed\": false}, {\"check\": \"repeat empty redo\", \"actual\": [[], \"a\", []], \"expected\": [[], \"a\", []], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.974,"exit_code":1,"observations":[{"actual":[["a"],"b",["c"]],"check":"noop retains redo","expected":[["a"],"b",["c"]],"passed":true},{"actual":[["a","b"],"x",["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],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\", [\"c\"]], \"expected\": [[\"a\"], \"b\", [\"c\"]], \"passed\": true}, {\"check\": \"branch\", \"actual\": [[\"a\", \"b\"], \"x\", [\"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], 2, []], \"expected\": [[0, 1], 2, []], \"passed\": true}, {\"check\": \"repeat empty redo\", \"actual\": [[], \"a\", []], \"expected\": [[], \"a\", []], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}