FAILURE MAP
← Case archive

FA-8211 / Direct manipulation / Open access

Drag-and-drop list reordering: Dropping against a removed target clears the list · case 01

Dropping against a removed target clears the list.

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

ROOT CAUSE

The unknown operation uses `if source not in items or target not in items: return []` where the contract requires `if source not in items or target not in items: return items`.

VERIFIED REPAIR

Implement the unknown operation as `if source not in items or target not in items: return items`.

Unsuccessful approach: Appending a missing source creates an unowned item.

Case contract

Cancellation, missing endpoints and self drops preserve order; otherwise remove the source and insert it immediately before or after the surviving target.

Why this case matters

A deterministic model of drag-and-drop list reordering; 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, source, target, after, cancelled):
    items = list(items)
    if cancelled: return items
    if source not in items or target not in items: return []
    if source == target: return items
    items.remove(source)
    index = items.index(target) + (1 if after else 0)
    items.insert(index, source)
    return items
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cancel', solve(['a','b','c'], 'a', 'c', True, True), ['a', 'b', 'c'])
check('missing', solve(['a','b'], 'a', 'gone', True, False), ['a', 'b'])
check('self', solve(['a','b'], 'a', 'a', True, False), ['a', 'b'])
check('after', solve(['a','b','c'], 'a', 'c', True, False), ['b', 'c', 'a'])
check('before', solve(['a','b','c'], 'c', 'a', False, False), ['c', 'a', 'b'])
check('parameterized drag length', solve(list(range(N+2)), 0, N+1, True, False), list(range(1,N+2))+[0])
for repetition in range(N):
    check('repeat before', solve(['a','b','c'], 'c', 'a', False, False), ['c', 'a', 'b'])
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
cancel['a', 'b', 'c']['a', 'b', 'c']Passed
missing[]['a', 'b']Failed
self['a', 'b']['a', 'b']Passed
after['b', 'c', 'a']['b', 'c', 'a']Passed
before['c', 'a', 'b']['c', 'a', 'b']Passed
parameterized drag length[1, 2, 0][1, 2, 0]Passed
repeat before['c', 'a', 'b']['c', 'a', 'b']Passed

SHA-256 / c6e0239d87998b762ef375ee39b9ae91301cab50b18d8c14818f701bd758e243

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(items, source, target, after, cancelled):
    items = list(items)
    if cancelled: return items
    if source not in items or target not in items: return items + [source]
    if source == target: return items
    items.remove(source)
    index = items.index(target) + (1 if after else 0)
    items.insert(index, source)
    return items
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cancel', solve(['a','b','c'], 'a', 'c', True, True), ['a', 'b', 'c'])
check('missing', solve(['a','b'], 'a', 'gone', True, False), ['a', 'b'])
check('self', solve(['a','b'], 'a', 'a', True, False), ['a', 'b'])
check('after', solve(['a','b','c'], 'a', 'c', True, False), ['b', 'c', 'a'])
check('before', solve(['a','b','c'], 'c', 'a', False, False), ['c', 'a', 'b'])
check('parameterized drag length', solve(list(range(N+2)), 0, N+1, True, False), list(range(1,N+2))+[0])
for repetition in range(N):
    check('repeat before', solve(['a','b','c'], 'c', 'a', False, False), ['c', 'a', 'b'])
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
cancel['a', 'b', 'c']['a', 'b', 'c']Passed
missing['a', 'b', 'a']['a', 'b']Failed
self['a', 'b']['a', 'b']Passed
after['b', 'c', 'a']['b', 'c', 'a']Passed
before['c', 'a', 'b']['c', 'a', 'b']Passed
parameterized drag length[1, 2, 0][1, 2, 0]Passed
repeat before['c', 'a', 'b']['c', 'a', 'b']Passed

SHA-256 / 319fbb982c1f84a2e816dd1a7d568f3e5907b0ad8eabdd840c6e035fd222232d

3 / The verified repair

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

N = 1
observations = []
def solve(items, source, target, after, cancelled):
    items = list(items)
    if cancelled: return items
    if source not in items or target not in items: return items
    if source == target: return items
    items.remove(source)
    index = items.index(target) + (1 if after else 0)
    items.insert(index, source)
    return items
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cancel', solve(['a','b','c'], 'a', 'c', True, True), ['a', 'b', 'c'])
check('missing', solve(['a','b'], 'a', 'gone', True, False), ['a', 'b'])
check('self', solve(['a','b'], 'a', 'a', True, False), ['a', 'b'])
check('after', solve(['a','b','c'], 'a', 'c', True, False), ['b', 'c', 'a'])
check('before', solve(['a','b','c'], 'c', 'a', False, False), ['c', 'a', 'b'])
check('parameterized drag length', solve(list(range(N+2)), 0, N+1, True, False), list(range(1,N+2))+[0])
for repetition in range(N):
    check('repeat before', solve(['a','b','c'], 'c', 'a', False, False), ['c', 'a', 'b'])
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
cancel['a', 'b', 'c']['a', 'b', 'c']Passed
missing['a', 'b']['a', 'b']Passed
self['a', 'b']['a', 'b']Passed
after['b', 'c', 'a']['b', 'c', 'a']Passed
before['c', 'a', 'b']['c', 'a', 'b']Passed
parameterized drag length[1, 2, 0][1, 2, 0]Passed
repeat before['c', 'a', 'b']['c', 'a', 'b']Passed

SHA-256 / dd447b91b66ff81728f3bffe4798f9817fe7259a02b0987235ab214a33f6dfd8

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

Case digest / 2a98720f10b38d99c8f2ad63b2d578ac58860e7d8b3436e7d010cecb1c7eb709