FAILURE MAP
← Case archive

FA-48636 / Delimited text / Open access

An explicitly empty label is converted to an ordinal · 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

An explicitly empty label is converted to an ordinal.

THE FAILURE

An explicitly empty label is converted to an ordinal.

Unsuccessful approach: The alternate implementation still violates the same declared invariant: an explicitly empty label is converted to an ordinal.

Case contract

Decode comma rows with header label followed by data cells. First field is a row label; labels must be unique, including empty label. Return labels and values separately. All data rows have the width specified in data.width; preserve label spelling and row order.

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):
    labels,values=[],[]
    for line in data['lines']:
        cells=line.split(',')
        label,row=cells[0],cells[1:]
        if len(row)!=data['width'] or label in labels: return None
        labels.append(label if label else str(len(labels))); values.append(row)
    return {'labels':labels,'values':values}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('rows', solve(_vary({'width': 2, 'lines': ['r,@,x', 'q,y,z']})), _vary({'labels': ['r', 'q'], 'values': [['@', 'x'], ['y', 'z']]}))
check('empty label', solve(_vary({'width': 1, 'lines': [',@']})), _vary({'labels': [''], 'values': [['@']]}))
check('duplicate', solve(_vary({'width': 1, 'lines': ['r,@', 'r,z']})), _vary(None))
check('bad width', solve(_vary({'width': 2, 'lines': ['r,@']})), _vary(None))
check('spaces', solve(_vary({'width': 1, 'lines': [' r ,@']})), _vary({'labels': [' r '], 'values': [['@']]}))
check('uppercase label', solve(_vary({'width': 1, 'lines': ['ROW,@']})), _vary({'labels': ['ROW'], 'values': [['@']]}))
check('zero width', solve(_vary({'width': 0, 'lines': ['@']})), _vary({'labels': ['@'], 'values': [[]]}))
check('empty table', solve(_vary({'width': 2, 'lines': []})), _vary({'labels': [], 'values': []}))
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
rows{'labels': ['r', 'q'], 'values': [['cell', 'x'], ['y', 'z']]}{'labels': ['r', 'q'], 'values': [['cell', 'x'], ['y', 'z']]}Passed
empty label{'labels': ['0'], 'values': [['cell']]}{'labels': [''], 'values': [['cell']]}Failed
duplicateNoneNonePassed
bad widthNoneNonePassed
spaces{'labels': [' r '], 'values': [['cell']]}{'labels': [' r '], 'values': [['cell']]}Passed
uppercase label{'labels': ['ROW'], 'values': [['cell']]}{'labels': ['ROW'], 'values': [['cell']]}Passed
zero width{'labels': ['cell'], 'values': [[]]}{'labels': ['cell'], 'values': [[]]}Passed
empty table{'labels': [], 'values': []}{'labels': [], 'values': []}Passed

SHA-256 / 2187196ef9678b6e73b63364d84697eda822c2bad31e2f3de1bf452b0e5647f4

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):
    labels,values=[],[]
    for line in data['lines']:
        cells=line.split(',')
        label,row=cells[0],cells[1:]
        if len(row)!=data['width'] or label in labels: return None
        labels.append(label if label else None); values.append(row)
    return {'labels':labels,'values':values}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('rows', solve(_vary({'width': 2, 'lines': ['r,@,x', 'q,y,z']})), _vary({'labels': ['r', 'q'], 'values': [['@', 'x'], ['y', 'z']]}))
check('empty label', solve(_vary({'width': 1, 'lines': [',@']})), _vary({'labels': [''], 'values': [['@']]}))
check('duplicate', solve(_vary({'width': 1, 'lines': ['r,@', 'r,z']})), _vary(None))
check('bad width', solve(_vary({'width': 2, 'lines': ['r,@']})), _vary(None))
check('spaces', solve(_vary({'width': 1, 'lines': [' r ,@']})), _vary({'labels': [' r '], 'values': [['@']]}))
check('uppercase label', solve(_vary({'width': 1, 'lines': ['ROW,@']})), _vary({'labels': ['ROW'], 'values': [['@']]}))
check('zero width', solve(_vary({'width': 0, 'lines': ['@']})), _vary({'labels': ['@'], 'values': [[]]}))
check('empty table', solve(_vary({'width': 2, 'lines': []})), _vary({'labels': [], 'values': []}))
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
rows{'labels': ['r', 'q'], 'values': [['cell', 'x'], ['y', 'z']]}{'labels': ['r', 'q'], 'values': [['cell', 'x'], ['y', 'z']]}Passed
empty label{'labels': [None], 'values': [['cell']]}{'labels': [''], 'values': [['cell']]}Failed
duplicateNoneNonePassed
bad widthNoneNonePassed
spaces{'labels': [' r '], 'values': [['cell']]}{'labels': [' r '], 'values': [['cell']]}Passed
uppercase label{'labels': ['ROW'], 'values': [['cell']]}{'labels': ['ROW'], 'values': [['cell']]}Passed
zero width{'labels': ['cell'], 'values': [[]]}{'labels': ['cell'], 'values': [[]]}Passed
empty table{'labels': [], 'values': []}{'labels': [], 'values': []}Passed

SHA-256 / fca454d5528703c650a4b1401a4776499a5e2dbb15bb983e807c8ea7a20d3ea6

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

Case digest / ed39fbc621b4c87819a3a1165bb95d9c49833d7c207a4a05dd1685ce6cf86bff