FAILURE MAP
← Case archive

FA-48471 / Delimited text / Open access

A repeat control copies the first table row forever · case 01

A structured table violates the declared record or column contract.

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

ROOT CAUSE

A repeat control copies the first table row forever.

THE FAILURE

A repeat control copies the first table row forever.

Unsuccessful approach: The alternate implementation still violates the same declared invariant: a repeat control copies the first table row forever.

Case contract

Read comma rows, with an R|count control line repeating the most recent data row count additional times. Count must be positive ASCII decimal; controls cannot precede data. Repeated rows do not become a distinct source row. Return independent row values in order; ordinary payloads contain no pipe.

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=[]; previous=None
    for line in data:
        if line.startswith('R|'):
            token=line[2:]
            if previous is None or not token.isascii() or not token.isdecimal() or int(token)<1: return None
            out.extend([list(out[0]) for _ in range(int(token))])
        else:
            if '|' in line: return None
            previous=line.split(',')
            out.append(previous)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeat', solve(_vary(['@,x', 'R|2'])), _vary([['@', 'x'], ['@', 'x'], ['@', 'x']]))
check('new source', solve(_vary(['a,b', 'R|1', '@,z', 'R|1'])), _vary([['a', 'b'], ['a', 'b'], ['@', 'z'], ['@', 'z']]))
check('orphan', solve(_vary(['R|2'])), _vary(None))
check('zero', solve(_vary(['a', 'R|0'])), _vary(None))
check('negative', solve(_vary(['a', 'R|-1'])), _vary(None))
check('empty row', solve(_vary(['', 'R|1'])), _vary([[''], ['']]))
check('chained', solve(_vary(['@', 'R|1', 'R|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
repeat[['cell', 'x'], ['cell', 'x'], ['cell', 'x']][['cell', 'x'], ['cell', 'x'], ['cell', 'x']]Passed
new source[['a', 'b'], ['a', 'b'], ['cell', 'z'], ['a', 'b']][['a', 'b'], ['a', 'b'], ['cell', 'z'], ['cell', 'z']]Failed
orphanNoneNonePassed
zeroNoneNonePassed
negativeNoneNonePassed
empty row[[''], ['']][[''], ['']]Passed
chained[['cell'], ['cell'], ['cell']][['cell'], ['cell'], ['cell']]Passed

SHA-256 / cf0bc5008998fc9c801e408adaa1dea74c3a67bc2db76994be00c810da3da0a5

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=[]; previous=None
    for line in data:
        if line.startswith('R|'):
            token=line[2:]
            if previous is None or not token.isascii() or not token.isdecimal() or int(token)<1: return None
            out.extend([list(out[-1]) if len(out)==1 else list(out[0]) for _ in range(int(token))])
        else:
            if '|' in line: return None
            previous=line.split(',')
            out.append(previous)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeat', solve(_vary(['@,x', 'R|2'])), _vary([['@', 'x'], ['@', 'x'], ['@', 'x']]))
check('new source', solve(_vary(['a,b', 'R|1', '@,z', 'R|1'])), _vary([['a', 'b'], ['a', 'b'], ['@', 'z'], ['@', 'z']]))
check('orphan', solve(_vary(['R|2'])), _vary(None))
check('zero', solve(_vary(['a', 'R|0'])), _vary(None))
check('negative', solve(_vary(['a', 'R|-1'])), _vary(None))
check('empty row', solve(_vary(['', 'R|1'])), _vary([[''], ['']]))
check('chained', solve(_vary(['@', 'R|1', 'R|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
repeat[['cell', 'x'], ['cell', 'x'], ['cell', 'x']][['cell', 'x'], ['cell', 'x'], ['cell', 'x']]Passed
new source[['a', 'b'], ['a', 'b'], ['cell', 'z'], ['a', 'b']][['a', 'b'], ['a', 'b'], ['cell', 'z'], ['cell', 'z']]Failed
orphanNoneNonePassed
zeroNoneNonePassed
negativeNoneNonePassed
empty row[[''], ['']][[''], ['']]Passed
chained[['cell'], ['cell'], ['cell']][['cell'], ['cell'], ['cell']]Passed

SHA-256 / cbf50da3c099d2af1ae34a1eb400858a09c0c21218c733f3f69f741e8adf7460

HELD IN THE MEMBER ARCHIVE

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

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

Case digest / 1673e0381a5c1794cbc3c3474bcadcfb4d21601ccab9dded134a82c2f771b8fe