{"abstract":"Replacement length delta stretches later annotations.","category":"Annotation span alignment","checks":7,"contract":"Replace [start,end) with new_length characters. Spans ending at or before start stay fixed; spans starting at or after end shift by delta; overlapping spans keep start and adjust end by delta.","contract_signature":"spans, start, end, new_length","evaluation_group":"annotation-span-replace-delta","failed_approach":"Applying the delta at the old start also moves annotations touching the replaced range backward.","family":"w3-annotation-span-alignment-replace-delta","id":"FA-100151","implementations":{"attempt":{"sha256":"87deb3cb549c55c747489740834e63dc1ff55f43e554cfa3dc9e2a1ca525a3d5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(spans, start, end, new_length):\n    delta=new_length-(end-start); return [[s+delta if s>=start else s,e+delta if e>=start else e] for s,e in spans]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('before replacement', solve([[1,2]],4,N+4,N+1), [[1,2]])\ncheck('after replacement', solve([[N+5,N+8]],4,N+4,N+1), [[N+6,N+9]])\ncheck('overlaps left edge', solve([[2,N+5]],4,N+4,N+1), [[2,N+6]])\ncheck('touches old start', solve([[1,4]],4,N+4,N+1), [[1,4]])\ncheck('touches old end', solve([[N+4,N+6]],4,N+4,N+1), [[N+5,N+7]])\ncheck('empty input', solve([],4,N+4,N+1), [])\ncheck('same length replacement', solve([[N+4,N+6]],4,N+4,N), [[N+4,N+6]])\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":"ed8bc6b27830bb516a8c7eed0057ef51551b752ce79c9f14311e18892307e3be","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(spans, start, end, new_length):\n    delta=new_length-(end-start); return [[s,e+delta if e>start else e] for s,e in spans]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('before replacement', solve([[1,2]],4,N+4,N+1), [[1,2]])\ncheck('after replacement', solve([[N+5,N+8]],4,N+4,N+1), [[N+6,N+9]])\ncheck('overlaps left edge', solve([[2,N+5]],4,N+4,N+1), [[2,N+6]])\ncheck('touches old start', solve([[1,4]],4,N+4,N+1), [[1,4]])\ncheck('touches old end', solve([[N+4,N+6]],4,N+4,N+1), [[N+5,N+7]])\ncheck('empty input', solve([],4,N+4,N+1), [])\ncheck('same length replacement', solve([[N+4,N+6]],4,N+4,N), [[N+4,N+6]])\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":"Contracts use integer offsets, explicit edits, and supplied token boundaries; they do not define a tokenizer or production annotation format. 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":"w3-annotation-span-alignment-replace-delta","generated_at":"2026-09-30T16:48:32.171424+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A small offline annotation transformation keeps span coordinates explicit when text or token boundaries change.","root_cause":"Only the span end is shifted, stretching annotations located after a length-changing replacement.","sha256":"a2c9672e32785e2b43988c688414270560f275c1bcc749ddfa4235eb5ec1b7b1","title":"Replacement length delta stretches later annotations · case 01","variant":1,"variant_policy":"The fixture code references N, supplied as 1 through 5. Fixed boundary checks may repeat. These records share one mechanism and must remain together in evaluation splits.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":30.163,"exit_code":1,"observations":[{"actual":[[1,2]],"check":"before replacement","expected":[[1,2]],"passed":true},{"actual":[[7,10]],"check":"after replacement","expected":[[7,10]],"passed":true},{"actual":[[2,7]],"check":"overlaps left edge","expected":[[2,7]],"passed":true},{"actual":[[1,5]],"check":"touches old start","expected":[[1,4]],"passed":false},{"actual":[[6,8]],"check":"touches old end","expected":[[6,8]],"passed":true},{"actual":[],"check":"empty input","expected":[],"passed":true},{"actual":[[5,7]],"check":"same length replacement","expected":[[5,7]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"before replacement\", \"actual\": [[1, 2]], \"expected\": [[1, 2]], \"passed\": true}, {\"check\": \"after replacement\", \"actual\": [[7, 10]], \"expected\": [[7, 10]], \"passed\": true}, {\"check\": \"overlaps left edge\", \"actual\": [[2, 7]], \"expected\": [[2, 7]], \"passed\": true}, {\"check\": \"touches old start\", \"actual\": [[1, 5]], \"expected\": [[1, 4]], \"passed\": false}, {\"check\": \"touches old end\", \"actual\": [[6, 8]], \"expected\": [[6, 8]], \"passed\": true}, {\"check\": \"empty input\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"same length replacement\", \"actual\": [[5, 7]], \"expected\": [[5, 7]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":28.749,"exit_code":1,"observations":[{"actual":[[1,2]],"check":"before replacement","expected":[[1,2]],"passed":true},{"actual":[[6,10]],"check":"after replacement","expected":[[7,10]],"passed":false},{"actual":[[2,7]],"check":"overlaps left edge","expected":[[2,7]],"passed":true},{"actual":[[1,4]],"check":"touches old start","expected":[[1,4]],"passed":true},{"actual":[[5,8]],"check":"touches old end","expected":[[6,8]],"passed":false},{"actual":[],"check":"empty input","expected":[],"passed":true},{"actual":[[5,7]],"check":"same length replacement","expected":[[5,7]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"before replacement\", \"actual\": [[1, 2]], \"expected\": [[1, 2]], \"passed\": true}, {\"check\": \"after replacement\", \"actual\": [[6, 10]], \"expected\": [[7, 10]], \"passed\": false}, {\"check\": \"overlaps left edge\", \"actual\": [[2, 7]], \"expected\": [[2, 7]], \"passed\": true}, {\"check\": \"touches old start\", \"actual\": [[1, 4]], \"expected\": [[1, 4]], \"passed\": true}, {\"check\": \"touches old end\", \"actual\": [[5, 8]], \"expected\": [[6, 8]], \"passed\": false}, {\"check\": \"empty input\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"same length replacement\", \"actual\": [[5, 7]], \"expected\": [[5, 7]], \"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."}}