FAILURE MAP
← Case archive

FA-100151 / Annotation span alignment / Open access

Replacement length delta stretches later annotations · case 01

Replacement length delta stretches later annotations.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Only the span end is shifted, stretching annotations located after a length-changing replacement.

THE FAILURE

Only the span end is shifted, stretching annotations located after a length-changing replacement.

Unsuccessful approach: Applying the delta at the old start also moves annotations touching the replaced range backward.

Case 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.

Why this case matters

A small offline annotation transformation keeps span coordinates explicit when text or token boundaries change.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(spans, start, end, new_length):
    delta=new_length-(end-start); return [[s,e+delta if e>start else e] for s,e in spans]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('before replacement', solve([[1,2]],4,N+4,N+1), [[1,2]])
check('after replacement', solve([[N+5,N+8]],4,N+4,N+1), [[N+6,N+9]])
check('overlaps left edge', solve([[2,N+5]],4,N+4,N+1), [[2,N+6]])
check('touches old start', solve([[1,4]],4,N+4,N+1), [[1,4]])
check('touches old end', solve([[N+4,N+6]],4,N+4,N+1), [[N+5,N+7]])
check('empty input', solve([],4,N+4,N+1), [])
check('same length replacement', solve([[N+4,N+6]],4,N+4,N), [[N+4,N+6]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
before replacement[[1, 2]][[1, 2]]Passed
after replacement[[6, 10]][[7, 10]]Failed
overlaps left edge[[2, 7]][[2, 7]]Passed
touches old start[[1, 4]][[1, 4]]Passed
touches old end[[5, 8]][[6, 8]]Failed
empty input[][]Passed
same length replacement[[5, 7]][[5, 7]]Passed

SHA-256 / ed8bc6b27830bb516a8c7eed0057ef51551b752ce79c9f14311e18892307e3be

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(spans, start, end, new_length):
    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]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('before replacement', solve([[1,2]],4,N+4,N+1), [[1,2]])
check('after replacement', solve([[N+5,N+8]],4,N+4,N+1), [[N+6,N+9]])
check('overlaps left edge', solve([[2,N+5]],4,N+4,N+1), [[2,N+6]])
check('touches old start', solve([[1,4]],4,N+4,N+1), [[1,4]])
check('touches old end', solve([[N+4,N+6]],4,N+4,N+1), [[N+5,N+7]])
check('empty input', solve([],4,N+4,N+1), [])
check('same length replacement', solve([[N+4,N+6]],4,N+4,N), [[N+4,N+6]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
before replacement[[1, 2]][[1, 2]]Passed
after replacement[[7, 10]][[7, 10]]Passed
overlaps left edge[[2, 7]][[2, 7]]Passed
touches old start[[1, 5]][[1, 4]]Failed
touches old end[[6, 8]][[6, 8]]Passed
empty input[][]Passed
same length replacement[[5, 7]][[5, 7]]Passed

SHA-256 / 87deb3cb549c55c747489740834e63dc1ff55f43e554cfa3dc9e2a1ca525a3d5

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

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.

Observations recorded using Python 3.12.14 at 2026-09-30T16:48:32.171424+00:00.

Case digest / a2c9672e32785e2b43988c688414270560f275c1bcc749ddfa4235eb5ec1b7b1