FAILURE MAP
← Case archive

FA-48196 / Delimited text / Open access

Missing trailing fields become explicit empty strings · case 01

A structured table violates the declared record or column contract.

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

ROOT CAUSE

Missing trailing fields become explicit empty strings.

THE FAILURE

Missing trailing fields become explicit empty strings.

Unsuccessful approach: The alternate implementation still violates the same declared invariant: missing trailing fields become explicit empty strings.

Case contract

Transpose comma records into physical columns. Pad missing trailing cells with null, preserving explicit empty strings. Width is the largest source row width; empty input has no columns. Output columns are in increasing physical position.

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=[line.split(',') for line in data]
    width=max((len(row) for row in rows),default=0)
    out=[]
    for col in range(width):
        out.append([row[col] if col<len(row) else '' for row in rows])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ragged', solve(_vary(['@,a,b', 'x'])), _vary([['@', 'x'], ['a', None], ['b', None]]))
check('later wider', solve(_vary(['@', 'x,y'])), _vary([['@', 'x'], [None, 'y']]))
check('explicit empty', solve(_vary(['@,', 'x'])), _vary([['@', 'x'], ['', None]]))
check('empty input', solve(_vary([])), _vary([]))
check('one empty', solve(_vary([''])), _vary([['']]))
check('rectangular', solve(_vary(['a,b', 'c,d'])), _vary([['a', 'c'], ['b', 'd']]))
check('unsorted', solve(_vary(['z,1', 'a,2'])), _vary([['z', 'a'], ['1', '2']]))
check('three rows', solve(_vary(['@,x', 'y', 'z,w'])), _vary([['@', 'y', 'z'], ['x', None, 'w']]))
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
ragged[['cell', 'x'], ['a', ''], ['b', '']][['cell', 'x'], ['a', None], ['b', None]]Failed
later wider[['cell', 'x'], ['', 'y']][['cell', 'x'], [None, 'y']]Failed
explicit empty[['cell', 'x'], ['', '']][['cell', 'x'], ['', None]]Failed
empty input[][]Passed
one empty[['']][['']]Passed
rectangular[['a', 'c'], ['b', 'd']][['a', 'c'], ['b', 'd']]Passed
unsorted[['z', 'a'], ['1', '2']][['z', 'a'], ['1', '2']]Passed
three rows[['cell', 'y', 'z'], ['x', '', 'w']][['cell', 'y', 'z'], ['x', None, 'w']]Failed

SHA-256 / 5bf467957b4d812a85ecbe6f44167bad96e13742d516054c367d4a9a847a6180

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=[line.split(',') for line in data]
    width=max((len(row) for row in rows),default=0)
    out=[]
    for col in range(width):
        out.append([row[col] if col<len(row) else 0 for row in rows])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ragged', solve(_vary(['@,a,b', 'x'])), _vary([['@', 'x'], ['a', None], ['b', None]]))
check('later wider', solve(_vary(['@', 'x,y'])), _vary([['@', 'x'], [None, 'y']]))
check('explicit empty', solve(_vary(['@,', 'x'])), _vary([['@', 'x'], ['', None]]))
check('empty input', solve(_vary([])), _vary([]))
check('one empty', solve(_vary([''])), _vary([['']]))
check('rectangular', solve(_vary(['a,b', 'c,d'])), _vary([['a', 'c'], ['b', 'd']]))
check('unsorted', solve(_vary(['z,1', 'a,2'])), _vary([['z', 'a'], ['1', '2']]))
check('three rows', solve(_vary(['@,x', 'y', 'z,w'])), _vary([['@', 'y', 'z'], ['x', None, 'w']]))
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
ragged[['cell', 'x'], ['a', 0], ['b', 0]][['cell', 'x'], ['a', None], ['b', None]]Failed
later wider[['cell', 'x'], [0, 'y']][['cell', 'x'], [None, 'y']]Failed
explicit empty[['cell', 'x'], ['', 0]][['cell', 'x'], ['', None]]Failed
empty input[][]Passed
one empty[['']][['']]Passed
rectangular[['a', 'c'], ['b', 'd']][['a', 'c'], ['b', 'd']]Passed
unsorted[['z', 'a'], ['1', '2']][['z', 'a'], ['1', '2']]Passed
three rows[['cell', 'y', 'z'], ['x', 0, 'w']][['cell', 'y', 'z'], ['x', None, 'w']]Failed

SHA-256 / eced7a7608692223f5832dac0cb91b6672e15ba092c8e5766a7df0abc410b9af

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 8 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.730875+00:00.

Case digest / 812a3ee154d23f23986aa6e770cc7d9d0394bb8356ee2aa334a3e01e9590355b