FA-48731 / Delimited text / Open access
A field span is paired with the entire unsplit record · case 01
A structured table violates the declared record or column contract.
ROOT CAUSE
A field span is paired with the entire unsplit record.
VERIFIED REPAIR
Preserve the named invariant at the faulty decision: fields.append([data[start:position],start,position])
Unsuccessful approach: The alternate implementation still violates the same declared invariant: a field span is paired with the entire unsplit record.
Case contract
Split a simple unquoted comma record and return [value,start,end] for each field, using zero-based Unicode-code-point offsets and exclusive ends. Delimiters are outside field spans; empty fields have equal start/end positions. The input contains no record terminator.
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):
fields=[]; start=0
for position,ch in enumerate(data):
if ch==',':
fields.append([data,start,position])
start=position+1
fields.append([data[start:],start,len(data)])
return fields
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('normal', solve(_vary('ab,c')), _vary([['ab', 0, 2], ['c', 3, 4]]))
check('empty edges', solve(_vary(',a,')), _vary([['', 0, 0], ['a', 1, 2], ['', 3, 3]]))
check('empty input', solve(_vary('')), _vary([['', 0, 0]]))
check('unicode', solve(_vary('é,😀')), _vary([['é', 0, 1], ['😀', 2, 3]]))
check('many empties', solve(_vary(',,')), _vary([['', 0, 0], ['', 1, 1], ['', 2, 2]]))
check('one', solve(_vary('abcd')), _vary([['abcd', 0, 4]]))
check('middle empty', solve(_vary('a,,b')), _vary([['a', 0, 1], ['', 2, 2], ['b', 3, 4]]))
check('variant source extent', solve(('x'*N)+',y'), [['x'*N,0,N],['y',N+1,N+2]])
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 |
|---|---|---|---|
| normal | [['ab,c', 0, 2], ['c', 3, 4]] | [['ab', 0, 2], ['c', 3, 4]] | Failed |
| empty edges | [[',a,', 0, 0], [',a,', 1, 2], ['', 3, 3]] | [['', 0, 0], ['a', 1, 2], ['', 3, 3]] | Failed |
| empty input | [['', 0, 0]] | [['', 0, 0]] | Passed |
| unicode | [['é,😀', 0, 1], ['😀', 2, 3]] | [['é', 0, 1], ['😀', 2, 3]] | Failed |
| many empties | [[',,', 0, 0], [',,', 1, 1], ['', 2, 2]] | [['', 0, 0], ['', 1, 1], ['', 2, 2]] | Failed |
| one | [['abcd', 0, 4]] | [['abcd', 0, 4]] | Passed |
| middle empty | [['a,,b', 0, 1], ['a,,b', 2, 2], ['b', 3, 4]] | [['a', 0, 1], ['', 2, 2], ['b', 3, 4]] | Failed |
| variant source extent | [['x,y', 0, 1], ['y', 2, 3]] | [['x', 0, 1], ['y', 2, 3]] | Failed |
SHA-256 / 800f7b242b7c88a6dcc74e0c27db2263cfaadc1f65422baeb8c25ad0cf733c2b
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):
fields=[]; start=0
for position,ch in enumerate(data):
if ch==',':
fields.append([data[:position],start,position])
start=position+1
fields.append([data[start:],start,len(data)])
return fields
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('normal', solve(_vary('ab,c')), _vary([['ab', 0, 2], ['c', 3, 4]]))
check('empty edges', solve(_vary(',a,')), _vary([['', 0, 0], ['a', 1, 2], ['', 3, 3]]))
check('empty input', solve(_vary('')), _vary([['', 0, 0]]))
check('unicode', solve(_vary('é,😀')), _vary([['é', 0, 1], ['😀', 2, 3]]))
check('many empties', solve(_vary(',,')), _vary([['', 0, 0], ['', 1, 1], ['', 2, 2]]))
check('one', solve(_vary('abcd')), _vary([['abcd', 0, 4]]))
check('middle empty', solve(_vary('a,,b')), _vary([['a', 0, 1], ['', 2, 2], ['b', 3, 4]]))
check('variant source extent', solve(('x'*N)+',y'), [['x'*N,0,N],['y',N+1,N+2]])
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 |
|---|---|---|---|
| normal | [['ab', 0, 2], ['c', 3, 4]] | [['ab', 0, 2], ['c', 3, 4]] | Passed |
| empty edges | [['', 0, 0], [',a', 1, 2], ['', 3, 3]] | [['', 0, 0], ['a', 1, 2], ['', 3, 3]] | Failed |
| empty input | [['', 0, 0]] | [['', 0, 0]] | Passed |
| unicode | [['é', 0, 1], ['😀', 2, 3]] | [['é', 0, 1], ['😀', 2, 3]] | Passed |
| many empties | [['', 0, 0], [',', 1, 1], ['', 2, 2]] | [['', 0, 0], ['', 1, 1], ['', 2, 2]] | Failed |
| one | [['abcd', 0, 4]] | [['abcd', 0, 4]] | Passed |
| middle empty | [['a', 0, 1], ['a,', 2, 2], ['b', 3, 4]] | [['a', 0, 1], ['', 2, 2], ['b', 3, 4]] | Failed |
| variant source extent | [['x', 0, 1], ['y', 2, 3]] | [['x', 0, 1], ['y', 2, 3]] | Passed |
SHA-256 / c620761b62b4209709140d83212e52fdfe701163bbd00a8ebe0a08675df15c96
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):
fields=[]; start=0
for position,ch in enumerate(data):
if ch==',':
fields.append([data[start:position],start,position])
start=position+1
fields.append([data[start:],start,len(data)])
return fields
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('normal', solve(_vary('ab,c')), _vary([['ab', 0, 2], ['c', 3, 4]]))
check('empty edges', solve(_vary(',a,')), _vary([['', 0, 0], ['a', 1, 2], ['', 3, 3]]))
check('empty input', solve(_vary('')), _vary([['', 0, 0]]))
check('unicode', solve(_vary('é,😀')), _vary([['é', 0, 1], ['😀', 2, 3]]))
check('many empties', solve(_vary(',,')), _vary([['', 0, 0], ['', 1, 1], ['', 2, 2]]))
check('one', solve(_vary('abcd')), _vary([['abcd', 0, 4]]))
check('middle empty', solve(_vary('a,,b')), _vary([['a', 0, 1], ['', 2, 2], ['b', 3, 4]]))
check('variant source extent', solve(('x'*N)+',y'), [['x'*N,0,N],['y',N+1,N+2]])
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 |
|---|---|---|---|
| normal | [['ab', 0, 2], ['c', 3, 4]] | [['ab', 0, 2], ['c', 3, 4]] | Passed |
| empty edges | [['', 0, 0], ['a', 1, 2], ['', 3, 3]] | [['', 0, 0], ['a', 1, 2], ['', 3, 3]] | Passed |
| empty input | [['', 0, 0]] | [['', 0, 0]] | Passed |
| unicode | [['é', 0, 1], ['😀', 2, 3]] | [['é', 0, 1], ['😀', 2, 3]] | Passed |
| many empties | [['', 0, 0], ['', 1, 1], ['', 2, 2]] | [['', 0, 0], ['', 1, 1], ['', 2, 2]] | Passed |
| one | [['abcd', 0, 4]] | [['abcd', 0, 4]] | Passed |
| middle empty | [['a', 0, 1], ['', 2, 2], ['b', 3, 4]] | [['a', 0, 1], ['', 2, 2], ['b', 3, 4]] | Passed |
| variant source extent | [['x', 0, 1], ['y', 2, 3]] | [['x', 0, 1], ['y', 2, 3]] | Passed |
SHA-256 / 36d88f5387bcb781d1af648c07014ef487be5bdb8e70990a67002beb75f82ffa
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:53.423624+00:00.
Case digest / 11c255bb837027b95bd45875979ca2af0439000178287ebbef2334f9339c181a