FA-48281 / Delimited text / Open access
A length-cell writer omits the mandatory trailing delimiter · case 01
A structured table violates the declared record or column contract.
ROOT CAUSE
A length-cell writer omits the mandatory trailing delimiter.
VERIFIED REPAIR
Preserve the named invariant at the faulty decision: out.append(token+':'+cell+',')
Unsuccessful approach: The alternate implementation still violates the same declared invariant: a length-cell writer omits the mandatory trailing delimiter.
Case contract
Write text cells in canonical concatenated length:payload, form with Unicode-code-point lengths, not encoded byte lengths. Empty cells are explicit 0:, and an empty list emits empty text. Do not escape delimiters appearing inside payload.
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:
size=len(cell)
token=str(size)
out.append(token+':'+cell)
return ''.join(out)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unicode', solve(_vary(['é'])), _vary('1:é,'))
check('empty cell', solve(_vary([''])), _vary('0:,'))
check('delimiters', solve(_vary(['a:b,c'])), _vary('5:a:b,c,'))
check('several', solve(_vary(['a', 'bc'])), _vary('1:a,2:bc,'))
check('empty list', solve(_vary([])), _vary(''))
check('ASCII', solve(_vary(['abcd'])), _vary('4:abcd,'))
check('astral', solve(_vary(['😀'])), _vary('1:😀,'))
check('variant payload extent', solve(['x'*N]), str(N)+':'+('x'*N)+',')
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 |
|---|---|---|---|
| unicode | 1:é | 1:é, | Failed |
| empty cell | 0: | 0:, | Failed |
| delimiters | 5:a:b,c | 5:a:b,c, | Failed |
| several | 1:a2:bc | 1:a,2:bc, | Failed |
| empty list | | | Passed |
| ASCII | 4:abcd | 4:abcd, | Failed |
| astral | 1:😀 | 1:😀, | Failed |
| variant payload extent | 1:x | 1:x, | Failed |
SHA-256 / 573fcd3476d854e9b699b54249a1f6e9c6a35c1abc53be0005cd4b904d9842f6
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:
size=len(cell)
token=str(size)
out.append(token+':'+cell+';')
return ''.join(out)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unicode', solve(_vary(['é'])), _vary('1:é,'))
check('empty cell', solve(_vary([''])), _vary('0:,'))
check('delimiters', solve(_vary(['a:b,c'])), _vary('5:a:b,c,'))
check('several', solve(_vary(['a', 'bc'])), _vary('1:a,2:bc,'))
check('empty list', solve(_vary([])), _vary(''))
check('ASCII', solve(_vary(['abcd'])), _vary('4:abcd,'))
check('astral', solve(_vary(['😀'])), _vary('1:😀,'))
check('variant payload extent', solve(['x'*N]), str(N)+':'+('x'*N)+',')
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 |
|---|---|---|---|
| unicode | 1:é; | 1:é, | Failed |
| empty cell | 0:; | 0:, | Failed |
| delimiters | 5:a:b,c; | 5:a:b,c, | Failed |
| several | 1:a;2:bc; | 1:a,2:bc, | Failed |
| empty list | | | Passed |
| ASCII | 4:abcd; | 4:abcd, | Failed |
| astral | 1:😀; | 1:😀, | Failed |
| variant payload extent | 1:x; | 1:x, | Failed |
SHA-256 / 8af649e86939de8d9c5634a83c3f51d3cc225290df43a97d1bafe94b37bf5831
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:
size=len(cell)
token=str(size)
out.append(token+':'+cell+',')
return ''.join(out)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unicode', solve(_vary(['é'])), _vary('1:é,'))
check('empty cell', solve(_vary([''])), _vary('0:,'))
check('delimiters', solve(_vary(['a:b,c'])), _vary('5:a:b,c,'))
check('several', solve(_vary(['a', 'bc'])), _vary('1:a,2:bc,'))
check('empty list', solve(_vary([])), _vary(''))
check('ASCII', solve(_vary(['abcd'])), _vary('4:abcd,'))
check('astral', solve(_vary(['😀'])), _vary('1:😀,'))
check('variant payload extent', solve(['x'*N]), str(N)+':'+('x'*N)+',')
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 |
|---|---|---|---|
| unicode | 1:é, | 1:é, | Passed |
| empty cell | 0:, | 0:, | Passed |
| delimiters | 5:a:b,c, | 5:a:b,c, | Passed |
| several | 1:a,2:bc, | 1:a,2:bc, | Passed |
| empty list | | | Passed |
| ASCII | 4:abcd, | 4:abcd, | Passed |
| astral | 1:😀, | 1:😀, | Passed |
| variant payload extent | 1:x, | 1:x, | Passed |
SHA-256 / f09bf3b090d8cf036f150411d47f0cd35aad71493a8a39073e6f98dbd0ba9de1
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:49.355659+00:00.
Case digest / 2cd0dbc4187c648d3a783d66b19ef54be02b376a1a47a1a5e88c9c572d4e3697