FAILURE MAP
← Case archive

FA-100211 / Annotation span alignment / Open access

Sentence partition retains untrimmed cross-boundary spans · case 01

Sentence partition retains untrimmed cross-boundary spans.

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

ROOT CAUSE

A span is returned intact when it touches any sentence instead of being clipped into sentence-local pieces.

THE FAILURE

A span is returned intact when it touches any sentence instead of being clipped into sentence-local pieces.

Unsuccessful approach: Filtering on sentence start omits a leading fragment when an annotation begins inside that sentence.

Case contract

For ordered sentence intervals, intersect each span [s,e,label] with each sentence [a,b); emit [max(s,a),min(e,b),label] only when nonempty.

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, sentences):
    return [[s,e,l] for s,e,l in spans if any(s<=b and a<=e for a,b in sentences)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('crossing split', solve([[1,7,'x']],[[0,4],[4,9]]), [[1,4,'x'],[4,7,'x']])
check('touch only omitted', solve([[0,4,'x']],[[4,8]]), [])
check('inside one sentence', solve([[5,6,'y']],[[0,4],[4,9]]), [[5,6,'y']])
check('multiple spans', solve([[1,3,'a'],[6,8,'b']],[[0,5],[5,10]]), [[1,3,'a'],[6,8,'b']])
check('no sentences', solve([[1,2,'x']],[]), [])
check('no spans', solve([],[[0,3]]), [])
check('equal whole sentence', solve([[N,N+2,'z']],[[N,N+2]]), [[N,N+2,'z']])
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
crossing split[[1, 7, 'x']][[1, 4, 'x'], [4, 7, 'x']]Failed
touch only omitted[[0, 4, 'x']][]Failed
inside one sentence[[5, 6, 'y']][[5, 6, 'y']]Passed
multiple spans[[1, 3, 'a'], [6, 8, 'b']][[1, 3, 'a'], [6, 8, 'b']]Passed
no sentences[][]Passed
no spans[][]Passed
equal whole sentence[[1, 3, 'z']][[1, 3, 'z']]Passed

SHA-256 / 3430689d0a032eeeaba9d1a31d7e74658fee723847a6e9df99cb4966ad046254

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(spans, sentences):
    return [[max(s,a),min(e,b),l] for s,e,l in spans for a,b in sentences if s<=a<e]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('crossing split', solve([[1,7,'x']],[[0,4],[4,9]]), [[1,4,'x'],[4,7,'x']])
check('touch only omitted', solve([[0,4,'x']],[[4,8]]), [])
check('inside one sentence', solve([[5,6,'y']],[[0,4],[4,9]]), [[5,6,'y']])
check('multiple spans', solve([[1,3,'a'],[6,8,'b']],[[0,5],[5,10]]), [[1,3,'a'],[6,8,'b']])
check('no sentences', solve([[1,2,'x']],[]), [])
check('no spans', solve([],[[0,3]]), [])
check('equal whole sentence', solve([[N,N+2,'z']],[[N,N+2]]), [[N,N+2,'z']])
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
crossing split[[4, 7, 'x']][[1, 4, 'x'], [4, 7, 'x']]Failed
touch only omitted[][]Passed
inside one sentence[][[5, 6, 'y']]Failed
multiple spans[][[1, 3, 'a'], [6, 8, 'b']]Failed
no sentences[][]Passed
no spans[][]Passed
equal whole sentence[[1, 3, 'z']][[1, 3, 'z']]Passed

SHA-256 / bd7a7d59f3252bc72d88ba71aa07540d6b3d8f865dce4beedafae9bd6c3c56fe

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

Case digest / 5d4f463ef6774796dd7bad201de8bae7afd200598acfec5fcac12307b8aa4cb0