FA-47751 / Delimited text / Open access
A later delimiter replaces an equally supported earlier candidate · case 01
A structured table violates the declared record or column contract.
ROOT CAUSE
The update condition changes stable tie precedence.
VERIFIED REPAIR
Preserve the named invariant at the faulty decision: if candidate_score > score:
Unsuccessful approach: Adding an initialization fallback does not restore strict tie comparison.
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 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 | tab | comma | Failed |
| score | tab | tab | Passed |
| none | None | None | Passed |
| large width | cell | cell | Passed |
| singleton row distractor | tab | tab | Passed |
SHA-256 / 17c7f8f0df0af62a8752ee1394d61a9ee14b60e09732f8446ce43e49c8366eaf
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)) != 1: continue
candidate_score = len(counts) * counts[0]
if candidate_score >= score or best is None:
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 | tab | comma | Failed |
| score | tab | tab | Passed |
| none | None | None | Passed |
| large width | cell | cell | Passed |
| singleton row distractor | tab | tab | Passed |
SHA-256 / a18928b0ef65d281fff0f2e13d2e7a9097ccac711a358a7cf403aba4b00c93aa
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.432237+00:00.
Case digest / 380f0be4095e5bb35a67b2f4531856fbb25b1d43dcac64bee0b8bf57a8cf9b6b