FAILURE MAP
← Case archive

FA-8941 / Table interactions / Open access

Multi-column sort interaction: Nonremovable sort columns can be cleared · case 01

Nonremovable sort columns can be cleared.

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

ROOT CAUSE

The removable operation uses `entry = None` where the contract requires `entry = None if removable else (column, 'asc')`.

VERIFIED REPAIR

Implement the removable operation as `entry = None if removable else (column, 'asc')`.

Unsuccessful approach: Always cycling back to ascending ignores removable mode.

Case contract

New sort is ascending; activation cycles ascending to descending to removed when allowed; single mode replaces all sorts; multi mode preserves priorities when changing direction.

Why this case matters

A deterministic model of multi-column sort interaction; 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(sorting, column, multi, removable):
    sorting = list(sorting)
    index = next((i for i, (c, d) in enumerate(sorting) if c == column), None)
    if index is None: entry = (column, 'asc')
    elif sorting[index][1] == 'asc': entry = (column, 'desc')
    else: entry = None
    if not multi: return [entry] if entry else []
    if index is None: return sorting + [entry]
    if entry is None: return sorting[:index] + sorting[index+1:]
    sorting[index] = entry
    return sorting
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new', solve([], 'a', False, True), [('a', 'asc')])
check('reverse', solve([('a','asc')], 'a', False, True), [('a', 'desc')])
check('locked', solve([('a','desc')], 'a', False, False), [('a', 'asc')])
check('remove', solve([('a','desc')], 'a', False, True), [])
check('single', solve([('a','asc')], 'b', False, True), [('b', 'asc')])
check('priority', solve([('a','asc'),('b','asc')], 'a', True, True), [('a', 'desc'), ('b', 'asc')])
check('append', solve([('a','asc')], 'b', True, True), [('a', 'asc'), ('b', 'asc')])
check('parameterized sort identity', solve([],str(N),False,True), [(str(N),'asc')])
for repetition in range(N):
    check('repeat append', solve([('a','asc')], 'b', True, True), [('a', 'asc'), ('b', 'asc')])
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
new[['a', 'asc']][['a', 'asc']]Passed
reverse[['a', 'desc']][['a', 'desc']]Passed
locked[][['a', 'asc']]Failed
remove[][]Passed
single[['b', 'asc']][['b', 'asc']]Passed
priority[['a', 'desc'], ['b', 'asc']][['a', 'desc'], ['b', 'asc']]Passed
append[['a', 'asc'], ['b', 'asc']][['a', 'asc'], ['b', 'asc']]Passed
parameterized sort identity[['1', 'asc']][['1', 'asc']]Passed
repeat append[['a', 'asc'], ['b', 'asc']][['a', 'asc'], ['b', 'asc']]Passed

SHA-256 / cbb1ab7a8e0b97a2ae6ef736c3cd78068bf88b5d5bdf544fb46d170f4a079528

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(sorting, column, multi, removable):
    sorting = list(sorting)
    index = next((i for i, (c, d) in enumerate(sorting) if c == column), None)
    if index is None: entry = (column, 'asc')
    elif sorting[index][1] == 'asc': entry = (column, 'desc')
    else: entry = (column, 'asc')
    if not multi: return [entry] if entry else []
    if index is None: return sorting + [entry]
    if entry is None: return sorting[:index] + sorting[index+1:]
    sorting[index] = entry
    return sorting
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new', solve([], 'a', False, True), [('a', 'asc')])
check('reverse', solve([('a','asc')], 'a', False, True), [('a', 'desc')])
check('locked', solve([('a','desc')], 'a', False, False), [('a', 'asc')])
check('remove', solve([('a','desc')], 'a', False, True), [])
check('single', solve([('a','asc')], 'b', False, True), [('b', 'asc')])
check('priority', solve([('a','asc'),('b','asc')], 'a', True, True), [('a', 'desc'), ('b', 'asc')])
check('append', solve([('a','asc')], 'b', True, True), [('a', 'asc'), ('b', 'asc')])
check('parameterized sort identity', solve([],str(N),False,True), [(str(N),'asc')])
for repetition in range(N):
    check('repeat append', solve([('a','asc')], 'b', True, True), [('a', 'asc'), ('b', 'asc')])
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
new[['a', 'asc']][['a', 'asc']]Passed
reverse[['a', 'desc']][['a', 'desc']]Passed
locked[['a', 'asc']][['a', 'asc']]Passed
remove[['a', 'asc']][]Failed
single[['b', 'asc']][['b', 'asc']]Passed
priority[['a', 'desc'], ['b', 'asc']][['a', 'desc'], ['b', 'asc']]Passed
append[['a', 'asc'], ['b', 'asc']][['a', 'asc'], ['b', 'asc']]Passed
parameterized sort identity[['1', 'asc']][['1', 'asc']]Passed
repeat append[['a', 'asc'], ['b', 'asc']][['a', 'asc'], ['b', 'asc']]Passed

SHA-256 / f56c4936aad414229dc423b61104a1bb46235d6158b8331cf61521e7ce95b6f9

3 / The verified repair

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

N = 1
observations = []
def solve(sorting, column, multi, removable):
    sorting = list(sorting)
    index = next((i for i, (c, d) in enumerate(sorting) if c == column), None)
    if index is None: entry = (column, 'asc')
    elif sorting[index][1] == 'asc': entry = (column, 'desc')
    else: entry = None if removable else (column, 'asc')
    if not multi: return [entry] if entry else []
    if index is None: return sorting + [entry]
    if entry is None: return sorting[:index] + sorting[index+1:]
    sorting[index] = entry
    return sorting
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new', solve([], 'a', False, True), [('a', 'asc')])
check('reverse', solve([('a','asc')], 'a', False, True), [('a', 'desc')])
check('locked', solve([('a','desc')], 'a', False, False), [('a', 'asc')])
check('remove', solve([('a','desc')], 'a', False, True), [])
check('single', solve([('a','asc')], 'b', False, True), [('b', 'asc')])
check('priority', solve([('a','asc'),('b','asc')], 'a', True, True), [('a', 'desc'), ('b', 'asc')])
check('append', solve([('a','asc')], 'b', True, True), [('a', 'asc'), ('b', 'asc')])
check('parameterized sort identity', solve([],str(N),False,True), [(str(N),'asc')])
for repetition in range(N):
    check('repeat append', solve([('a','asc')], 'b', True, True), [('a', 'asc'), ('b', 'asc')])
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
new[['a', 'asc']][['a', 'asc']]Passed
reverse[['a', 'desc']][['a', 'desc']]Passed
locked[['a', 'asc']][['a', 'asc']]Passed
remove[][]Passed
single[['b', 'asc']][['b', 'asc']]Passed
priority[['a', 'desc'], ['b', 'asc']][['a', 'desc'], ['b', 'asc']]Passed
append[['a', 'asc'], ['b', 'asc']][['a', 'asc'], ['b', 'asc']]Passed
parameterized sort identity[['1', 'asc']][['1', 'asc']]Passed
repeat append[['a', 'asc'], ['b', 'asc']][['a', 'asc'], ['b', 'asc']]Passed

SHA-256 / a08be1d7850601d077383173dfb4eb1fa4f9128cc14b5bd4a88ee340523c72f7

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

Case digest / 8400a074af9e19adb2eb4c57cfab833d71c47b7ef7f8ce0e951f413e895484c9