{"abstract":"Backward selections start replacement at the anchor.","category":"Text editing","checks":8,"contract":"Composition is preserved; replace the normalized half-open selection and collapse both endpoints immediately after inserted text.","contract_signature":"text, anchor, focus, replacement, composing","evaluation_group":"xi-text-selection","failed_approach":"Using the upper endpoint discards the selection direction normalization.","family":"xi-text-selection-backward-start","id":"FA-7911","implementations":{"attempt":{"sha256":"f8bb19297456c52fc070eb78ac7702cc105241140472403288d1d87a28368cad","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text, anchor, focus, replacement, composing):\n    if composing: return (text, anchor, focus)\n    lo = max(anchor, focus)\n    hi = max(anchor, focus)\n    result = text[:lo] + replacement + text[hi:]\n    caret = lo + len(replacement)\n    return (result, caret, caret)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('composition', solve('abcdef', 1, 4, 'XY', True), ('abcdef', 1, 4))\ncheck('forward', solve('abcdef', 1, 4, 'XY', False), ('aXYef', 3, 3))\ncheck('backward', solve('abcdef', 4, 1, 'XY', False), ('aXYef', 3, 3))\ncheck('insertion', solve('ab', 1, 1, 'XYZ', False), ('aXYZb', 4, 4))\ncheck('delete', solve('abc', 0, 3, '', False), ('', 0, 0))\ncheck('no selection', solve('abc', 2, 2, '', False), ('abc', 2, 2))\ncheck('parameterized selected length', solve('a'*N, 0, N, 'X', False), ('X', 1, 1))\nfor repetition in range(N):\n    check('repeat no selection', solve('abc', 2, 2, '', False), ('abc', 2, 2))\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":"ccc1689ab8bc23b91b62a15cd4df140c1c2c3debba9c0225db31a081510d677f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text, anchor, focus, replacement, composing):\n    if composing: return (text, anchor, focus)\n    lo = anchor\n    hi = max(anchor, focus)\n    result = text[:lo] + replacement + text[hi:]\n    caret = lo + len(replacement)\n    return (result, caret, caret)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('composition', solve('abcdef', 1, 4, 'XY', True), ('abcdef', 1, 4))\ncheck('forward', solve('abcdef', 1, 4, 'XY', False), ('aXYef', 3, 3))\ncheck('backward', solve('abcdef', 4, 1, 'XY', False), ('aXYef', 3, 3))\ncheck('insertion', solve('ab', 1, 1, 'XYZ', False), ('aXYZb', 4, 4))\ncheck('delete', solve('abc', 0, 3, '', False), ('', 0, 0))\ncheck('no selection', solve('abc', 2, 2, '', False), ('abc', 2, 2))\ncheck('parameterized selected length', solve('a'*N, 0, N, 'X', False), ('X', 1, 1))\nfor repetition in range(N):\n    check('repeat no selection', solve('abc', 2, 2, '', False), ('abc', 2, 2))\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-text-selection-backward-start","generated_at":"2026-09-29T14:38:16.617078+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic model of text selection replacement; this isolates one interface invariant without requiring a browser.","root_cause":"The backward start operation uses `anchor` where the contract requires `min(anchor, focus)`.","sha256":"0830ba95a9102041ef29cdbcd98b211ccede4137f8a366ad92b555c134954128","title":"Text selection replacement: Backward selections start replacement at the anchor · 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":44.63,"exit_code":1,"observations":[{"actual":["abcdef",1,4],"check":"composition","expected":["abcdef",1,4],"passed":true},{"actual":["abcdXYef",6,6],"check":"forward","expected":["aXYef",3,3],"passed":false},{"actual":["abcdXYef",6,6],"check":"backward","expected":["aXYef",3,3],"passed":false},{"actual":["aXYZb",4,4],"check":"insertion","expected":["aXYZb",4,4],"passed":true},{"actual":["abc",3,3],"check":"delete","expected":["",0,0],"passed":false},{"actual":["abc",2,2],"check":"no selection","expected":["abc",2,2],"passed":true},{"actual":["aX",2,2],"check":"parameterized selected length","expected":["X",1,1],"passed":false},{"actual":["abc",2,2],"check":"repeat no selection","expected":["abc",2,2],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"composition\", \"actual\": [\"abcdef\", 1, 4], \"expected\": [\"abcdef\", 1, 4], \"passed\": true}, {\"check\": \"forward\", \"actual\": [\"abcdXYef\", 6, 6], \"expected\": [\"aXYef\", 3, 3], \"passed\": false}, {\"check\": \"backward\", \"actual\": [\"abcdXYef\", 6, 6], \"expected\": [\"aXYef\", 3, 3], \"passed\": false}, {\"check\": \"insertion\", \"actual\": [\"aXYZb\", 4, 4], \"expected\": [\"aXYZb\", 4, 4], \"passed\": true}, {\"check\": \"delete\", \"actual\": [\"abc\", 3, 3], \"expected\": [\"\", 0, 0], \"passed\": false}, {\"check\": \"no selection\", \"actual\": [\"abc\", 2, 2], \"expected\": [\"abc\", 2, 2], \"passed\": true}, {\"check\": \"parameterized selected length\", \"actual\": [\"aX\", 2, 2], \"expected\": [\"X\", 1, 1], \"passed\": false}, {\"check\": \"repeat no selection\", \"actual\": [\"abc\", 2, 2], \"expected\": [\"abc\", 2, 2], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.932,"exit_code":1,"observations":[{"actual":["abcdef",1,4],"check":"composition","expected":["abcdef",1,4],"passed":true},{"actual":["aXYef",3,3],"check":"forward","expected":["aXYef",3,3],"passed":true},{"actual":["abcdXYef",6,6],"check":"backward","expected":["aXYef",3,3],"passed":false},{"actual":["aXYZb",4,4],"check":"insertion","expected":["aXYZb",4,4],"passed":true},{"actual":["",0,0],"check":"delete","expected":["",0,0],"passed":true},{"actual":["abc",2,2],"check":"no selection","expected":["abc",2,2],"passed":true},{"actual":["X",1,1],"check":"parameterized selected length","expected":["X",1,1],"passed":true},{"actual":["abc",2,2],"check":"repeat no selection","expected":["abc",2,2],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"composition\", \"actual\": [\"abcdef\", 1, 4], \"expected\": [\"abcdef\", 1, 4], \"passed\": true}, {\"check\": \"forward\", \"actual\": [\"aXYef\", 3, 3], \"expected\": [\"aXYef\", 3, 3], \"passed\": true}, {\"check\": \"backward\", \"actual\": [\"abcdXYef\", 6, 6], \"expected\": [\"aXYef\", 3, 3], \"passed\": false}, {\"check\": \"insertion\", \"actual\": [\"aXYZb\", 4, 4], \"expected\": [\"aXYZb\", 4, 4], \"passed\": true}, {\"check\": \"delete\", \"actual\": [\"\", 0, 0], \"expected\": [\"\", 0, 0], \"passed\": true}, {\"check\": \"no selection\", \"actual\": [\"abc\", 2, 2], \"expected\": [\"abc\", 2, 2], \"passed\": true}, {\"check\": \"parameterized selected length\", \"actual\": [\"X\", 1, 1], \"expected\": [\"X\", 1, 1], \"passed\": true}, {\"check\": \"repeat no selection\", \"actual\": [\"abc\", 2, 2], \"expected\": [\"abc\", 2, 2], \"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."}}