FAILURE MAP
← Case archive

FA-7971 / Selection controls / Open access

Anchored range selection: The clicked endpoint is excluded from range selection · case 01

The clicked endpoint is excluded from range selection.

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

ROOT CAUSE

The endpoint operation uses `items[a:b]` where the contract requires `items[a:b+1]`.

VERIFIED REPAIR

Implement the endpoint operation as `items[a:b+1]`.

Unsuccessful approach: Excluding the anchor still leaves an incomplete range.

Case contract

Ranges include both endpoints in document order; plain clicks replace; additive selection unions; missing targets preserve selection.

Why this case matters

A deterministic model of anchored range selection; this isolates one interface invariant without requiring a browser.

1 / The failure

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

N = 1
observations = []
def solve(items, selected, anchor, target, extend, additive):
    if target not in items: return sorted(selected)
    if not extend or anchor not in items: span = {target}
    else:
        a, b = sorted((items.index(anchor), items.index(target)))
        span = set(items[a:b])
    return sorted(set(selected) | span if additive else span)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('removed', solve(['a','b'], ['a'], 'a', 'x', False, False), ['a'])
check('plain', solve(['a','b','c'], ['a'], 'a', 'c', False, False), ['c'])
check('forward', solve(['a','b','c'], [], 'a', 'c', True, False), ['a', 'b', 'c'])
check('backward', solve(['a','b','c'], [], 'c', 'a', True, False), ['a', 'b', 'c'])
check('union', solve(['a','b','c'], ['a'], 'b', 'c', True, True), ['a', 'b', 'c'])
check('replace', solve(['a','b','c'], ['a'], 'b', 'c', True, False), ['b', 'c'])
check('parameterized inclusive range', solve(list(range(N+2)), [], 0, N, True, False), list(range(N+1)))
for repetition in range(N):
    check('repeat replace', solve(['a','b','c'], ['a'], 'b', 'c', True, False), ['b', 'c'])
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
removed['a']['a']Passed
plain['c']['c']Passed
forward['a', 'b']['a', 'b', 'c']Failed
backward['a', 'b']['a', 'b', 'c']Failed
union['a', 'b']['a', 'b', 'c']Failed
replace['b']['b', 'c']Failed
parameterized inclusive range[0][0, 1]Failed
repeat replace['b']['b', 'c']Failed

SHA-256 / 2f66061add8b24790df182b195bec735ec334895da8d2b7b7945df778ade5ee1

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(items, selected, anchor, target, extend, additive):
    if target not in items: return sorted(selected)
    if not extend or anchor not in items: span = {target}
    else:
        a, b = sorted((items.index(anchor), items.index(target)))
        span = set(items[a+1:b+1])
    return sorted(set(selected) | span if additive else span)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('removed', solve(['a','b'], ['a'], 'a', 'x', False, False), ['a'])
check('plain', solve(['a','b','c'], ['a'], 'a', 'c', False, False), ['c'])
check('forward', solve(['a','b','c'], [], 'a', 'c', True, False), ['a', 'b', 'c'])
check('backward', solve(['a','b','c'], [], 'c', 'a', True, False), ['a', 'b', 'c'])
check('union', solve(['a','b','c'], ['a'], 'b', 'c', True, True), ['a', 'b', 'c'])
check('replace', solve(['a','b','c'], ['a'], 'b', 'c', True, False), ['b', 'c'])
check('parameterized inclusive range', solve(list(range(N+2)), [], 0, N, True, False), list(range(N+1)))
for repetition in range(N):
    check('repeat replace', solve(['a','b','c'], ['a'], 'b', 'c', True, False), ['b', 'c'])
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
removed['a']['a']Passed
plain['c']['c']Passed
forward['b', 'c']['a', 'b', 'c']Failed
backward['b', 'c']['a', 'b', 'c']Failed
union['a', 'c']['a', 'b', 'c']Failed
replace['c']['b', 'c']Failed
parameterized inclusive range[1][0, 1]Failed
repeat replace['c']['b', 'c']Failed

SHA-256 / 43d1169a8cc862be7e412b970ee2db5489f959d4dfafb3c8c555efebeb3944a2

3 / The verified repair

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

N = 1
observations = []
def solve(items, selected, anchor, target, extend, additive):
    if target not in items: return sorted(selected)
    if not extend or anchor not in items: span = {target}
    else:
        a, b = sorted((items.index(anchor), items.index(target)))
        span = set(items[a:b+1])
    return sorted(set(selected) | span if additive else span)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('removed', solve(['a','b'], ['a'], 'a', 'x', False, False), ['a'])
check('plain', solve(['a','b','c'], ['a'], 'a', 'c', False, False), ['c'])
check('forward', solve(['a','b','c'], [], 'a', 'c', True, False), ['a', 'b', 'c'])
check('backward', solve(['a','b','c'], [], 'c', 'a', True, False), ['a', 'b', 'c'])
check('union', solve(['a','b','c'], ['a'], 'b', 'c', True, True), ['a', 'b', 'c'])
check('replace', solve(['a','b','c'], ['a'], 'b', 'c', True, False), ['b', 'c'])
check('parameterized inclusive range', solve(list(range(N+2)), [], 0, N, True, False), list(range(N+1)))
for repetition in range(N):
    check('repeat replace', solve(['a','b','c'], ['a'], 'b', 'c', True, False), ['b', 'c'])
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
removed['a']['a']Passed
plain['c']['c']Passed
forward['a', 'b', 'c']['a', 'b', 'c']Passed
backward['a', 'b', 'c']['a', 'b', 'c']Passed
union['a', 'b', 'c']['a', 'b', 'c']Passed
replace['b', 'c']['b', 'c']Passed
parameterized inclusive range[0, 1][0, 1]Passed
repeat replace['b', 'c']['b', 'c']Passed

SHA-256 / caeebbec1387af3a4eff6775092231c4860974fc3c1fee025be129f473c5877c

Verification & scope

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

Case digest / 2d0a76c683c47a8af9c921b9dbc656d8ef684e17e2f537e67b97610313162cd5