FA-47786 / Delimited text / Open access
An all-null column is reported as a text column · case 01
A structured table violates the declared record or column contract.
ROOT CAUSE
Absence of observations is conflated with observed text.
VERIFIED REPAIR
Preserve the named invariant at the faulty decision: else 'unknown' for kinds
Unsuccessful approach: A numeric default likewise invents unsupported evidence.
Case contract
Infer per-column wire types from already lexed two-column rows. Unquoted empty and NULL cells supply no evidence; quoted cells force text. Unquoted lowercase true/false are bool; canonical signed decimal integers without leading zeros are int; all other cells text. Mixed non-null kinds promote to text; a column with no evidence is unknown.
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):
evidence = [set(), set()]
for row in data:
for i, (value, quoted) in enumerate(row):
if not quoted and value in ('', 'NULL'): continue
if quoted: kind = 'text'
elif value in ('true', 'false'): kind = 'bool'
elif value.lstrip('-').isascii() and value.lstrip('-').isdigit() and value == str(int(value)): kind = 'int'
else: kind = 'text'
evidence[i].add(kind)
return [next(iter(kinds)) if len(kinds) == 1 else 'text' if kinds else 'text' for kinds in evidence]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('typed', solve(_vary([[['12', False], ['true', False]], [['-2', False], ['false', False]]])), _vary(['int', 'bool']))
check('quoted number', solve(_vary([[['12', True], ['@', False]]])), _vary(['text', 'text']))
check('null only', solve(_vary([[['NULL', False], ['', False]]])), _vary(['unknown', 'unknown']))
check('quoted empty', solve(_vary([[['', True], ['NULL', True]]])), _vary(['text', 'text']))
check('leading zero', solve(_vary([[['01', False], ['-0', False]]])), _vary(['text', 'text']))
check('mixed', solve(_vary([[['1', False], ['true', False]], [['@', False], ['2', False]]])), _vary(['text', 'text']))
check('null ignored', solve(_vary([[['NULL', False], ['', False]], [['1', False], ['false', False]]])), _vary(['int', 'bool']))
check('empty table', solve(_vary([])), _vary(['unknown', 'unknown']))
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 |
|---|---|---|---|
| typed | ['int', 'bool'] | ['int', 'bool'] | Passed |
| quoted number | ['text', 'text'] | ['text', 'text'] | Passed |
| null only | ['text', 'text'] | ['unknown', 'unknown'] | Failed |
| quoted empty | ['text', 'text'] | ['text', 'text'] | Passed |
| leading zero | ['text', 'text'] | ['text', 'text'] | Passed |
| mixed | ['text', 'text'] | ['text', 'text'] | Passed |
| null ignored | ['int', 'bool'] | ['int', 'bool'] | Passed |
| empty table | ['text', 'text'] | ['unknown', 'unknown'] | Failed |
SHA-256 / a3e0e8fc4f845cadfcb2b1ccd4ebdb77525035b7dfa153864363ba55f6ea6b65
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):
evidence = [set(), set()]
for row in data:
for i, (value, quoted) in enumerate(row):
if not quoted and value in ('', 'NULL'): continue
if quoted: kind = 'text'
elif value in ('true', 'false'): kind = 'bool'
elif value.lstrip('-').isascii() and value.lstrip('-').isdigit() and value == str(int(value)): kind = 'int'
else: kind = 'text'
evidence[i].add(kind)
return [next(iter(kinds)) if len(kinds) == 1 else 'text' if kinds else 'int' for kinds in evidence]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('typed', solve(_vary([[['12', False], ['true', False]], [['-2', False], ['false', False]]])), _vary(['int', 'bool']))
check('quoted number', solve(_vary([[['12', True], ['@', False]]])), _vary(['text', 'text']))
check('null only', solve(_vary([[['NULL', False], ['', False]]])), _vary(['unknown', 'unknown']))
check('quoted empty', solve(_vary([[['', True], ['NULL', True]]])), _vary(['text', 'text']))
check('leading zero', solve(_vary([[['01', False], ['-0', False]]])), _vary(['text', 'text']))
check('mixed', solve(_vary([[['1', False], ['true', False]], [['@', False], ['2', False]]])), _vary(['text', 'text']))
check('null ignored', solve(_vary([[['NULL', False], ['', False]], [['1', False], ['false', False]]])), _vary(['int', 'bool']))
check('empty table', solve(_vary([])), _vary(['unknown', 'unknown']))
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 |
|---|---|---|---|
| typed | ['int', 'bool'] | ['int', 'bool'] | Passed |
| quoted number | ['text', 'text'] | ['text', 'text'] | Passed |
| null only | ['int', 'int'] | ['unknown', 'unknown'] | Failed |
| quoted empty | ['text', 'text'] | ['text', 'text'] | Passed |
| leading zero | ['text', 'text'] | ['text', 'text'] | Passed |
| mixed | ['text', 'text'] | ['text', 'text'] | Passed |
| null ignored | ['int', 'bool'] | ['int', 'bool'] | Passed |
| empty table | ['int', 'int'] | ['unknown', 'unknown'] | Failed |
SHA-256 / e479e48fdad3d36c6dc76907aa45f14f40ac8a0fcb5aff00ae742032cafbaf0e
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):
evidence = [set(), set()]
for row in data:
for i, (value, quoted) in enumerate(row):
if not quoted and value in ('', 'NULL'): continue
if quoted: kind = 'text'
elif value in ('true', 'false'): kind = 'bool'
elif value.lstrip('-').isascii() and value.lstrip('-').isdigit() and value == str(int(value)): kind = 'int'
else: kind = 'text'
evidence[i].add(kind)
return [next(iter(kinds)) if len(kinds) == 1 else 'text' if kinds else 'unknown' for kinds in evidence]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('typed', solve(_vary([[['12', False], ['true', False]], [['-2', False], ['false', False]]])), _vary(['int', 'bool']))
check('quoted number', solve(_vary([[['12', True], ['@', False]]])), _vary(['text', 'text']))
check('null only', solve(_vary([[['NULL', False], ['', False]]])), _vary(['unknown', 'unknown']))
check('quoted empty', solve(_vary([[['', True], ['NULL', True]]])), _vary(['text', 'text']))
check('leading zero', solve(_vary([[['01', False], ['-0', False]]])), _vary(['text', 'text']))
check('mixed', solve(_vary([[['1', False], ['true', False]], [['@', False], ['2', False]]])), _vary(['text', 'text']))
check('null ignored', solve(_vary([[['NULL', False], ['', False]], [['1', False], ['false', False]]])), _vary(['int', 'bool']))
check('empty table', solve(_vary([])), _vary(['unknown', 'unknown']))
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 |
|---|---|---|---|
| typed | ['int', 'bool'] | ['int', 'bool'] | Passed |
| quoted number | ['text', 'text'] | ['text', 'text'] | Passed |
| null only | ['unknown', 'unknown'] | ['unknown', 'unknown'] | Passed |
| quoted empty | ['text', 'text'] | ['text', 'text'] | Passed |
| leading zero | ['text', 'text'] | ['text', 'text'] | Passed |
| mixed | ['text', 'text'] | ['text', 'text'] | Passed |
| null ignored | ['int', 'bool'] | ['int', 'bool'] | Passed |
| empty table | ['unknown', 'unknown'] | ['unknown', 'unknown'] | Passed |
SHA-256 / ff76d7e2cb78e5fc37c9122b58bf52c46aa8a0f466da8026d55e34fe1265ce64
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.814938+00:00.
Case digest / b3ad97ce47d13141d127583f76e027e3bd3f979f7d813fa289f69c33f9cfad15