FAILURE MAP
← Case archive

FA-99706 / Chunk citation alignment / Open access

A citation in joined text is attributed to the wrong chunk · case 01

A citation in joined text is attributed to the wrong chunk.

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

ROOT CAUSE

The global position is interpreted as an index into the chunk list.

THE FAILURE

The global position is interpreted as an index into the chunk list.

Unsuccessful approach: Choosing the first chunk whose end exceeds the point ignores that the point may precede the chunk start.

Case contract

Given chunk starts and lengths, map point p to its containing chunk index using half-open intervals; return None for gaps or out of range.

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(starts, lengths, point):
    return next((i for i,(s,n) in enumerate(zip(starts,lengths)) if i==point),None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('later chunk',solve([0,N+3],[N,2],N+3),1)
check('first start',solve([0,5],[3,2],0),0)
check('end excluded',solve([0],[3],3),None)
check('gap',solve([0,5],[3,2],4),None)
check('empty',solve([],[],1),None)
check('second interior',solve([0,5],[3,2],6),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
later chunkNone1Failed
first start00Passed
end excludedNoneNonePassed
gapNoneNonePassed
emptyNoneNonePassed
second interiorNone1Failed

SHA-256 / c25ce441de28f71e9c4e34787b964425dbbcd470374dadd624164a50f84d9fc7

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(starts, lengths, point):
    return next((i for i,(s,n) in enumerate(zip(starts,lengths)) if point<s+n),None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('later chunk',solve([0,N+3],[N,2],N+3),1)
check('first start',solve([0,5],[3,2],0),0)
check('end excluded',solve([0],[3],3),None)
check('gap',solve([0,5],[3,2],4),None)
check('empty',solve([],[],1),None)
check('second interior',solve([0,5],[3,2],6),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
later chunk11Passed
first start00Passed
end excludedNoneNonePassed
gap1NoneFailed
emptyNoneNonePassed
second interior11Passed

SHA-256 / 0610990f5d8dbf25b6b2abd7737f6d16f5ffabff190f39141fcc1cbde4f7a75d

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

Case digest / 55bf285e60641a68366ea584288c9080b1e94d2d5d27a62a0a8e5d053ce00490