FA-47741 / Delimited text / Open access
A ragged delimiter candidate defeats a stable dialect · case 01
A structured table violates the declared record or column contract.
ROOT CAUSE
The candidate score is computed without requiring consistent record width.
VERIFIED REPAIR
Preserve the named invariant at the faulty decision: if len(set(counts)) != 1: continue
Unsuccessful approach: Allowing two distinct widths still accepts a ragged candidate.
Case contract
Choose comma, tab, or semicolon from precomputed per-record field counts. Ignore blank physical records marked null. A candidate must have >=2 fields on every sampled record and constant width. Score is record count times width; greatest score wins, ties use candidate order. No valid candidate returns null.
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):
best, score = None, -1
for name, counts in data:
counts = [c for c in counts if c is not None]
if not counts: continue
if min(counts) < 2: continue
if False: continue
candidate_score = len(counts) * counts[0]
if candidate_score > score:
best, score = name, candidate_score
return best
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('stable', solve(_vary([['comma', [2, 2]], ['tab', [1, 1]]])), _vary('comma'))
check('ragged distractor', solve(_vary([['comma', [2, 3]], ['tab', [2, 2]]])), _vary('tab'))
check('blank ignored', solve(_vary([['comma', [None, 2, 2]], ['tab', [1, 1]]])), _vary('comma'))
check('ties', solve(_vary([['comma', [2, 2]], ['tab', [2, 2]]])), _vary('comma'))
check('score', solve(_vary([['comma', [3]], ['tab', [2, 2]]])), _vary('tab'))
check('none', solve(_vary([['comma', [1, 1]], ['tab', []]])), _vary(None))
check('large width', solve(_vary([['@', [4, 4]], ['tab', [2, 2]]])), _vary('@'))
check('singleton row distractor', solve(_vary([['comma', [2, 1]], ['tab', [2, 2]]])), _vary('tab'))
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 |
|---|---|---|---|
| stable | comma | comma | Passed |
| ragged distractor | comma | tab | Failed |
| blank ignored | comma | comma | Passed |
| ties | comma | comma | Passed |
| score | tab | tab | Passed |
| none | None | None | Passed |
| large width | cell | cell | Passed |
| singleton row distractor | tab | tab | Passed |
SHA-256 / c7ab108dd3a1cdae7200c81af61d9b54d501860602c31cc7af6c23a47942315f
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):
best, score = None, -1
for name, counts in data:
counts = [c for c in counts if c is not None]
if not counts: continue
if min(counts) < 2: continue
if len(set(counts)) > 2: continue
candidate_score = len(counts) * counts[0]
if candidate_score > score:
best, score = name, candidate_score
return best
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('stable', solve(_vary([['comma', [2, 2]], ['tab', [1, 1]]])), _vary('comma'))
check('ragged distractor', solve(_vary([['comma', [2, 3]], ['tab', [2, 2]]])), _vary('tab'))
check('blank ignored', solve(_vary([['comma', [None, 2, 2]], ['tab', [1, 1]]])), _vary('comma'))
check('ties', solve(_vary([['comma', [2, 2]], ['tab', [2, 2]]])), _vary('comma'))
check('score', solve(_vary([['comma', [3]], ['tab', [2, 2]]])), _vary('tab'))
check('none', solve(_vary([['comma', [1, 1]], ['tab', []]])), _vary(None))
check('large width', solve(_vary([['@', [4, 4]], ['tab', [2, 2]]])), _vary('@'))
check('singleton row distractor', solve(_vary([['comma', [2, 1]], ['tab', [2, 2]]])), _vary('tab'))
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 |
|---|---|---|---|
| stable | comma | comma | Passed |
| ragged distractor | comma | tab | Failed |
| blank ignored | comma | comma | Passed |
| ties | comma | comma | Passed |
| score | tab | tab | Passed |
| none | None | None | Passed |
| large width | cell | cell | Passed |
| singleton row distractor | tab | tab | Passed |
SHA-256 / 7d1c5e2ec14b8cf33824d9464fda74c900aab896c5f86aff00e80a9c52c3b257
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):
best, score = None, -1
for name, counts in data:
counts = [c for c in counts if c is not None]
if not counts: continue
if min(counts) < 2: continue
if len(set(counts)) != 1: continue
candidate_score = len(counts) * counts[0]
if candidate_score > score:
best, score = name, candidate_score
return best
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('stable', solve(_vary([['comma', [2, 2]], ['tab', [1, 1]]])), _vary('comma'))
check('ragged distractor', solve(_vary([['comma', [2, 3]], ['tab', [2, 2]]])), _vary('tab'))
check('blank ignored', solve(_vary([['comma', [None, 2, 2]], ['tab', [1, 1]]])), _vary('comma'))
check('ties', solve(_vary([['comma', [2, 2]], ['tab', [2, 2]]])), _vary('comma'))
check('score', solve(_vary([['comma', [3]], ['tab', [2, 2]]])), _vary('tab'))
check('none', solve(_vary([['comma', [1, 1]], ['tab', []]])), _vary(None))
check('large width', solve(_vary([['@', [4, 4]], ['tab', [2, 2]]])), _vary('@'))
check('singleton row distractor', solve(_vary([['comma', [2, 1]], ['tab', [2, 2]]])), _vary('tab'))
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 |
|---|---|---|---|
| stable | comma | comma | Passed |
| ragged distractor | tab | tab | Passed |
| blank ignored | comma | comma | Passed |
| ties | comma | comma | Passed |
| score | tab | tab | Passed |
| none | None | None | Passed |
| large width | cell | cell | Passed |
| singleton row distractor | tab | tab | Passed |
SHA-256 / 80639751816c2aa1c07cc6278a002624f22205ab1a0853c70536a411e2802b0d
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:44.400877+00:00.
Case digest / a8bc44254509e3d11de07234faab0f750f1125865faad7284f822ec59d88b869