FA-47906 / Delimited text / Open access
A bare scalar containing pipes is coerced into a list · case 01
A structured table violates the declared record or column contract.
ROOT CAUSE
Pipe separators are interpreted without the enclosing list marker.
VERIFIED REPAIR
Preserve the named invariant at the faulty decision: value = cell
Unsuccessful approach: Limiting coercion to scalars with pipes still changes their declared type.
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 inner.split('|')
else:
if '[' in cell or ']' in cell: return None
value = cell.split('|')
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']] | Failed |
| empty list | [[]] | [[]] | Passed |
| empty elements | [['', 'a', '']] | [['', 'a', '']] | Passed |
| bare empty | [['']] | [''] | Failed |
| unclosed | None | None | Passed |
| suffix | None | None | Passed |
| nested | None | None | Passed |
| bare bracket | None | None | Passed |
| pipe bare | [['a', 'b']] | ['a|b'] | Failed |
| three list | [['a', 'b', 'c']] | [['a', 'b', 'c']] | Passed |
SHA-256 / 4a9f521690f4a387526fdadbe27e00f58a3a5c32a27be16b7c2e0a1d7a33ed27
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.split('|')
else:
if '[' in cell or ']' in cell: return None
value = cell.split('|') if '|' in cell else 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'] | Failed |
| three list | [['a', 'b', 'c']] | [['a', 'b', 'c']] | Passed |
SHA-256 / e7cde554b52cff807a18e246200cd6e71e80c1fa164117f2a69023b3a866f57a
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.865274+00:00.
Case digest / c10a6fccd693ec10d9103452d91a13de880be8303bb972d373b9ee80083290af