FA-48391 / Delimited text / Open access
Incoming column indexes are used in the inverse direction · case 01
A structured table violates the declared record or column contract.
ROOT CAUSE
Incoming column indexes are used in the inverse direction.
THE FAILURE
Incoming column indexes are used in the inverse direction.
Unsuccessful approach: The alternate implementation still violates the same declared invariant: incoming column indexes are used in the inverse direction.
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=proposal
elif tag=='DATA':
if len(fields)!=width: return None
row=[None]*width
for position,original in enumerate(order): row[position]=fields[original]
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 | [['y', 'z', 'cell']] | [['cell', 'y', 'z']] | Failed |
| replace | [['z', 'cell', 'y']] | [['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'], ['cell', 'y']] | [['cell', 'x'], ['cell', 'y']] | Passed |
SHA-256 / e126168aff5f7abccd6eaa2ca430b9071d9cb3722a0a5c2361d215f141ad674e
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=proposal
elif tag=='DATA':
if len(fields)!=width: return None
row=[None]*width
for position,original in enumerate(order): row[position]=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 | [['z', 'cell', 'y']] | [['cell', 'y', 'z']] | Failed |
| 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 | [['x', 'cell'], ['cell', 'y']] | [['cell', 'x'], ['cell', 'y']] | Failed |
SHA-256 / ef16b198ee4329f4ff1ec5b8cb18038b33c2882431282efe8b5336dd9aa7422b
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 / c82ac89f81eca3a92b78f94d3b59fe190c5080b66d975956fa6a9720fa42e06d