FAILURE MAP
← Case archive

FA-100201 / Annotation span alignment / Open access

Annotations intersecting an edit are silently retained · case 01

Annotations intersecting an edit are silently retained.

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

ROOT CAUSE

A remapper shifts every span after an edit even when the edit replaces its text.

THE FAILURE

A remapper shifts every span after an edit even when the edit replaces its text.

Unsuccessful approach: Dropping spans whose endpoint touches the edit loses valid adjacent annotations.

Case contract

For replacement of [left,right), discard spans with positive overlap; keep spans ending <= left; shift spans starting >= right 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, left, right, delta):
    return [[s+(delta if s>=right else 0),e+(delta if e>=right else 0),l] for s,e,l in spans]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('overlap removed', solve([[2,5,'x']],3,4,N), [])
check('touch left survives', solve([[0,3,'x']],3,4,N), [[0,3,'x']])
check('touch right shifts', solve([[4,7,'x']],3,4,N), [[4+N,7+N,'x']])
check('survivors both sides', solve([[0,2,'a'],[5,7,'b']],3,4,2), [[0,2,'a'],[7,9,'b']])
check('empty list', solve([],N,N+1,2), [])
check('containing edit removed', solve([[0,8,'x']],3,5,-1), [])
check('one char exact edit removed', solve([[3,4,'x']],3,4,0), [])
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
overlap removed[[2, 6, 'x']][]Failed
touch left survives[[0, 3, 'x']][[0, 3, 'x']]Passed
touch right shifts[[5, 8, 'x']][[5, 8, 'x']]Passed
survivors both sides[[0, 2, 'a'], [7, 9, 'b']][[0, 2, 'a'], [7, 9, 'b']]Passed
empty list[][]Passed
containing edit removed[[0, 7, 'x']][]Failed
one char exact edit removed[[3, 4, 'x']][]Failed

SHA-256 / 79df80c36aef98b1744953281c0f4379de5d29ce78a11ca7f4a1a5d9e2dac146

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(spans, left, right, delta):
    return [[s+(delta if s>=right else 0),e+(delta if e>=right else 0),l] for s,e,l in spans if not (s<=right and e>=left)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('overlap removed', solve([[2,5,'x']],3,4,N), [])
check('touch left survives', solve([[0,3,'x']],3,4,N), [[0,3,'x']])
check('touch right shifts', solve([[4,7,'x']],3,4,N), [[4+N,7+N,'x']])
check('survivors both sides', solve([[0,2,'a'],[5,7,'b']],3,4,2), [[0,2,'a'],[7,9,'b']])
check('empty list', solve([],N,N+1,2), [])
check('containing edit removed', solve([[0,8,'x']],3,5,-1), [])
check('one char exact edit removed', solve([[3,4,'x']],3,4,0), [])
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
overlap removed[][]Passed
touch left survives[][[0, 3, 'x']]Failed
touch right shifts[][[5, 8, 'x']]Failed
survivors both sides[[0, 2, 'a'], [7, 9, 'b']][[0, 2, 'a'], [7, 9, 'b']]Passed
empty list[][]Passed
containing edit removed[][]Passed
one char exact edit removed[][]Passed

SHA-256 / 655d1bdbaaf9ab934d43e9790a4f82645b539749d60c3f98483f1b2e023362d4

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:33.096416+00:00.

Case digest / 33750161f1ebd2276bd9b87d14955fb1119daa201c11a35b54edb5f7426f5a2f