FAILURE MAP
← Case archive

FA-48251 / Delimited text / Open access

A payload endpoint is relative to the record origin instead of its content origin · case 01

A structured table violates the declared record or column contract.

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

ROOT CAUSE

A payload endpoint is relative to the record origin instead of its content origin.

VERIFIED REPAIR

Preserve the named invariant at the faulty decision: end=begin+size

Unsuccessful approach: The alternate implementation still violates the same declared invariant: a payload endpoint is relative to the record origin instead of its content origin.

Case contract

Read concatenated decimal-length:payload, cells, where length counts Unicode code points in this stipulated text format. Lengths are nonempty canonical ASCII decimal, including zero; payload may contain commas and colons. A terminal comma is mandatory after each payload. Return cells or null for malformed input.

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=[]; pos=0
    while pos<len(data):
        colon=data.find(':',pos)
        if colon<0: return None
        token=data[pos:colon]
        if not token.isascii() or not token.isdecimal() or token != str(int(token)): return None
        size=int(token); begin=colon+1; end=pos+size
        if end>=len(data) or data[end]!=',': return None
        out.append(data[begin:end])
        pos=end+1
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two', solve(_vary('1:a,3:x,y,')), _vary(['a', 'x,y']))
check('colon payload', solve(_vary('3:a:b,')), _vary(['a:b']))
check('zero', solve(_vary('0:,')), _vary(['']))
check('unicode', solve(_vary('1:é,')), _vary(['é']))
check('truncated', solve(_vary('4:ab,')), _vary(None))
check('missing terminator', solve(_vary('1:a')), _vary(None))
check('leading zero', solve(_vary('01:a,')), _vary(None))
check('trailing junk', solve(_vary('1:a,x')), _vary(None))
check('zero stream', solve(_vary('')), _vary([]))
check('multi digit', solve(_vary('10:abcdefghij,')), _vary(['abcdefghij']))
check('variant payload extent', solve(str(N)+':'+('x'*N)+','), ['x'*N])
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
twoNone['a', 'x,y']Failed
colon payloadNone['a:b']Failed
zeroNone['']Failed
unicodeNone['é']Failed
truncated['ab']NoneFailed
missing terminatorNoneNonePassed
leading zeroNoneNonePassed
trailing junkNoneNonePassed
zero stream[][]Passed
multi digitNone['abcdefghij']Failed
variant payload extentNone['x']Failed

SHA-256 / 1e046668eb1fd77bc22c21766432ae171c19fb8ce9e75cc91f1533c97b8c3956

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=[]; pos=0
    while pos<len(data):
        colon=data.find(':',pos)
        if colon<0: return None
        token=data[pos:colon]
        if not token.isascii() or not token.isdecimal() or token != str(int(token)): return None
        size=int(token); begin=colon+1; end=colon+size
        if end>=len(data) or data[end]!=',': return None
        out.append(data[begin:end])
        pos=end+1
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two', solve(_vary('1:a,3:x,y,')), _vary(['a', 'x,y']))
check('colon payload', solve(_vary('3:a:b,')), _vary(['a:b']))
check('zero', solve(_vary('0:,')), _vary(['']))
check('unicode', solve(_vary('1:é,')), _vary(['é']))
check('truncated', solve(_vary('4:ab,')), _vary(None))
check('missing terminator', solve(_vary('1:a')), _vary(None))
check('leading zero', solve(_vary('01:a,')), _vary(None))
check('trailing junk', solve(_vary('1:a,x')), _vary(None))
check('zero stream', solve(_vary('')), _vary([]))
check('multi digit', solve(_vary('10:abcdefghij,')), _vary(['abcdefghij']))
check('variant payload extent', solve(str(N)+':'+('x'*N)+','), ['x'*N])
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
twoNone['a', 'x,y']Failed
colon payloadNone['a:b']Failed
zeroNone['']Failed
unicodeNone['é']Failed
truncatedNoneNonePassed
missing terminatorNoneNonePassed
leading zeroNoneNonePassed
trailing junkNoneNonePassed
zero stream[][]Passed
multi digitNone['abcdefghij']Failed
variant payload extentNone['x']Failed

SHA-256 / 1d8c1379d265893bcd36590af761a6d1bec41c85091adcf295676dc4e363df24

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=[]; pos=0
    while pos<len(data):
        colon=data.find(':',pos)
        if colon<0: return None
        token=data[pos:colon]
        if not token.isascii() or not token.isdecimal() or token != str(int(token)): return None
        size=int(token); begin=colon+1; end=begin+size
        if end>=len(data) or data[end]!=',': return None
        out.append(data[begin:end])
        pos=end+1
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two', solve(_vary('1:a,3:x,y,')), _vary(['a', 'x,y']))
check('colon payload', solve(_vary('3:a:b,')), _vary(['a:b']))
check('zero', solve(_vary('0:,')), _vary(['']))
check('unicode', solve(_vary('1:é,')), _vary(['é']))
check('truncated', solve(_vary('4:ab,')), _vary(None))
check('missing terminator', solve(_vary('1:a')), _vary(None))
check('leading zero', solve(_vary('01:a,')), _vary(None))
check('trailing junk', solve(_vary('1:a,x')), _vary(None))
check('zero stream', solve(_vary('')), _vary([]))
check('multi digit', solve(_vary('10:abcdefghij,')), _vary(['abcdefghij']))
check('variant payload extent', solve(str(N)+':'+('x'*N)+','), ['x'*N])
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
two['a', 'x,y']['a', 'x,y']Passed
colon payload['a:b']['a:b']Passed
zero['']['']Passed
unicode['é']['é']Passed
truncatedNoneNonePassed
missing terminatorNoneNonePassed
leading zeroNoneNonePassed
trailing junkNoneNonePassed
zero stream[][]Passed
multi digit['abcdefghij']['abcdefghij']Passed
variant payload extent['x']['x']Passed

SHA-256 / 2f57e6bd494ca1b250d6b6d2e5744b0558eba9494f414d49634b2a506cc65f0b

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

Case digest / 54ea705dde1fa68f3a920cd9dabcb9c54ec54d21ef32020ab453e66ce09e1889