FAILURE MAP
← Case archive

FA-100166 / Annotation span alignment / Open access

Token labels leak across neighboring annotations · case 01

Token labels leak across neighboring annotations.

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

ROOT CAUSE

A token is labeled by any annotation with an inclusive endpoint touch.

THE FAILURE

A token is labeled by any annotation with an inclusive endpoint touch.

Unsuccessful approach: Checking only token start drops a label when an annotation begins inside a token.

Case contract

For each token interval, emit labels in annotation order whose half-open intervals positively overlap it.

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(tokens, spans):
    return [[label for s,e,label in spans if a<=e and s<=b] for a,b in tokens]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('inside token overlap', solve([[0,4]],[[3,6,'x']]), [['x']])
check('left touching excluded', solve([[0,3]],[[3,6,'x']]), [[]])
check('right touching excluded', solve([[6,9]],[[3,6,'x']]), [[]])
check('two labels preserve order', solve([[2,7]],[[0,4,'a'],[5,8,'b']]), [['a','b']])
check('empty annotation set', solve([[0,2]],[]), [[]])
check('empty token set', solve([],[[0,2,'x']]), [])
check('identical bounds', solve([[N,N+2]],[[N,N+2,'q']]), [['q']])
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
inside token overlap[['x']][['x']]Passed
left touching excluded[['x']][[]]Failed
right touching excluded[['x']][[]]Failed
two labels preserve order[['a', 'b']][['a', 'b']]Passed
empty annotation set[[]][[]]Passed
empty token set[][]Passed
identical bounds[['q']][['q']]Passed

SHA-256 / 047fd49dcae1535ac330edc322840c3c03c40d051dcfd41fa3bf5c6da62be558

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(tokens, spans):
    return [[label for s,e,label in spans if s<=a<e] for a,b in tokens]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('inside token overlap', solve([[0,4]],[[3,6,'x']]), [['x']])
check('left touching excluded', solve([[0,3]],[[3,6,'x']]), [[]])
check('right touching excluded', solve([[6,9]],[[3,6,'x']]), [[]])
check('two labels preserve order', solve([[2,7]],[[0,4,'a'],[5,8,'b']]), [['a','b']])
check('empty annotation set', solve([[0,2]],[]), [[]])
check('empty token set', solve([],[[0,2,'x']]), [])
check('identical bounds', solve([[N,N+2]],[[N,N+2,'q']]), [['q']])
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
inside token overlap[[]][['x']]Failed
left touching excluded[[]][[]]Passed
right touching excluded[[]][[]]Passed
two labels preserve order[['a']][['a', 'b']]Failed
empty annotation set[[]][[]]Passed
empty token set[][]Passed
identical bounds[['q']][['q']]Passed

SHA-256 / 6dc17ded388b589e003c1e6414c897a27c8a2c568c12d0437c4fb31b1738a8e5

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

Case digest / 8c26b4bd5479923b491890bea93af65a33b4fd329c65c530904919fc273e2ab0