FAILURE MAP
← Case archive

FA-11826 / Document structure integrity / Open access

Deleting text leaves a bookmark endpoint inside removed content · case 01

Deleting text leaves a bookmark endpoint inside removed content in the controlled document model.

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

ROOT CAUSE

Bookmark coordinates remain in the pre-edit coordinate system.

VERIFIED REPAIR

Map both endpoints through the deletion coordinate transform, retaining collapsed bookmarks.

Unsuccessful approach: Shifting endpoints after deletion fails to clamp endpoints lying inside the removed interval.

Case contract

Given a valid bookmark [start,end] and deleted half-open text range [a,b], transform both endpoints: before stays, inside clamps to a, after shifts by b-a.

Why this case matters

Structured editing must preserve document semantics independently of visual rendering.

1 / The failure

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

N = 1
observations = []
def solve(start, end, a, b):
    return [start,end]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [((N,N+4,N+1,N+3),[N,N+2]), ((N+1,N+2,N,N+3),[N,N]), ((0,1,3,5),[0,1]), ((5,7,1,3),[3,5]), ((1,3,1,3),[1,1]), ((2,4,3,3),[2,4])]
for i, (args, expected) in enumerate(fixtures):
    check("document fixture " + str(i), solve(*args), expected)
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
document fixture 0[1, 5][1, 3]Failed
document fixture 1[2, 3][1, 1]Failed
document fixture 2[0, 1][0, 1]Passed
document fixture 3[5, 7][3, 5]Failed
document fixture 4[1, 3][1, 1]Failed
document fixture 5[2, 4][2, 4]Passed

SHA-256 / 6c5fb9106731d716523959c87f60137ba45a972847b206e0f41dcfdb65e24c78

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(start, end, a, b):
    return [p-(b-a) if p>=b else p for p in (start,end)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [((N,N+4,N+1,N+3),[N,N+2]), ((N+1,N+2,N,N+3),[N,N]), ((0,1,3,5),[0,1]), ((5,7,1,3),[3,5]), ((1,3,1,3),[1,1]), ((2,4,3,3),[2,4])]
for i, (args, expected) in enumerate(fixtures):
    check("document fixture " + str(i), solve(*args), expected)
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
document fixture 0[1, 3][1, 3]Passed
document fixture 1[2, 3][1, 1]Failed
document fixture 2[0, 1][0, 1]Passed
document fixture 3[3, 5][3, 5]Passed
document fixture 4[1, 1][1, 1]Passed
document fixture 5[2, 4][2, 4]Passed

SHA-256 / 9dccac182cb24d3f6b47ab213eb8ba648cf8dc8a19e70f10989942c28f26a1d3

3 / The verified repair

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

N = 1
observations = []
def solve(start, end, a, b):
    return [p if p<=a else a if p<b else p-(b-a) for p in (start,end)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [((N,N+4,N+1,N+3),[N,N+2]), ((N+1,N+2,N,N+3),[N,N]), ((0,1,3,5),[0,1]), ((5,7,1,3),[3,5]), ((1,3,1,3),[1,1]), ((2,4,3,3),[2,4])]
for i, (args, expected) in enumerate(fixtures):
    check("document fixture " + str(i), solve(*args), expected)
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
document fixture 0[1, 3][1, 3]Passed
document fixture 1[1, 1][1, 1]Passed
document fixture 2[0, 1][0, 1]Passed
document fixture 3[3, 5][3, 5]Passed
document fixture 4[1, 1][1, 1]Passed
document fixture 5[2, 4][2, 4]Passed

SHA-256 / a3e8d4992772b39ffac224b0b6b0e9267d7eacf03e4339d0f60f67e5b04e6f36

Verification & scope

An offline simplified document model, not a claim of conformance to any office file 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-29T14:38:51.330529+00:00.

Case digest / 4ef961b0ccb55eefa8d1ae78caf65cb7746b77c9a6f3a06add5f8e8d77400eb5