FA-48581 / Delimited text / Open access
A column without annotation receives an invented empty unit · case 01
A structured table violates the declared record or column contract.
ROOT CAUSE
A column without annotation receives an invented empty unit.
VERIFIED REPAIR
Preserve the named invariant at the faulty decision: name,unit=cell,None
Unsuccessful approach: The alternate implementation still violates the same declared invariant: a column without annotation receives an invented empty unit.
Case contract
Parse comma header cells with optional terminal [unit]. Return [name,unit-or-null]. Only one terminal bracket pair is allowed; name and unit must be nonempty. Bare header names are preserved including spaces; bracket text is not normalized. Duplicate full name/unit pairs reject, but one name with different units is allowed.
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 '[' in cell:
opening=cell.find('[')
if not cell.endswith(']') or cell.count('[')!=1 or cell.count(']')!=1: return None
name,unit=cell[:opening],cell[opening+1:-1]
if not name or not unit: return None
else:
if not cell or ']' in cell: return None
name,unit=cell,''
pair=[name,unit]
if pair in out: return None
out.append(pair)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('units', solve(_vary('@ [kg],time[s]')), _vary([['@ ', 'kg'], ['time', 's']]))
check('bare', solve(_vary('@')), _vary([['@', None]]))
check('two units', solve(_vary('mass[kg],mass[g]')), _vary([['mass', 'kg'], ['mass', 'g']]))
check('duplicate', solve(_vary('a[x],a[x]')), _vary(None))
check('empty unit', solve(_vary('a[]')), _vary(None))
check('empty name', solve(_vary('[kg]')), _vary(None))
check('suffix', solve(_vary('a[x]tail')), _vary(None))
check('nested', solve(_vary('a[[x]]')), _vary(None))
check('bare space', solve(_vary(' name ')), _vary([[' name ', None]]))
check('unit exact spelling', solve(_vary('a[ Pa ],b[Pa]')), _vary([['a', ' Pa '], ['b', 'Pa']]))
check('shared unit', solve(_vary('a[x],b[x]')), _vary([['a', 'x'], ['b', 'x']]))
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 |
|---|---|---|---|
| units | [['cell ', 'kg'], ['time', 's']] | [['cell ', 'kg'], ['time', 's']] | Passed |
| bare | [['cell', '']] | [['cell', None]] | Failed |
| two units | [['mass', 'kg'], ['mass', 'g']] | [['mass', 'kg'], ['mass', 'g']] | Passed |
| duplicate | None | None | Passed |
| empty unit | None | None | Passed |
| empty name | None | None | Passed |
| suffix | None | None | Passed |
| nested | None | None | Passed |
| bare space | [[' name ', '']] | [[' name ', None]] | Failed |
| unit exact spelling | [['a', ' Pa '], ['b', 'Pa']] | [['a', ' Pa '], ['b', 'Pa']] | Passed |
| shared unit | [['a', 'x'], ['b', 'x']] | [['a', 'x'], ['b', 'x']] | Passed |
SHA-256 / 773ede681c91dc8257157791e15b0440c40bcbf51088e19f1b969f05e6f42ece
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 '[' in cell:
opening=cell.find('[')
if not cell.endswith(']') or cell.count('[')!=1 or cell.count(']')!=1: return None
name,unit=cell[:opening],cell[opening+1:-1]
if not name or not unit: return None
else:
if not cell or ']' in cell: return None
name,unit=cell,'1'
pair=[name,unit]
if pair in out: return None
out.append(pair)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('units', solve(_vary('@ [kg],time[s]')), _vary([['@ ', 'kg'], ['time', 's']]))
check('bare', solve(_vary('@')), _vary([['@', None]]))
check('two units', solve(_vary('mass[kg],mass[g]')), _vary([['mass', 'kg'], ['mass', 'g']]))
check('duplicate', solve(_vary('a[x],a[x]')), _vary(None))
check('empty unit', solve(_vary('a[]')), _vary(None))
check('empty name', solve(_vary('[kg]')), _vary(None))
check('suffix', solve(_vary('a[x]tail')), _vary(None))
check('nested', solve(_vary('a[[x]]')), _vary(None))
check('bare space', solve(_vary(' name ')), _vary([[' name ', None]]))
check('unit exact spelling', solve(_vary('a[ Pa ],b[Pa]')), _vary([['a', ' Pa '], ['b', 'Pa']]))
check('shared unit', solve(_vary('a[x],b[x]')), _vary([['a', 'x'], ['b', 'x']]))
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 |
|---|---|---|---|
| units | [['cell ', 'kg'], ['time', 's']] | [['cell ', 'kg'], ['time', 's']] | Passed |
| bare | [['cell', '1']] | [['cell', None]] | Failed |
| two units | [['mass', 'kg'], ['mass', 'g']] | [['mass', 'kg'], ['mass', 'g']] | Passed |
| duplicate | None | None | Passed |
| empty unit | None | None | Passed |
| empty name | None | None | Passed |
| suffix | None | None | Passed |
| nested | None | None | Passed |
| bare space | [[' name ', '1']] | [[' name ', None]] | Failed |
| unit exact spelling | [['a', ' Pa '], ['b', 'Pa']] | [['a', ' Pa '], ['b', 'Pa']] | Passed |
| shared unit | [['a', 'x'], ['b', 'x']] | [['a', 'x'], ['b', 'x']] | Passed |
SHA-256 / 480b169f80d9755134127888f27c7ca6fbfc3ac7a566ea9d448bc980fbe3626b
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 '[' in cell:
opening=cell.find('[')
if not cell.endswith(']') or cell.count('[')!=1 or cell.count(']')!=1: return None
name,unit=cell[:opening],cell[opening+1:-1]
if not name or not unit: return None
else:
if not cell or ']' in cell: return None
name,unit=cell,None
pair=[name,unit]
if pair in out: return None
out.append(pair)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('units', solve(_vary('@ [kg],time[s]')), _vary([['@ ', 'kg'], ['time', 's']]))
check('bare', solve(_vary('@')), _vary([['@', None]]))
check('two units', solve(_vary('mass[kg],mass[g]')), _vary([['mass', 'kg'], ['mass', 'g']]))
check('duplicate', solve(_vary('a[x],a[x]')), _vary(None))
check('empty unit', solve(_vary('a[]')), _vary(None))
check('empty name', solve(_vary('[kg]')), _vary(None))
check('suffix', solve(_vary('a[x]tail')), _vary(None))
check('nested', solve(_vary('a[[x]]')), _vary(None))
check('bare space', solve(_vary(' name ')), _vary([[' name ', None]]))
check('unit exact spelling', solve(_vary('a[ Pa ],b[Pa]')), _vary([['a', ' Pa '], ['b', 'Pa']]))
check('shared unit', solve(_vary('a[x],b[x]')), _vary([['a', 'x'], ['b', 'x']]))
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 |
|---|---|---|---|
| units | [['cell ', 'kg'], ['time', 's']] | [['cell ', 'kg'], ['time', 's']] | Passed |
| bare | [['cell', None]] | [['cell', None]] | Passed |
| two units | [['mass', 'kg'], ['mass', 'g']] | [['mass', 'kg'], ['mass', 'g']] | Passed |
| duplicate | None | None | Passed |
| empty unit | None | None | Passed |
| empty name | None | None | Passed |
| suffix | None | None | Passed |
| nested | None | None | Passed |
| bare space | [[' name ', None]] | [[' name ', None]] | Passed |
| unit exact spelling | [['a', ' Pa '], ['b', 'Pa']] | [['a', ' Pa '], ['b', 'Pa']] | Passed |
| shared unit | [['a', 'x'], ['b', 'x']] | [['a', 'x'], ['b', 'x']] | Passed |
SHA-256 / 786974f621723854f9ce4e3b3e0e2114cb0c656819f95836b3b08a9f68113f80
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:52.091818+00:00.
Case digest / 06d6710704a538ad388e3cc7d431de431b6da9701ebea0e980e3268386fbdcdc