FA-47841 / Delimited text / Open access
A BOM hides the delimiter preamble · case 01
A structured table violates the declared record or column contract.
ROOT CAUSE
Preamble recognition runs on text still carrying its file signature.
THE FAILURE
Preamble recognition runs on text still carrying its file signature.
Unsuccessful approach: Removing only a stand-alone signature does not handle a signature before sep=.
Case contract
Read a table with optional exact first line sep=<single nonquote, nonnewline character>. A first-line BOM is removed before recognizing this directive. Without directive use comma. The directive is not data. Later sep= lines are ordinary records. Return delimiter and split records; empty input has no records.
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):
lines = list(data)
if not lines: return [',', []]
if False: lines[0] = lines[0][1:]
delimiter = ','
if lines[0].startswith('sep='):
value = lines.pop(0)[4:]
if len(value) != 1 or value in '\r\n"': return None
delimiter = value
return [delimiter, [line.split(delimiter) for line in lines]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('custom', solve(_vary(['sep=;', '@;x'])), _vary([';', [['@', 'x']]]))
check('BOM directive', solve(_vary(['\ufeffsep=;', '@;x'])), _vary([';', [['@', 'x']]]))
check('default', solve(_vary(['@,x'])), _vary([',', [['@', 'x']]]))
check('later directive', solve(_vary(['a,b', 'sep=;'])), _vary([',', [['a', 'b'], ['sep=;']]]))
check('bad multi', solve(_vary(['sep=;;', 'x'])), _vary(None))
check('bad quote', solve(_vary(['sep="', 'x'])), _vary(None))
check('empty marker', solve(_vary(['sep=', 'x'])), _vary(None))
check('directive only', solve(_vary(['sep=;'])), _vary([';', []]))
check('zero', solve(_vary([])), _vary([',', []]))
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 |
|---|---|---|---|
| custom | [';', [['cell', 'x']]] | [';', [['cell', 'x']]] | Passed |
| BOM directive | [',', [['\ufeffsep=;'], ['cell;x']]] | [';', [['cell', 'x']]] | Failed |
| default | [',', [['cell', 'x']]] | [',', [['cell', 'x']]] | Passed |
| later directive | [',', [['a', 'b'], ['sep=;']]] | [',', [['a', 'b'], ['sep=;']]] | Passed |
| bad multi | None | None | Passed |
| bad quote | None | None | Passed |
| empty marker | None | None | Passed |
| directive only | [';', []] | [';', []] | Passed |
| zero | [',', []] | [',', []] | Passed |
SHA-256 / 82f2f0ceb26e8b0b929be1d95084889a69f17ef73bce97e2c77dfa101a3104de
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):
lines = list(data)
if not lines: return [',', []]
if lines[0] == '\ufeff': lines[0] = ''
delimiter = ','
if lines[0].startswith('sep='):
value = lines.pop(0)[4:]
if len(value) != 1 or value in '\r\n"': return None
delimiter = value
return [delimiter, [line.split(delimiter) for line in lines]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('custom', solve(_vary(['sep=;', '@;x'])), _vary([';', [['@', 'x']]]))
check('BOM directive', solve(_vary(['\ufeffsep=;', '@;x'])), _vary([';', [['@', 'x']]]))
check('default', solve(_vary(['@,x'])), _vary([',', [['@', 'x']]]))
check('later directive', solve(_vary(['a,b', 'sep=;'])), _vary([',', [['a', 'b'], ['sep=;']]]))
check('bad multi', solve(_vary(['sep=;;', 'x'])), _vary(None))
check('bad quote', solve(_vary(['sep="', 'x'])), _vary(None))
check('empty marker', solve(_vary(['sep=', 'x'])), _vary(None))
check('directive only', solve(_vary(['sep=;'])), _vary([';', []]))
check('zero', solve(_vary([])), _vary([',', []]))
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 |
|---|---|---|---|
| custom | [';', [['cell', 'x']]] | [';', [['cell', 'x']]] | Passed |
| BOM directive | [',', [['\ufeffsep=;'], ['cell;x']]] | [';', [['cell', 'x']]] | Failed |
| default | [',', [['cell', 'x']]] | [',', [['cell', 'x']]] | Passed |
| later directive | [',', [['a', 'b'], ['sep=;']]] | [',', [['a', 'b'], ['sep=;']]] | Passed |
| bad multi | None | None | Passed |
| bad quote | None | None | Passed |
| empty marker | None | None | Passed |
| directive only | [';', []] | [';', []] | Passed |
| zero | [',', []] | [',', []] | Passed |
SHA-256 / 77cc43296e5973814dd0b81a44a04faf5de73c527ac53b1f728b6fd06229486c
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 9 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:45.478995+00:00.
Case digest / 38762df5a875fc57a5de96ffdae89be6ec18a902ed3bded88eb0932b2a92faaf