FA-47891 / Delimited text / Open access
An empty list cell is decoded as one empty element · case 01
A structured table violates the declared record or column contract.
ROOT CAUSE
Empty container syntax is confused with an explicitly empty list item.
VERIFIED REPAIR
Preserve the named invariant at the faulty decision: value = [] if inner == '' else inner.split('|')
Unsuccessful approach: Wrapping the empty inner string preserves the same false item.
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 = 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 | [['']] | [[]] | Failed |
| 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 / 1f338da94a3a889829d695a4a01b8da1161626c0c21bfe35f2e9611dc9190ea0
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 = [inner] 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 | [['']] | [[]] | Failed |
| 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 / f51409a4813d455f8c9ff3e0a3dc9f923f70c625ba95378f7aee3440af0bd383
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.738127+00:00.
Case digest / ded24c65a09cb059487f58bb3961859b4107576eaeeb07a39e2fff52302a4b82