FAILURE MAP
← Case archive

FA-47981 / Delimited text / Open access

Error records lose surplus cells before reporting · 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

Diagnostic storage truncates the original malformed row.

THE FAILURE

Diagnostic storage truncates the original malformed row.

Unsuccessful approach: Joining cells into one value loses the original field boundaries.

Case contract

Import three-column comma rows with exact modes strict, skip, or collect. Width failures are 1-based source record positions. Strict returns {error:position}; skip omits bad rows; collect returns valid rows and errors containing position and original cells. Header is supplied separately and not counted.

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):
    rows, errors = [], []
    for position,line in enumerate(data['lines'], 1):
        cells = line.split(',')
        if len(cells) != 3:
            if data['mode'] == 'strict': return {'error':position}
            if data['mode'] == 'collect': errors.append([position, cells[:3]])
            continue
        rows.append(cells)
    return {'rows':rows, 'errors':errors}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('collect', solve(_vary({'mode': 'collect', 'lines': ['@,a,b', 'x,y', 'c,d,e', 'z']})), _vary({'rows': [['@', 'a', 'b'], ['c', 'd', 'e']], 'errors': [[2, ['x', 'y']], [4, ['z']]]}))
check('strict', solve(_vary({'mode': 'strict', 'lines': ['@,a,b', 'x,y', 'c,d,e']})), _vary({'error': 2}))
check('skip', solve(_vary({'mode': 'skip', 'lines': ['x,y', '@,a,b', 'z']})), _vary({'rows': [['@', 'a', 'b']], 'errors': []}))
check('normal', solve(_vary({'mode': 'strict', 'lines': ['@,a,b']})), _vary({'rows': [['@', 'a', 'b']], 'errors': []}))
check('empty', solve(_vary({'mode': 'collect', 'lines': []})), _vary({'rows': [], 'errors': []}))
check('empty cells', solve(_vary({'mode': 'collect', 'lines': [',,']})), _vary({'rows': [['', '', '']], 'errors': []}))
check('wide', solve(_vary({'mode': 'collect', 'lines': ['a,b,c,d']})), _vary({'rows': [], 'errors': [[1, ['a', 'b', 'c', 'd']]]}))
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
collect{'errors': [[2, ['x', 'y']], [4, ['z']]], 'rows': [['cell', 'a', 'b'], ['c', 'd', 'e']]}{'errors': [[2, ['x', 'y']], [4, ['z']]], 'rows': [['cell', 'a', 'b'], ['c', 'd', 'e']]}Passed
strict{'error': 2}{'error': 2}Passed
skip{'errors': [], 'rows': [['cell', 'a', 'b']]}{'errors': [], 'rows': [['cell', 'a', 'b']]}Passed
normal{'errors': [], 'rows': [['cell', 'a', 'b']]}{'errors': [], 'rows': [['cell', 'a', 'b']]}Passed
empty{'errors': [], 'rows': []}{'errors': [], 'rows': []}Passed
empty cells{'errors': [], 'rows': [['', '', '']]}{'errors': [], 'rows': [['', '', '']]}Passed
wide{'errors': [[1, ['a', 'b', 'c']]], 'rows': []}{'errors': [[1, ['a', 'b', 'c', 'd']]], 'rows': []}Failed

SHA-256 / 0a4c0fe7f00285109bf6cf6fb3deee910a020d15b0142241ada534ee82832711

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):
    rows, errors = [], []
    for position,line in enumerate(data['lines'], 1):
        cells = line.split(',')
        if len(cells) != 3:
            if data['mode'] == 'strict': return {'error':position}
            if data['mode'] == 'collect': errors.append([position, [','.join(cells)]])
            continue
        rows.append(cells)
    return {'rows':rows, 'errors':errors}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('collect', solve(_vary({'mode': 'collect', 'lines': ['@,a,b', 'x,y', 'c,d,e', 'z']})), _vary({'rows': [['@', 'a', 'b'], ['c', 'd', 'e']], 'errors': [[2, ['x', 'y']], [4, ['z']]]}))
check('strict', solve(_vary({'mode': 'strict', 'lines': ['@,a,b', 'x,y', 'c,d,e']})), _vary({'error': 2}))
check('skip', solve(_vary({'mode': 'skip', 'lines': ['x,y', '@,a,b', 'z']})), _vary({'rows': [['@', 'a', 'b']], 'errors': []}))
check('normal', solve(_vary({'mode': 'strict', 'lines': ['@,a,b']})), _vary({'rows': [['@', 'a', 'b']], 'errors': []}))
check('empty', solve(_vary({'mode': 'collect', 'lines': []})), _vary({'rows': [], 'errors': []}))
check('empty cells', solve(_vary({'mode': 'collect', 'lines': [',,']})), _vary({'rows': [['', '', '']], 'errors': []}))
check('wide', solve(_vary({'mode': 'collect', 'lines': ['a,b,c,d']})), _vary({'rows': [], 'errors': [[1, ['a', 'b', 'c', 'd']]]}))
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
collect{'errors': [[2, ['x,y']], [4, ['z']]], 'rows': [['cell', 'a', 'b'], ['c', 'd', 'e']]}{'errors': [[2, ['x', 'y']], [4, ['z']]], 'rows': [['cell', 'a', 'b'], ['c', 'd', 'e']]}Failed
strict{'error': 2}{'error': 2}Passed
skip{'errors': [], 'rows': [['cell', 'a', 'b']]}{'errors': [], 'rows': [['cell', 'a', 'b']]}Passed
normal{'errors': [], 'rows': [['cell', 'a', 'b']]}{'errors': [], 'rows': [['cell', 'a', 'b']]}Passed
empty{'errors': [], 'rows': []}{'errors': [], 'rows': []}Passed
empty cells{'errors': [], 'rows': [['', '', '']]}{'errors': [], 'rows': [['', '', '']]}Passed
wide{'errors': [[1, ['a,b,c,d']]], 'rows': []}{'errors': [[1, ['a', 'b', 'c', 'd']]], 'rows': []}Failed

SHA-256 / 7ac7443f468ff693ae5f36a66d091933187681e86aae57f44a72d5c9f4be7741

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

Case digest / a55774fe5a9f075940f0316fb1de91ec4c04c3fe1edeb1cc04a8abdc9e6b4a12