FA-8931 / Table interactions / Open access
Multi-column sort interaction: New sort columns start descending despite ascending contract · case 01
New sort columns start descending despite ascending contract.
ROOT CAUSE
The new column operation uses `if index is None: entry = (column, 'desc')` where the contract requires `if index is None: entry = (column, 'asc')`.
THE FAILURE
The new column operation uses `if index is None: entry = (column, 'desc')` where the contract requires `if index is None: entry = (column, 'asc')`.
Unsuccessful approach: Skipping the entry prevents starting sorting.
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, 'desc')
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| new | [['a', 'desc']] | [['a', 'asc']] | Failed |
| reverse | [['a', 'desc']] | [['a', 'desc']] | Passed |
| locked | [['a', 'asc']] | [['a', 'asc']] | Passed |
| remove | [] | [] | Passed |
| single | [['b', 'desc']] | [['b', 'asc']] | Failed |
| priority | [['a', 'desc'], ['b', 'asc']] | [['a', 'desc'], ['b', 'asc']] | Passed |
| append | [['a', 'asc'], ['b', 'desc']] | [['a', 'asc'], ['b', 'asc']] | Failed |
| parameterized sort identity | [['1', 'desc']] | [['1', 'asc']] | Failed |
| repeat append | [['a', 'asc'], ['b', 'desc']] | [['a', 'asc'], ['b', 'asc']] | Failed |
SHA-256 / 490b0f846b4e2fb656b5d1b7d407ab4340b128d6e455e73a3c23538a5b9d0a87
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 = None
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| new | [] | [['a', 'asc']] | Failed |
| reverse | [['a', 'desc']] | [['a', 'desc']] | Passed |
| locked | [['a', 'asc']] | [['a', 'asc']] | Passed |
| remove | [] | [] | Passed |
| single | [] | [['b', 'asc']] | Failed |
| priority | [['a', 'desc'], ['b', 'asc']] | [['a', 'desc'], ['b', 'asc']] | Passed |
| append | [['a', 'asc'], None] | [['a', 'asc'], ['b', 'asc']] | Failed |
| parameterized sort identity | [] | [['1', 'asc']] | Failed |
| repeat append | [['a', 'asc'], None] | [['a', 'asc'], ['b', 'asc']] | Failed |
SHA-256 / 295c0140a2b135fe6eecc104b056e537ad69c8e029c8ba72bd989d0dd8fe2968
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 9 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:25.741482+00:00.
Case digest / 064b50730288a724f67533d53bd915d2b2d3c7b6e01574535874167a60fdcd1d