FA-48396 / Delimited text / Open access
A new column-order announcement composes with stale order · case 01
A structured table violates the declared record or column contract.
ROOT CAUSE
A new column-order announcement composes with stale order.
THE FAILURE
A new column-order announcement composes with stale order.
Unsuccessful approach: The alternate implementation still violates the same declared invariant: a new column-order announcement composes with stale order.
Case contract
Process an initial comma header plus ORDER|comma-indexes and DATA|comma-values records. ORDER is a zero-based permutation describing each incoming position original column index. Each new order replaces the previous order. DATA is rearranged into original header order. Reject invalid permutations and row widths.
Why this case matters
Delimited interchange needs explicit framing, schema and field semantics at ingestion and emission boundaries.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
def _vary(value):
if value == '@END': return 3 + 4*N
if isinstance(value, str): return value.replace('@', 'cell' * N)
if isinstance(value, list): return [_vary(x) for x in value]
if isinstance(value, dict): return {_vary(k): _vary(v) for k,v in value.items()}
return value
N = 1
observations = []
def solve(data):
width=len(data[0].split(',')); order=list(range(width)); rows=[]
for line in data[1:]:
tag,payload=(line.split('|',1)+[''])[:2]
fields=payload.split(',')
if tag=='ORDER':
if any(not x.isascii() or not x.isdecimal() for x in fields): return None
proposal=[int(x) for x in fields]
if sorted(proposal)!=list(range(width)): return None
order=[order[i] for i in proposal]
elif tag=='DATA':
if len(fields)!=width: return None
row=[None]*width
for position,original in enumerate(order): row[original]=fields[position]
rows.append(row)
else: return None
return rows
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cyclic', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'DATA|z,@,y'])), _vary([['@', 'y', 'z']]))
check('replace', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'ORDER|1,2,0', 'DATA|y,z,@'])), _vary([['@', 'y', 'z']]))
check('duplicate order', solve(_vary(['a,b', 'ORDER|0,0'])), _vary(None))
check('out of range', solve(_vary(['a,b', 'ORDER|0,2'])), _vary(None))
check('wrong width', solve(_vary(['a,b', 'DATA|@'])), _vary(None))
check('identity', solve(_vary(['a,b', 'DATA|@,z'])), _vary([['@', 'z']]))
check('reset', solve(_vary(['a,b', 'ORDER|1,0', 'DATA|x,@', 'ORDER|0,1', 'DATA|@,y'])), _vary([['@', 'x'], ['@', 'y']]))
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 |
|---|---|---|---|
| cyclic | [['cell', 'y', 'z']] | [['cell', 'y', 'z']] | Passed |
| replace | [['y', 'z', 'cell']] | [['cell', 'y', 'z']] | Failed |
| duplicate order | None | None | Passed |
| out of range | None | None | Passed |
| wrong width | None | None | Passed |
| identity | [['cell', 'z']] | [['cell', 'z']] | Passed |
| reset | [['cell', 'x'], ['y', 'cell']] | [['cell', 'x'], ['cell', 'y']] | Failed |
SHA-256 / 92a3114f8d1af85addecefe463d3f929ea992066a9eb3da3725abcb960b910a7
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
def _vary(value):
if value == '@END': return 3 + 4*N
if isinstance(value, str): return value.replace('@', 'cell' * N)
if isinstance(value, list): return [_vary(x) for x in value]
if isinstance(value, dict): return {_vary(k): _vary(v) for k,v in value.items()}
return value
N = 1
observations = []
def solve(data):
width=len(data[0].split(',')); order=list(range(width)); rows=[]
for line in data[1:]:
tag,payload=(line.split('|',1)+[''])[:2]
fields=payload.split(',')
if tag=='ORDER':
if any(not x.isascii() or not x.isdecimal() for x in fields): return None
proposal=[int(x) for x in fields]
if sorted(proposal)!=list(range(width)): return None
order=list(reversed(proposal))
elif tag=='DATA':
if len(fields)!=width: return None
row=[None]*width
for position,original in enumerate(order): row[original]=fields[position]
rows.append(row)
else: return None
return rows
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cyclic', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'DATA|z,@,y'])), _vary([['@', 'y', 'z']]))
check('replace', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'ORDER|1,2,0', 'DATA|y,z,@'])), _vary([['@', 'y', 'z']]))
check('duplicate order', solve(_vary(['a,b', 'ORDER|0,0'])), _vary(None))
check('out of range', solve(_vary(['a,b', 'ORDER|0,2'])), _vary(None))
check('wrong width', solve(_vary(['a,b', 'DATA|@'])), _vary(None))
check('identity', solve(_vary(['a,b', 'DATA|@,z'])), _vary([['@', 'z']]))
check('reset', solve(_vary(['a,b', 'ORDER|1,0', 'DATA|x,@', 'ORDER|0,1', 'DATA|@,y'])), _vary([['@', 'x'], ['@', 'y']]))
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 |
|---|---|---|---|
| cyclic | [['cell', 'z', 'y']] | [['cell', 'y', 'z']] | Failed |
| replace | [['y', 'cell', 'z']] | [['cell', 'y', 'z']] | Failed |
| duplicate order | None | None | Passed |
| out of range | None | None | Passed |
| wrong width | None | None | Passed |
| identity | [['cell', 'z']] | [['cell', 'z']] | Passed |
| reset | [['x', 'cell'], ['y', 'cell']] | [['cell', 'x'], ['cell', 'y']] | Failed |
SHA-256 / e1005cb62df82f1f72ef24a71f5b080c6c44bb2eb8bd1d4ffc56f0395ad16e74
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 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
Deterministic bounded in-memory model. No claim of complete CSV or external format conformance. 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:44:50.539296+00:00.
Case digest / 98f6ec1ceed714d833ff8f15b10dac12ad4ce74ee58c26878392b08d0d99ae8b