FAILURE MAP
← Case archive

FA-47631 / Delimited text / Open access

An ordinary compact cell consumes no output position · case 01

A structured table violates the declared record or column contract.

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

ROOT CAUSE

Uncompressed cells are assigned a zero repeat count.

VERIFIED REPAIR

Preserve the named invariant at the faulty decision: else: count, value = 1, cell

Unsuccessful approach: Trimming uncompressed values changes significant text.

Case contract

Parse a bounded compact comma row. A field count*value expands value count times; fields lacking star occur once. Count is positive ASCII decimal and cumulative width cannot exceed budget. Split at first star; an empty value is valid. Return expanded cells.

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['row'].split(','):
        if '*' in cell:
            count, value = cell.split('*', 1)
            if not count.isascii() or not count.isdecimal(): return None
            count = int(count)
            if count <= 0: return None
        else: count, value = 0, cell
        if len(out) + count > data['budget']: return None
        out.extend([value] * count)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('expanded', solve(_vary({'row': '2*@,x', 'budget': 3})), _vary(['@', '@', 'x']))
check('star value', solve(_vary({'row': '2*a*b', 'budget': 2})), _vary(['a*b', 'a*b']))
check('empty repeated', solve(_vary({'row': '2*', 'budget': 2})), _vary(['', '']))
check('zero', solve(_vary({'row': '0*x', 'budget': 2})), _vary(None))
check('negative', solve(_vary({'row': '-1*x', 'budget': 2})), _vary(None))
check('aggregate limit', solve(_vary({'row': '2*x,2*y', 'budget': 3})), _vary(None))
check('exact limit', solve(_vary({'row': '3*@', 'budget': 3})), _vary(['@', '@', '@']))
check('ordinary', solve(_vary({'row': '@,z', 'budget': 2})), _vary(['@', 'z']))
check('space value', solve(_vary({'row': ' @ ', 'budget': 1})), _vary([' @ ']))
check('empty field', solve(_vary({'row': '', 'budget': 1})), _vary(['']))
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
expanded['cell', 'cell']['cell', 'cell', 'x']Failed
star value['a*b', 'a*b']['a*b', 'a*b']Passed
empty repeated['', '']['', '']Passed
zeroNoneNonePassed
negativeNoneNonePassed
aggregate limitNoneNonePassed
exact limit['cell', 'cell', 'cell']['cell', 'cell', 'cell']Passed
ordinary[]['cell', 'z']Failed
space value[][' cell ']Failed
empty field[]['']Failed

SHA-256 / 5ddadf43485a028b5f9e89b9fd6e5e38f2ffad19f3bf38e533ec00c25a0935b9

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['row'].split(','):
        if '*' in cell:
            count, value = cell.split('*', 1)
            if not count.isascii() or not count.isdecimal(): return None
            count = int(count)
            if count <= 0: return None
        else: count, value = 1, cell.strip()
        if len(out) + count > data['budget']: return None
        out.extend([value] * count)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('expanded', solve(_vary({'row': '2*@,x', 'budget': 3})), _vary(['@', '@', 'x']))
check('star value', solve(_vary({'row': '2*a*b', 'budget': 2})), _vary(['a*b', 'a*b']))
check('empty repeated', solve(_vary({'row': '2*', 'budget': 2})), _vary(['', '']))
check('zero', solve(_vary({'row': '0*x', 'budget': 2})), _vary(None))
check('negative', solve(_vary({'row': '-1*x', 'budget': 2})), _vary(None))
check('aggregate limit', solve(_vary({'row': '2*x,2*y', 'budget': 3})), _vary(None))
check('exact limit', solve(_vary({'row': '3*@', 'budget': 3})), _vary(['@', '@', '@']))
check('ordinary', solve(_vary({'row': '@,z', 'budget': 2})), _vary(['@', 'z']))
check('space value', solve(_vary({'row': ' @ ', 'budget': 1})), _vary([' @ ']))
check('empty field', solve(_vary({'row': '', 'budget': 1})), _vary(['']))
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
expanded['cell', 'cell', 'x']['cell', 'cell', 'x']Passed
star value['a*b', 'a*b']['a*b', 'a*b']Passed
empty repeated['', '']['', '']Passed
zeroNoneNonePassed
negativeNoneNonePassed
aggregate limitNoneNonePassed
exact limit['cell', 'cell', 'cell']['cell', 'cell', 'cell']Passed
ordinary['cell', 'z']['cell', 'z']Passed
space value['cell'][' cell ']Failed
empty field['']['']Passed

SHA-256 / d219ba46bae7e5dbe29c4d4150047f59bca360f35ba874314a00af0fc6b9b400

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['row'].split(','):
        if '*' in cell:
            count, value = cell.split('*', 1)
            if not count.isascii() or not count.isdecimal(): return None
            count = int(count)
            if count <= 0: return None
        else: count, value = 1, cell
        if len(out) + count > data['budget']: return None
        out.extend([value] * count)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('expanded', solve(_vary({'row': '2*@,x', 'budget': 3})), _vary(['@', '@', 'x']))
check('star value', solve(_vary({'row': '2*a*b', 'budget': 2})), _vary(['a*b', 'a*b']))
check('empty repeated', solve(_vary({'row': '2*', 'budget': 2})), _vary(['', '']))
check('zero', solve(_vary({'row': '0*x', 'budget': 2})), _vary(None))
check('negative', solve(_vary({'row': '-1*x', 'budget': 2})), _vary(None))
check('aggregate limit', solve(_vary({'row': '2*x,2*y', 'budget': 3})), _vary(None))
check('exact limit', solve(_vary({'row': '3*@', 'budget': 3})), _vary(['@', '@', '@']))
check('ordinary', solve(_vary({'row': '@,z', 'budget': 2})), _vary(['@', 'z']))
check('space value', solve(_vary({'row': ' @ ', 'budget': 1})), _vary([' @ ']))
check('empty field', solve(_vary({'row': '', 'budget': 1})), _vary(['']))
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
expanded['cell', 'cell', 'x']['cell', 'cell', 'x']Passed
star value['a*b', 'a*b']['a*b', 'a*b']Passed
empty repeated['', '']['', '']Passed
zeroNoneNonePassed
negativeNoneNonePassed
aggregate limitNoneNonePassed
exact limit['cell', 'cell', 'cell']['cell', 'cell', 'cell']Passed
ordinary['cell', 'z']['cell', 'z']Passed
space value[' cell '][' cell ']Passed
empty field['']['']Passed

SHA-256 / 63773b057cc3b84576a3f7026468a14689432628cf8fb8f96357624fb853bab5

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

Case digest / 0310882cb2337ea536d603cd1f175729d595e6bfbdcb4a1a61cddac570640d66