FAILURE MAP
← Case archive

FA-47621 / Delimited text / Open access

Run-length expansion budgets each run independently · 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

Individual legal runs can jointly exceed the row width budget.

THE FAILURE

Individual legal runs can jointly exceed the row width budget.

Unsuccessful approach: Making the combined limit exclusive rejects exactly full rows.

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 = 1, cell
        if 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 limit['x', 'x', 'y', 'y']NoneFailed
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 / 5f0e6c004679eb2e691b44608f82551f39793abea62a6b1105970bbaec241018

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
        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
expandedNone['cell', 'cell', 'x']Failed
star valueNone['a*b', 'a*b']Failed
empty repeatedNone['', '']Failed
zeroNoneNonePassed
negativeNoneNonePassed
aggregate limitNoneNonePassed
exact limitNone['cell', 'cell', 'cell']Failed
ordinaryNone['cell', 'z']Failed
space valueNone[' cell ']Failed
empty fieldNone['']Failed

SHA-256 / 4993ca8f4329a45a9a002ecee79afc390ef556faf5933d9804407218844e36a2

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 10 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:43.415237+00:00.

Case digest / 37f0292b80d60a58f0c145b778e282020577b51ed0cc59c29f3e8f6835c18c5c