FAILURE MAP
← Case archive

FA-99666 / Chunk citation alignment / Open access

Equal offsets from distinct sources are merged · case 01

Equal offsets from distinct sources are merged.

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

ROOT CAUSE

The merge key omits the source identifier.

THE FAILURE

The merge key omits the source identifier.

Unsuccessful approach: Merging strict overlaps leaves adjacent source intervals fragmented.

Case contract

Rows are [source,start,end]; merge overlapping or touching spans only for same source and sort by source then offsets.

Why this case matters

A deterministic citation bookkeeping model isolates source attribution from rendering and retrieval.

1 / The failure

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

N = 1
observations = []
def solve(rows):
    spans=sorted((s,e) for src,s,e in rows)
    out=[]
    for s,e in spans:
     if out and s<=out[-1][1]: out[-1][1]=max(out[-1][1],e)
     else: out.append([s,e])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('same interval sources',solve([['b',N,N+3],['a',N,N+2]]),[['a',N,N+2],['b',N,N+3]])
check('same source overlap',solve([['a',0,3],['a',2,5]]),[['a',0,5]])
check('touch same source',solve([['a',0,2],['a',2,4]]),[['a',0,4]])
check('gap',solve([['a',0,1],['a',3,4]]),[['a',0,1],['a',3,4]])
check('empty',solve([]),[])
check('single',solve([['z',N,N+1]]),[['z',N,N+1]])
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
same interval sources[[1, 4]][['a', 1, 3], ['b', 1, 4]]Failed
same source overlap[[0, 5]][['a', 0, 5]]Failed
touch same source[[0, 4]][['a', 0, 4]]Failed
gap[[0, 1], [3, 4]][['a', 0, 1], ['a', 3, 4]]Failed
empty[][]Passed
single[[1, 2]][['z', 1, 2]]Failed

SHA-256 / bb37cfed34c1b19d934978a4cb7bbd1f80b3cd31c0eb0d0cb488737f24ae60d0

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(rows):
    out=[]
    for src,s,e in sorted(rows):
     if out and src==out[-1][0] and s<out[-1][2]: out[-1][2]=max(out[-1][2],e)
     else: out.append([src,s,e])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('same interval sources',solve([['b',N,N+3],['a',N,N+2]]),[['a',N,N+2],['b',N,N+3]])
check('same source overlap',solve([['a',0,3],['a',2,5]]),[['a',0,5]])
check('touch same source',solve([['a',0,2],['a',2,4]]),[['a',0,4]])
check('gap',solve([['a',0,1],['a',3,4]]),[['a',0,1],['a',3,4]])
check('empty',solve([]),[])
check('single',solve([['z',N,N+1]]),[['z',N,N+1]])
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
same interval sources[['a', 1, 3], ['b', 1, 4]][['a', 1, 3], ['b', 1, 4]]Passed
same source overlap[['a', 0, 5]][['a', 0, 5]]Passed
touch same source[['a', 0, 2], ['a', 2, 4]][['a', 0, 4]]Failed
gap[['a', 0, 1], ['a', 3, 4]][['a', 0, 1], ['a', 3, 4]]Passed
empty[][]Passed
single[['z', 1, 2]][['z', 1, 2]]Passed

SHA-256 / aad37bf9e3c7e13d0dfbc3143d17acc4951a817bdce1cf93883f0c037b2aa8ed

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 6 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

Inputs are small integer offsets and identifiers under the stated toy contract; this does not define a document format or production citation API. 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:26.712695+00:00.

Case digest / af14fac272217fa2afc35222411bb9e21b3f4aa8e35b580ecf0411eff4d74d0a