FA-7961 / Selection controls / Open access
Anchored range selection: An ordinary click unexpectedly extends from the old anchor · case 01
An ordinary click unexpectedly extends from the old anchor.
ROOT CAUSE
The plain click operation uses `anchor not in items` where the contract requires `not extend or anchor not in items`.
THE FAILURE
The plain click operation uses `anchor not in items` where the contract requires `not extend or anchor not in items`.
Unsuccessful approach: Always treating clicks as plain prevents shift ranges.
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 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| removed | ['a'] | ['a'] | Passed |
| plain | ['a', 'b', '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 | ['b', 'c'] | ['b', 'c'] | Passed |
| parameterized inclusive range | [0, 1] | [0, 1] | Passed |
| repeat replace | ['b', 'c'] | ['b', 'c'] | Passed |
SHA-256 / 3ce64b7e9c92c8a8aed6c50dfe2b5336f7f33b7fe7c4dd966b142af526eb184b
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 True: 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| removed | ['a'] | ['a'] | Passed |
| plain | ['c'] | ['c'] | Passed |
| forward | ['c'] | ['a', 'b', 'c'] | Failed |
| backward | ['a'] | ['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 / f9850a90020e1cd73e37ff89298224a2d5087b07eca8a0f04d367cdbaff58987
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 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
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 / ed20c8f7602f9a861250a4755ecee6a3f9a30412611976fb20d809468327a92c