FAILURE MAP
← Case archive

FA-7976 / Selection controls / Open access

Anchored range selection: Modifier range selection erases prior independent selections · case 01

Modifier range selection erases prior independent selections.

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

ROOT CAUSE

The additive operation uses `span` where the contract requires `set(selected) | span if additive else span`.

VERIFIED REPAIR

Implement the additive operation as `set(selected) | span if additive else span`.

Unsuccessful approach: Always unioning prevents plain range replacement.

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+1])
    return sorted(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['b', 'c']['a', 'b', 'c']Failed
replace['b', 'c']['b', 'c']Passed
parameterized inclusive range[0, 1][0, 1]Passed
repeat replace['b', 'c']['b', 'c']Passed

SHA-256 / 088afb54222ee8b29bbe3904201c3514f1d7f445a5c307841d0520a24640a88d

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:b+1])
    return sorted(set(selected) | 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['a', 'c']['c']Failed
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['a', 'b', 'c']['b', 'c']Failed
parameterized inclusive range[0, 1][0, 1]Passed
repeat replace['a', 'b', 'c']['b', 'c']Failed

SHA-256 / 73e959c64911d6c41dd258dfdc97cf93fac062daf60ba643202fbace5f17eda6

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

Case digest / 8b3d1702d1106f3399d3ace8d81e8fd230ab077ffadaee605c03eee56f87fa05