FAILURE MAP
← Case archive

FA-47626 / Delimited text / Open access

A repeated cell loses literal stars in its value · 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

The last star is taken as the count delimiter.

VERIFIED REPAIR

Preserve the named invariant at the faulty decision: count, value = cell.split('*', 1)

Unsuccessful approach: Removing stars after the first split destroys ordinary value content.

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.rsplit('*', 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 valueNone['a*b', 'a*b']Failed
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 / 52f1711d5ea79a93e95b0e8ebccc9ed1506319cb6b9c4fe0751bafe9f17c242a

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)
            value = value.replace('*', '')
            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['ab', 'ab']['a*b', 'a*b']Failed
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 / b903d08f84f7a139ab590deeac1c934f095588f65010153756a3965c56408251

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

Case digest / 0abed6514f1f58d414cff554a7e9651d4400284aca208df055c7ea573fd9f156