FAILURE MAP
← Case archive

FA-100226 / Annotation span alignment / Open access

Discontinuous annotation fragments merge across a gap · case 01

Discontinuous annotation fragments merge across a gap.

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

ROOT CAUSE

A fragment reducer spans the minimum and maximum offsets without checking adjacency.

THE FAILURE

A fragment reducer spans the minimum and maximum offsets without checking adjacency.

Unsuccessful approach: Sorting fragments leaves overlapping and touching intervals unmerged.

Case contract

Given possibly disjoint intervals, sort and merge overlapping or touching intervals; preserve genuine gaps.

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(pieces):
    return [[min(s for s,e in pieces),max(e for s,e in pieces)]] if pieces else []
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disjoint retained', solve([[0,2],[5,7]]), [[0,2],[5,7]])
check('overlap merged', solve([[0,4],[2,6]]), [[0,6]])
check('touch merged', solve([[0,2],[2,4]]), [[0,4]])
check('unsorted input', solve([[5,7],[0,2]]), [[0,2],[5,7]])
check('empty input', solve([]), [])
check('singleton', solve([[N,N+1]]), [[N,N+1]])
check('nested interval', solve([[0,8],[2,3]]), [[0,8]])
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
disjoint retained[[0, 7]][[0, 2], [5, 7]]Failed
overlap merged[[0, 6]][[0, 6]]Passed
touch merged[[0, 4]][[0, 4]]Passed
unsorted input[[0, 7]][[0, 2], [5, 7]]Failed
empty input[][]Passed
singleton[[1, 2]][[1, 2]]Passed
nested interval[[0, 8]][[0, 8]]Passed

SHA-256 / 07e570ba95e9733e7207095366e825ad6e5394fb8cd93b8670705c00a788883d

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(pieces):
    return sorted(pieces)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disjoint retained', solve([[0,2],[5,7]]), [[0,2],[5,7]])
check('overlap merged', solve([[0,4],[2,6]]), [[0,6]])
check('touch merged', solve([[0,2],[2,4]]), [[0,4]])
check('unsorted input', solve([[5,7],[0,2]]), [[0,2],[5,7]])
check('empty input', solve([]), [])
check('singleton', solve([[N,N+1]]), [[N,N+1]])
check('nested interval', solve([[0,8],[2,3]]), [[0,8]])
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
disjoint retained[[0, 2], [5, 7]][[0, 2], [5, 7]]Passed
overlap merged[[0, 4], [2, 6]][[0, 6]]Failed
touch merged[[0, 2], [2, 4]][[0, 4]]Failed
unsorted input[[0, 2], [5, 7]][[0, 2], [5, 7]]Passed
empty input[][]Passed
singleton[[1, 2]][[1, 2]]Passed
nested interval[[0, 8], [2, 3]][[0, 8]]Failed

SHA-256 / 7fc00c1a490d5792b550282201598eaa9a88fb46d26a17a6b4becc38078f7938

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

Case digest / bcd98e2088b34c39753fc5d9ae65de0a0a13e80dd12a07d479fc0f866d568252