FAILURE MAP
← Case archive

FA-48236 / Delimited text / Open access

Appended rows are concatenated without record terminators · case 01

A structured table violates the declared record or column contract.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Appended rows are concatenated without record terminators.

THE FAILURE

Appended rows are concatenated without record terminators.

Unsuccessful approach: The alternate implementation still violates the same declared invariant: appended rows are concatenated without record terminators.

Case contract

Append comma rows to existing serialized text. Existing text is either empty or ends in a complete physical record, optionally lacking its final LF. On an empty file emit the supplied header once, followed by new rows. For a nonempty unterminated tail insert exactly one LF before new rows. With no new rows return existing text unchanged.

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):
    if not data['rows']: return data['existing']
    text=data['existing']
    if not text: text=','.join(data['header']) + '\n'
    elif not text.endswith('\n'): text+='\n'
    for row in data['rows']:
        text+=','.join(row)
    return text
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\n@,x\n'))
check('terminated', solve(_vary({'existing': 'a,b\nq,z\n', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\nq,z\n@,x\n'))
check('unterminated', solve(_vary({'existing': 'a,b\nq,z', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\nq,z\n@,x\n'))
check('no new', solve(_vary({'existing': 'a,b', 'header': ['a', 'b'], 'rows': []})), _vary('a,b'))
check('empty untouched', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': []})), _vary(''))
check('two appended', solve(_vary({'existing': 'a\n', 'header': ['a'], 'rows': [['@'], ['z']]})), _vary('a\n@\nz\n'))
check('empty cells', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['', '']]})), _vary('a,b\n,\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 fixtureActualExpectedOutcome
newa,b cell,xa,b cell,x Failed
terminateda,b q,z cell,xa,b q,z cell,x Failed
unterminateda,b q,z cell,xa,b q,z cell,x Failed
no newa,ba,bPassed
empty untouchedPassed
two appendeda cellza cell z Failed
empty cellsa,b ,a,b , Failed

SHA-256 / f94b43bf65420310fa8e3d90e7790b6125e08d2e29e62b888c072c03fbf0b4f6

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):
    if not data['rows']: return data['existing']
    text=data['existing']
    if not text: text=','.join(data['header']) + '\n'
    elif not text.endswith('\n'): text+='\n'
    for row in data['rows']:
        text+=','.join(row)+','
    return text
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\n@,x\n'))
check('terminated', solve(_vary({'existing': 'a,b\nq,z\n', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\nq,z\n@,x\n'))
check('unterminated', solve(_vary({'existing': 'a,b\nq,z', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\nq,z\n@,x\n'))
check('no new', solve(_vary({'existing': 'a,b', 'header': ['a', 'b'], 'rows': []})), _vary('a,b'))
check('empty untouched', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': []})), _vary(''))
check('two appended', solve(_vary({'existing': 'a\n', 'header': ['a'], 'rows': [['@'], ['z']]})), _vary('a\n@\nz\n'))
check('empty cells', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['', '']]})), _vary('a,b\n,\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 fixtureActualExpectedOutcome
newa,b cell,x,a,b cell,x Failed
terminateda,b q,z cell,x,a,b q,z cell,x Failed
unterminateda,b q,z cell,x,a,b q,z cell,x Failed
no newa,ba,bPassed
empty untouchedPassed
two appendeda cell,z,a cell z Failed
empty cellsa,b ,,a,b , Failed

SHA-256 / d333c56e367bdea45ed7eb327e0523b6a6db15f608ed0cf3186b17ccd908a606

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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:48.937112+00:00.

Case digest / 72c846b1c1da6c6da724eb984d5f4c75c821d2923af2d50fb13f79363a89595f