FA-47896 / Delimited text / Open access
Empty positions inside a list cell disappear · case 01
A structured table violates the declared record or column contract.
ROOT CAUSE
The list-cell parser filters empty members that have positional meaning.
VERIFIED REPAIR
Preserve the named invariant at the faulty decision: inner.split('|')
Unsuccessful approach: Trimming list separators loses edge positions while retaining only interior empties.
Case contract
Decode a semicolon table row whose cells are either bare scalar text or bracketed pipe lists. Backslash has no special role. List elements may be empty; [] is an empty list. Brackets must occupy the whole cell; nested brackets reject. Return each cell as scalar text or a list.
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 = []
for cell in data.split(';'):
if cell.startswith('['):
if not cell.endswith(']'): return None
inner = cell[1:-1]
if '[' in inner or ']' in inner: return None
value = [] if inner == '' else [x for x in inner.split('|') if x]
else:
if '[' in cell or ']' in cell: return None
value = cell
out.append(value)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed', solve(_vary('@;[a|b]')), _vary(['@', ['a', 'b']]))
check('empty list', solve(_vary('[]')), _vary([[]]))
check('empty elements', solve(_vary('[|a|]')), _vary([['', 'a', '']]))
check('bare empty', solve(_vary('')), _vary(['']))
check('unclosed', solve(_vary('[a')), _vary(None))
check('suffix', solve(_vary('[a]tail')), _vary(None))
check('nested', solve(_vary('[[a]]')), _vary(None))
check('bare bracket', solve(_vary('a]')), _vary(None))
check('pipe bare', solve(_vary('a|b')), _vary(['a|b']))
check('three list', solve(_vary('[a|b|c]')), _vary([['a', 'b', 'c']]))
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 |
|---|---|---|---|
| mixed | ['cell', ['a', 'b']] | ['cell', ['a', 'b']] | Passed |
| empty list | [[]] | [[]] | Passed |
| empty elements | [['a']] | [['', 'a', '']] | Failed |
| bare empty | [''] | [''] | Passed |
| unclosed | None | None | Passed |
| suffix | None | None | Passed |
| nested | None | None | Passed |
| bare bracket | None | None | Passed |
| pipe bare | ['a|b'] | ['a|b'] | Passed |
| three list | [['a', 'b', 'c']] | [['a', 'b', 'c']] | Passed |
SHA-256 / 11402d2bc8a43bc0b65c52bc52d7452f6f8c7217783a54466afc5a86fed83e4e
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 = []
for cell in data.split(';'):
if cell.startswith('['):
if not cell.endswith(']'): return None
inner = cell[1:-1]
if '[' in inner or ']' in inner: return None
value = [] if inner == '' else inner.strip('|').split('|')
else:
if '[' in cell or ']' in cell: return None
value = cell
out.append(value)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed', solve(_vary('@;[a|b]')), _vary(['@', ['a', 'b']]))
check('empty list', solve(_vary('[]')), _vary([[]]))
check('empty elements', solve(_vary('[|a|]')), _vary([['', 'a', '']]))
check('bare empty', solve(_vary('')), _vary(['']))
check('unclosed', solve(_vary('[a')), _vary(None))
check('suffix', solve(_vary('[a]tail')), _vary(None))
check('nested', solve(_vary('[[a]]')), _vary(None))
check('bare bracket', solve(_vary('a]')), _vary(None))
check('pipe bare', solve(_vary('a|b')), _vary(['a|b']))
check('three list', solve(_vary('[a|b|c]')), _vary([['a', 'b', 'c']]))
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 |
|---|---|---|---|
| mixed | ['cell', ['a', 'b']] | ['cell', ['a', 'b']] | Passed |
| empty list | [[]] | [[]] | Passed |
| empty elements | [['a']] | [['', 'a', '']] | Failed |
| bare empty | [''] | [''] | Passed |
| unclosed | None | None | Passed |
| suffix | None | None | Passed |
| nested | None | None | Passed |
| bare bracket | None | None | Passed |
| pipe bare | ['a|b'] | ['a|b'] | Passed |
| three list | [['a', 'b', 'c']] | [['a', 'b', 'c']] | Passed |
SHA-256 / 8b43d8d78b58d4525d06838f83d1ecc12a6cdbbb16c7c4eadeb9700ebc7e7662
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 = []
for cell in data.split(';'):
if cell.startswith('['):
if not cell.endswith(']'): return None
inner = cell[1:-1]
if '[' in inner or ']' in inner: return None
value = [] if inner == '' else inner.split('|')
else:
if '[' in cell or ']' in cell: return None
value = cell
out.append(value)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed', solve(_vary('@;[a|b]')), _vary(['@', ['a', 'b']]))
check('empty list', solve(_vary('[]')), _vary([[]]))
check('empty elements', solve(_vary('[|a|]')), _vary([['', 'a', '']]))
check('bare empty', solve(_vary('')), _vary(['']))
check('unclosed', solve(_vary('[a')), _vary(None))
check('suffix', solve(_vary('[a]tail')), _vary(None))
check('nested', solve(_vary('[[a]]')), _vary(None))
check('bare bracket', solve(_vary('a]')), _vary(None))
check('pipe bare', solve(_vary('a|b')), _vary(['a|b']))
check('three list', solve(_vary('[a|b|c]')), _vary([['a', 'b', 'c']]))
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 |
|---|---|---|---|
| mixed | ['cell', ['a', 'b']] | ['cell', ['a', 'b']] | Passed |
| empty list | [[]] | [[]] | Passed |
| empty elements | [['', 'a', '']] | [['', 'a', '']] | Passed |
| bare empty | [''] | [''] | Passed |
| unclosed | None | None | Passed |
| suffix | None | None | Passed |
| nested | None | None | Passed |
| bare bracket | None | None | Passed |
| pipe bare | ['a|b'] | ['a|b'] | Passed |
| three list | [['a', 'b', 'c']] | [['a', 'b', 'c']] | Passed |
SHA-256 / d9d1414890c4d25606ec0675ea56671b810d0e81c2b522a2ee1789d93a179cf4
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:45.753402+00:00.
Case digest / 534ba304841cf7736061ba90a5110fb800e4d7ea408f5a00de5b39e6713656c1