FAILURE MAP
← Case archive

FA-99726 / Chunk citation alignment / Open access

Citations after an insertion retain stale offsets · case 01

Citations after an insertion retain stale offsets.

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

ROOT CAUSE

A source edit shifts later positions but citation offsets are copied unchanged.

THE FAILURE

A source edit shifts later positions but citation offsets are copied unchanged.

Unsuccessful approach: Shifting only spans fully after the insertion misses spans that cross the insertion.

Case contract

Given span [s,e), insertion at p of length d shifts both endpoints when p <= s; shifts only end when s < p < e; otherwise unchanged.

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(span, position, length):
    s,e=span
    return [s,e]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('after insertion',solve([N+2,N+5],N,3),[N+5,N+8])
check('crosses insertion',solve([N-2,N+2],N,3),[N-2,N+5])
check('before insertion',solve([0,2],N+2,4),[0,2])
check('at start',solve([N,N+2],N,1),[N+1,N+3])
check('at end',solve([N-2,N],N,2),[N-2,N])
check('zero insertion',solve([1,4],2,0),[1,4])
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
after insertion[3, 6][6, 9]Failed
crosses insertion[-1, 3][-1, 6]Failed
before insertion[0, 2][0, 2]Passed
at start[1, 3][2, 4]Failed
at end[-1, 1][-1, 1]Passed
zero insertion[1, 4][1, 4]Passed

SHA-256 / 5d6d5eb188c11fd2f29e7c4bb64b0d48f33f9fdc2037e39b0b92d8536b96291e

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(span, position, length):
    s,e=span
    return [s+length,e+length] if s>=position else [s,e]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('after insertion',solve([N+2,N+5],N,3),[N+5,N+8])
check('crosses insertion',solve([N-2,N+2],N,3),[N-2,N+5])
check('before insertion',solve([0,2],N+2,4),[0,2])
check('at start',solve([N,N+2],N,1),[N+1,N+3])
check('at end',solve([N-2,N],N,2),[N-2,N])
check('zero insertion',solve([1,4],2,0),[1,4])
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
after insertion[6, 9][6, 9]Passed
crosses insertion[-1, 3][-1, 6]Failed
before insertion[0, 2][0, 2]Passed
at start[2, 4][2, 4]Passed
at end[-1, 1][-1, 1]Passed
zero insertion[1, 4][1, 4]Passed

SHA-256 / 6ec1e5b55d063c7ddf1d1f9b4b172e87d228b2cf2bf587d44a9063aa6d1bc1b6

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

Case digest / 1f9ebc222c9266e04529ed31d126afa6fd29ee5468cd165abb242800e5a75d32