FA-47606 / Delimited text / Open access
Unspecified sparse cells become empty strings · case 01
A structured table violates the declared record or column contract.
ROOT CAUSE
The fill value conflates an omitted column with an explicit empty string.
VERIFIED REPAIR
Preserve the named invariant at the faulty decision: out = [None] * data['width']
Unsuccessful approach: A numeric sentinel also invents a supplied value.
Case contract
Parse comma fields index=value into a fixed-width dense row. Indexes are unsigned decimal integers, zero based, strictly increasing and less than width; equal indexes reject. Missing positions remain null. Values may contain equals; empty values are retained.
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):
out = [''] * data['width']
last = -1
for cell in data['row'].split(',') if data['row'] else []:
parts = cell.split('=', 1)
if len(parts) != 2: return None
index, value = parts
if not index.isascii() or not index.isdecimal(): return None
index = int(index)
if index <= last or index >= data['width']: return None
out[index] = value
last = index
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('gaps', solve(_vary({'width': 4, 'row': '0=@,2=z'})), _vary(['@', None, 'z', None]))
check('equals value', solve(_vary({'width': 2, 'row': '1=a=b'})), _vary([None, 'a=b']))
check('empty value', solve(_vary({'width': 2, 'row': '0='})), _vary(['', None]))
check('duplicate', solve(_vary({'width': 2, 'row': '0=x,0=y'})), _vary(None))
check('decreasing', solve(_vary({'width': 3, 'row': '2=x,1=y'})), _vary(None))
check('out of bounds', solve(_vary({'width': 2, 'row': '2=x'})), _vary(None))
check('negative', solve(_vary({'width': 2, 'row': '-1=x'})), _vary(None))
check('Unicode digit', solve(_vary({'width': 2, 'row': '١=x'})), _vary(None))
check('empty row', solve(_vary({'width': 3, 'row': ''})), _vary([None, None, None]))
check('last slot', solve(_vary({'width': 2, 'row': '1=@'})), _vary([None, '@']))
check('malformed', solve(_vary({'width': 2, 'row': '0'})), _vary(None))
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 |
|---|---|---|---|
| gaps | ['cell', '', 'z', ''] | ['cell', None, 'z', None] | Failed |
| equals value | ['', 'a=b'] | [None, 'a=b'] | Failed |
| empty value | ['', ''] | ['', None] | Failed |
| duplicate | None | None | Passed |
| decreasing | None | None | Passed |
| out of bounds | None | None | Passed |
| negative | None | None | Passed |
| Unicode digit | None | None | Passed |
| empty row | ['', '', ''] | [None, None, None] | Failed |
| last slot | ['', 'cell'] | [None, 'cell'] | Failed |
| malformed | None | None | Passed |
SHA-256 / ff6e3ccdd88768e72fd99bba18f118e222e669a06045fa2c1054ba1a635515b4
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):
out = [0] * data['width']
last = -1
for cell in data['row'].split(',') if data['row'] else []:
parts = cell.split('=', 1)
if len(parts) != 2: return None
index, value = parts
if not index.isascii() or not index.isdecimal(): return None
index = int(index)
if index <= last or index >= data['width']: return None
out[index] = value
last = index
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('gaps', solve(_vary({'width': 4, 'row': '0=@,2=z'})), _vary(['@', None, 'z', None]))
check('equals value', solve(_vary({'width': 2, 'row': '1=a=b'})), _vary([None, 'a=b']))
check('empty value', solve(_vary({'width': 2, 'row': '0='})), _vary(['', None]))
check('duplicate', solve(_vary({'width': 2, 'row': '0=x,0=y'})), _vary(None))
check('decreasing', solve(_vary({'width': 3, 'row': '2=x,1=y'})), _vary(None))
check('out of bounds', solve(_vary({'width': 2, 'row': '2=x'})), _vary(None))
check('negative', solve(_vary({'width': 2, 'row': '-1=x'})), _vary(None))
check('Unicode digit', solve(_vary({'width': 2, 'row': '١=x'})), _vary(None))
check('empty row', solve(_vary({'width': 3, 'row': ''})), _vary([None, None, None]))
check('last slot', solve(_vary({'width': 2, 'row': '1=@'})), _vary([None, '@']))
check('malformed', solve(_vary({'width': 2, 'row': '0'})), _vary(None))
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 |
|---|---|---|---|
| gaps | ['cell', 0, 'z', 0] | ['cell', None, 'z', None] | Failed |
| equals value | [0, 'a=b'] | [None, 'a=b'] | Failed |
| empty value | ['', 0] | ['', None] | Failed |
| duplicate | None | None | Passed |
| decreasing | None | None | Passed |
| out of bounds | None | None | Passed |
| negative | None | None | Passed |
| Unicode digit | None | None | Passed |
| empty row | [0, 0, 0] | [None, None, None] | Failed |
| last slot | [0, 'cell'] | [None, 'cell'] | Failed |
| malformed | None | None | Passed |
SHA-256 / 0a984f9a4a4b461158987f61fbfd44b9aca1b84533be95b9b749bdcc3836bcf2
3 / The verified repair
Exit 0"""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):
out = [None] * data['width']
last = -1
for cell in data['row'].split(',') if data['row'] else []:
parts = cell.split('=', 1)
if len(parts) != 2: return None
index, value = parts
if not index.isascii() or not index.isdecimal(): return None
index = int(index)
if index <= last or index >= data['width']: return None
out[index] = value
last = index
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('gaps', solve(_vary({'width': 4, 'row': '0=@,2=z'})), _vary(['@', None, 'z', None]))
check('equals value', solve(_vary({'width': 2, 'row': '1=a=b'})), _vary([None, 'a=b']))
check('empty value', solve(_vary({'width': 2, 'row': '0='})), _vary(['', None]))
check('duplicate', solve(_vary({'width': 2, 'row': '0=x,0=y'})), _vary(None))
check('decreasing', solve(_vary({'width': 3, 'row': '2=x,1=y'})), _vary(None))
check('out of bounds', solve(_vary({'width': 2, 'row': '2=x'})), _vary(None))
check('negative', solve(_vary({'width': 2, 'row': '-1=x'})), _vary(None))
check('Unicode digit', solve(_vary({'width': 2, 'row': '١=x'})), _vary(None))
check('empty row', solve(_vary({'width': 3, 'row': ''})), _vary([None, None, None]))
check('last slot', solve(_vary({'width': 2, 'row': '1=@'})), _vary([None, '@']))
check('malformed', solve(_vary({'width': 2, 'row': '0'})), _vary(None))
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 |
|---|---|---|---|
| gaps | ['cell', None, 'z', None] | ['cell', None, 'z', None] | Passed |
| equals value | [None, 'a=b'] | [None, 'a=b'] | Passed |
| empty value | ['', None] | ['', None] | Passed |
| duplicate | None | None | Passed |
| decreasing | None | None | Passed |
| out of bounds | None | None | Passed |
| negative | None | None | Passed |
| Unicode digit | None | None | Passed |
| empty row | [None, None, None] | [None, None, None] | Passed |
| last slot | [None, 'cell'] | [None, 'cell'] | Passed |
| malformed | None | None | Passed |
SHA-256 / ebde7d9d18958d4e1cfacab840730be2957c345cf185ef26b808ebe1c3c3e9f0
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:43.139267+00:00.
Case digest / 5aef09d1d14cba101b2bcf39d9f3c34135bef97140ed629d4a46e9a50c884c84